Unit 7 · Prepare your data
How to compute a scale total in SPSS
Use Compute Variable in SPSS to create scale totals and means, handle missing items with MEAN and MEAN.n, and make difference scores.
Quick answer: How do you compute a scale total in SPSS?
- Click Transform › Compute Variable.
- Type a name for the new variable in Target Variable.
- Type a formula in Numeric Expression, such as MEAN(item1, item2, item3).
- Click OK.
Computing scale scores
Compute Variable creates new variables from formulas, most often a total or average score across the items of a questionnaire scale, or a difference score such as post − pre.
When to use it
- Creating scale totals or means from item responses.
- Difference or change scores.
- Transformations such as logarithms for skewed data.
How it works
A mean of the items (MEAN function) stays on the original response scale, which is easy to interpret, and uses whatever items each person answered. MEAN.n requires at least n valid answers. A plain sum, or a formula like (a + b + c) / 3, gives a missing result if any single item is missing.
Worked example
COMPUTE anx_mean = MEAN.3(anx1, anx2, anx3_r, anx4). Each person gets the average of their answered items, as long as they answered at least three.
Key terms
- Target variable
- The new variable being created.
- Numeric expression
- The formula.
- EXECUTE
- Syntax command that runs pending transformations.
Common mistakes
- Using the original instead of the reversed item.
- Summing items when some people have missing answers.
- Not checking a few cases by hand afterwards.
How to do it in SPSS
The SPSS syntax
Prefer typing to clicking? Open File › New › Syntax, paste this in, select it and choose Run › Selection. Every dialog's Paste button writes the same kind of code.
* Mean of the items, as long as at least 3 of the 4 were answered.
COMPUTE anx_mean = MEAN.3(anx1, anx2, anx3_r, anx4).
VARIABLE LABELS anx_mean 'Anxiety (mean of items)'.
EXECUTE.Practice data
Download the file used in this lesson and run it yourself in SPSS: you should get the same results as the screens above.
- anxiety_items.savFour anxiety items, one reverse-worded, with some missing answers (N = 100)
Now practise it interactively →
Reading is only half of it. Tap through the real SPSS menus, read the output and pick the right write-up in 7 quick questions, with instant feedback on every answer.
Practice for this lesson is part of Pro, with every unit, unlimited hearts and saved progress.