Page 1 of 1

fill missing data

Posted: Wed Aug 10, 2011 1:03 pm
by basil
how do I fill missing data? i would like to fill missing data with its recent value. For example, 1 2 3 NA 4 5 becomes 1 2 3 3 4 5.
Are there other options for filling missing data?

Re: fill missing data

Posted: Wed Aug 10, 2011 1:32 pm
by EViews Gareth
Interpolation is the standard method (available from the proc menu). It won't do the specific one you want, though. For that you could do something like:

Code: Select all

series xfilled = @recode(x=na, x(-1), x)
where X is the series that has the missings.

Re: fill missing data

Posted: Wed May 21, 2014 12:22 pm
by dagfinnrime
Hi,

the following is better as it also handles cases with multiple NAs in a sequence.

Code: Select all

series xfilled = @recode(x=na, xfilled(-1), x)
Dagfinn