compute the average of the previous year in a monthly series

For questions regarding programming in the EViews programming language.

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

eviewsuserforum
Posts: 19
Joined: Wed Apr 22, 2015 5:11 am

compute the average of the previous year in a monthly series

Postby eviewsuserforum » Thu Oct 08, 2015 11:34 am

Hopefully my question fits in this subforum.

I have been stuck with what is probably dumb.

I have a monthly time series say from 2010m1 to 2016m12.

For each month throughout year Y, I need Eviews to return the Jan-Dec average of year Y-1

eg, if mean for 2014 is 5, I need Eviews to return 5 for months Jan-15 to Dec-15 to be set to 5.

and I would like to avoid creating new object. gloups!

Can someone help please?

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

Re: compute the average of the previous year in a monthly se

Postby startz » Thu Oct 08, 2015 11:59 am

Code: Select all

series annualMeans = @meansby(y,@year) series laggedAverage = annualMeans(-12)
Maybe...


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests