Page 1 of 1

Looping with shifting sample range

Posted: Thu Mar 31, 2011 5:33 pm
by numbernumberable
Hi,

I'm trying to record F-statistics of regressions for one series "xr" where the equation is

xr c xr(-1) xr(-2) xr(-3) ... xr(-50)

for the xr series (sample size = 888)

I want to make a program that will loop the estimation 50 observations at a time (in sequence) through the entire sample size. Specifically, I want to:

smpl 1 51
ls xr c xr(-1) xr(-2) xr(-3) ... xr(-50)
*record f-statistic*

smpl 2 52
ls xr c xr(-1) xr(-2) xr(-3) ... xr(-50)
*record f-statistic*

smpl 3 53
ls xr c xr(-1) xr(-2) xr(-3) ... xr(-50)
*record f-statistic*

.
.
.

smpl 838 888
ls xr c xr(-1) xr(-2) xr(-3) ... xr(-50)
*record f-statistic*

end

is there program I can write that can sequence the estimation from sample size 1-51, then 5-52, all the way up to 838-888 in 50 observation windows, while recording the F-statistic for each estimation along the way? Thanks for your help.

Re: Looping with shifting sample range

Posted: Fri Apr 01, 2011 8:11 am
by EViews Gareth
You should read the Programming guide, and take a look at some of the sample rolling regression posts.