Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73370

Out of sample rolling estimation "k" periods ahead

$
0
0
Hi,

I am trying to perform a rolling-window estimation t+k period ahead. I am using the command "rolling" and I have managed to get an estimation for k=1 only. How can I add k=2, k=3 etc...

I am using a code that is similar to the following:
Code:
use http://www.stata-press.com/data/r13/ibm, clear
tsset t

generate ibmadj = ibm - irx

generate spxadj = spx - irx
rolling _b _se, window(200) saving(betas, replace) keep(date): regress ibmadj spxadj

use betas.dta, clear
How can I modify it so that I can add the _b[ ] for k={2,3...n} in the "betas.dta" file? Thanks!


Viewing all articles
Browse latest Browse all 73370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>