On Fri, 15 Jan 2021, Artur Bala wrote:
Dear developers,
I thought that the following "if" conditions are supposed to give the same
results but they actually don't. And the 2nd "if" block ignores
"NA" values
Interesting.
The problem you report can be exemplified even more easily as
<hansl>
scalar z = NA
if z < 0
print "A"
else
print "B"
endif
</hansl>
I'm not sure what we should do in an "if" block if the condition is
neither true or false. At the moment, we treat NA as true (because it's
non-zero), but I wonder if we should throw an error instead.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------