MATRIX producing a signed zero at saving?
Posted by Kirill Orlov on Sep 02, 2021; 1:05pm
URL: http://spssx-discussion.165.s1.nabble.com/MATRIX-producing-a-signed-zero-at-saving-tp5740750.html
SPSS (at least vers. 20, 22, 25) MATRIX session *saves* the result of 0 * (-1) as -0.
*MATRIX saving two versions of 0.
matrix.
compute x= {1;0}.
compute y= {0;-1}.
compute xy= x &* y.
print xy /format f20.16. /*The two zeros
print (xy(1)=xy(2)). /*They are equal
print (xy=0). /*and are zero
save xy /out= * /var= xy. /*But upon saving out to a dataset...
end matrix.
frequencies xy. /*...there are TWO different zeros in FREQUENCIES!
/* click both to find that one is "signed"
*Compare with this normal result.
data list list /x y.
begin data
1 0
0 -1
end data.
compute xy= x * y.
frequencies xy. /*One value, zero
Do you think it is fair?