Page 1 of 1

Dates in for loop

Posted: Wed Apr 24, 2013 7:35 am
by jjulioro
Dear group,

I have a monthly database and want to test, sequentially, for a structural break in a window of my data, and want to save the p-valu of one of the tests in a matrix for later use.

The program, reduced to the bare bones of my problem looks like

equation eq0a.gmm Y Y(-1) X1 X2 @ Z1 Z2 Z3
matrix(1,60) parmstab
scalar limit = 60
for !obs=1 to limit
freeze(eq0af) eq0a.break test 2003m12+!obs
parmstab(1,!obs)=eq0af(4,5)
delete eq0af
next

The problem is that an error arises regarding the date in the command
freeze(eq0af) eq0a.breaktest 2003m12+!obs

The error says 'illegal date 2003M12+1 in "freeze(eq0af) eq0a.breaktest 2003m12+1"'
I have tried several ways with no success.

Could you please point me out my error.

Regards,

Juan Manuel

Re: Dates in for loop

Posted: Wed Apr 24, 2013 7:43 am
by EViews Gareth
Probably something like:

Code: Select all

%date = @otod(@dtoo("2003m12")+!obs) freeze(eq0af) eq0a.break test {%date}

Re: Dates in for loop

Posted: Wed Apr 24, 2013 8:12 am
by jjulioro
Thanks a lot. It worked.

Regards,

Juan Manuel