Page 1 of 1

Replacing NAs in multiple series

Posted: Tue Nov 13, 2012 9:42 am
by kaywu814
Hi,

I am cleaning a dataset and am having an issue where I would like to replace NAs in multiple series with 0's instead. Is there a quick and easy way to do this (perhaps with a loop) instead of using @recode for each individual variable?

For example, instead of using

X=@recode(X=na,0,X)

we would like to have a loop that replaces NAs with 0's in all our series.

Thanks in advance.

Re: Replacing NAs in multiple series

Posted: Tue Nov 13, 2012 9:57 am
by EViews Gareth

Code: Select all

%serieslist = @wlookup("*", "series") for %i {%serieslist} {%i} = @recode({%i}=na, 0, {%i}) next