Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Factor variables and outreg/outreg2


From   Richard Williams <[email protected]>
To   [email protected], "[email protected]" <[email protected]>
Subject   Re: st: Factor variables and outreg/outreg2
Date   Fri, 02 Mar 2012 16:25:41 -0500

At 03:49 PM 3/2/2012, Schmidt, William wrote:
I am attempting to use outreg2 but I would like to report a limited set of covariates. I have factor variables in my regression, and they seem to be ignored by the options in outreg. In the example below, for instance, i.foreign##c.weight is not reported.

sysuse auto, clear
regress mpg i.foreign##c.weight i.rep78 headroom
outreg2 using myfile, keep(i.foreign##c.weight headroom) sortvar(headroom i.foreign##c.weight)

This isn't quite right but it may be closer to what you want.

outreg2 using myfile, keep(1.foreign#c.weight headroom) sortvar(headroom i.foreign#c.weight)

Personally, I tend to avoid the ## notation and instead write stuff like

regress mpg i.foreign weight i.foreign#c.weight i.rep78 headroom

It may take more typing but it helps me to keep straight what I am doing. Plus, in various post-estimation commands, you often have to write things like 1.foreign rather than i.foreign. Look at how the regress command labeled each line of the output.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index