Hi all!
I'm trying to easily extract the moving average of a time series in the year.
So, I know the function "@month". For the given month 'i', 'i'=1,2,...,12.
I've combined it with the @movav function in the way: @movav(X,i).
I'm not getting what I expected. What probably I've done wrong?
Tks in advance, Fabio.
Date Function/Manipulation (@month / @movav)
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13611
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Date Function/Manipulation (@month / @movav)
I'm not 100% certain I understand what you're after here.
Are you just saying you want the cumulative average from the start of each year?
Are you just saying you want the cumulative average from the start of each year?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13611
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Date Function/Manipulation (@month / @movav)
A simple:
Will do it, apart from for the first year. To get the first year working, you'll have to do something like:
Code: Select all
series cumsum = @recode(@year=@year(-1),x+cumsum(-1),x)
Code: Select all
smpl @all
series cumsum = x
smpl @first+1 @last
cumsum = @recode(@year=@year(-1),x+cumsum(-1),x)
smpl @all
Re: Date Function/Manipulation (@month / @movav)
Ok. Tks. I was trying something direct (to build a kind of formula link).
Do u know why "@movav" with "@month" doesn't work?
Tks, Fabio.
Do u know why "@movav" with "@month" doesn't work?
Tks, Fabio.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13611
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Date Function/Manipulation (@month / @movav)
Well, @movav is meant to move both the start and end point. You want to only move the end point, and then jump the start point.
Who is online
Users browsing this forum: No registered users and 2 guests
