Assign special values for some observations in a series

For questions regarding programming in the EViews programming language.

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

ecardamone
Posts: 40
Joined: Wed Sep 17, 2014 12:23 pm

Assign special values for some observations in a series

Postby ecardamone » Mon Sep 21, 2015 1:27 pm

Hi,
I have two times series, x1 and x2 dated 1997 to 2013. Both series have negative observations in some periods, that I would like to turn into NA. Is there a simple way to do this? I have tried

Code: Select all

if x1>0 then x1=na else x1=x1 endif

but that doesn't work. I get an error message saying "NA found in matrix in..."

I am using EViews 9.

Thanks for help!

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

Re: Assign special values for some observations in a series

Postby EViews Gareth » Mon Sep 21, 2015 1:28 pm


EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Assign special values for some observations in a series

Postby EViews Glenn » Mon Sep 21, 2015 1:44 pm


ecardamone
Posts: 40
Joined: Wed Sep 17, 2014 12:23 pm

Re: Assign special values for some observations in a series

Postby ecardamone » Tue Sep 22, 2015 6:14 am

Thank you very much! @recode worked great.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests