Announcement

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

  • Formatting output from lincom with estout

    Following on from a previous post I would like to incorporate the output from using lincom into exported results using esttout. Using estadd gets me most of the way there, but I end up with two separate rows for the coefficient & standard error- similarly, I can add the p-value as an additional scalar using ttail, but what I really want is for it to format as one row with parenthesis & sig. stars similar to the other output. Is there a way to achieve this within estout?

    Currently, output looks like:

    Code:
    sysuse auto, clear
    
    gen goodmpg = 0
    replace goodmpg = 1        if mpg > 25
    
    gen interact = goodmpg * foreign
    
    reg price goodmpg foreign interact
    est store reg1
    lincom goodmpg + foreign
    estadd scalar coeff = `r(estimate)'
    estadd scalar serr = `r(se)'
    
    . esttab reg1, stats(coeff serr) drop(_cons)
    
    ----------------------------
                          (1)   
                        price   
    ----------------------------
    goodmpg           -1786.8   
                      (-1.54)   
    
    foreign            1056.5   
                       (1.24)   
    
    interact          -1308.2   
                      (-0.75)   
    ----------------------------
    coeff              -730.3   
    serr               1556.8   
    ----------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    I would like it to look like:

    Code:
    ----------------------------
                          (1)   
                        price   
    ----------------------------
    goodmpg           -1786.8   
                      (-1.54)   
    
    foreign            1056.5   
                       (1.24)   
    
    interact          -1308.2   
                      (-0.75)   
    ----------------------------
    label              -730.3   
                      (1556.8)  
    ----------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001

Working...
X