Announcement

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

  • Automating the Creation of a Table to Report Summary Statistics Net Panel and Time Fixed Effects

    Hello Statalist,

    I am attempting to automate the creation of a summary statistics table to report the standard deviation for a set of variables. Please take the following rudimentary "skeleton" table as an example of what I am trying to create.

    SD SD Net Panel FE SD Net Panel and Time FE
    Variable A

    Now, please consider the Stata example dataset "xtline1.dta" as an example of the panel data that I am working with.

    Code:
    sysuse xtline1, clear
    xtset person day
    
    quietly regress calories
    di e(rmse)
    quietly xtreg calories, fe i(person)
    di e(rmse)
    quietly xtreg calories i.day, fe i(person)
    di e(rmse)
    First, this chunk above demonstrates that if I regress the variable of interest (calories) first against itself I can retrieve the raw standard deviation from the e-return list (in the form of the RMSE). Second, this shows that if I regresscalories against a full set of panel unit fixed effects I can retrieve the standard deviation net the unit effects. Third, this shows that if I regress calories against a full set of both panel unit and time unit fixed effects I can also easily obtain the standard deviation net the unit and time effects.

    Using this example, how would one automate the creation of the included skeleton table? I have tried using Ben Jann's wonderful estout package, but the "estadd, ysumm" command doesn't seem to accommodate calculating the summary statistics for the y-variable across multiple model specifications.

    Any help would be greatly appreciated. Thank you for your time.

  • #2
    Sometimes it is easiest just to create a bunch of macros and then list them in the format you want.

    Comment


    • #3
      I think you can use the row option of asdoc (available from SSC). See this blog entry
      http://fintechprofessor.com/2018/09/...stata-ms-word/
      Regards
      --------------------------------------------------
      Attaullah Shah, PhD.
      Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
      FinTechProfessor.com
      https://asdocx.com
      Check out my asdoc program, which sends outputs to MS Word.
      For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

      Comment

      Working...
      X