Introduction
Data cleaning in SPSS is the step that protects every result you report, because a single mistyped value can distort a mean, a correlation or a regression. Before you run any analysis, you need to check your dataset for errors and correct them. This tutorial walks you through both stages. You will use Frequencies to find impossible codes in categorical variables, and Descriptives to find implausible values in continuous variables. You will then sort the data to locate each error and fix it, using real examples such as a source-of-credit code with no matching category and an interest rate of 600%.
Step 1: Show Both Values and Labels in SPSS Output
Checking for errors in SPSS depends on whether the variable is categorical or continuous.
First ensure that the value labels for the categorical variables are turned on by following the procedure below:
- Go to the Edit menu and choose Options.
- Under the Output tab, go to the last box titled “variable values in labels shown as:” and select “values and labels” from the drop-down menu, then click OK.
This is demonstrated below:


The following images show value labels turned off and value labels turned on, respectively.


It is important to turn on the value labels so that you can see clearly where the errors are for categorical variables.
Step 2: Check Categorical Variables for Errors Using Frequencies
To check for errors in categorical variables, follow the procedure below:
- Click on Analyze > Descriptive statistics > Frequencies.
- Choose the variables that you want to check for errors for > click on the arrow button to move the variable to the variables box.
- Click on statistics button > select minimum and maximum from the Dispersion section.
- Click continue > OK.
The images below demonstrate the procedure:




In the above example, the variable of interest is called “source of credit over the last 12 months” and has 14 different categories of sources of credit and a category for other sources of credit.
However, the dataset shows 2 instances where a code “16” was entered into the dataset, which is an error because there was no category 16.
It is important to correct this error before data analysis is done.
Step 3: Check Continuous Variables for Errors Using Descriptives
To check for errors in continuous variables, follow the procedure below:
- Click on Analyze > Descriptive statistics > Descriptives.
- Choose the variable of interest and click on the arrow button to move it to the variables box.
- Click on the Options button > select mean, standard deviation, minimum and maximum.
- Click continue, then OK.
The above procedure is demonstrated in the images below:




Check if the statistics make sense. Do the minimum and maximum values make sense, given the nature of the variable? Do the mean and standard deviation make sense? If there is an outlier in the data, the mean will be affected.
In the example above, the variable of interest is “annual interest rate” on loans/credit and the maximum value is 600, which does not make sense.
Once you have identified the errors, the next step is to correct them.
Step 4: Locate the Errors
Before correcting the errors, you need to find where the errors are in the dataset.
If you have a large dataset, it is tedious and time-consuming to find errors manually. Using the “sort” option is a more efficient technique.
To sort data, follow the procedure below:
- Click on the Data menu > choose sort cases.
- Click on the variable that you know has an error > click on the arrow to move it to the “sort by” box.
- Click on either ascending or descending order. Ascending order means that you start with the lowest value to the highest value, while descending order starts with the highest value to the lowest value.
- Click OK.
In the Data Editor window, select the data view tab and use the variables columns to find the variable with the error. You should be able to find the error in the dataset.
The above procedure is demonstrated in the images below using the variable “annual interest rate.”



Step 5: Correct the Errors
Once you have identified the error in the dataset, it is time to correct it. There are two ways of correcting errors in a dataset, depending on whether you have access to the original questionnaire or not.
When you have the original questionnaire
- If you have access to the original questionnaire, simply check the ID number of the affected questionnaire and cross-check with that questionnaire if there was an error during the data entry process, then correct the error in the data file.
When you can’t verify the value
- If you do not have access to the original questionnaire, simply delete the error in the data file. SPSS will assign a system missing value, which is denoted as a full stop in the data file.
Step 6: Re-run the Checks
After correcting the errors, it is important to repeat the error check once more to ensure that no other errors exist.
Conclusion
Clean data is the foundation of credible findings, and the routine is simple: check, locate, correct, then check again. Run Frequencies on categorical variables and Descriptives on continuous ones, use Sort Cases to find the problem rows, and fix each error from the original questionnaire where you can. If you can’t verify a value, delete it so that SPSS treats it as missing. Cleaning takes time, but it is far quicker than re-running a whole analysis later. Next, SPSS Tutorial #5 shows you how to merge data stored in separate files.
Introduction to SPSS for Beginners: Interface and Data Entry (SPSS Tutorial #1)
How to Recode, Group and Compute Variables in SPSS (SPSS Tutorial #2)
How to Add, Delete, Sort, Split and Select Cases in SPSS (SPSS Tutorial #3)
