Announcement

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

  • Esttab with tabstat by group: how to remove the statistic name?

    I am trying to produce a table of means by two grouping variables. I have found a sufficient solution, see MWE below. There is just the issue that the header includes the information "mean" in every column. How can I disable that?


    MWE:

    Code:
    local vars turn length weight
    
    sysuse auto.dta, replace
    drop if rep78==.
    
    estpost tabstat `vars' if foreign==1, by(rep78) statistics(mean) columns(statistics) nototal
    eststo model1
    estpost tabstat `vars' if foreign==0, by(rep78) statistics(mean) columns(statistics) nototal
    eststo model2
    
    
    #delimit ;
        esttab model1 model2,
            varwidth(30)
            label unstack nonumber noobs nonote compress
            cells(mean(label("") fmt(2)))
            mtitles("M1" "M2");
    #delimit cr

  • #2
    estout is from SSC. Thanks for the reproducible example. You need:

    Code:
    #delimit ;
        esttab model1 model2, collab(none)
            varwidth(30)
            label unstack nonumber noobs nonote compress
            cells(mean(label("") fmt(2)))
            mtitles("M1" "M2");
    #delimit cr

    Comment

    Working...
    X