Announcement

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

  • xtreg-Regression runs very slow

    Hello,

    I am running the following regression:
    Code:
    quietly xtreg sell retp retm ybeta c.retp##c.ybeta c.retm##c.ybeta iretp iretz mini maxi sqrhp logprc dec i.dec##c.retp i.dec##c.retm i.bdate, re robust
    I run this regression to test whether being in the gain vs. loss domain and the risk of stocks has an impact on the selling decision of investors.
    My problem is that when I run this code it takes very long for it to complete and show the regression output (takes over 20 minutes). My dataset consists of arond 100,000 observations including 1500 trading days, therefore i.bdate runs to 1500.

    Is there any possibility to adjust the code so that it does not take ages to get the result?

    Thanks in advance!
    Last edited by Jana He; 08 Dec 2022, 09:47.

  • #2
    Jana:
    regression codes that run very slow take hours, not minutes.
    Twenty minutes seem fair given the complexity of the right-hand side of your regression equation.
    Surely, all those interactions are part of the issue: can't you slim your code down in this respect?
    In addition, please note that complex specification usually make the dissemination of your results difficult.
    As an aside, have you already checked that -fe- is not the way to go?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      regression codes that run very slow take hours, not minutes.
      And if you combine a large data set with a multi-level model having several random effects, they can take days or weeks.

      Comment


      • #4
        Thank you! This is already the simplest form of the regression I can think of. Therefore, I think I just have to wait each time I run the regression

        Comment

        Working...
        X