Announcement

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

  • Bug in asreg?

    I believe there is a bug in the asreg function. When I run rolling window regressions on panel data (firm * quarter), the predictions and residuals are identical in each quarter. E.g. when I run...
    asreg y x, by(qtr) fitted window(qtr 4)
    ... all predicted values in a particular quarter are identical, and so are all residuals.

    This problem does *not* occur when I do not specify a window, ie when running
    asreg y x, by(qtr) fitted

    Something seems be wrong with the "window" option.

    Has anybody had the same issue?


  • #2
    Hello Florian Peters
    Welcome to Statalist. You should mention that asreg is from on SSC. Since the grouping variable in your dataset is firm, and the range variable is qtr, therefore, the command should should
    Code:
    bys firm: asreg y x, window(qtr 4)
    By the way, using just 4 observation in a regression is not a good idea.
    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