fill missing data

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

basil
Posts: 37
Joined: Thu Apr 28, 2011 11:48 am

fill missing data

Postby basil » Wed Aug 10, 2011 1:03 pm

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?

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

Re: fill missing data

Postby EViews Gareth » Wed Aug 10, 2011 1:32 pm

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.

dagfinnrime
Posts: 54
Joined: Sat Oct 11, 2008 9:37 am
Location: Oslo
Contact:

Re: fill missing data

Postby dagfinnrime » Wed May 21, 2014 12:22 pm

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests