Identifier LAGS is Not Recognizable
Posted: Wed Mar 16, 2011 10:28 am
Hi Everyone,
I am new to this board, RATS and time series generally. I am trying to write a very simple (practice) procedure which gives me the statistics of a series restricted depending on previous values. So, I want my procedure to tell me the statistics of a series if I restrict the series to the observations which are preceded by two periods of values greater than zero (for example).
I am getting this error which I try to source the code file:
## SX11. Identifier LAGS is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>> if 2==lags<<<<
I've spent some time pouring over the User Guide and Reference Manual, but can't seem to find the problem. I want to be able to use 'series' and 'lags' in the code. Hope you can help. Thanks.
I am new to this board, RATS and time series generally. I am trying to write a very simple (practice) procedure which gives me the statistics of a series restricted depending on previous values. So, I want my procedure to tell me the statistics of a series if I restrict the series to the observations which are preceded by two periods of values greater than zero (for example).
I am getting this error which I try to source the code file:
## SX11. Identifier LAGS is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>> if 2==lags<<<<
I've spent some time pouring over the User Guide and Reference Manual, but can't seem to find the problem. I want to be able to use 'series' and 'lags' in the code. Hope you can help. Thanks.
Code: Select all
procedure unit series
type series series
local series
OPTION INTEGER lags
OPTION REAL shock 0
set first = %if(series{1}>shock,1,0)
set second = %if(series{2}>shock,1,0)
set third = %if(series{3}>shock,1,0)
set fourth = %if(series{4}>shock,1,0)
set fifth = %if(series{5}>shock,1,0)
set sixth = %if(series{6}>shock,1,0)
set seventh = %if(series{7}>shock,1,0)
set eighth = %if(series{8}>shock,1,0)
set ninth = %if(series{9}>shock,1,0)
set tenth = %if(series{10}>shock,1,0)
set eleventh = %if(series{11}>shock,1,0)
set twelfth = %if(series{12}>shock,1,0)
if 1==lags
set great = %if(first = 1,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 2==lags
set great = %if(first + second = 2,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 3==lags
set great = %if(first+second+third = 3,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 4==lags
set great = %if(first+second+third+fourth = 4,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 5==lags
set great = %if(first+second+third+fourth+fifth = 5,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 6=lags
set great = %if(first+second+third+fourth+fifth+sixth = 6,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 7==lags
set great = %if(first+second+third+fourth+fifth+sixth+seventh = 7,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) (series)
end if
if 8==lags
set great = %if(first+second+third+fourth+fifth+sixth+seventh+eighth = 8,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 9==lags
set great = %if(first+second+third+fourth+fifth+sixth+seventh+eighth+ninth = 9,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 10==lags
set great = %if(first+second+third+fourth+fifth+sixth+seventh+eighth+ninth+tenth = 10,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 11==lags
set great = %if(first+second+third+fourth+fifth+sixth+seventh+eighth+ninth+tenth+eleventh = 11,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
if 12==lags
set great = %if(first+second+third+fourth+fifth+sixth+seventh+eighth+ninth+tenth+eleventh+twelfth = 12,1,0)
dis 'If we restrict the series to values preceded by chosen shocks, then we obtain the following data.'
stat(smpl=great) series
end if
end unit