Study Meadow

Note 2

Spread, range and standard deviation

The bus takes 25 minutes on average.

A true statement, and of no use whatever to someone who has to be at work by nine. What you want to know is how badly it can go. An average tells you where the numbers are centred. It says nothing about how far they wander, and the wandering is usually what you end up living with.

Here are two invented routes, each timed on five mornings.

Two bus routes with the same mean, illustrativeRoute A journeys all fall between 24 and 26 minutes. Route B journeys run from 10 to 50 minutes. Both average 25.01020304050Journey time, minutesRoute ARoute Bboth average 25
Illustrative. Same average, very different mornings.

Route A runs 24, 25, 25, 25, 26. Route B runs 10, 15, 20, 30, 50. Each adds to 125, so each averages 25 minutes. Route A is a bus you can plan around. Route B is a lottery.

Three ways to measure the wandering

The range is the simplest: largest minus smallest. Route A has a range of 2 minutes and Route B of 40. Its flaw is that it depends entirely on the two most extreme values, so one freak morning redraws the whole thing. It also tends to grow as you collect more data, because more observations mean more chances for a strange one.

The interquartile range, or IQR, ignores the extremes. Sort the data, cut it into quarters, and report the distance between the first-quarter mark and the third-quarter mark. That distance holds the middle half of the values. House-price and salary reports sometimes give this as “the middle 50 percent paid between X and Y”, which is an excellent thing to find in a report. Box plots are a picture of the same idea. There are several slightly different conventions for finding quartiles in small data sets, so two pieces of software can disagree by a small amount. That is not a bug.

The standard deviation, or SD, is the workhorse. Roughly, it is a typical distance from the mean. The procedure looks fussy until you see why each step is there.

  1. Find how far each value is from the mean. If you simply averaged those distances you would always get zero, because the pluses and minuses cancel. That is what the mean is.
  2. So square them, which turns everything positive and also gives big misses extra weight.
  3. Average the squares. That result is called the variance, and its units are minutes squared, which mean nothing to anybody.
  4. Take the square root to get back to minutes.

Route A, by the same steps, comes out at about 0.7 minutes. Now the two routes have numbers that match how they feel: 25 give or take about 1, and 25 give or take about 16.

Why divide by 4 rather than 5? When your five numbers are a sample from something bigger, their distances from their own mean run slightly small, because the sample mean sits in the middle of that particular sample by construction. Dividing by one fewer corrects for this on average. If the five values are the entire population you care about, you divide by 5. Calculators often have two buttons for this, and for a large data set the choice barely matters.

The 68-95-99.7 habit

If your data are shaped like a bell, there is a rule of thumb: about 68 percent of values fall within one SD of the mean, about 95 percent within two, and about 99.7 percent within three. This is the reason an SD is more than an abstraction. IQ tests, for instance, are scaled to a mean of 100 and an SD of 15. So a score of 130, two SDs above the mean, is around the top 2 or 3 percent of the test’s reference group, and that number is arithmetic rather than a finding about brains.

The rule belongs to the bell curve. Lots of data are not bell-shaped, and the rule can then mislead you badly. Income, again, has a long right tail. Route B has one journey at 50 minutes and four below 31, so “25 give or take 16” suggests that a 9-minute journey is about as likely as a 41-minute one, which it may not be.

There is a weaker guarantee that holds for any data at all, known as Chebyshev’s inequality. At least 75 percent of values lie within two SDs of the mean and at least 89 percent within three, no matter the shape. It is less precise and it is never wrong, a combination more people could aim for.

Spread in places you might not expect

Once you start looking, the average is often the less interesting number.

SituationAverage saysSpread says
Delivery timesWhen it usually comesHow long to keep the day free
Investment returnsThe long-run pullHow hard the bad years are
A drug’s effectBenefit for the groupWhether some people gained a lot and others nothing
Two hospitals’ waiting timesWhich is quicker on the wholeWhether either leaves a few people waiting for days

The investment row is worth a pause. Suppose two funds both average 5 percent a year, one with steady returns and the other swinging between +30 and −20. Volatility costs you money even if the average return is the same, because losses compound. Lose 20 percent and gain 30 percent and you do not end up 10 percent ahead: 100 becomes 80 and then 104, a gain of 4 percent. See percent change for more of that sort of thing.

Do not confuse these two

A standard deviation describes how spread out the individuals are. A standard error describes how much a sample’s average would bounce around if you repeated the study. The SE equals the SD divided by the square root of the sample size, so it shrinks as the sample grows, while the SD of the data just settles towards its true value.

This matters because papers and charts sometimes show error bars without saying which they are. SE bars are a good deal shorter, so they make results look tidier. If a chart says “mean ± 2” and the caption does not say what the 2 is, nobody has told you anything yet. The note on confidence intervals picks this up.

What to ask

The distribution sandbox calculates all of these for any list of numbers you paste in.

Goes with: Average, and which one they mean, Confidence intervals.