Date: Fri, 9 Sep 2005 09:59:24 -0400
Reply-To: Martin Sherman <MSherman@loyola.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Martin Sherman <MSherman@loyola.edu>
Subject: Explaining output of a do if with missing values
Content-Type: text/plain; charset=US-ASCII
Dear list, I have the following syntax program along with the output.
What I don't understand
is why if Race eq 3 and sex is missing then racesex eq 5 but when sex
eq 1 and race is missing
then racesex eq missing. What am I missing. thanks, martin sherman
data list free / race sex.
begin data
1 1
. 1
1 2
1 2
2 1
2 1
2 .
2 2
3 1
3 1
3 2
3 2
. .
3 .
4 1
4 2
4 2
5 1
. 1
5 2
end data.
do if (race eq 1 and sex eq 1).
compute racesex=1.
else if (race eq 1 and sex eq 2).
compute racesex=2.
else if (race eq 2 and sex eq 1).
compute racesex=3.
else if (race eq 2 and sex eq 2).
compute racesex=4.
else.
compute racesex=5.
end if.
list race sex racesex.
1.00 1.00 1.00
. 1.00 .
1.00 2.00 2.00
1.00 2.00 2.00
2.00 1.00 3.00
2.00 1.00 3.00
2.00 . .
2.00 2.00 4.00
3.00 1.00 5.00
3.00 1.00 5.00
3.00 2.00 5.00
3.00 2.00 5.00
. . .
3.00 . 5.00
4.00 1.00 5.00
4.00 2.00 5.00
4.00 2.00 5.00
5.00 1.00 5.00
. 1.00 .
5.00 2.00 5.00
|