Announcement

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

  • export multiple regression results.

    Hello to all,

    I'm creating this topic because I haven't found my answer on it.

    I am currently stuck, I have just spent several days on my problem without success.

    I would like to export my results in an excel or csv file linked to several regression.

    I have a large dataset and I have to do several regressions. (120 regressions per order). I use the following command:

    by CountryofHeadquarters, sort: regress TAA1 A1 REVRECA1 PPEA1

    CountryofHeadquarters allows me to do my regressions by country
    TAA1 : dependent variable
    A1, REVRECA1 and PPEA1 are my independent variables.

    With this, I have about 120 regressions. I can't type all the results by hand. So I would like to export all these results to an excel or csv table. But I can't do it, I tried with esttab; outreg2 and putexcel but nothing works.

    I also want to include in each regression result the residuals and the p-values.

    Can you please help me?

    Thanks a lot,

    Loïc DUBOIS

  • #2
    Loic,

    When faced with similar problems, I often rely on a combination of -forvalues-, -lincom-, and locals. While this approach may not be the most elegant solution, it works well when the number of iterations is not too large. Here is the algorithm that I would follow:
    1. For each of the 120 models that I need to analyze, I loop through the process using -forvalues-.
    2. Next, I run the appropriate regression model for each order.
    3. Once the regression is complete, I run -lincom- to directly obtain the point estimates and standard errors. These are reported via scalars. Type return list after -lincom- to see them
    4. I then save the scalars in local variables.
    5. Finally, I transfer all of the relevant local variables to a separate dataset for further analysis (where I calculate 95% CI, z/t values, and P-values -based on point estimates and standard errors).

    Comment

    Working...
    X