SPSS data cleaning is the documented process of checking whether a dataset matches its codebook, research question and analytical plan before results are interpreted. It includes preserving the original file, confirming the unit of analysis, reviewing variable types and labels, identifying invalid codes, inspecting missingness, checking duplicates and impossible combinations, examining distributions, documenting transformations and retaining a reproducible record. Cleaning does not mean changing data until an output looks favourable. A surprising value may be valid; a missing value is not automatically zero; and an outlier is not automatically removable. The right action depends on the source, measurement process, analysis purpose and a transparent decision rule (IBM, 2026; USC Libraries, 2026).

Cleaning is evidence protection, not cosmetic editing

A dataset arrives with a history. It may have been entered manually, exported from a survey platform, joined from several files or downloaded from an official source. Codes may be unclear, variable formats may have shifted and records may include missing or duplicated values. Cleaning makes this history visible and produces an auditable analytical file. The Statistics Project Methodology resource explains the upstream decisions about variables, data source and design that make this technical workflow meaningful.

The most important discipline is separation. Preserve the raw file unchanged where permitted. Create a working copy, a codebook, a decisions log and reproducible syntax. If a decision cannot be explained to another reader, it should not be hidden inside an overwritten data file. IBM’s data-preparation documentation centres the identification of suspicious cases, variables and values and the review of missingness; the methodological choice must still be reasoned and recorded rather than automatically applied (IBM, 2026).

Cleaning activityPurposeDocument in the logAction that should not be automatic
Import and structure checkConfirm rows/columns/encodings match the source.File name, source, date, row/column count.Assuming an import is correct because it opens.
Codebook reconciliationCheck variable labels, types, units and codes.Definition, expected range and source field.Guessing what an undocumented code means.
Missingness reviewIdentify amount and pattern of unavailable data.User/system missing codes, counts and handling approach.Replacing missing values without a rationale.
Duplicate reviewDetect repeated records or identifiers.Matching rule and investigation result.Deleting all repeated rows without checking design.
Range/logic checkFind impossible or inconsistent combinations.Rule, cases flagged and source verification.Changing values only because they look unusual.
Transformation/recodeCreate analytically justified variables.Formula, original field, reason and version.Overwriting an original measure.

A ten-step SPSS data-cleaning workflow

1. Preserve the source and create a project structure

Retain the original download or export in a read-only raw-data folder if policy permits. Use a separate working-data file. Keep a folder for syntax, output, codebook, decisions log and exported tables. The source file should have a version/date record, because official and survey data can be revised.

2. Confirm the unit of analysis

Ask what one row represents: a respondent, household, transaction, month, school, area or event. This determines whether a duplicate is really a duplicate and whether later observations are independent. If an intended one-row-per-person dataset has repeated rows because of multiple visits, the data structure needs redesign or a repeated-measures approach; it is not merely a deletion task.

3. Inspect names, labels, types and measurement levels

In SPSS, variable labels and value labels make future output readable, while numeric/string type, decimals, date formats and user-missing definitions affect analysis. Compare every essential field with a data dictionary or questionnaire. A variable named income may be a monthly band, annual figure, household total or a missingness flag. Do not infer meaning from its short name.

4. Run frequency and descriptive checks

Use frequencies for categories and basic descriptive summaries for numerical fields. Look for impossible codes, unexpected zeros, negative values where none are valid, implausible dates, extreme values and category labels that should have been defined. This stage should precede inferential analysis.

5. Investigate missing data

Distinguish genuine zero, “not applicable”, “prefer not to say”, “don’t know”, skipped question and system missing. They can have different meanings. Record their counts and pattern by key groups or time where relevant. Missingness can affect both descriptive and inferential results; a procedure that fills values requires a substantive and methodological rationale, not convenience.

6. Check duplicates and identifier logic

Where a unique identifier is expected, examine repeated IDs. Where there is no identifier, exact matching across several fields may flag possible duplicate records, but can also flag genuine similar cases. Check collection design and source documentation before deciding.

7. Review logical consistency

Create rules based on the questionnaire or dataset. An age value should fit the stated eligible range; a follow-up answer should be consistent with its filter question; an end date should not precede a start date. Flag records for verification rather than silently substituting preferred values.

8. Examine distributions and outliers

Use a histogram, box plot or sorted table to inspect numerical values. An outlier can be a data-entry error, a coding issue or a valid uncommon observation. Verify against source records where allowed. If a legitimate value is retained, report its influence or use a summary/model suited to the distribution; if a verified error is corrected, log the basis.

9. Recode or derive transparently

Create new variables rather than overwriting originals. Give the new variable a clear label and record the formula, category rule or transformation. Do not collapse categories merely because a later test requires larger counts unless the grouping is substantively defensible and disclosed.

10. Save syntax, output and a cleaning summary

Use SPSS syntax for reproducible transformations and checks wherever possible. Save output showing frequencies and decisions. Produce a short cleaning summary: source, version, records received, exclusions with rationale, transformed variables, missing-data approach and remaining limitations.

