Change values for certain dates of series in a group
Posted: Thu May 21, 2015 3:28 pm
Hello
I am using Eviews 8.1.
I have several groups, each of which contains about 20 time series per country. The last date for which these series have values varies (let's assume that the most recent data for any of the series in the first group is 2015m04). For series that do not have values for this date (ie, only through 2015m03), I would like to extrapolate (or "pull forward") the value of the last date for which data are available to the last date of the sample. This is shown in the attached excel file -- columns B-F are the raw data, and columns H-L ("transformed data") is what I am trying to do.
I get an error message at the line {%a}(!i) = {%a}(!i)(-1)
Syntax error in "GENR AUD_REAL(5) = AUD_REAL(5)(-1)
Obviously this is wrong but I do not know how to index the series in the group properly.
Any help would be much appreciated.
Thank you very much
Jeff
for %a aud cad zar
for !i=1 to {%a}.@count
%name = {%a}.@seriesname(!i)
%first = {%name}.@first
%last = {%name}.@last
smpl %first %last
'Note: %end in the next row is defined in the program previously, and I have confirmed that it is in fact the last date for which any of the series in the group has a value
if %last < %end then
scalar fill = @datediff(@dateval(%end),@dateval(%last),"mm")
if fill>0 then
for !x = 1 to fill
smpl %last+!x %last+!x
{%a}(!i) = {%a}(!i)(-1)
next
endif
endif
next
next
I am using Eviews 8.1.
I have several groups, each of which contains about 20 time series per country. The last date for which these series have values varies (let's assume that the most recent data for any of the series in the first group is 2015m04). For series that do not have values for this date (ie, only through 2015m03), I would like to extrapolate (or "pull forward") the value of the last date for which data are available to the last date of the sample. This is shown in the attached excel file -- columns B-F are the raw data, and columns H-L ("transformed data") is what I am trying to do.
I get an error message at the line {%a}(!i) = {%a}(!i)(-1)
Syntax error in "GENR AUD_REAL(5) = AUD_REAL(5)(-1)
Obviously this is wrong but I do not know how to index the series in the group properly.
Any help would be much appreciated.
Thank you very much
Jeff
for %a aud cad zar
for !i=1 to {%a}.@count
%name = {%a}.@seriesname(!i)
%first = {%name}.@first
%last = {%name}.@last
smpl %first %last
'Note: %end in the next row is defined in the program previously, and I have confirmed that it is in fact the last date for which any of the series in the group has a value
if %last < %end then
scalar fill = @datediff(@dateval(%end),@dateval(%last),"mm")
if fill>0 then
for !x = 1 to fill
smpl %last+!x %last+!x
{%a}(!i) = {%a}(!i)(-1)
next
endif
endif
next
next