Announcement

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

  • panel data and rolling regression

    Dear all Stata users,

    I am doing a rolling regression to obtain beta values for a panel of firms. I use a 60-months window for each beta estimated. I have previously taken an econometric course, where I learned about FD, FE and RE estimation. In my rolling code, however, I do not use xtreg, but regular reg (and I have tsset my data, not xtset). Is this wrong? Can I not worry about RD, RE and RE because the rolling regression estimates the beta for one firm at the time, thus treating the data as timeseries for each firm?

    I would appreciate any help regarding this.

    ​Jonas

  • #2
    I believe that you can just use the regular reg, at least when you would want to save the intercept of each regression instead of the beta

    Comment


    • #3
      Hi Victoria,

      Thank you very much for your quick reply. I want to save the betas, but I have the dependent variable as excess return. Like this:
      [gen excessReturn= trt1m-RF][/reg excessReturn MktRF, r ]

      Jonas.

      Comment


      • #4
        Im so sorry, the rolling-part did not show in my last post. My full code is:
        qui rolling _b _se if excessReturn!=., window(60) saving(betas, replace): reg excessReturn MarketPremium, r

        Comment


        • #5
          You're welcome.

          Please do not depend solely on my advice because I'm also rather inexperienced with Stata.
          What does the last r stand for in your code? robust?

          I ran a similar code once (CAPM, 3 factor etc.) but I didn't use ,r in my rolling code.

          By the way, you should double check before you post a topic/thread because your first post contains many mistakes. I also recommend you to click on the A above the place where you enter your message and then select the code you want to post, then click on # and the code becomes a lot more readible for others.

          So, click on the A (next to the smiley), then select your code and press on #

          Code:
          qui rolling _b _se if excessReturn!=., window(60) saving(betas, replace): reg excessReturn MarketPremium, r

          Comment

          Working...
          X