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.

Free tutorialPro practiceAbout 5 minutes7 practice questions

Quick answer: How do you compute a scale total in SPSS?

  1. Click Transform › Compute Variable.
  2. Type a name for the new variable in Target Variable.
  3. Type a formula in Numeric Expression, such as MEAN(item1, item2, item3).
  4. Click OK.

Last updated November 2026 · Not sure this is the right test? Try the Which statistical test? tool.

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

Compute Variable

Transform › Compute Variable creates a new column from a formula, such as the total or average of the items in a scale.

Compute Variable
Target Variable:1
anx_mean
Type & Label…
Variables
Anxiety item 1 [anx1]
Anxiety item 2 [anx2]
Anxiety item 3 reversed [anx3_r]
Anxiety item 4 [anx4]
Numeric Expression:2
MEAN(anx1, anx2, anx3_r, anx4)
Function group:3
Arithmetic
Statistical
Missing Values
Date Arithmetic
Functions and Special Variables:
Max
Mean
Min
Sd
Sum
If… (optional case selection condition)4
OKPasteResetCancelHelp
  1. 1
    Target VariableThe name of the new column. If it already exists, SPSS asks before overwriting it.
  2. 2
    Numeric ExpressionThe formula. Use the reversed item (anx3_r), not the original.
  3. 3
    Function groupStatistical holds MEAN and SUM. Double-click a function to drop it into the expression.
  4. 4
    If…Optional: compute only for some cases, such as people who answered every item.

MEAN(anx1, anx2, …) averages whatever items each person answered. (anx1 + anx2 + …) / 4 gives a blank if any single item is missing.

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.

More in Prepare your data