Urgent question about a dummy regression

For questions regarding programming in the EViews programming language.

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

RickS
Posts: 5
Joined: Sat May 19, 2012 12:31 pm

Urgent question about a dummy regression

Postby RickS » Thu Jun 14, 2012 6:45 am

Hello,

For an exercise i have to regress a dummy variable on a residual series to detect so called innovation outliers (IO's). The dummy variable must take the value 1 at a certain date and 0 otherwise. For example at the fourth quarter of the year 1977:

equation regIOdummy
series IOdummy = @recode(@date=@dateval(" 1977.4"), 1, 0) 'create the dummy as i mentioned earlier'
regIOdummy.ls residx IOdummy 'residx is the depended residual variable'

So far so good: i obtain plausible regression output.

But now i want to repeat this for the complete sample 1960.4 to 2006.2 and store the t-statistic of each regression. This means that i want to execute a regression as i did above but then with an 'updating' dummy variable. So in the first regression the dummy takes the value 1 at 1960.4 and 0 else, in the second regression the dummy takes value 1 at 1961.1 and 0 else, et cetera. untill 2006.2. I used the next code to execute the process I just described.

matrix(186,3) statistics
equation regIOdummy

for !i=3 to !i=186
series IOdummy = @recode(@date=@dateval(" 1960.1+!I"), 1, 0)
regIOdummy.ls residx IOdummy
rowplace(statistics, IOdummy.@tstats, !i)
!i=!i+1

next

But this code doesn't execute anything. I have the feeling that the problem is that the 'dateval' doesn't recognize the date value "1960.1+!i". Is this true and what is the solution for it?

Thanks a lot for your help!

Rick

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

Re: Urgent question about a dummy regression

Postby EViews Gareth » Thu Jun 14, 2012 8:03 am

Your description of the problem is correct - @dateval cannot interpret "1960.1 + !i" correctly.

This is a workaround - there are probably more efficient ways, but I'd need more information to use them. This should work:

Code: Select all

%date = @otod(@dtoo("1960.1")+!i) series IOdummy = @recode(@date = @dateval(%date), 1, 0)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests