← Chapter 4
Statistics · Chapter 4

Standard Deviation

A mean tells you where a dataset sits. It says nothing about how tightly the values crowd around that spot — and two groups with the identical mean can be nothing alike. The standard deviation is the number that measures that crowding. Turn the spread dial below and every deviation from the mean stretches or shrinks in front of you, with s tracking the dial exactly and the variance tracking its square. Every dot, bar, curve and number is computed live from the values currently on screen.

The data and its deviations

the mean within 1 SD within 2 SD above the mean below the mean

Why the deviations get squared

What the dial does to each number

Standard deviationturn the spread dial
×1.00
—
34
Send the dial to
Shape of the data
Which divisor
Values n34
Mean—
SD s—
Variance s²—
within 1 SD—bell: ~68%
within 2 SD—bell: ~95%
within 3 SD—bell: ~99.7%
Read the formula as a set of instructions and it stops being frightening. Take each value's distance from the mean — that is a deviation. Square them, so that distances below the mean stop cancelling distances above it, and so that far-away values count for much more than near ones. Add the squares up and divide, which gives an average squared distance: the variance. Then take the square root to get back out of squared units and into the units you started in. That last step is the whole reason s is the number we report: a variance of 52 “squared beats per minute” means nothing to anybody, but an s of 7.2 beats per minute is a distance you can picture on the axis above. As for divide by what — use n when the values in front of you are the entire group you care about, and n − 1 when they are a sample standing in for a larger population. Dividing by n would make the variance come out slightly too small on average, and n − 1 corrects that exactly — exactly for the variance, at least. The square root of a perfectly corrected variance is not itself perfectly corrected, a subtlety worth knowing about and almost never worth acting on. Flip the toggle and watch: the two answers differ by a whisker here, and by less and less as n grows.
Four things that are easy to get wrong. First, s is not the average distance from the mean. That number exists and has its own name — the mean absolute deviation — and it is always the smaller of the two, because squaring gives the far points extra weight. Second, 68–95–99.7 is not a property of the standard deviation. It is a property of the bell curve. Switch the shape to Flat or Two clumps and watch those percentages break while every formula on this page keeps working. What holds for any dataset is much weaker: at least 75% of the values lie within 2 SDs of the mean and at least 89% within 3. Third, a bigger s is not automatically worse. On the lathe it is a warning; in a group of patients it is real biological variation, not error. Fourth, s can never be negative — it is a square root of a sum of squares — and it equals zero only when every single value is identical.