Announcement

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

  • Sending multiple estimation results at once using one Stata command

    Hello Statalist,

    I used the following commands on my panel data:

    by Wave, sort : regress logLast_pay Main_Activity_Sector1 Main_Activity_Sector2 Main_Activity_Sector3 Main_Activity_Sector4 Main_Activity_Sector5 Main_Activity_Sector6 Main_Activity_Sector7 Main_Activity_Sector8 Main_Activity_Sector9 Main_Activity_Sector10 Main_Activity_Sector11 Main_Activity_Sector12 Main_Activity_Sector13 Rural_Urban2

    estimates store bywave1

    esttab using bywave1.csv

    I noticed that it was only the last of the four estimation results that was sent to Excel file.

    Please what Stata command do I need to use to send all the estimation results at once to Excel file? There are four waves, and I still have a lot more of such tasks to carry out by panel id (6) such that regressing and exporting individually will take more of my time.

    Thank you.

    Florence Ijagbone


  • #2
    estout is from SSC (FAQ Advice #12). Only the last estimates in memory are exported, i.e., the -by:- prefix does not store all the estimates simultaneously. You can use levelsof instead and loop.

    Code:
    estimates clear
    levelsof Wave, local(waves)
    foreach wave of local waves{
        eststo: regress logLast_pay Main_Activity_Sector1 Main_Activity_Sector2 Main_Activity_Sector3 Main_Activity_Sector4 Main_Activity_Sector5 Main_Activity_Sector6 Main_Activity_Sector7 Main_Activity_Sector8 Main_Activity_Sector9 Main_Activity_Sector10 Main_Activity_Sector11 Main_Activity_Sector12 Main_Activity_Sector13 Rural_Urban2 if Wave==`wave'
    }
    esttab est* using bywave1.csv, replace

    Comment


    • #3
      I have used the suggested code successfully.

      Thank you very much.

      Comment

      Working...
      X