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
and treats them as numeric!!! Is that normal?
Best,
Artur
<hansl>
nulldata 10
series x = normal(0,1)
x[2]=NA
x[5]=NA
test1 = abs(x)>=0.5
series test2=NA
series test3=NA
loop for i=1..$nobs
test2[i] = abs(x[i])>= 0.5 ? 1: 0
endloop
loop for i=1..$nobs
if abs(x[i])>= 0.5
test3[i] = 1
else
test3[i] = 0
endif
endloop
print x test1 test2 test3 --byobs
</hansl>