Cleaning Data in SPSS: A Step-by-Step Guide in 8 Steps
Cleaning SPSS data: systematically check coding, missing values, and unusual observations.
A missing value, a miscoded response, or an overlooked typo can distort the results of an entire analysis. This SPSS data cleaning guide shows you how to check your dataset in a traceable manner, correct errors, and scientifically document every decision. This is particularly relevant for theses, dissertations, and publications: It is not the quantity of analyses that is convincing, but the quality of the data basis.
Data cleaning is not an annoying intermediate step before the actual statistics. It determines whether means, group comparisons, regressions, or reliability analyses can be meaningfully interpreted at all. Therefore, proceed in a structured manner and never change the original dataset without control.
Why data cleaning in SPSS is so crucial
SPSS continues to calculate with problematic data. An age of 999 years, a response category outside the scale, or a missing value stored as zero does not automatically trigger a warning message. The program initially treats such entries as valid information. The consequence can be shifted key figures, artificial outliers, or misleading significances.
At the same time, data cleaning does not mean deleting all unusual cases. An extreme value can be an input error, but also a real and content-wise important observation. The right decision depends on the variable definition, the survey situation, and your research question. Scientifically sound is a correction only when it is justified, verifiable, and documented.
Cleaning SPSS data: 8-step guide
1. Back up the original file and create a working version
Save your raw dataset unchanged and create a separate working file, for example with the addition "_cleaned". This way, it remains traceable at all times which changes you have made. For extensive projects, a syntax file is additionally recommended. There you save every work step as an SPSS command, instead of only making changes by clicking.
This separation is more than formality. If it later turns out that a coding needs to be interpreted differently, you can reproduce, adapt, and re-run the cleaning. Especially with dissertations, clinical studies, or publications, this saves considerable time.
2. Check the variable view for plausibility
Open the variable view in SPSS. Check variable names, type, decimal places, value labels, measurement level, and defined missing values. Common errors arise already here: A categorical variable is treated as a scale, a date is imported as a string, or the answer "don't know" remains as a regular numerical value in the dataset.
Also check whether the codings fit the survey. For example, in a five-point Likert scale, only values 1 to 5 may occur. If 9 was used for "no answer", this value must be defined under "Missing" as user-defined. Otherwise, it flows into means and further calculations.
3. Evaluate frequencies and distributions
The fastest first quality check is via Analyze > Descriptive Statistics > Frequencies. Select all categorical variables and, for manageable amounts, also metric variables. Check the smallest and largest values, frequency tables, as well as missing information.
Pay attention to values that are technically impossible or unlikely: negative waiting times, study semesters outside the possible range, or codes that were not provided in the questionnaire. For metric variables, Descriptive Statistics with minimum, maximum, mean, and standard deviation additionally help.
A single unusual value is not yet an error. Compare it with the questionnaire, the data source, or if applicable, the original survey form. If an input error can be clearly proven, correct it. If the information is not verifiable, a missing value is often methodologically more honest than a guess.
4. Handle missing values correctly
Distinguish between actually missing information and questions that are not applicable. "No answer", "not surveyed", and "not applicable" have different meanings depending on the study design. Therefore, they must not automatically be treated the same.
With few missing values, an exclusion of cases may be justifiable per analysis. With a higher proportion, however, it can reduce the sample size and distort results, especially if certain groups more frequently do not provide information. Then you should first investigate whether a systematic pattern exists. Imputation can be useful, but it is not a standard repair and must fit the measurement level, sample size, and analysis goal.
Always document how many values per variable are missing and how you handle them. In the work, a transparent description in the methods section is usually sufficient; with more complex procedures, the justification belongs more extensively in the analysis plan.
5. Find duplicate cases and implausible combinations
Duplicate datasets arise, for example, through repeated survey participation, faulty exports, or merged files. First check a unique case ID. If no ID is present, combinations of characteristics such as time, age, gender, or questionnaire answers can provide clues. Only delete possible duplicates after their identity is sufficiently secured.
Also check for logical contradictions. Someone who states in a filter question that they have never smoked should not subsequently have stated a daily cigarette amount. Such cases are not necessarily unusable. Possibly a filter logic in the online questionnaire was incorrectly implemented or an answer misunderstood. Crucial is whether a clear rule for the cleaning can be derived from the study design.
6. Identify outliers, do not remove prematurely
For metric variables, boxplots under Graphs > Chart Builder or Analyze > Descriptive Statistics > Explore are suitable. Thereby you recognize unusual individual values and at the same time receive information about skewness, range, and distribution. Standardized z-values can additionally help: values beyond approximately plus or minus 3.29 are often considered unusual. This limit is a hint, not an automatic deletion criterion.
Check three questions for every outlier: Is the value technically or content-wise faulty? Is it plausible for the research question? Does it significantly change the results? With real extreme values, it can be more useful to perform a robust analysis, a transformation, or a sensitivity analysis, instead of excluding the case. Report transparently if results with and without unusual cases were compared.
7. Check scales and correct missing recodings
In questionnaires, reverse-coded items are a particularly common error. If a negatively formulated item was not reverse-coded, the scale formation can become unusable. Therefore, before calculating sums or means, check the questionnaire and the coding of every single item.
In SPSS, you can perform recodings via Transform > Recode into Different Variables. Work with a new variable as much as possible, so that the original coding remains preserved. Subsequently, check the reliability, for example via Cronbach's Alpha, and check the item-total correlations. A low alpha is not automatically a data error, but can indicate inconsistent items, a wrong polarity, or a very short scale.
8. Document cleaning and finalize analysis file
In the end, it should be traceable which cases were excluded, which values were recoded, and which variables were newly calculated. For this, keep a short cleaning protocol with date, rule, number of affected cases, and justification. Keep the SPSS syntax, the raw data, and the final analysis file separately.
This documentation protects you in case of questions from supervisors, co-authors, or reviewers. It also facilitates the presentation of results in the methods section. Formulate it precisely there, for example: Missing values were treated as system-defined, implausible entries were checked based on pre-defined criteria, and clearly faulty values were corrected or set as missing.
Typical errors that endanger your analysis
Particularly problematic are silent changes to the dataset, deleting unusual cases without justification, and equating 0 with "missing". It is also risky to clean variables based on the later significance. Data cleaning must occur before the hypothesis-testing analyses according to professional rules, not according to the desired result.
The user interface of SPSS can also lead to errors: Someone who writes a recoding directly into an existing variable may lose the original values. Someone who does not save the syntax can hardly reproduce work steps later. With smaller seminar projects, this may not be noticeable. With a thesis or publication, exactly this traceability can be crucial.
When professional support is useful
A professional check is particularly worthwhile with many missing values, multiple data sources, complex scales, medical or clinical data, as well as unclear outliers. Even if your supervision time is tight or you have to report results promptly, an individual statistics consultation can create certainty. Easy Statistik supports research projects with PhD statisticians, traceable documentation, and discreet 1:1 guidance.
Use the contact form for an initial assessment and briefly describe your study design, your variables, and the concrete uncertainty. A cleanly cleaned file is not a guarantee for a significant result, but it creates the basis for results that you can professionally defend.