SPSS Automatic Recode

This SPSS tutorial explains how to use SPSS Automatic Recode to convert variable from string to number (from Nominal to Scale).

SPSS Automatic Recode

In SPSS, the ideal data source is to convert all nominal data to numeric data, and then use Value Labels to map the corresponding text, it is because many analysis cannot use nominal data.

Automatic Recode is a function to create a new column and automatically convert nominal variable from text to number. It also allows conversion of numeric variable to numeric value in ascending / descending order.

Assume that we have a variable gender, which contains values Female, Male, Unknown and blank

SPSS Automatic Recode 01


Navigate to Transform > Automatic Recode

SPSS Automatic Recode 02


Move the variable to the right box by clicking the arrow, and then type a new variable name in New Name. I use “test” in this example. Click on Add New Name button.

SPSS Automatic Recode 03


Gender–>??????? becomes Gender–>test

Click on OK

SPSS Automatic Recode 04


Go back to Data View, a new variable “test” is created.

Blank value is assigned as 1, Female as 2, Male as 3, Unknown as 4. This is because number is assigned in an ascending alphabetic order.

SPSS Automatic Recode 05

You can also assign number in descending alphabetic order by checking the Highest value option


Switch to Variable View > select the Value property of test column

You can see the mapping is defined here.

SPSS Automatic Recode 07

If you have check the box Treat blank string values as user-missing in Automatic Recode menu, blank data is assigned as the last number (4 is the last number in the example) and defined it as Missing.

SPSS Automatic Recode 08


Leave a Reply

Your email address will not be published.