# SPSS Tutorials

BASICS REGRESSION T-TEST ANOVA CORRELATION

# SPSS Recode – Cautionary Note

## Summary

When variables are recoded, it is important to adjust their value labels as well. Otherwise, misleading data may result.

## SPSS Recode Resulting in Misleading Data

• In SPSS, RECODE can change values into different values but does not change any dictionary information. In order to do the latter, additional commands are needed.
• Omitting these may result in misleading data. A notorious example of this is recoding variables but forgetting to correct their value labels afterwards.
• The following syntax demonstrates the point. Note how the second FREQUENCIES command produces incorrect results.

## SPSS Recode Syntax Example

*1. Create test variable.

data list free/v1.
begin data
1 2 2 3 3 3 4 4 4 4
end data.

*2. Frequencies. Note we have a happy sample (mostly 'Very good').

set tnumbers both.

frequencies v1.

*3. Reverse coding for v1. Alternative: compute v1 = 5 - v1.

recode v1 (1=4)(2=3)(3=2)(4=1).

*4. If value labels are left unaltered, we now have an angry sample (mostly 'Very bad').

frequencies v1.

## Solutions

• One could recode old variables into new variables. In this case, value labels will be completely absent which is perhaps less bad than misleading value labels. However, besides having to specify correct value labels, other dictionary information (variable labels, missing values and so on) will be absent as well. And last but not least, new variables are appended to the end of the data. This is usually not where we'd like them.
• An alternative is to show values and value labels in output tables by running SET TNUMBERS BOTH.. Now, 1) run frequencies, 2) recode 3) apply the correct value labels and 4) run frequencies again. This allows for a basic check whether everything went right.
• Use the SPSS Clone Variables Tool before recoding. Like so, the cloned variables can be compared to their recoded counterparts after recoding.
• For reverse coding variables, a handy tool that automatically corrects value labels is found under SPSS Recode Values with Value Labels.

# Let me know what you think!

*Required field. Your comment will show up after approval from a moderator.