MODULE 09
Spread, Variance & Error
Averages are intuitive. Why do we need anything else? A visual lab about spread, squares and error.
Examples on this page use constructed or simulated teaching data, not empirical findings. About the data
- Research question
- Variables
- Variable roles
- Measurement levels
- Method choice
- Statistical logic (trained here)
- SPSS workflow
- Output interpretation (trained here)
- Defensible conclusion (trained here)
Understand
The trouble with averages
Four groups, one average
Synthetic data: four groups of 20 respondents rate their trust in parliament from 0 to 10. A report says “average trust: 5.0, median 5” for every group. Are the groups alike?
Each dot is one respondent. ▲ marks the mean, the point where the dots would balance; the dashed line marks the median.
| Group | Mean | Median | SD | Min | Max |
|---|---|---|---|---|---|
| Group A: consensus | 5.0 | 5.0 | ? | ? | ? |
| Group B: spread out | 5.0 | 5.0 | ? | ? | ? |
| Group C: polarised | 5.0 | 5.0 | ? | ? | ? |
| Group D: long right tail | 5.0 | 5.0 | ? | ? | ? |
One person can move the mean, but not the median
Synthetic monthly net incomes (thousand HUF) of nine people. Raise the ninth person’s income and watch where the balance point goes.
Mean 394k, median 390k. 5 of 9 people earn less than the mean.
Mean
394k
Median
390k
Below the mean
5 of 9
The median only asks who is in the middle, so it stays at 390k. The mean is a balance point: every unit of distance counts, so one far-away value drags it along.
Why statistics gets more complicated
Understand
Spread as squares
Variance is an average square
Synthetic data: how many books six respondents read last year. Drag a dot up or down, or choose a respondent and use the slider.
Dots = respondents; dashed line = mean; vertical lines = deviations from the mean. In the squared view each deviation becomes a square whose side is the deviation, so its area is the squared deviation.
Respondent to move
Respondent F: 15 books. Mean 7.0, sum of squares 106.0, variance 21.2, standard deviation 4.60.
Mean
7.0
Sum of deviations
0.0
Sum of squares
106.0
Variance = SS ÷ 5
21.2
SD = √variance
4.60
| Respondent | Books | Deviation from mean | Squared deviation |
|---|---|---|---|
| A | 2 | -5.0 | 25.0 |
| B | 4 | -3.0 | 9.0 |
| C | 5 | -2.0 | 4.0 |
| D | 7 | 0.0 | 0.0 |
| E | 9 | 2.0 | 4.0 |
| F | 15 | 8.0 | 64.0 |
| Sum | 42 | 0.0 | 106.0 |
Variance: the total area of the squares, shared out over n − 1. It is in squared units (books²).
Standard deviation: the side of the average square, back in the original unit (books). Large deviations count disproportionately: a deviation of 8 adds 64, one of 2 adds only 4.
Why n − 1 and not n? The deviations are measured from the sample’s own mean, which sits exactly in the middle of these observations, so they come out slightly too small. Dividing by n − 1 corrects for that; it is what SPSS reports.
Understand
Deviations from a prediction: residuals
From total spread to what is left over
Synthetic data: weekly hours of news use (X) and a political knowledge score (Y) for eight respondents. Choose what we use to predict each person’s score, and compare the squares that are left.
Dots = respondents; the thick line = the prediction (dashed when it is simply the mean of Y). Each vertical line is a respondent’s error, observed minus predicted, and each square has that error as its side.
Prediction: the mean of Y. Sum of squared errors 1739.9, 100 percent of the total 1739.9.
Slope used
0.00
Sum of squared errors
1739.9
Share of total spread left
100.0%
Share accounted for
0.0%
Predicting everyone with the mean (50.6) leaves the full total sum of squares, 1739.9. This is the starting point of ANOVA and of correlation: all the spread there is to account for.
This split holds when the predictions ŷ come from the least-squares line (or, in ANOVA, from the group means). For any other tilt of “your line” the two parts no longer add up to the total, which is one more reason the best line is the one we use.
You have seen this split before: ANOVA
…and in correlation
Try
Error terms: why their spread matters
Where the error term comes from, and why it matters
A simulation: in an invented population, knowledge = 30 + 3 × news hours + error. The error is everything else that differs between people. Each sample gives a slightly different line.
How far people typically fall from the population line.
Dots = the first sample; thick black line = its fitted line; shaded ribbon = ± one residual SD around it; thin grey lines = fitted lines of 24 other samples; dashed line = the population line (known here only because we invented the population).
Error SD 10, n 30. Residual SD 9.7, slope 2.31, standard error 0.50, t 4.62, p < .001. Slopes across 25 samples vary with SD 0.45.
Residual SD (typical error)
9.7
Slope in this sample
2.31
Standard error of the slope
0.50
SD of the 25 slopes (observed wobble)
0.45
t (df 28) = slope ÷ SE
4.62
p (two-tailed)
< .001
The residuals of one sample are our only window on the error term. Their SD (9.7) estimates how far people fall from the line, and from it we get the standard error: a prediction of how much the slope would wobble from sample to sample. Compare it with the wobble we can actually see (0.45). Bigger errors widen the ribbon and the wobble; larger samples calm the wobble but not the ribbon. The t value is the slope measured in standard errors, the same t that tests a Pearson correlation.
Bigger residual spread → bigger standard error. More cases or a wider range of X → smaller standard error.
The same logic as the t-tests: an estimate divided by its standard error, which is built from the spread of the data.
Try
A first look at heteroscedasticity
Is the error the same size everywhere?
Simulated data, 150 respondents. All three versions have the same line and the same average error; only where the error is large changes. The lower chart plots each residual (observed minus predicted) against X.
Shaded bands: ± the typical residual (root mean square) within each third of the X range, with the number printed in the lower chart.
Constant spread. Typical residual: low X 10.1, middle 11.6, high X 8.8.
Typical residual, low X
10.1
Typical residual, middle X
11.6
Typical residual, high X
8.8
One overall residual SD
10.4
The residuals form an even horizontal band: the typical error at high X (8.8) is about the same as at low X (10.1); the small difference is sampling noise. This is homoscedasticity (equal spread), the situation the usual standard error assumes.
The group version is already in your SPSS output
SPSS
Ask SPSS for spread, not just the centre
Before you open SPSS
- 1Which variable?Ytrust in parliament 0–10
- 2Separately by group?Yes: Xgroup as factor
- 3Which statistics?Mean and median for the centre; SD (or variance), minimum, maximum for the spread; skewness for the shape.
- 4Which picture?Histogram or boxplot per group: the shape is the point.
| Group | N | Mean | Median | Variance | Std. Deviation | Minimum | Maximum | Skewness |
|---|---|---|---|---|---|---|---|---|
| A | 20 | 5.00 | 5.00 | 0.84 | 0.92 | 3 | 7 | 0.00 |
| B | 20 | 5.00 | 5.00 | 8.00 | 2.83 | 0 | 10 | 0.00 |
| C | 20 | 5.00 | 5.00 | 16.53 | 4.07 | 0 | 10 | 0.00 |
| D | 20 | 5.00 | 5.00 | 3.05 | 1.75 | 3 | 10 | 1.84 |
- 1Identical means (and medians) in all four groups: the centre does not tell them apart.
- 2The SD does: from under 1 point (consensus) to about 4 points (polarised). Skewness flags group D's long right tail.
Even this table cannot show that group C is split into two camps: the SD is large, but a wide spread and two camps can share an SD. Always look at the histogram.
Test yourself
Mastery check
Mastery check
Interpret a summary
Two seminar groups both have a mean of 5.0 and a median of 5 on a 0–10 trust scale. What can you conclude about how similar the two groups' answers are?