Page 1 of 1
Creating an averaged time series over day and month per year
Posted: Mon Dec 21, 2020 9:58 am
by EconometriX
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.
Re: Creating an averaged time series over day and month per year
Posted: Mon Dec 21, 2020 10:08 am
by EViews Gareth
Probably, but you'll need to explain in more detail what you want.
Re: Creating an averaged time series over day and month per year
Posted: Mon Dec 21, 2020 10:30 am
by EconometriX
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.
Re: Creating an averaged time series over day and month per year
Posted: Mon Dec 21, 2020 10:39 am
by EViews Gareth
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)
Re: Creating an averaged time series over day and month per year
Posted: Mon Dec 21, 2020 10:43 am
by EconometriX
Perfect, thanks!