Replacing NA with values of another variable

For questions regarding programming in the EViews programming language.

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

Rosa.hh
Posts: 22
Joined: Tue Dec 14, 2010 8:07 am

Replacing NA with values of another variable

Postby Rosa.hh » Wed Dec 15, 2010 9:51 am

Hi!
I am using Eviews 7 and I working with a time series database 1990q1-2009q2. How can I replace a variable with the values of two other ones?

I want to creat a variable (grwth_r) which takes the values of max_total when max_total is different than NA
AND takes the values of a_rer_gq when max_total=NA

I know this is a very simple thing, but I am new at eviews and have not managed to get the right program.

I have alredy tried the following approaches but did not succed:

series grwth_r=@recode(a_rer_gq<>NA, a_rer_gq, max_total)

and

' smpl @first @last-(!endobs-!halfobs)
' series grwth_r=a_rer_gq

'smpl @last-(!halfobs-1) @last
'series grwth_r= max_total


I highly appreciate your help!!

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest