HerfstkleurenHelpdesk IBM SPSS Statistics 20

For students from Arnhem Business School
Home Codebook Data Data editing Analysis Graphs Settings Links Methods

Data editing Recode

Recode can be used when you want to create classes for a continuous variable.

It could also be that some of the outcomes for a variable have a too low frequency. For example the chisquare test has requirements regarding the expected frequencies. By combining answer codes into a single group you can comply with the chi-square conditions, while otherwise you would have to abandom the test.

Choosing an option

There are two options when recoding:

Recode Into Same variable: In this case you overwrite the values of the existing variable. The old values are replaced by new ones, using the recoding rules.
If you don't want to lose the original data it is wise to choose for "Recode into Different Variable".

Recode Into Different Variable: In this case you create a new variable. The values of this new variable are determined by the values of the old variable plus the recoding rules.

Note: When recoding a (continuous) scale variable the Visual Binning technique might come in handy.


Example of a question:

During a customer satisfaction survey the respondents were asked to state how much they (dis)agreed with certain statements. One of them was V01a:

As you can see the researchers have used a five point scale. We would like to simplify the results by combining "totally disagree" and "disagree" (codes 1 and 2), neutral remains unchanged (code 3) while we will also combine "agree" and "totally agree" (codes 4 and 5).


Using Recode:

Choose Transform > Recode Into Different Variable and complete the dialog box as follows:

After specifying the new name for the output variable you have to click the button "Change" to confirm it.
Next click on "Old and New Values" to specify the recoding rules. Do it as follows:

Note that you are creating a new variable. Therefore the recoding rules should specify for each existing code of the old variable what the value for the new variable should be. It is not automatically so that the new value will be the same as the old one, if there is no change specified.
That is why we have to include the rule "ELSE -> Copy".

Click Continue and OK. Check the results in the data and the variable views.


The result:

Copy the variable label of V01a and add value labels: 2 = (totally) disagree; 3 = neutral; 4 = (totally) agree. Add the value 6 as missing value, change the level of measurement to Ordinal and the number of decimals to 0.

Note: A new variable made with recode doesn't inherit the labeling and other properties of the old variable. So you will have to add this in the Variable View window.

If you now make a frequency table for the new variable you get:

Compare the new table on the left to the one of the original variable V01a on the right; what are the most remarkable differences in your opinion?


Last modified 30-10-2012

Jos Seegers, 2009; English version by Gé Groenewegen.