Glossary / Correlation
On days when more ice cream is sold, more people drown. The link is real and shows up in the data. But ice cream has nothing to do with it: the heat pushes both. Correlation can show that two things move together, and cannot tell you why at all.
“In plain words” is hidden on all puzzles.
Each dot is one day: how much ice cream was sold and how many people drowned. The more ice cream, the more drownings, and you can see it with the naked eye. Now keep only days with almost the same heat.
“Rigorous” is hidden on all puzzles.
Correlation is written r. It shows how closely points line up along a straight line. The sign gives the direction, the size how tight the link is.
300 points. Move the slider and see which cloud matches which number. Many are surprised that r = 0.3 already counts as "a link" while the cloud looks almost round, and r = 0.8 is still far from a line.
Even with the same target correlation, 300 random points give a slightly different r: "Shuffle" shows by how much.
Correlation is a useful number, but it fools people easily. Here are two more ways the data can say one thing and r another.
“Deeper” is hidden on all puzzles.
r = Σ (xᵢ − x̄)(yᵢ − ȳ) / √( Σ (xᵢ − x̄)² · Σ (yᵢ − ȳ)² )
The numerator adds up products of deviations from the means. A point top right or bottom left adds a plus, bottom right or top left a minus. The denominator only scales the sum so that r doesn't depend on units and stays between −1 and +1. This also shows the weak spot: one far-off point gives a huge product and can outweigh all the rest.
cov(x, x²) = E[x³] − E[x] · E[x²] = 0 − 0 · E[x²] = 0
If the x values are spread symmetrically around zero, then E[x] = 0 and E[x³] = 0: every cube on the right has an equal negative one on the left. So the numerator is zero, even though y is completely determined by x. Correlation measures only the straight-line part of a link.
rxy·z = (rxy − rxz · ryz) / √( (1 − rxz²)(1 − ryz²) )
This is the partial correlation: the link between ice cream x and drownings y when the temperature z is held fixed. In the first simulation ice cream correlates with temperature at –, drownings with temperature at –. Their product – almost equals the correlation of ice cream with drownings, –. So the temperature explains nearly the whole link, and the partial correlation is –. It is the same result as the "only days at 28–32°" button, without throwing any data away.
The middle value: line everyone up in order, and half are below it, half above.
A millionaire walks into a bar: the average income shoots up, the median barely moves.
The sum of all values divided by how many there are: what everyone would get if it were shared equally.
Almost everyone has more legs than average: the average is a little under two.
The average result you can expect if you repeat the same thing very many times.
A die's expected value is 3.5, yet no face shows 3.5.
A measure of spread: how far values typically stray from the mean. The standard deviation is its square root, in the same units.
Two towns with the same average temperature: one stays near +15 all year, the other swings from −20 to +50.
A bell-shaped distribution: most values sit near the mean, and the further away, the rarer.
Every ball on a Galton board falls at random, yet thousands of balls always build the same bell.
The more repetitions, the closer the share of an outcome gets to its true probability.
The share of heads creeps towards 50%, while the gap between heads and tails in coins usually grows.
The chance of an event given that something else is already known.
Almost all NBA players are tall, but almost all tall people are not NBA players.
Events are independent if knowing about one doesn't change the chances of the other.
After five heads in a row tails is no more likely: the coin remembers nothing.
How many times you multiply the base by itself to get a number: log₂ 8 = 3, because 2 · 2 · 2 = 8.
A sheet of paper folded in half 42 times would be thicker than the distance to the Moon.
A sample some people get into more easily than others, so it describes everyone badly.
In 1936 a magazine polled millions of Americans and still picked the wrong election winner.
How often chance alone would produce a gap at least as big as yours if there were really no difference.
When there is no effect at all, p below 0.05 turns up as often as p between 0.50 and 0.55.
A range around a measured number, built by a method that covers the true value in a chosen share of samples, such as 95%.
Of twenty honest 95% intervals, on average one misses the truth, and none of them knows whether it is the one.
The probability that a test notices a real effect of a given size. A power of 80% means the test misses one working effect in five.
A weak A/B test that does find an effect almost always exaggerates it: a real +10% shows up on the dashboard as +24%.
How far an average or a rate computed from a sample usually misses the truth: σ divided by the square root of the sample size.
Halving the error takes four times as much data.