All:
I have a survey dataset that I am analyzing ins SPSS. I have separate variables for race categories:
Variable Label
Q4_1 White or Caucasian
Q4_2 Black or African American
Q4_3 Hispanic
Etc. (8 all together)
I want to recode these 8 variables into one Combined Variable. So it will look like:
Variable Label Values
Race_Combined Race Combined 1 White, 2 Black 3 Hispanic, etc.
I want to be able to run crosstabs on my other data
The field for each variable is 1 (this variable selected) or . (not selected). Should I replace the (.) with a 0 before combining them?
I am running version 28 and none of the videos I've watched show exactly my screen. I tried running this command last night, but I got an error message every time.:
Copy code
* Create a new variable with initial missing values.
COMPUTE Race_Combine = $SYSMIS.
* Combine the races into the new variable.
IF (Q4_1 = 1) Race_Combine = 1.
IF (Q4_2 = 1) Race_Combine = 2.
IF (Q4_3 = 1) Race_Combine = 3.
IF (Q4_4 = 1) Race_Combine = 4.
IF (Q4_5 = 1) Race_Combine = 5.
IF (Q4_6 = 1) Race_Combine = 6.
IF (Q4_7 = 1) Race_Combine = 7.
IF (Q4_8 = 1) Race_Combine =8.
EXECUTE.
Error message:
An expression contains a string of characters followed by a left parenthesis, indicating that the string of characters is a function or vector name, but the characters do not match any existing function or vector. Check the spelling.
------------------------------
Judith Sylvester
------------------------------