Hi all, I am trying to do a 36 month rolling regression analysis where I would like to store the residuals of each regression as a new time series variable. In my mind, I would then have 36 observations with residuals from each regression in a new variable that I could use for further analysis. I am having trouble as it seems the 'residual variable' contains no values in the new file that is generated (see code below). Does anyone know why?
Please note, I am VERY new to STATA, so apologies if this is a dumb question or I am leaving out anything obvious
For further clarification:
The rolling regression is a 36 month window where i regress stock returns of a company on Fama-French five factor model.
Here is my input:
tsset date
rolling _b _se resid=e(resid), window(36) saving(rolling_resid, replace): regress stock_returns mktrf smb hml rmw cma
Thanks!
Please note, I am VERY new to STATA, so apologies if this is a dumb question or I am leaving out anything obvious
For further clarification:
The rolling regression is a 36 month window where i regress stock returns of a company on Fama-French five factor model.
Here is my input:
tsset date
rolling _b _se resid=e(resid), window(36) saving(rolling_resid, replace): regress stock_returns mktrf smb hml rmw cma
Thanks!
Comment