LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2008)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 21 Jul 2008 22:47:42 -0500
Reply-To:   Ariel Barak <abarakabarak@gmail.com>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Ariel Barak <abarakabarak@gmail.com>
Subject:   Re: Recode Multiple Variables into One Variable?
Comments:   To: Justin Meyer <justin.meyer@rowlandreading.org>
In-Reply-To:   <2BDDE596EB04B6459ADDF6592D8AE3108F644F@rowlandsrvr.RowlandReading.local>
Content-Type:   text/plain; charset=ISO-8859-1

Hi Justin,

Assuming your racial group variables are numeric, the syntax below works...if they're string, convert them to numeric and the syntax will work. There may be a more elegant way of doing this but oh well.

-Ariel

**************************************************************. * Define some dummy data to work with. DATA LIST FREE /id white black asian hispanic native . BEGIN DATA 01547 1 0 0 0 0 01471 0 1 0 0 0 01931 0 0 1 0 0 05974 0 0 0 1 0 06471 0 0 0 0 1 05411 1 0 0 1 0 03418 0 0 0 0 0 END DATA.

COMPUTE race=0.

IF white=1 race=1. IF black=1 race=2. IF asian=1 race=3. IF hispanic=1 race=4. IF native=1 race=5. IF (SUM(white TO native)>1) race=8. IF (SUM(white TO native)=0) race=999. EXE.

VALUE LABELS race 1 White 2 Black 3 Asian 4 Hispanic 5 NativeAmerican 8 Multiracial 999 Sysmis. **************************************************************.

On Mon, Jul 21, 2008 at 4:28 PM, Justin Meyer < justin.meyer@rowlandreading.org> wrote:

> Hi SPSS listers, > > > > I want to recode seven variables into one variable. Each of the seven > variables indicates a racial group, with 1=the student belongs to the > racial group and 0=the student does not belong to the racial group. I > want to turn the seven variables into one variable, with 1=Native > American, 2=Asian, 3=African American, and so on. In addition, I would > like 8=Multiracial (student marked more than one race) and 999=missing > (student didn't mark any race). Can anyone suggest a method for doing > this? I did attempt a few things and tried some searching, but I am out > of ideas. Thanks for your help! > > > > ____________________________________ > > Justin Meyer > > Researcher > > Rowland Reading Foundation > > 1 South Pinckney Street, Suite 324 > > Madison, WI 53703 > > phone: 866-370-7323 fax: 608-204-3846 > > www.rowlandreading.org <http://www.rowlandreading.org/> > > ____________________________________ > > 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


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