Hi,
I am a Eviews9 user and I am trying to create a monthly series x(t) whose observations are the cumulative sum of the observations of another monthly series y(t) from the previous January to the current month. The cumulative sum is reinitialized every 12 months, ie every January.
Example: suppose the year is Y
x(Ym1)=y(Ym1)
x(Ym2)=y(Ym1)+y(Ym2)
x(Ym3)=y(Ym1)+y(Ym2)+y(Ym3)
etc...
What I need at least is a way to identify the January observations. Is there a way to do this?
Thanks for your help
month identifier
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: month identifier
Assuming your workfile starts on a January:
Code: Select all
series x = @recode(@month=1,y,y+x(-1))
Re: month identifier
Well, unfortunately the workfile contains several X series which do not necessarily start on January. I need to find a way to identify January observations among series starting on any month. But thank you anyway for your @recode suggestion, I'll see if I can handle with it...Assuming your workfile starts on a January:Code: Select all
series x = @recode(@month=1,y,y+x(-1))
Who is online
Users browsing this forum: No registered users and 2 guests
