Date Function/Manipulation (@month / @movav)

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

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

Date Function/Manipulation (@month / @movav)

Postby fmramos » Tue May 11, 2010 10:36 am

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.

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

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

Postby EViews Gareth » Tue May 11, 2010 11:50 am

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?
Follow us on Twitter @IHSEViews

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

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

Postby fmramos » Tue May 11, 2010 11:54 am

yep. Tks.

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

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

Postby EViews Gareth » Tue May 11, 2010 12:02 pm

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
Follow us on Twitter @IHSEViews

fmramos
Posts: 113
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil
Contact:

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

Postby fmramos » Tue May 11, 2010 12:13 pm

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.

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

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

Postby EViews Gareth » Tue May 11, 2010 1:58 pm

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.
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 23 guests