Page 1 of 1

month identifier

Posted: Fri May 12, 2017 7:22 am
by remuct
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

Re: month identifier

Posted: Fri May 12, 2017 7:32 am
by EViews Gareth
Assuming your workfile starts on a January:

Code: Select all

series x = @recode(@month=1,y,y+x(-1))

Re: month identifier

Posted: Fri May 12, 2017 7:49 am
by remuct
Assuming your workfile starts on a January:

Code: Select all

series x = @recode(@month=1,y,y+x(-1))
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...