LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2008)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 31 Jan 2008 09:55:49 -0500
Reply-To:     Steve Runfeldt <steve@schwartzresearch.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Steve Runfeldt <steve@schwartzresearch.com>
Subject:      Recoding multiple variables into one new variable
In-Reply-To:  <200801310501.m0V0JUdn001969@malibu.cc.uga.edu>
Content-Type: text/plain; charset="utf-8"

Date: Wed, 30 Jan 2008 11:11:55 -0500 From: Deepa Bhat <deepa_bhat@jsi.com> 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 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


Back to: Top of message | Previous page | Main SPSSX-L page