Page 1 of 1

NA in series

Posted: Fri Sep 14, 2018 5:41 am
by stefanp
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?

Re: NA in series

Posted: Fri Sep 14, 2018 5:59 am
by EViews Gareth
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.

Re: NA in series

Posted: Fri Sep 14, 2018 6:23 am
by stefanp
series.@obs has exactly the same value for every observation.

Re: NA in series

Posted: Fri Sep 14, 2018 8:59 am
by EViews Matt
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.

Re: NA in series

Posted: Tue Sep 18, 2018 4:47 am
by stefanp
I still haven't figured out a way to exclude a cross section if there are too many NAs in this cross section.