Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • estout column output help

    Hello,

    I'm using the estout command like this:

    Code:
    sysuse auto
    
    glm  foreign price, fam(bin) link(logit) eform
    estimates store est1, title(Price)
    
    glm  foreign weight, fam(bin) link(logit) eform
    estimates store est2, title(Weight)
    
    estout est1 est2,  cells ("b(star fmt(1) label(AOR)) ci(par fmt(1) label(95% CI))") eform  stats(r2 bic N vce, labels(R-squared BIC "N. of cases" VCE)) label legend varlabels(_cons Constant)
    Which gives me results like this:
    Code:
    ------------------------------------------------------------------------------
                                Price                       Weight                
                                  AOR          95% CI          AOR          95% CI
    ------------------------------------------------------------------------------
    Car type    
                                                                     
    Price                         1.0       [1.0,1.0]                             
    Weight (lbs.)                                                1.0***          [1.0,1.0]
    Constant                   0.3       [0.1,1.1]          535.2*** [23.1,12410.7]
    ------------------------------------------------------------------------------
    R-squared                                                                     
    BIC                          98.5                         66.7                
    N. of cases                  74.0                         74.0                
    VCE                           oim                          oim                
    ------------------------------------------------------------------------------
    I want, however, to have all my independent variables in one column, as depicted below (I edited with text editor--sorry the alignment is messed up, I'm sure you get the picture). Is there any way to configure the options to achieve this kind of output?

    Code:
    ------------------------------------------------------------------------------
                                     
                                  AOR          95% CI       
    ------------------------------------------------------------------------------
    Car type  
                                                                       
    Price                   1.0           [1.0,1.0]  
       Constant              0.3          [0.1,1.1]          
    Weight (lbs.)           1.0***       [1.0,1.0]                                 
       Constant            535.2***   [23.1,12410.7]     
                
    ------------------------------------------------------------------------------
    Thanks so much!

    -Reese

  • #2
    estout is from Stata Journal, you are asked to explain.

    I want, however, to have all my independent variables in one column, as depicted below
    You can append the estimates, but you wish to have a list of statistics which are model dependent and yet your reproduction does not illustrate how to achieve this. Assuming that you save your estimates as est1- est3, for example

    Code:
    forval i=1/3{
    estout est`i' using myfile.doc, append cells ("b(star fmt(1) label(AOR)) ci(par fmt(1) label(95% CI))") eform stats(r2 bic N vce, labels(R-squared BIC "N. of cases" VCE)) label legend varlabels(_cons Constant)
    }
    This will give you a series of appended tables with the requested statistics for each. If you need to just append the estimates, you will then need to drop the statistics and the procedure is more involved.

    Comment

    Working...
    X