Possible @recode option

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

neilmorrow
Posts: 1
Joined: Tue May 09, 2017 6:08 am

Possible @recode option

Postby neilmorrow » Tue May 09, 2017 6:54 am

I am using the @recode command in the following way:
smpl 1997 2019
x=@recode(x=na,y/y(+1)*x(+1),x)

However, I would like to use the @recode command so that it begins with 2019, not 1997, given that I would like to replace "x=na" with a term that is calculated using values from the next year. Is this possible? Is there a better command to use than @recode?

Thanks!

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

Re: Possible @recode option

Postby EViews Gareth » Tue May 09, 2017 7:30 am

All series generation commands can be told to run backwards using the genr(r) command:

Code: Select all

genr(r) x=@recode(x=na,y/y(+1)*x(+1),x)
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 20 guests