Announcement

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

  • Report Results from Different Commands for the Same Variable in the Same Row in Estout

    I'm reporting statistics from both summarize and ttest on the same variables onto the same table using esttab, but the ttest results are automatically being reported on a different row, and I can't seem to align them. A reproducable example is below. I understand that, in this example, I could get them on the same row using just ttest results. The actual code I'm using is more complicated and requires both summarize and ttest.
    Code:
    clear
    sysuse auto
    
    #delimit;
    
    
    eststo dom:
        qui estpost sum price mpg if foreign == 0;
    eststo fgn:
        qui estpost sum price mpg if foreign == 1;
    eststo diff:
        qui estpost ttest price mpg, by(foreign);
    
    
    esttab dom fgn diff,
        cells(    
            mean(fmt(%8.1fc) pattern(1 1 0))
            b(star pattern(0 0 1) fmt(%8.2fc))
        )
        collabels(none)
        label nomtitles;
    Last edited by Danny Gold; 10 Nov 2022, 13:35. Reason: Added tags
Working...
X