Page 1 of 1

Date Function/Manipulation (@month / @movav)

Posted: Tue May 11, 2010 10:36 am
by fmramos
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.

Re: Date Function/Manipulation (@month / @movav)

Posted: Tue May 11, 2010 11:50 am
by EViews Gareth
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?

Re: Date Function/Manipulation (@month / @movav)

Posted: Tue May 11, 2010 11:54 am
by fmramos
yep. Tks.

Re: Date Function/Manipulation (@month / @movav)

Posted: Tue May 11, 2010 12:02 pm
by EViews Gareth
A simple:

Code: Select all

series cumsum = @recode(@year=@year(-1),x+cumsum(-1),x)
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

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)

Posted: Tue May 11, 2010 12:13 pm
by fmramos
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.

Re: Date Function/Manipulation (@month / @movav)

Posted: Tue May 11, 2010 1:58 pm
by EViews Gareth
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.