Dates in for loop
Posted: Wed Apr 24, 2013 7:35 am
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
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