After I woke up this morning, I realized the problem of super-row
or group-row categories is exactly the same as that of sorting on
variable names, which means I can use the same codes to create it.
-outreg2- now comes with groupvar( ) option, which is the
unforgiving version of sortvar( ). While sortvar( ) overlooks
variables not in the regression, groupvar( ) will insist on creating
them (variables) or non-variables (super-rows).
Naturally they are not compatible with each other.
Both commands will kick in during the appending action of outreg2
(because that's where I had put them in) - it shouldn't be too much
of a problem.
Anna will be testing it to make sure there's no odd behavior.
For the future reference, the codes will look like this. Whatever
not mentioned by this option will be pushed down under Group2,
and hence need not be mentioned. If you don't want them, combine
it with drop( ) option.
Yes, you will need the latest vaporware to do it.
prog drop _all
sysuse auto, clear
cd c:\
reg mpg rep head trunk weight
outreg2 using myfile, replace
reg mpg rep head weight turn disp gear
outreg2 using myfile, groupvar(Group1 trunk turn head weight Group2) see
>> Stepwise drops different variables in each regression which
>> causes for me a problem in presenting a neat table at the
>> end with all the variables in the order that I want them.
>> I would like to have all the variables in the table, in the
>> order in which I have put them in the regression.
>>
>> I am currently tricking outreg2 into keeping all the variables
>> by running a regression first in the order that I want, compiling
>> all regressions and with the intention of deleting the first
>> column at the end. No idea how to add "Group1"-type rows (addnote
>> does not do that in outreg2).
>
> Anna apparently wants to insert empty spaces, but what she really
> needs is to be able to sort on variable names. I have a version of
> -outreg2- that will do this. Whoever wants it now can get it from me.
>
> Unless there is a strong demand, I have no plan to add options for
> inserting Group-type rows. I don't think I'll need that one.
>
> -outreg2- is relatively easy to upgrade. It does matter how much
> original planning went into a program.
>
> For the future reference, the -sortvar( )- option can be invoked at
> any time. Like -keep( )- option, it is forgiving. You will need at
> least a version 2.1.0 Feb2009 or better to do this.
>
> prog drop _all
> sysuse auto, clear
> cd c:\
>
> * single equation
> reg mpg rep head trunk weight
> outreg2 using myfile, replace sortvar(trunk turn)
> reg mpg rep head weight turn disp gear
> outreg2 using myfile, sortvar(trunk turn) see
>
> * multiple equations
> reg3 (mpg rep head trunk weight) (head trunk weight rep gear)
> outreg2 using myfile, replace long
> reg3 (mpg rep head weight turn disp ) (mpg rep head trunk weight gear)
> outreg2 using myfile, sortvar(trunk turn) see long
_________________________________________________________________
Windows Live™: E-mail. Chat. Share. Get more ways to connect.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009
*
* 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/