I've been using replacement variables to define my estimation and solution samples for a VAR(2) model
%est_beg = 2000q4
%est_end = 2009q2
%slv_beg = 2001q2
%slv_end = 2015q4
smpl %est_beg %est_end
myvar.ls
makemodel commands etc
smpl %slv_beg %slv_end
solve the model commands
The two replacement variables %est_beg and %slv_beg are related by the lag lenght of the VAR
I would like to define a control variable
!varlen = 2
and then automatically determine
%slv_beg = %est_beg + !varlen
There is an example in the documentation showing something along the lines of
if !a>5 then
smpl 1950q1 1971q1+!a
endif
but this won't work with replacement variables.
I've been playing around with @dateval and @datediff etc, but haven't had any success. There has to be an easy way to do this, I just can't figure out what it is.
Any help will be greatly appreciated!
Silly date question
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Silly date question
The problem you're going to have is that dates are based on the frequency of the workfile, where as the number "2" isn't.
Probably the easiest thing to do is work with observation numbers rather than dates.
Usually if I'm writing a program where the sample is changing by a variable, I just write the sample as a function of @first and/or @last. Something like:
smpl @first+120+!varlen @first+150+!varlen
Probably the easiest thing to do is work with observation numbers rather than dates.
Usually if I'm writing a program where the sample is changing by a variable, I just write the sample as a function of @first and/or @last. Something like:
smpl @first+120+!varlen @first+150+!varlen
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 42 guests