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: outreg2 not giving wide format in MP 11.2


From   Farasat Bokhari <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: outreg2 not giving wide format in MP 11.2
Date   Thu, 11 Aug 2011 15:37:48 -0700 (PDT)

Eric.  


i tried using reg with outreg2 and everything works fine but not for logit or probit (not even with the sideway option).  i dont think it was ment to work this way. up until version 10.1 it was working fine. in fact, in version 10.1, i was also able to generate descriptive stats and output them using outreg2 (see the code below) as well as use it after probits.



will send an email to the author and see if he is willing to update the code for MP11.2.

thanks, fb


code for outreg2 after sum command:


> #delimit;
> mean assistance rewards sanctions lawsum clindex hrindex djindex gender age black othr
> ace hispanic
> if sample1 == 1 & pubsch == 1 [pw=weight] , over(adhd) cluster(state);
> 
> #delimit;
> outreg2 using descriptivestatsver07.xls, excel long replace noaster auto(3) bdec(3) ;
> 
> #delimit;
> mean assistance rewards sanctions lawsum clindex hrindex djindex gender age black othr
> ace hispanic
> if sample3 == 1 & pubsch==1 [pw=weight], over(medsadhd) cluster(state);
> 
> 
> #delimit;
> outreg2  using descriptivestatsver07.xls, long excel append noaster auto(3) bdec(3);
> 

  

> /***********  Probit 1.1 : Pr(ADHD) = f(assistance) **************************/
> #delimit;
> probit adhd assistance
>        age gender black othrace hispanic family2 family3 family4
>        poverty1-poverty7 edu1 edu2
>        pctpop5t19 lnsped lnlunch  pupiltchratio
>        lnschip2 lnmcaidpop lnschippop
>        if sample1 == 1 & pubsch == 1 [pw=weight], cluster(state);
> 
> outreg2  using estimate-pradhd-prmeds-nschlaws2003-ver07.xls,
> excel append symbol($^a$,$^b$,$^c$)  auto(2);
> 
> 
> /***********  Probit 1.1 : Pr(ADHD) = f(rewards) *****************************/
> #delimit;
> probit adhd rewards
>        age gender black othrace hispanic family2 family3 family4
>        poverty1-poverty7 edu1 edu2
>        pctpop5t19 lnsped lnlunch  pupiltchratio
>        lnschip2 lnmcaidpop lnschippop
>        if sample1 == 1 & pubsch == 1 [pw=weight], cluster(state);
> outreg2  using estimate-pradhd-prmeds-nschlaws2003-ver07.xls,
> excel append symbol($^a$,$^b$,$^c$)  auto(2);


****************************************************************************************************************************************************************



----- Original Message -----
From: Eric Booth <[email protected]>
To: "<[email protected]>" <[email protected]>
Cc: 
Sent: Thursday, August 11, 2011 9:35 PM
Subject: Re: st: outreg2 not giving wide format in MP 11.2

<>

It appears to be an issue with the way multiple logit estimation results are handled by -outreg2- (from SSC by the way) .  When I run your example with -regress- it works in the way you expect , ex:

************
sysuse auto, clear
clonevar for2 = foreign
g i = 1
#delimit;
logit foreign
    mpg turn price headr
      if i == 1, or robust ;
outreg2  using a.xls, replace excel;

logit for2 
    mpg turn price
      if i == 1, or robust ;
outreg2  using a.xls, append excel sortvar(turn price mpg ) see ;
    **try adding the 'sideway' option to see the difference
#delimit cr

#delimit;
reg foreign
    mpg turn price headr
      if i == 1 ;
outreg2  using a.xls, replace excel;


#delimit;
reg for2 
    mpg turn price
      if i == 1 ;
outreg2  using a.xls, append excel sortvar(turn price mpg ) see ;
#delimit cr
************
If this is intentional then I missed it in the help file -- if not, it might be worth emailing the author (Roy Wada) and seeing if he is willing to change this behavior .  If you add the option 'sideway' to the logit -outreg2-, the coefficients line up (but the SE are no longer under the coeff).

  Other options include (1) re-insheeting the .xls tables you made, manipulating the tables (shifting the cells upward to align the coeff. across the rows), and re-exporting them;  (2)  using other table production programs like -estout- or -outreg- from SSC  (3) writing your own program to do what you want.

- Eric
On Aug 11, 2011, at 8:33 AM, Farasat Bokhari wrote:

> I am using outreg2 after a logit command on multiple dependent variables.  No matter what I do, the columns from multiple regressions are not next to each other. I have even tried forcing it by using the "wide" option (which is the default anyway) but the output file does not contain columns next to each other but rather vertically stacked. The prob. has started showing up in my stata 11.2 MP  (was not there in state 10). Any suggestions on how to proceed?
> 
> Thanks.
> 
> example of code used:
> 
> 
> 
> #delimit;
> logit y1
>      x1 x2 x3 x4
>       if useobs == 1, or robust ;
> #delimit;
> outreg  using a.xls, replace excel wide;
> 
> 
> #delimit;
> logit y2 
>      x1 x2 x3
>       if useobs == 1, or robust ;
> #delimit;
> outreg  using a.xls, append excel wide;
> 
> *
> *   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/


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


*
*   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