Page 1 of 1
Missing Values
Posted: Fri Nov 22, 2013 1:27 pm
by rmoralesaramburu
Hello
How do I program Eviews to manage NA values. I will like to fill NA values with the next "not NA" value, for example:
Series01
NA
NA
NA
NA
4
7
8
....
The NAs of this series has to be filled with number 4.
Series01
4
4
4
4
4
7
8
Thanks!
Re: Missing Values
Posted: Sat Nov 23, 2013 11:47 am
by EViews Gareth
Assuming that the last value in the series is not an NA, this will work:
Code: Select all
smpl @first @last-1
genr(r) series01 = @recode(series01=na, series01(1), series01)
smpl @all
Re: Missing Values
Posted: Mon Nov 25, 2013 8:47 am
by rmoralesaramburu
Sorry, that only put the first value not equal to NA in the row before that first value, but I need to replace the others NA. So what the code did was the following
Series01
NA
NA
NA
NA
4
5
7
Series01 (after running the code)
NA
NA
NA
4
4
5
7
Re: Missing Values
Posted: Mon Nov 25, 2013 9:33 am
by EViews Gareth
Works for me:
Code: Select all
create u 7
series series01
series01.fill na, na, na, na, 4, 5, 7
smpl @first @last-1
genr(r) series01 = @recode(series01=na, series01(1), series01)
smpl @all
Re: Missing Values
Posted: Mon Nov 25, 2013 10:26 am
by rmoralesaramburu
What is the (r) in genr(r) for? I am not getting it. I am attaching the excel, could you try for br_l for example?
Thanks!
Re: Missing Values
Posted: Mon Nov 25, 2013 10:51 am
by EViews Gareth
The (R) stands for reverse - it tells EViews to generate the values starting at the bottom and working up.
Re: Missing Values
Posted: Mon Nov 25, 2013 11:30 am
by EViews Gareth
Looks like there is a slight issue with genr(r) on large workfiles with threading turned on. To get it to work, until we patch, go to Options->General Options->Advanced System Settings, then change the maximum number of threads to "1".
Re: Missing Values
Posted: Thu Dec 19, 2013 10:11 am
by rmoralesaramburu
Hello
I have a series with NA and non NA values on it. I would like fill the NA values interpolating, or repeating the previous value. How can I program it?
Thanks
Re: Missing Values
Posted: Thu Dec 19, 2013 10:24 am
by EViews Gareth
Look at series.adjust in the Object Reference.
Re: Missing Values
Posted: Thu Dec 19, 2013 1:14 pm
by rmoralesaramburu
I got it with ipolate function.
I am getting the following error when I try to generate a series:
"Missing data generated in "genr it_co_l=@mav(100*(col_li-@mmin(col_li,14*5))/(@mmax(col_li,14*5)-@mmin(col_li,14*5)),20)"
The series is created but it is stopping my program when I run it. I don't want it to stop
Re: Missing Values
Posted: Thu Dec 19, 2013 2:40 pm
by EViews Gareth
Increase the number of errors your program allows when running.