last and last+1 in smpl statements for all series

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

Fregensburg
Posts: 38
Joined: Tue Jan 21, 2014 4:04 am

last and last+1 in smpl statements for all series

Postby Fregensburg » Wed Mar 12, 2014 3:08 am

Dear Eviews experts,

I have a workfile in which I over-provided, up to 2015 (so I can add data from an excel file that I update with additional observations every week). Weekly, I will be using a program to estimate a model using all observations –thus until 3/7/2014, leaving out all NA-, and I will solve the model one step ahead, so through to 14/7/2014. In both cases the start date is fixed, say 1/03/2009. What lines of code in the smpl statements do I need for that?

Many thanks

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

Re: last and last+1 in smpl statements for all series

Postby EViews Gareth » Wed Mar 12, 2014 7:29 am

Estimate over the entire range - EViews will figure out which observations are available for you automatically.

Then use the residual series to figure out the observations that were actually used. Thus something like:

Code: Select all

smpl 1/03/2009 @last equation eq1.ls y c x !lst = @ilast(resid) %forc = @otod(!lst+1) smpl 1/03/2009 {%forc} eq1.forecast yf

Fregensburg
Posts: 38
Joined: Tue Jan 21, 2014 4:04 am

Re: last and last+1 in smpl statements for all series

Postby Fregensburg » Wed Mar 12, 2014 10:50 am

Thank you. When I do as you say, something like:

Code: Select all

smpl 1/03/2009 @last var var1.ls1 3 dlog(y,0,1) dlog(x,0,1) !lst = @ilast(resid) %forc = @otod( !lst+1) smpl 1/03/2009 {%forc} var1.makemodel(varmod) varmod.solve(d=s)
I get an error message, to the effect of:
Sample endpoints adjusted for lags leads leaving no observation to solve in “DO_VARMOD.SOLVE(D=S)”

Could you advice on how to proceed?

Thanks again

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

Re: last and last+1 in smpl statements for all series

Postby EViews Gareth » Wed Mar 12, 2014 11:09 am

Ah, from a VAR you'll have to make the residual series yourself, rather than use the built in one:

Code: Select all

smpl 1/03/2009 @last var var1.ls1 3 dlog(y,0,1) dlog(x,0,1) var1.makeresid r1 r2 !lst = @ilast(r1) %forc = @otod( !lst+1) smpl 1/03/2009 {%forc} var1.makemodel(varmod) varmod.solve(d=s)

Fregensburg
Posts: 38
Joined: Tue Jan 21, 2014 4:04 am

Re: last and last+1 in smpl statements for all series

Postby Fregensburg » Wed Mar 12, 2014 11:21 am

Many thanks for such a rapid response. I still get the same error message though. Maybe there's an alternative way to set the sample?

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

Re: last and last+1 in smpl statements for all series

Postby EViews Gareth » Wed Mar 12, 2014 11:30 am

Works for me:

Code: Select all

create w 2009 2014 smpl @first @now series y=rnd series x=rnd smpl 1/03/2009 @last var var1.ls 1 3 dlog(y,0,1) dlog(x,0,1) var1.makeresid r1 r2 !lst = @ilast(r1) %forc = @otod( !lst+1) smpl 1/03/2009 {%forc} var1.makemodel(varmod) varmod.solve(d=s)
Post your workfile/program


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests