Evidence asset

Survey data cleaning checklist: 20 tests before analysis

Turn a raw survey export into an auditable analysis file with 20 duplicate, range, routing, missingness, timestamp and transformation tests.

Published
25 September 2026
Reading time
13 min
Author and reviewer
The Survey Review

Survey data cleaning is the documented process of finding and resolving records that violate the questionnaire, fieldwork plan or analysis specification. Keep the raw export immutable, run checks in code or a versioned query, write every decision to an issue log, and produce a new analysis file. Cleaning should make errors visible; it should not silently force answers to look plausible.

What is survey data cleaning?

Survey data cleaning converts a raw response export into a documented analysis file by checking it against the questionnaire, routing rules, sample records, fieldwork dispositions and variable definitions. It is separate from a data dictionary, which defines fields and codes, and from pre-launch QA, which tests the instrument before live collection.

Start by preserving the exact raw export and its file hash. Work only on a copy, keep transformation code under version control, and save a row-level issue log. That design makes the process repeatable and lets a reviewer distinguish the source value from the action taken.

20-test survey data cleaning checklist

IDTestPass conditionEvidence to retain
I1Stable row keyEvery response has one non-changing unique keyKey rule and duplicate count
I2Exact duplicate recordsRepeated platform records are identified without assuming similar answers are duplicatesCompared fields and retained-row rule
I3Sample-to-response joinInvitation or panel IDs join at the declared cardinalityMatched, unmatched and multiply matched counts
I4Direct identifiersAnalysis files contain only identifiers explicitly required by the planIdentifier inventory and removal rule
S1Expected columnsExport fields match the approved dictionary and questionnaire versionAdded, missing and renamed fields
S2Variable typesDates, numbers, booleans and text parse without silent coercionParsing errors by field
S3Allowed codesEvery stored value is documented or logged as an exceptionOut-of-domain values
R1Branch eligibilityDownstream answers occur only for respondents in the item's universeQuestionnaire rule and failing keys
R2Structural missingnessItems not shown use the declared structural-missing stateDisplayed-state or route marker
R3Impossible pathsNo record reaches mutually incompatible branches or terminal outcomesRoute trace and failing condition
R4Stale hidden valuesA changed upstream answer cannot leave an ineligible downstream value activeAnswer history or replay test
C1Displayed unansweredItem nonresponse is distinct from not shownRendered-state evidence
C2Partial-response ruleCompletion status follows the predeclared thresholdThreshold, denominator and status
C3Technical missingnessFailures, timeouts and interrupted writes are not recoded as respondent choicesSystem state and incident note
V1Numeric rangesValues fall inside documented bounds or appear in the issue logMinimum, maximum and exception rows
V2Date and timezoneTimestamps parse in the documented timezone and valid sequenceOriginal value, timezone and normalized value
V3Multi-select encodingSelected, unselected, not shown and missing are distinguishableExport shape and code rule
V4Other-text linkageFree text appears only with the relevant “Other” state, unless the instrument permits otherwiseParent answer and text field
O1Declared exclusionsTest, preview and known operational records are removed only by a written ruleExclusion reason and count
O2Reproducible outputRerunning the same code on the same raw export produces the same analysis file hashInput, code and output hashes

Reusable issue log

Keep one row per flagged field or record. The minimum fields are issue_id, check_id, row_key, variable, observed_value, expected_rule, evidence, action, code_version, reviewer and resolution_time. Add a status such as open, corrected, excluded, retained or accepted limitation. Never overwrite the raw value to hide what happened.

Worked example: routing and missingness

Question Q2 asks whether a respondent used the service. Only users see Q12 satisfaction. A non-user with Q12=5 fails the branch-eligibility test because the path should never expose Q12. A non-user with the documented structural-missing code passes. A user with Q12 blank is different again: it may be item nonresponse or a technical failure, depending on whether Q12 was rendered and whether the response write completed.

The cleaning pipeline should not replace all three states with zero. It should preserve the source values, derive an issue classification from route evidence and apply only the declared action. The accompanying data dictionary must define Q12's allowed range, missing codes and universe so the test is machine-checkable.

Duplicate decision tree

  1. Are record IDs identical? Inspect whether the platform or transfer process duplicated one submission.
  2. Do invitation tokens match but answers differ? Apply the declared repeat-submission rule; do not automatically keep the first or last response.
  3. Do only IP or device attributes match? Do not assume identity. Shared networks and devices are common.
  4. Are answers merely similar? Retain both unless independent evidence establishes duplication.
  5. Was one record excluded? Log both keys, the retained record, the excluded record and the governing rule.

Validation queries before analysis

  • Every analysis row has exactly one stable key.
  • Every stored code is allowed by the dictionary or appears in the issue log.
  • Every branch condition agrees with downstream values and structural-missing codes.
  • Every derived score can be recomputed from retained source variables.
  • Every exclusion maps to a predeclared rule and final disposition.
  • Counts reconcile from raw export to retained, corrected, excluded and unresolved records.
  • Rerunning the pipeline on the same raw export produces the same file hash.

Transparent method

We converted the private draft into a field-level release gate and checked its metadata requirements against current institutional documentation. Harvard and OSF identify variable names, definitions, allowed values and units as core dictionary fields. ICPSR explicitly documents missing codes and universe or skip patterns, while DDI describes structured metadata as a basis for accuracy checking and replication. The duplicate, routing and output-hash tests are operational controls derived from those documented fields; they are not claimed as universal exclusion standards.

Limitations

Cleaning cannot repair a biased sample, recover data that were never collected, validate a construct or justify deleting inconvenient responses. Speeding, straight-lining and open-text quality flags are context-dependent; they should not become automatic exclusions without a study-specific rationale established before seeing the result. A technically valid value can still be substantively wrong, and a statistical outlier can be a genuine answer. Privacy, access and retention rules apply to raw, intermediate and cleaned files.

Sources and limitations

Verification date: 25 September 2026. This is operational survey-design guidance, not legal advice. Requirements can differ by jurisdiction, audience and research purpose. Send corrections with a primary source through our corrections process.