Announcement

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

  • recently upgraded to Stata 17.0, esttab not working like in Stata 15.1

    Hello Statalisters,

    I recently upgraded Stata from version 15.1 to 17.0. I am trying to run and save some descriptive statistics in .rtf form. Code that I have previously used succesfully before the upgrade is no longer working. Here is my specific code and problem:

    Code:
    estpost tabstat user [aw=sampweight], by(year) stats(n mean sd) column(stats) listwise
    
    esttab using "Table 1.rtf", replace cells("count(label(Obs)) mean(label(Mean) fmt(3)) sd(label(St. Dev.) fmt(3))") label nonote noobs nonumber nostar unstack title({\b "Table 1: Summary Statistics of Tanning Variables by Year"}) modelwidth(8) compress noeqlines nomtitles
    The estpost command produces the following table in Stata:

    year | e(count) e(Mean) e(SD)
    -------------+---------------------------------
    2005 | 23181 .142814 .3498906
    2008 | 16368 .1486858 .3557893
    2010 | 21830 .0528185 .2236761
    2013 | 28027 .0402188 .1964754
    2015 | 27520 .0339387 .1810746
    -------------+---------------------------------
    Total | 116926 .080136 .2715048

    The esttab command, however, is only producing the following in .rtf:

    Table 1: Summary Statistics of Tanning Variables by Year
    Obs Mean St. Dev.
    2005 23182
    2008 16370
    2010 21828
    2013 28029
    2015 27519
    Total 116928
    Essentially, the mean and standard deviation values are no longer appearing in my .rtf file. Does anyone know why and if there are any suggested fixes to this problem? My code ran without any problems in Stata 15.1. Also, I attempted updating estout from ssc and that did not fix the problem. I also updated Stata to made sure State is up to date.

  • #2
    This is a problem that will be fixed in the next update of Stata 17.

    Here's the explanation:

    In Stata 17, tabstat was updated to the new style of capitalized headers. When the save option is used with tabstat, it returns the matrix r(StatTotal) with the statistics in rows labeled with the headers. So in Stata 17, these row names are now capitalized versus before they were not. This change should have been done under version control (this failure was really a bug) so that it did not break existing commands like esttab. tabstat will obey version control in the next update of Stata 17, and esttab will work properly again.
    Last edited by Bill Sribney (StataCorp); 01 Jun 2021, 13:05.
    Bill Sribney (StataCorp)

    Comment


    • #3
      Thanks, Bill! I appreciate your response and explanation. I look forward to the next update that will return esttab to working properly again.

      Comment

      Working...
      X