NA in series

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

NA in series

Postby stefanp » Fri Sep 14, 2018 5:41 am

I have a panel in which contains only NAs for some cross sections. I need to run individual estimations for each cross section. Obviously, if one cross sections only contains NAs, I end up with an error message (insufficient observations)

To avoid this problem I use want to use an if condition, i.e. if series<>NA then do stuff. However, I receive an error: "NA found in matrix if series<>NA then"

Any suggestions?

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

Re: NA in series

Postby EViews Gareth » Fri Sep 14, 2018 5:59 am

If statements cannot be used with raw series.

Use:

Code: Select all

if series.@obs > 0 then
'estimate
endif


Of course you probably don't want 0 as the test. You'll need more than that.
Follow us on Twitter @IHSEViews

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Re: NA in series

Postby stefanp » Fri Sep 14, 2018 6:23 am

series.@obs has exactly the same value for every observation.

EViews Matt
EViews Developer
Posts: 560
Joined: Thu Apr 25, 2013 7:48 pm

Re: NA in series

Postby EViews Matt » Fri Sep 14, 2018 8:59 am

I believe EViews Gareth meant "@obs(series)" rather than "series.@obs". The function @obs respects the current sample, which I assume you're setting as you iterate through your cross sections.

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Re: NA in series

Postby stefanp » Tue Sep 18, 2018 4:47 am

I still haven't figured out a way to exclude a cross section if there are too many NAs in this cross section.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 20 guests