Missing Values
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Missing Values
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!
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!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Missing Values
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
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Re: Missing Values
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
Series01
NA
NA
NA
NA
4
5
7
Series01 (after running the code)
NA
NA
NA
4
4
5
7
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Missing Values
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
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Re: Missing Values
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!
Thanks!
- Attachments
-
- fi_latam.xlsx
- (1.88 MiB) Downloaded 634 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Missing Values
The (R) stands for reverse - it tells EViews to generate the values starting at the bottom and working up.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Missing Values
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".
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Re: Missing Values
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
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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Missing Values
Look at series.adjust in the Object Reference.
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Re: Missing Values
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
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
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Missing Values
Increase the number of errors your program allows when running.
Who is online
Users browsing this forum: No registered users and 2 guests
