| Date: | Thu, 27 Apr 2006 02:37:53 -0400 |
| Reply-To: | Richard Ristow <wrristow@mindspring.com> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | Richard Ristow <wrristow@mindspring.com> |
| Subject: | Re: Selecting Cases |
|
| In-Reply-To: | <20060426212904.05EAE3E39B@mail.contracttesting.com> |
| Content-Type: | text/plain; charset=us-ascii; format=flowed;
x-avg-checked=avg-ok-72E348F6 |
|---|
At 05:32 PM 4/26/2006, Patrick S Bennett wrote:
>I have a dataset with 114 cases. Of these 114 cases I have 30 in age
>group 1, 30 in age group 2 and 54 in age group 3. I want the select
>cases feature to select 25 age group 1's, 25 age group 2's and 25 age
>group 3's.
I assume you want these drawn at random. If so, use SAMPLE, not SELECT
IF. I'm working from documentation(*), and haven't tested, but try
this:
DO IF AGEGRP EQ 1.
. SAMPLE 25 FROM 30.
ELSE IF AGEGRP EQ 3.
. SAMPLE 25 FROM 30.
ELSE IF AGEGRP EQ 3.
. SAMPLE 25 FROM 54.
END IF.
....................
From SPSS 14 Command Syntax Reference, p. 1546:
Sampling Subgroups
DO IF SEX EQ 'M'.
SAMPLE 1846 FROM 8000.
END IF.
.. SAMPLE is placed inside a DO IF-END IF structure to sample subgroups
differently. Assume that this survey is for 10,000 people in which 80%
of the sample is male, while the known universe is 48% male. To obtain
a sample that corresponds to the known universe and that maximizes the
size of the sample, 1846 (48/52*2000) males and all females must be
sampled. The DO IF structure restricts the sampling process to the
males.
|