Urgent question about a dummy regression
Posted: 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
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