I would say we do not want that.

Receiving a "False" signals at the meta-level that all is fine, there are two numbers that were actually compared according to the boolean condition, and the answer is that the condition does not hold. But this is not how most of us  understand a situation where one of the "numbers" is NA, being a missing value or even a "not-a-number".

So I think Allin's proposal is the wise one.


Alecos Papadopoulos PhD
Athens University of Economics and Business
web: alecospapadopoulos.wordpress.com/
scholar:https://g.co/kgs/BqH2YU
On 15/1/2021 18:46, Allin Cottrell wrote:
On Fri, 15 Jan 2021, Riccardo (Jack) Lucchetti wrote:

On Fri, 15 Jan 2021, Allin Cottrell wrote:

Following C-library rules one could say that comparisons of the sort z < x, z
x, z <= x, z >= y should all give FALSE/0 rather than NA if one or more of
{z, x} are NA. I'm not sure if we want that.

Or we could just print the string "Schrödinger!".

Nice one!

Unless there are any strong objections, for gretl 2021a I propose to revert to the status quo prior to breakage. That means that all comparisons involving NA (including equals and not-equals) will give NA, and if this arises in the context of an "if" test an error will be flagged.

We can debate this later, but briefly here's my thinking on why this is at least defensible. The IEEE rules for comparisons involving NaNs are consistent and arguably correct when we're dealing with true "Not-a-Number", as can arise from a failed calculation such as taking the log of a negative number. But they're not very intuitive, and -- more important -- it's not at all clear that they're the right approach for handling primary NAs (missing values in a dataset).

(Note, this is without prejudice to the application of IEEE rules for arithmetic invoving NaNs, it's specific to boolean comparisons.)

Allin

_______________________________________________
Gretl-users mailing list -- gretl-users@gretlml.univpm.it
To unsubscribe send an email to gretl-users-leave@gretlml.univpm.it
Website: https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/