Date: Fri, 9 Sep 2005 15:38:06 -0500
Reply-To: "Marks, Jim" <Jim.Marks@lodgenet.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Marks, Jim" <Jim.Marks@lodgenet.com>
Subject: Re: computing new var along with DO IF
Content-Type: text/plain; charset="us-ascii"
Amy:
Are you trying to filter with the variable finother and getting cases
where finother eq 2?
If so, you need to compute a different variable that flags only the
cases where finother = 1.
COMPUTE need_UVa2 EQ finalneed > 0 and accessUVa =2.
will do the trick. The variable need_UVa2 will have 1 for cases that
meet the condition, and 0 for cases that don't.
(Cases with a missing value in finalneed and/or accessUVa2 will have
system-missing for need_UVa2)
"FILTER" excludes cases where the filter variable is missing or equal
to zero. All other numbers pass the filter (including decimal and
negative values).
--jim
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Amy Thelk
Sent: Friday, September 09, 2005 2:14 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: computing new var along with DO IF
I tried to compute a new variable that separates students who got need-
based financial aid from those who didn't, while filtering out from the
new variable those students who qualified for a program called
"AccessUVa." When I use the following syntax, the AccessUVa folks are
filtered out of the first value of the new variable (finother=1) but
they are not filtered out of the second (finother =2.
Can anyone let me know how to get better results than I've gotten by
using this syntax:
Do If (finalneed gt 0 and AccessUVa=2).
Compute finother=1.
else if (finalneed le 0 and AccessUVa=2).
compute finother=2.
Value label finother 1 'Received need-based aid' 2 'Did not receive
need- based aid'.
End if.
Execute.
Thanks.