Series of overlapping data

For questions regarding programming in the EViews programming language.

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

junim
Posts: 2
Joined: Mon Mar 12, 2012 5:34 am

Series of overlapping data

Postby junim » Mon Mar 12, 2012 6:06 am

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

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

Re: Series of overlapping data

Postby EViews Gareth » Mon Mar 12, 2012 7:53 am

If k is fixed, you just want a moving sum. You can use the @movsum function for that.

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: Series of overlapping data

Postby startz » Mon Mar 12, 2012 8:06 am

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)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests