Announcement

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

  • Adding a Mean row to esttab

    Hi,

    I would like to add a row containing the means of the dependent variables to my esttab table, right above the observations row. How can I do that?

    Best

  • #2
    estout is from SSC (FAQ Advice #12).

    Code:
    sysuse auto, clear
    eststo m1: regress mpg weight disp
    qui sum `e(depvar)' if e(sample)
    estadd scalar Mean= r(mean)
    eststo m2: regress price weight disp
    qui sum `e(depvar)' if e(sample)
    estadd scalar Mean= r(mean)
    esttab m*, scalars(Mean N r2) noobs
    Res.:

    Code:
    . 
    . esttab m*, scalars(Mean N r2) noobs
    
    --------------------------------------------
                          (1)             (2)   
                          mpg           price   
    --------------------------------------------
    weight           -0.00657***        1.823*  
                      (-5.63)          (2.15)   
    
    displacement      0.00528           2.087   
                       (0.54)          (0.29)   
    
    _cons               40.08***        247.9   
                      (19.84)          (0.17)   
    --------------------------------------------
    Mean                21.30          6165.3   
    N                      74              74   
    r2                  0.653           0.291   
    --------------------------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001

    Comment

    Working...
    X