Dates in for loop

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

jjulioro
Posts: 4
Joined: Fri Jul 06, 2012 1:44 pm

Dates in for loop

Postby jjulioro » 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

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

Re: Dates in for loop

Postby EViews Gareth » Wed Apr 24, 2013 7:43 am

Probably something like:

Code: Select all

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

jjulioro
Posts: 4
Joined: Fri Jul 06, 2012 1:44 pm

Re: Dates in for loop

Postby jjulioro » Wed Apr 24, 2013 8:12 am

Thanks a lot. It worked.

Regards,

Juan Manuel


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests