Date: Wed, 30 Jan 2008 11:11:55 -0500
From: Deepa Bhat <
[hidden email]>
Subject: Recoding multiple variables into one new variable
Hi everyone,
I have a database in which the data entry staff entered the responses
to one question in four different columns. I would like to combine it
all into one column. The syntax I have so far is the following:
RECODE
q3_1a
(1=1) (2=2) (99=99) (SYSMIS=SYSMIS) INTO new3_1 .
VARIABLE LABELS new3_1 'Clean table or tray'.
EXECUTE .
SPSS won't let me recode another variable (q3_1b q3_1c q3_1d) into
new3_1. I don't have to worry about any response overriding another one
because each response is affiliated with a different person.
I am trying to avoid doing frequencies of each and tallying it up the
total by hand. Is there a syntax that will allow me to recode multiple
variables into one variable?
Thanks so much,
Deepa
*************************************************************
Deepa,
I believe that another solution might be the following:
COMPUTE new3_1=MAX(q3_1a,q3_1b,q3_1c,q3_1d).
This should take the highest value for each case and put it into the new var. It should skip the system missing cases. If you are using 9s or 99s to indicate missing values, you may need to recode these in the original variables to either sysmis or 0 first.
This is what I would have done. I agree with ViAnn, that, if all you want is simple frequencies, then Tables or CTables is your best bet. But I have rarely just wanted frequency counts of data. Most of the time descriptive stats are just a prelude to something more sophisticated. If you are going to do anything with that data, you are going to want them all consolidated.
Steve
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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