Workflow stepUseful evidence to inspectDecision boundary
ImportRow count, variable count, delimiter/date/encoding outcome.Reconcile with source documentation.
Variable auditLabels, type, value labels, units and expected range.Clarify ambiguity with the data owner or documentation.
Frequency reviewCounts, rare codes, unexpected categories and missing values.Do not treat rare as invalid without source evidence.
Logic rulesConditional responses, dates and permitted combinations.Flag and verify rather than invent a replacement.
Distribution checkHistogram, box plot, summary measures and influential values.Preserve valid extremes and explain their relevance.
ReproducibilitySyntax file, dated working file and decisions log.Never rely solely on memory or overwritten menus.

Missingness needs meaning, not a one-click response

Missing data are not a single phenomenon. A respondent may not have been asked a question, may have declined to answer, may have skipped it, or may have been lost during file export. A machine may record a system missing value. Treating all such entries as the same can distort results.

The first task is descriptive: how much is missing, in which variables, and for which records? The next is contextual: why might values be missing and what does the dataset documentation say? Only then can a researcher consider an appropriate analysis approach. In small student projects, it is often better to report missingness and use a transparent complete-case or variable-specific count with a stated limitation than to attempt an advanced replacement method without understanding its assumptions.

Missing-data code or patternPossible meaningAppropriate first response
Blank/system missingNo stored response or unavailable field.Check source/export documentation.
99 or 999Possible special missing code.Verify codebook before treating it as a number.
“Not applicable”Question did not apply by design.Keep distinct from refusal or unknown.
“Prefer not to say”Intentional non-response.Report separately when context matters.
Concentration in one groupPotential selection or process issue.Investigate design and qualify interpretation.

Fictional planning application

The following scenario is fictional. Sian receives an anonymised teaching survey file about commuting and study routines. She plans to explore the association between reported weekly study time and commute duration. Her first SPSS frequencies show 99 values in both variables, several commute durations of 0, and two identical rows.

Sian does not immediately remove or recode anything. She checks the codebook and finds that 99 represents “not answered”; she defines it as user-missing in the working file and records the change in syntax. The zero commute durations are valid because some respondents live on campus. The two identical rows have different anonymous IDs and were collected on different dates, so they are not duplicates. She creates a histogram, finds one reported study value of 168 hours per week and checks the teaching-data note, which confirms a verified entry error; she corrects it in a new derived field while retaining an audit note.

Her cleaned-data summary allows a reader to follow every decision. The key point is not that the final file looks tidier; it is that the path from source to analysis is visible and defensible.

Practical SPSS routine

Open the raw file only to inspect it, then save a dated working copy. In Variable View, add or correct labels only with reference to documentation, and define missing codes deliberately. In Data View, use frequencies, descriptive summaries and charts to identify values needing investigation. Use syntax to reproduce recodes, derived variables and key checks. Save the syntax and output alongside the dataset.

Before analysis, produce a final data-ready table: variables retained, variable definitions, usable records, missing-data handling, exclusions with rationale and material data-quality limits. The next stage is not simply running a procedure; SPSS Output Interpretation requires the question, design and cleaning record to read a table or chart responsibly.

Critical limitations and safeguards

Cleaning cannot create information that was never collected. It cannot make a convenience sample representative, repair invalid measurement or establish causal inference. Do not delete records, change categories or replace values to make a test meet an assumption or produce a preferred result. Preserve originals, label working versions and disclose decisions.

If the dataset contains personal, sensitive, health, financial, employment or protected-characteristic data, follow institutional security and disclosure-control procedures. Do not export identifiable records into informal files or use external tools without permission. Where a cleaning issue materially affects participant rights, legal obligations or study validity, obtain appropriate advice from the data owner, supervisor, ethics route or qualified statistician.

FAQs

Q1. Should I delete outliers in SPSS?
Not automatically. First determine whether a value is a source or entry error. Valid unusual values may be substantively important and should normally be retained, with an appropriate analysis or transparent sensitivity discussion.

Q2. Can I replace missing values with the mean?
Not as a default. Mean replacement can change distributions and uncertainty. Missingness needs to be understood and any handling method justified by the design and data.

Q3. Why should I keep SPSS syntax?
Syntax records transformations and checks in a reproducible form. It allows you or another reader to rerun the workflow and inspect how a working file was created.

Q4. Does data cleaning happen only once?
It is iterative. Early checks may reveal a documentation question; later analysis may reveal an issue needing investigation. Each revision should be versioned and logged.

References

IBM (2026) IBM SPSS Statistics (Accessed: 25 August 2026).

IBM (2026) IBM SPSS Data Preparation 30 (Accessed: 25 August 2026).

USC Libraries (2026) Quantitative Methods (Accessed: 25 August 2026).

UK Data Service (2026) Data Skills Modules (Accessed: 25 August 2026).

UCLA Office of Advanced Research Computing (n.d.) Missing Data: SPSS Learning Modules (Accessed: 25 August 2026).