Announcement

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

  • Running a regression for each year using prior 10 years of data

    Dear STATA Users,

    Please, correct me if I am wrong. I need to run a regression at the industry level for each year of the sample period using prior 10 years of data. For this purpose, I use the following command:
    Code:
    bys industry: asreg  y a b c, wind(year 10) min(7)
    Is it correct?

  • #2
    There are many procedures that do things like this in Stata - statsby, rolling, and asreg among them. Since asreg is user-written, you may need to contact the author. However, you shouldn't bother anyone until you see if it works. You can easily do a few conventional regressions using if conditions, run the asreg, and see if you get the same parameters. You can also easily see if you're getting the right number of regressions.

    Comment


    • #3
      Phil Bromiley is right, to which I will add:

      A regression with 3 predictors fitted to 7 to 10 data points sounds like a real stretch to me, if that is what this means. If you are lumping together results for different firms, the story may be much better. But that's the meta-issue: there was not enough detail in #1 to say very much, which I guess is why I let this pass myself.

      Comment


      • #4
        The caution pointed out by Nick and Phil should be considered. As far as your question is concerned, the line of code does what you intend to do.
        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


        • #5
          Thank you very much for the answers!

          Comment

          Working...
          X