Date: Mon, 6 Jul 2009 08:38:40 -0700
Reply-To: Bruce Weaver <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Bruce Weaver <firstname.lastname@example.org>
Subject: Re: Question about selecting subsamples
Content-Type: text/plain; charset=UTF-8
stace swayne wrote:
> Dear list,
> I have to create sub-samples from a larger data set and I have a few
> Here is the back ground:
> I have a data set with 252 people, I have been asked to create sub-samples
> from this data set based on the following conditions and combine them
> together to reflect anyone in the sample who reported having an accident :
> (1) Any individual who answered¬ YES to the first accident inquiry
> (question #1)
> (2) Anyone who answered¬ NO to question 1 but¬ YES to question 6 (another
> accident inquiry question)
> (3) Anyone who answered¬ NO to question 1&6, but answered¬ YES to question
> 15 (another accident inquiry question)
> (4) Anyone who answered no to questions 1,6,&15 but answered YES to
> question 28.
> My question is: how would I go about writing the syntax to select based on
> these conditions.
> All suggestions are appreciated,
If Yes and No are the only possible responses, and if they are coded Y=1,
N=0, then this should work:
compute accident = Q1 or
(~Q1 and Q6) or
(~Q1 and ~Q6 and Q15) or
(~Q1 and ~Q6 and ~Q15 and Q28) . /* ~ means "not" .
filter by accident.
If you used codes Y=1 N=2, then you you need to be a bit more explicit, like
compute accident = (Q1 EQ 1) OR
((Q1 EQ 2) and (Q6 EQ 1)) OR
((Q1 EQ 2) and (Q6 EQ 2) and (Q15 EQ 1)) OR
((Q1 EQ 2) and (Q6 EQ 2) and (Q15 EQ 2) and (Q28 EQ 1)) .
filter by accident.
Personally, though, I always try to use the 1=Y 0=N codes, or recode to that
if given data from someone else, because the coding is much neater.
"When all else fails, RTFM."
View this message in context: http://www.nabble.com/Question-about-Frequency-Output-tp24225761p24357768.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
For a list of commands to manage subscriptions, send the command