Looping with shifting sample range

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

numbernumberable
Posts: 1
Joined: Thu Mar 31, 2011 5:15 pm

Looping with shifting sample range

Postby numbernumberable » Thu Mar 31, 2011 5:33 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Looping with shifting sample range

Postby EViews Gareth » Fri Apr 01, 2011 8:11 am

You should read the Programming guide, and take a look at some of the sample rolling regression posts.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests