Creating an averaged time series over day and month per year

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

EconometriX
Posts: 5
Joined: Mon Dec 21, 2020 9:47 am

Creating an averaged time series over day and month per year

Postby EconometriX » Mon Dec 21, 2020 9:58 am

Is there an easy way to create a series which averages a daily series over, say five years, based on specific month and day, but varying the year.
E.g. average of values related to 1/1/2015, 1/1/2016, 1/1/2017, 1/1/2018, 1/1/2019 ?
And then the next series member would be the average of 2/1/2015 and so on.

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

Re: Creating an averaged time series over day and month per year

Postby EViews Gareth » Mon Dec 21, 2020 10:08 am

Probably, but you'll need to explain in more detail what you want.
Follow us on Twitter @IHSEViews

EconometriX
Posts: 5
Joined: Mon Dec 21, 2020 9:47 am

Re: Creating an averaged time series over day and month per year

Postby EconometriX » Mon Dec 21, 2020 10:30 am

Very simple: I have daily values for 5 different years and want to create a series averaging the years for the same days and months, similar to the averageifs function in MS Excel.
The specific issue is averaging temperatures for the 1 Jan, then 2 Jan and so on always over a five years period. The time series would then be a representative value for each day.

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

Re: Creating an averaged time series over day and month per year

Postby EViews Gareth » Mon Dec 21, 2020 10:39 am

So you have a workfile with a page in it that contains daily (7 day?) observations between 2015 and 2019 (so 1826 observations)?

You wish to create a new series in the same page (so also 1826 observations) that contains the average over the years for the corresponding day/month combination?

If so,

Code: Select all

series avgx = @meansby(x, @day, @month)
Follow us on Twitter @IHSEViews

EconometriX
Posts: 5
Joined: Mon Dec 21, 2020 9:47 am

Re: Creating an averaged time series over day and month per year

Postby EconometriX » Mon Dec 21, 2020 10:43 am

Perfect, thanks!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 18 guests