Announcement

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

  • Storing regression outputs / panel data / issue with system limits / percentage of positive constants

    Dear Stata users,

    I am working with panel data. I am running regressions for each id with:

    bysort id: regress x y, robust

    The regressions run fine and the results are displayed. I use Stata 17 SE and have 298 ids with 260 observations for each regression in this case. My ultimate interest is in the percentage of all regressions that yield a positive constant.
    My first step for a solution was to store each regression output in one combined external file. My understanding from reading in the forum is that eststo and esttab are suitable commands to achieve the objective.

    However, when running:

    bysort id: eststo: regress x y, robust

    I get the error message: "system limit exceeded
    you need to drop one or more models". The regressions will then run but not store.


    I am now looking for guidance how to store the 298 regressions or achieve the ultimate objective in a different way.
    I have used a loop with outreg2 when the data is in timeseries format to extract the results, which works fine, but creates a lengthy cycle of computations (in a second step I am running these regression for multiple different subsets of the 260 observations). Is there an obvious reason what system limit is exceeded and how to remedy the situation? Should I instead try to store and insert the specific regression output (i.e. the constant) in a seperate variable? Any help is much appreciated.

    best,
    Daniel

  • #2
    Daniel:
    have you already taken a look at -statsby-?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you Carlo for this hint. I will try and report back. Best, Daniel

      Comment


      • #4
        Carlo, your hint was very helpful! Apologies for this apparently simple question. I very much appreciate your help and time here. I was able to write:
        statsby, by(id): regress x y, robust which simply created the variable I was looking for. With list _b_cons I was then also able to generate the respective list in the output window. The results match those above. Issue resolved. Best, Daniel

        Comment

        Working...
        X