Data science spotlight · Lesson 5A

Why Averages Behave

Pip’s first week at the hospital, learning what “normal” looks like. No maths needed to follow it. The maths sits underneath, for anyone who wants to look.

Pip starts a new job

Pip used to sort junk email. This week Pip joins a hospital data team, where the first lesson is surprisingly hard: before you can spot something unusual, you have to know what usual looks like.

Patients’ heights, waiting times, deliveries, incomes: each has its own shape. Learn to read the shape and you can say how surprising any one reading is.

Follow Pip through six everyday situations. Anything marked Try it is a toy you can play with.

1

The area under the curve is a chance

Try it

Data scientists call this curve a probability density function (PDF). The area between two values is the probability of landing there, and the whole area is exactly 1.

Imagine every adult patient this year standing in a line, sorted by height, and piled up like sand. The pile is highest where most people are. If you pick one patient at random, the chance they fall between two heights is simply the share of the sand between those heights.

Lesson 4’s integrals added up a rate to get a total. Here the same area adds up a curve to get a chance. And because every patient is somewhere, all the sand together makes 100%.

2

The 68, 95, 99.7 rule

Try it

Data scientists call the typical distance from the middle the standard deviation (SD, σ), and these three shares the empirical rule.

For these heights the middle is 170 cm and the typical distance from it is 10 cm. Step out one, two or three of those distances either side and see how much of the pile you have collected.

3

A billionaire walks into the pub

Try it

Data scientists call a long tail to the right positive skew. The mean gets dragged into the tail; the median (the middle person) hardly moves.

On Friday Pip goes to the pub with 20 colleagues. Their yearly incomes sit between £18k and £50k. Then someone famous walks in. What happens to the “average” income in the room?

People in the room
Median (middle person)
Mean (share it out equally)

Read the skew from the tail, not the peak: the long stretch of a few unusually large values is what pulls the mean. Incomes, house prices and hospital stays are all skewed this way.

4

Two couriers, same average, different surprises

Try it

Data scientists call how heavy the tails are kurtosis. Fat tails with more outliers: leptokurtic. Thinner tails: platykurtic. It is about the tails, not how pointy the peak is.

Two couriers deliver the hospital’s supplies. Both are on time on average, and both have the same typical spread. But one of them, now and then, is wildly late. Watch 1,000 deliveries from each and count the shocks: deliveries more than three typical misses away.

Typical spread (SD)
Shocks in 1,000 deliveries
5

Waiting for the bus: why averages turn into bells

Try it

Data scientists call this the Central Limit Theorem (CLT). The spread of the averages is the standard error, σ/√n.

Pip catches the bus to work. Most waits are short, but now and then the bus is very late, so single waits pile up lopsided, nothing like a bell. Now let Pip average its waits over several days, many times over. Change how many days go into each average and collect 500 averages.

1 day30 days
Spread of single waits10 min
Spread of these averages

The aha moment

The single waits are not bell-shaped at all, yet their averages are. That is why so much of statistics can use the bell curve: we usually care about averages, and averages behave, whatever the shape of the thing being averaged. The more you average, the tighter they cluster, shrinking with the square root of how many you average.

For the curious: when the CLT does not work

The CLT needs the single values to have a finite spread (variance). The Cauchy distribution has tails so heavy that its spread is infinite: average 30 or 3,000 Cauchy values and the average is no calmer than one value. Real data rarely behaves like that, but heavy tails are a warning sign.

n > 30 is a rule of thumb, not a law. The more lopsided the single values, the more you need to average before the bell appears.

6

One tall person, or a tall group?

Try it

Data scientists call “how many spreads from the middle” a Z-score. For one value, use σ. For an average of n values, use the standard error, σ/√n.

A patient walks in at 180 cm: taller than most, but you would not look twice. Now four patients walk in together whose average height is 180 cm. That is much stranger, because averages wobble far less than single people. Move the height and compare.

One patient: Z
One patient this tall or taller
Average of 4: Z
A group of 4 averaging this or more
For the curious: the two formulas side by side
one value: Z=x−μσ=180−17010=1
an average: Z=x̄−μσ/√n=180−17010/√4=105=2

The trap is using the first formula for an average: it forgets n and makes a strange group look ordinary.

The jargon, translated

Everything above has a proper name. Here is the dictionary, with the symbol where there is one.

If you can explain why one tall patient is ordinary but a tall group of four is not, you understand the Central Limit Theorem and the standard error. The formulas just make “ordinary” precise.