Announcement

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

  • Rolling window using Xtreg and saving betas

    Hi all,
    The project I'm working on currently needs a rolling window estimation using xtreg on a unbalanced panel since fixed effects yield so much better results. Therefore, I can't use "rolling" which only accepts reg command.
    Specifically, what I need to to is to keep track of one of the betas of xtreg X1 X2... over the windows.
    I need to save its value, statistical significance and confidence interval for each period, so I can build a time series for it.
    So how would I be able to save the values in a loop and store them in a matrix that I can access and export later?
    thank you, any help will be appreciated.

  • #2
    If it is a fixed effect model, you can create dummy variable for each cross-sectional unit and the use asreg (from SSC). asreg is super fast and works with rolling windows and groups. More on asreg here https://fintechprofessor.com/2017/12...ions-in-stata/
    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


    • #3
      Thank you for your answer Attaullah,
      I had actually checked asreg, however I don't know if it is compatible with xtreg and its various options. I'm using vce(robust) for example.
      I can only use a command that replicates the exact specification from xtreg if it cannot use xtreg itself.

      Comment

      Working...
      X