Announcement

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

  • Rolling regression - residuals

    Dear Statalist Members

    I have a question and I hope you will be able to help me.
    I want to run a rolling regression on a panel data set and get the estimations of firm- and year-specific residuals for each regression.I was planning to use rollreg but it seems that it does not support a residual as an option (or at least I could not find it). Could you suggest me another way how I can get these residuals?


    Thank you in advance!

  • #2
    Using search rolling, I see -asreg- (written by Attaullah Shah) has an option that seems to support residuals.
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      Residuals if not calculated directly can always be calculated from observed MINUS predicted. See also (e.g.) rangestat (SSC).

      Comment


      • #4
        Thank you for the quick response! I used the above mentioned -asreg- command and it worked perfectly.

        Comment


        • #5
          Using asreg, here is one working example of reporting residuals from a rolling regression that uses a10-period rolling window. The option fit reports both the fitted values and residuals for each observation.

          Code:
          ssc install asreg
          
          * Reporting fitted values and residuals 
           
          webuse grunfeld, clear
           
          bys company: asreg invest mvalue kstock, wind(year 10) fit
          The help file provides many examples of using other options of asreg
          Last edited by Attaullah Shah; 15 Aug 2018, 04:42.
          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

          Working...
          X