Date: Mon, 14 Jan 2008 17:33:48 -0800
Reply-To: "Raffe, Sydelle, SSA" <DRaffe@acgov.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Raffe, Sydelle, SSA" <DRaffe@acgov.org>
Subject: Re: drawing samples for hundreds of workers
In-Reply-To: <3440368C27E66D4588AF902A2A9EB8E2012301A9@CHIEMAIL1.spss.com>
Content-Type: text/plain; charset="iso-8859-1"
Yup.
-----Original Message-----
From: Norton, John [mailto:jnorton@spss.com]
Sent: Monday, January 14, 2008 5:23 PM
To: Raffe, Sydelle, SSA
Subject: RE: drawing samples for hundreds of workers
So you want to do a random selection of cases *within worker ID*?
JN
_____
From: Raffe, Sydelle, SSA [mailto:DRaffe@acgov.org]
Sent: Mon 1/14/2008 7:22 PM
To: Norton, John
Subject: RE: drawing samples for hundreds of workers
Thank you John. But, I want so much more. In my file, there are unique case records. These are apportioned to hundreds of different workers such that each worker has multiple cases.
We want to make a random selection of each workers cases. I don't think that's what I led you to understand.
-----Original Message-----
From: Norton, John [ mailto:jnorton@spss.com]
Sent: Monday, January 14, 2008 1:39 PM
To: Raffe, Sydelle, SSA; SPSSX-L@LISTSERV.UGA.EDU
Subject: RE: drawing samples for hundreds of workers
Hi Sydelle,
I'll assume that your co-worker is interested in a random selection of workers, rather than of cases in the data file, such that when a worker is selected, all his or her records are selected. If this assumption is not incorrect then one way to accomplish this is to aggregate the data based on worker ID, saving only that variable to an external data file. So, after aggregation, you will have a separate data file of nothing but unique IDs.
Then, using that aggregated file, you can execute a random selection of cases using the capabilities in the random selection engine within the Select Cases Wizard (under Data > Select Cases..) Be sure to click on the option to delete all unselected cases. Now create a constant variable with a value of 1 and call it something like "selected_case" and then save the data file. By default, that file will be in sort order by value of the ID.
Then, returning to the source file, sort it as well on the value of worker ID. Finally, you can merge the source file with the file just created (under Data > Merge Files > Add Variables...) and use worker ID as the link. Be sure to include the "selected_cases" variable.
The resulting file will now have the new variable (at the far right of the data file) with values of 1 and system missing (represented by a "." in the cell). It's necessary to change the system missing values to zeros so that you can finally execute the case selection. To replace the system missing values, use the Recode engine (under Transform > Recode into same variable) and replace the system missing values with zeros.
Finally, you can run another case selection to select all cases where the "select_case" variable has a value of 1.
HTH,
John Norton
SPSS Inc.
-----Original Message-----
From: SPSSX(r) Discussion [ mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Raffe, Sydelle, SSA
Sent: Monday, January 14, 2008 3:17 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: drawing samples for hundreds of workers
I have a co-worker who needs to identify a random sample of cases based on worker number in a file. There are many hundreds of workers who a have a varied number of cases. How could this be done?
Sydelle Raffe, Alameda County Social Services Agency
Information Services Division, Office of Data Management
e:mail: draffe@acgov.org
phone: 510-271-9174 fax: 510-271-9107
If you have a request for information, please submit an ODM request form at: https://alamedasocialservices.org/staff/support_services/statistics_and_reports/odm/index.cfm
=======
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
====================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
|