I am a SPSS novice.. I am currently run crosstabs on a very huge dataset but I am stuck. I would like to recode multiple variables into a single variable. The variables are currently structured in this way..
VARIABLE 1 -DRIVER_A_GENDER(VALUES-0=MALE AND 1=FEMALE) VARIABLE 2 -DRIVER_B_GENDER(VALUES-0=MALE AND 1=FEMALE) VARIABLE 3 -DRIVER_C_GENDER(VALUES-0=MALE AND 1=FEMALE) As u can see all three variables represent the same thing .i.e. gender of the driver, thus i would like group all three of them as Drivers_gender. Pls help...asap |
We need more info. How big is big? What other variables are you analysing?
Why are you doing this project and who for? Is it a student assessment or is it a genuine research project? If these are three different variables in the same row of a data matrix you're going to lose info. If they are separate rows you're going to have to split them somehow. Without seeing your data, one thing you could try is: Mult response groups = drivers (DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_B_GENDER (0,1) /freq drivers /tab drivers by drivers. . . to see what the distribution looks like. You can't save the group variable: you have to run the mult resp command each time (which is why syntax is easier: you can save chunks of code and use them again) To get tabulations with other variables you have to declare them inside the mult resp command: Mult response groups = drivers (DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (0,1) /var <your var list> /tab drivers by <your var list> . You might also look at COUNT and try: Count males = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (0) Females = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (1) . Freq males females. And COMPUTE driverpatt = sum (DRIVER_A_GENDER, DRIVER_B_GENDER, DRIVER_C_GENDER) . Freq driverpatt. It's a lot easier using SPSS with short var names. If you're using syntax you need a lot of key depressions to type those long ones in. If you're using the GUI, it saves typing the names, but takes twice as long to do anything. As you're newbie to SPSS, have a look at the tutorials on my site. John F Hall [hidden email] www.surveyresearch.weebly.com -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of bethino_m Sent: 27 June 2011 18:23 To: [hidden email] Subject: Recoding multiple variables into a single variable--HELP PLS I am a SPSS novice.. I am currently run crosstabs on a very huge dataset but I am stuck. I would like to recode multiple variables into a single variable. The variables are currently structured in this way.. VARIABLE 1 -DRIVER_A_GENDER(VALUES-0=MALE AND 1=FEMALE) VARIABLE 2 -DRIVER_B_GENDER(VALUES-0=MALE AND 1=FEMALE) VARIABLE 3 -DRIVER_C_GENDER(VALUES-0=MALE AND 1=FEMALE) As u can see all three variables represent the same thing .i.e. gender of the driver, thus i would like group all three of them as Drivers_gender. Pls help...asap -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Recoding-multiple-variables-in to-a-single-variable-HELP-PLS-tp4528976p4528976.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 ===================== 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 |
In reply to this post by bethino_m
At 12:23 PM 6/27/2011, bethino_m wrote:
>I am stuck. I would like to recode multiple variables into a single >variable. The variables are currently structured in this way.. >VARIABLE 1 -DRIVER_A_GENDER(VALUES-0=MALE AND 1=FEMALE) >VARIABLE 2 -DRIVER_B_GENDER(VALUES-0=MALE AND 1=FEMALE) >VARIABLE 3 -DRIVER_C_GENDER(VALUES-0=MALE AND 1=FEMALE) > >As you can see all three variables represent the same thing .i.e. >gender of the driver, thus I would like group all three of them as >Drivers_gender. Should all three have the same value, then? If so, why combine them, except for err-or checking? Or are they the genders of three different drivers? In that case, how would you like them combined? For example, if Driver A is male, Driver B is female, and Driver C is male, what value do you want the result to have? Finally -- this doesn't technically have to do with your question, but knowing it will give us context in which we may think of other solutions -- what will you be doing with the combined variable? ===================== 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 |
|
Administrator
|
If I follow:
COUNT maledrivers = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (0). COUNT femaledrivers = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (1).
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Administrator
|
Upon reflection, it could be done with a single COUNT command, like this:
COUNT maledrivers = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (0) / femaledrivers = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (1).
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
In reply to this post by Bruce Weaver
And if there is always a code 0/1, then the total is always 3 and
you can use one of the variables alone, without loss of information. If there can be 1, 2, or all 3 missing, then you need another step to obtain just 1 variable. This will work -- COMPUTE DSEX= 4*maledrivers + femaledrivers. * to get contiguous categories -- . RECODE DSEX ( <reduce the 16 to 10 or fewer, saving only the codes that are possible> ). -- Rich Ulrich > Date: Tue, 5 Jul 2011 08:10:19 -0700 > From: [hidden email] > Subject: Re: Recoding multiple variables into a single variable--HELP PLS > To: [hidden email] > > If I follow: > > COUNT maledrivers = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (0). > COUNT femaledrivers = DRIVER_A_GENDER DRIVER_B_GENDER DRIVER_C_GENDER (1). > > > > bethino_m wrote: > > > > I would like to have a total count of all males and all females from the > > drivers (driver A,B and C). and to compute a new variable that combines > > the values of all three variables. |
Free forum by Nabble | Edit this page |