How do I clean and code survey data before analysis in SPSS?

Cleaning and Coding Survey Data in SPSS

Before you run a single statistical test, your survey data needs to be checked, coded and organised. Skipping this step can lead to wrong results that are hard to trace later. In this blog, we'll walk through a practical process for preparing survey data in SPSS.

Set Up Variable View First:

  • Give each variable a short, clear name, and use the Label column for the full question wording.
  • Set the correct Measure for each variable: nominal, ordinal or scale.
  • Use Value Labels to record what each code means, for example 1 = Strongly disagree through 5 = Strongly agree.
  • Define missing value codes, such as 99 for no answer, in the Missing column so SPSS does not treat them as real data.

Create a Codebook:

  • Keep a separate document listing every variable, its codes, its labels and any reverse-coded items.
  • This makes your work easier to check, share and describe in your methodology chapter.

Screen for Errors:

  • Run Frequencies (Analyze > Descriptive Statistics > Frequencies) for every variable.
  • Look for values outside the allowed range, such as a 6 on a 1 to 5 scale, and check them against the original responses.
  • Use Descriptives to check minimum and maximum values for continuous variables such as age.

Deal with Problem Responses:

  • Look for duplicate submissions, especially in online surveys.
  • Check for respondents who gave the same answer to every item, or who completed the survey unrealistically fast. Decide on clear rules for excluding them and apply those rules consistently.
  • Record every exclusion and the reason for it.

Recode and Compute:

  • Reverse-code negatively worded items using Transform > Recode into Different Variables, keeping the originals unchanged.
  • Combine items into scale scores using Transform > Compute Variable, for example the mean of the items.
  • Group categories if needed, such as combining small education categories, and note the change in your codebook.

Keep a Clean Record:

  • Save a copy of the raw data file before making changes, and work on a separate cleaned file.
  • Use SPSS syntax (the Paste button) to record your steps, so you can repeat or correct them easily.

Careful data preparation is what makes your analysis trustworthy. Set up your variables properly, keep a codebook, screen for errors, apply consistent rules, and record every step. Your results chapter will be much easier to write and defend as a result.