Silly date question
Posted: Mon Aug 17, 2009 5:10 pm
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!
%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!