Processing the Data

If you are new to this and are unfamiliar with the terms “processing” and “syntax,” click on this link to get a little bit of background information before you start processing the data.

We are now ready to create our processing syntax file. Go to the file menu and then click on “New” and “Syntax.” The first command you are going to paste in the file will be the command that opened the dataset. Opening the dataset is the first thing someone trying to reproduce your work will need to do. You can find this command at the top of your output file.  If you can’t figure out which command I mean, you can mouseover here to see what mine looks like, yours will look similar but not exactly the same. Copy and paste the command into the syntax file, and save the file in the Command File folder. Call the file processing.sps

Now we are going to process our data to create a new race variable that we can use. As we learned earlier in this exercise, there were actually four race variables plus the separate Hispanic question in Pew’s dataset. People could identify up to four races and each was recorded as a separate variable. This way of operationalizing race is terrible for analysis. We want just one variable with as much information in it as possible.

There are many options for creating a new usable race variable.  If you are interested in the options I thought of, click here.  The option we are going to use is to combine a the race variables to create a new variable that includes categories of “mixed race” and “Hispanic.”

The code is below.  You can simply copy and paste it into your syntax file.  The comments explain a little bit about the steps but if you would like more information about what is happening, you can click here and I will go explain the steps one at a time.

*This code creates a mixed race variable.
RECODE race3m2 (SYSMIS=0) (1 thru 6=1) INTO mixedrace.
Value labels mixedrace
0 ‘not mixed race’
1 ‘mixed race’.
Variable labels mixedrace Respondent reported more than one racial identity.
*This code creates a new race variable called racerecode.
RECODE race3m1(else = copy) into racerecode.
Apply dictionary from * /source variables = race3m1 /target variables = racerecode.
Variable Labels racerecode Race Variable including Mixed Race Category.
*This code changes the category of people in our new variable who report more than one race to mixed race.
If mixedrace=1 racerecode=10.
Add value labels racerecode 10 ‘mixed race’.
*Turning the variable raceosr into numeric from string.
AUTORECODE VARIABLES=raceos
/INTO raceosr
/PRINT.
*Changing four categories (“mixed” “mixed breed” “mestizo” “mixed race’) to mixed race and making other categories missing.
If raceosr=5 racerecode=10.
if raceosr=6 racerecode=10.
if raceosr=7 racerecode=10.
if raceosr=8 racerecode=10.
RECODE racerecode (1=1) (2=2) (3=3) (5=4) (7=5) (10=6) (4=7) (6=8) (8=9) (9=10).
Value labels racerecode
1 ‘White’
2 ‘Black’
3 ‘Asian’
4 ‘Native American’
5 ‘Hispanic’
6 ‘Mixed Race’
7 ‘Other Race’
8 ‘Pacific Islander’
9 ‘Do not know’
10 ‘Refused’.
Missing Values racerecode (7 thru 10).

Now that the code is in your syntax window, go ahead and highlight it and run it.

You also need to save the new data file you have created. This is your final dataset—i.e., the fully processed data that you will use to generate the analysis for this exercise. Give this final data file the name analysis.sav, and save it in your Analysis-Data folder. Now you have the file that will allow you to run your analysis.