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 (June 2004)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 17 Jun 2004 09:16:51 -0400
Reply-To:     "Goodwin, Jay ARI" <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Goodwin, Jay ARI" <>
Subject:      Re: sample with given criteria (UNCLASSIFIED)
Comments: To: 'Adam Olszˇwka' <>
Content-Type: text/plain; charset="iso-8859-1"

Classification: UNCLASSIFIED Caveats: NONE

Hi Adam,

One brute force solution follows. It isn't elegant or automated, but it is functional.

First do your math to figure out how many cases go in each cell given your criteria. By my quick calculations for sex = 1, you should have N of 4, 6, 2, and 8 for education = 1,2,3,4 respectively; for sex = 2, you should have 16, 24, 8, and 32 for education = 1, 2, 3, 4 respectively. You technically do not need it, but should probably do a crosstab to see what the actual cell N's are for the whole dataset. In the syntax I have just multiplied the to be selected sample size by 100 for demonstration. Syntax follows...

Do if (sex eq 1) and (educ eq 1). Sample 4 from 400. Else if (sex eq 1) and (educ eq 2). Sample 6 from 600. Else if (sex eq 1) and (educ eq 3). Sample 2 from 200. Else if (sex eq 1) and (educ eq 4). Sample 8 from 800. Else if (sex eq 2) and (educ eq 1). Sample 16 from 1600. Else if (sex eq 2) and (educ eq 2). Sample 24 from 2400. Else if (sex eq 2) and (educ eq 3). Sample 8 from 800. Else if (sex eq 2) and (educ eq 4). Sample 32 from 3200. End if.

If someone has a more elegant solution that is flexible to the sampling criteria, I would appreciate seeing it.



-----Original Message----- From: Adam Olszˇwka [] Sent: Thursday, June 17, 2004 8:49 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: sample with given criteria

Hi everybody,

I've got dataset with 10000 cases. Variables are: sex (codes:1,2) and education (codes:1,2,3,4). I'm looking for syntax that would draw 100 cases sample but with given criteria. Let's say: sex=1 - 20 sex=2 - 80 and education=1 - 20 education=2 - 30 education=3 - 10 education=4 - 40. Any ideas how to do it or where I should look for it?

Thanks in advance,

Adam Olszowka Classification: UNCLASSIFIED Caveats: NONE

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