Date: Wed, 28 Sep 2005 20:37:40 -0400
Reply-To: Richard Ristow <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Richard Ristow <firstname.lastname@example.org>
Subject: Re: Recoding
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 02:10 PM 9/28/2005, Jean Campbell wrote:
>I have two separate variables that list a person's profession, one is
>a string variable and the other is numeric. I want to recode both
>variables into one new variable "profession." But so far I can only
>recode one variable at a time into a new variable...
And, at 03:02 PM 9/28/2005, expanded:
>My goal is to recode all of my profession data into one of the
>3. Other human services
>The first two are from a list presented to the person filling it in,
>the third category comes from a combination of other [choices on the
>list] AND a write in "other" option:
>3 social worker
>13 Other (specify _________)
>[So,] there are two variables: one that represents any of the 12
>possible professions (numeric) and one that represents a write-in
>I want to have everyone who choose "healthcare-medical" and everyone
>who wrote in something I adjudicate as "healthcare-medical" to be
>recoded to "1." [,etc.]
OK, you're adjudicating. So you can't recode from the string variable;
you need a new variable, which I'll call B1, which gives the category
you've assigned to that individual's "Other" response. Would something
like this work?
NUMERIC B2 (F3).
VAR LABEL B2 'Professional category, assigning written-in "Other"
VAL LABEL B2
3 'social worker'
DO IF MISSING(A) AND MISSING(B1).
. COMPUTE B2 = $SYSMIS.
ELSE IF MISSING(A) OR A EQ 13.
. COMPUTE B2 = B1.
. COMPUTE B2 = A.
Then, if I've got the logic right (not checked), B2 is the best
assignment you have, of each person to one of the categories. (Note
category 13, for people you couldn't assign.)
Then, if you want to combine categories,