Page 1 of 1

Series of overlapping data

Posted: Mon Mar 12, 2012 6:06 am
by junim
I am working on some times series data and I would be grateful if someone could help.

I am trying to create a series where each variable is generated as a sum of the next k period observations (e.g. k=120). So I am looking for a way to make this command easier:

Code: Select all

Series y=x+x(+1)+x(+2)+...+x(+k)

/Junim

Re: Series of overlapping data

Posted: Mon Mar 12, 2012 7:53 am
by EViews Gareth
If k is fixed, you just want a moving sum. You can use the @movsum function for that.

Re: Series of overlapping data

Posted: Mon Mar 12, 2012 8:06 am
by startz
If k is fixed, you just want a moving sum. You can use the @movsum function for that.
Maybe to get the lead,

Code: Select all

series ytemp=@movsum(x,k) series y = ytemp(k)