Calculate period averages

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

javiersan
Posts: 184
Joined: Mon Jan 19, 2009 8:18 am

Calculate period averages

Postby javiersan » Thu Nov 26, 2009 5:50 am

Hello,

I have a series with data on a weekly frequency and would like to calculate a new series which has for each weekly point the average of the series for the month (series_m)

The result would be something like:
Date series series_m
1-Jan-09 2.0 4.0
8-Jan-09 5.0 4.0
15-Jan-09 4.0 4.0
22-Jan-09 5.0 4.0
29-Jan-09 4.0 4.0

5-Feb-09 6.0 5.0
12-Feb-09 3.0 5.0
19-Feb-09 4.0 5.0
26-Feb-09 7.0 5.0

One way of doing this I guess is to run through each of the months in the series using a for...next, change the sample and calculate series_m=@mean(series[,s]). However, is there a way to calculate this using one or two formulas and not a loop or sample changing?

Thanks,

Javier

javiersan
Posts: 184
Joined: Mon Jan 19, 2009 8:18 am

Re: Calculate period averages

Postby javiersan » Thu Nov 26, 2009 8:56 am

I found the solution:
series series_m=@meansby(series,@month(series),@year(series))


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 19 guests