By Ruben Geert van den Berg on October 2, 2013 under Other Recoding Tutorials.

SPSS Recode Values with Value Labels


In SPSS we sometimes find ordinal variables where lower values indicate more positive attitudes or larger quantities. An example is shown in the screenshot below.

SPSS Recode With Value Labels Tool - Coding Scheme

Now, the coding scheme shown above is not really ‘wrong’ in any way. However, we usually prefer higher values indicating more positive attitudes or larger quantities because we find this more intuitive. Therefore, we'll sometimes want to ‘reverse code’ variables.
SPSS doesn't offer an easy option for doing so. The best approach is using RECODE. However, this requires adjusting the value labels too; with regard to our first example, if you change 5 to 1, then the value label for 1 should become “Very bad”. So we need to recode with value labels rather than just recode. But doing so for all values is quite a bit of work and mistakes are easily made.
We therefore built our SPSS Recode Values with Value Labels Tool. Apart from reverse coding, the tool can be used to reorder values and their corresponding value labels according to different schemes too, which is often necessary after using AUTORECODE.
We'll demonstrate our tool using inconsistent_coding.sav, shown below. You can follow along with the steps in this tutorial by downloading and opening this file.

SPSS Recode With Value Labels Tool - Data View

Inconsistently Coded Variables

Right, our data look pretty normal at first glance. However, different variables use different coding schemes. This becomes apparent upon running FREQUENCIES as shown in the syntax below.

*1. Show values and value labels in following frequency tables.

set tnumbers both.

*2. Run frequency tables. Note the inconsistent coding in the output viewer window.

frequencies prod1 to prod10.


SPSS Recode With Value Labels Tool - Inconsistent Coding Schemes

Now, when we carefully inspect all output, we'll find that prod3, prod4, prod8 and prod9 need to be reverse coded. So let's get it done.

SPSS Recode with Value Labels Tool - How to Use it?

SPSS Recode With Value Labels Tool - Interface

Clicking Paste results in the syntax below.

VARIABLES = 'prod3 prod4 prod8 prod9'
OLDVALUES = '1 2 3 4 5'
NEWVALUES = '5 4 3 2 1'.

Inspecting the Results

Running the aforementioned syntax reverse codes the specified variables. After doing so, we can do a ‘quick and dirty’ inspection by rerunning our frequency tables and comparing them to the previous ones. The results for prod3 are shown below.

SPSS Recode With Value Labels Tool - Result

For a more thorough inspection, you could use our SPSS Clone Variables Tool before you recode any variables. Doing so allows you to compare the recoded variables with their original counterparts by running CROSSTABS.

Comment on this Tutorial

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

This Tutorial has 8 Comments