Announcement

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

  • Problem with estpost and esttab

    Dear all,

    I am trying to export two tables with the usual code, which a while ago was working perfectly. Now it just produces two empty tables with only LaTeX preamble. I post the code with the web dataset I am using here below:

    Code:
        use https://stats.idre.ucla.edu/stat/stata/notes/hsb2, clear
    
        estpost tabstat read female write, c(stat) stat(sum mean sd min max n) 
        
        esttab using "$teout/table1.tex", replace ////
               cells("sum(fmt(%13.0fc)) mean(fmt(%13.2fc)) sd(fmt(%13.2fc)) min max count") nonumber ///
               nomtitle nonote noobs label booktabs ///
               collabels("Sum" "Mean" "SD" "Min" "Max" "N")
        
        eststo clear  // clear the est locals
        
        estpost tabstat read write, by(female) c(stat) stat(mean sd) nototal
        
        esttab using "$teout/table2.tex", replace ///
               main(mean %15.2f) aux(sd %15.2f) nostar nonumber unstack ///
               compress nonote noobs gap label booktabs   ///
               collabels(none) ///
               eqlabels("Male" "Female") /// 
               nomtitles
    Does anyone know what I might be doing wrong? Thank you very much in advance!

  • #2
    estout is from SSC, as you are asked to explain (FAQ Advice #12). Can you copy and paste exactly the result from the following?

    Code:
       use https://stats.idre.ucla.edu/stat/stata/notes/hsb2, clear
    
        estpost tabstat read female write, c(stat) stat(sum mean sd min max n)
        
        esttab, replace ////
               cells("sum(fmt(%13.0fc)) mean(fmt(%13.2fc)) sd(fmt(%13.2fc)) min max count") nonumber ///
               nomtitle nonote noobs label booktabs ///
               collabels("Sum" "Mean" "SD" "Min" "Max" "N")
        
        eststo clear  // clear the est locals
        
        estpost tabstat read write, by(female) c(stat) stat(mean sd) nototal
        
        esttab, replace ///
               main(mean %15.2f) aux(sd %15.2f) nostar nonumber unstack ///
               compress nonote noobs gap label booktabs   ///
               collabels(none) ///
               eqlabels("Male" "Female") ///
               nomtitles

    Comment

    Working...
    X