Different ways to check for NA

For questions regarding programming in the EViews programming language.

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

Ecovi
Posts: 30
Joined: Sun Mar 23, 2014 9:34 am

Different ways to check for NA

Postby Ecovi » Wed Aug 20, 2014 3:27 am

What is the difference between @isna(a) and a=na in if statements? Which one would be better or faster? The result is the same.

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

Re: Different ways to check for NA

Postby EViews Gareth » Wed Aug 20, 2014 5:43 am

They're essentially the same.

Ecovi
Posts: 30
Joined: Sun Mar 23, 2014 9:34 am

Re: Different ways to check for NA

Postby Ecovi » Wed Aug 20, 2014 7:44 am

Thanks!

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Different ways to check for NA

Postby EViews Glenn » Wed Aug 20, 2014 7:53 am

The former is a bit easier to read when using expressions, as in the admittedly artificial example

Code: Select all

(log(y)*(exp(x)=37))=na
versus

Code: Select all

@isna(log(y)*(exp(x)=37))

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

Re: Different ways to check for NA

Postby EViews Gareth » Wed Aug 20, 2014 7:57 am

And you can use @isna inside other functions


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests