Tech Tips
Automatic Recode in IBM SPSS Statistics
This tech tip demonstrates how to easily convert a string variable to a numeric variable using Automatic Recode. Users often have data in string format, yet they need it in numeric format to run specific analyses.
With IBM SPSS Statistics, you have the power to work inside a single, integrated interface to run descriptive statistics, regression, advanced statistics, and machine learning models. Its seamless integration with open source and quick help at your fingertips ensures you are well-equipped for any data analysis task, making you feel confident and capable.
For example, we have data on regions and spending. We want to compare average spending across regions. We believe that spending is higher in London than in other areas, but we want to test this hypothesis using One-Way ANOVA. Our spend variable is numeric, but our region variable is string.
When we open the One-Way ANOVA dialog box, the region variable does not appear. This is where the Automatic Recode allows us to quickly create a new numeric region variable in our data. Each region will have a numeric code, and missing data will be included. Once we make our new numeric variable, we will see it in the One-Way dialogue box, and we can run our test.
To access Automatic Recode, users can follow these steps:
- Go to the Transform menu.
- Select Automatic Recode.
- In the dialog box, move the Variable(s) into the Variable> New Name box. Then, provide a name for the new variable and click the Add New Name button.
- Users can choose to recode starting from the lowest or highest value and treat blank string values as user missing. They can also use the same recoding scheme for all variables.
- Click OK to create your new variable.
The One-Way ANOVA dialog box now recognises your new variable because it is numeric. You are now ready to proceed with your test.
Need some help?
Learn how to use SPSS from the experts
With more than 20 years of delivering highly successful training programs, Version 1 offers a wide range of training options to best suit your requirements, enabling you to optimise your IBM SPSS Software, achieve your analytical goals and continually improve your results.
Related Tech Tips
Our SPSS experts have created a range of Tech Tips for IBM SPSS Statistics. Take a look through.