| Date: | Thu, 17 Jun 2004 16:06:40 +0200 |
| Reply-To: | Adam Olszówka <adamolszowka@hotmail.com> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | Adam Olszówka <adamolszowka@hotmail.com> |
| Subject: | Re: sample with given criteria (UNCLASSIFIED) |
| Content-Type: | text/plain; charset="iso-8859-1" |
Jay, thanks for quick reply.
The problem is that the structure of my original dataset is not the same as
sample I'd like to create.
And second thing (and more important) is that I need more automated
solution.
Thanks anyway,
Adam
----- Original Message -----
From: "Goodwin, Jay ARI" <GoodwinJ@ARI.army.mil>
Newsgroups: bit.listserv.spssx-l
To: <SPSSX-L@LISTSERV.UGA.EDU>
Sent: Thursday, June 17, 2004 3:16 PM
Subject: Re: sample with given criteria (UNCLASSIFIED)
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.
HTH
Jay
-----Original Message-----
From: Adam Olszówka [mailto:adamolszowka@hotmail.com]
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
|