Page 1 of 1

replace NAs by 0 in for loop over multiple series

Posted: Tue May 14, 2013 11:59 am
by tzink
I couldn't quite piece together how to accomplish this seemingly simple task. I have multiple series that I want to replace NAs by 0.

I know for a single series I use
X=@recode(X=na,0,X)

But I can't figure out how to loop over a list of series I specify
Something like

Code: Select all

for %i SERIES1 SERIES2 SERIES3 %i=@recode(%i=na,0,%i) next
but that doesn't work, obviously.

Re: replace NAs by 0 in for loop over multiple series

Posted: Tue May 14, 2013 12:29 pm
by EViews Gareth
Put braces around the %i in the @recode line.

Re: replace NAs by 0 in for loop over multiple series

Posted: Tue May 14, 2013 1:58 pm
by tzink
Great, thanks. I feel like eviews programming is full of these little tricks that are fairly impossible to figure out without asking...