LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 6 Jul 2009 08:38:40 -0700
Reply-To:     Bruce Weaver <bweaver@lakeheadu.ca>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Bruce Weaver <bweaver@lakeheadu.ca>
Subject:      Re: Question about selecting subsamples
In-Reply-To:  <786941.3922.qm@web55805.mail.re3.yahoo.com>
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 > questions: >  > 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, >  > Thanks, >  > Stace > >

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" . exe. filter by accident.

If you used codes Y=1 N=2, then you you need to be a bit more explicit, like this:

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)) . exe. 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.

----- -- Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "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 SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


Back to: Top of message | Previous page | Main SPSSX-L page