Skip to content

← Math Further 9–12

Does Ice Cream Cause Drowning?

Topic 30 · Grades 9–12 · Correlation and cause

What this builds on from class
In this unit 9 sections
  1. Reading a cloud of dots
  2. How together? Measuring it with r
  3. The hidden third thing
  4. Four ways to rise together
  5. When r misleads
  6. How to find a cause: a fair test
  7. A story from maths
  8. Questions
  9. Where to go next

Sabina works for the local newspaper in a district of the Tarai. Going through three years of records, she notices something strange: in the months when the shops sell the most ice cream, the most people drown in the rivers and ponds. When hardly any ice cream is sold, hardly anyone drowns. Her headline: “Is ice cream killing our swimmers?” At the next council meeting, a member proposes banning ice cream from Baisakh to Bhadra.

The district and its numbers are made up, but the pattern is a famous one. Here are Sabina’s 36 months; tap a few dots to see which months they are.

Try it

Sabina’s 36 months

Each dot is one month: how much ice cream the district’s shops sold, across, and how many people drowned, up.

0481216051015drownings in the monthice cream sold (thousand cups)
Month
tap a dot
Ice cream
–
Drownings
–

Guess first. Would the ban save lives?

Pick an answer to see why.

Reading a cloud of dots

A graph like Sabina’s, one dot for each case with two measurements as its coordinates, is a scatter graph (or scatter plot). Read it as a shape. Her dots run from the bottom left to the top right: months with more ice cream tend to have more drownings. When one thing tends to be bigger where the other is bigger, the two have a positive association. If the dots ran from top left to bottom right (the more of one, the less of the other), it would be negative.

Then ask how tight it is: dots close along a line make a strong association; Sabina’s broad band is moderately strong. Ask whether the band is straight (linear) or bends, and look for clusters (groups with gaps between them) and outliers, dots far from all the others.

How together? Measuring it with r

“Moderately strong” is a judgment by eye. Statisticians measure it with one number, the correlation coefficient r. To see where it comes from, draw two dashed lines through the dots: one at the average of the x-values, one at the average of the y-values. They meet at the point of averages and cut the graph into four corners.

A dot in the top right corner is above average in both. A dot in the bottom left is below average in both. Both kinds are evidence of “together”. A dot in the top left or bottom right goes against it: one measurement is above average and the other below.

Now give each dot a rectangle, from the point of averages to the dot. Its width is how far the dot is from the average across, x−xˉ x - \bar{x} , and its height how far from the average up, y−yˉ y - \bar{y} (the bar means “the average of”). In the two rising corners the two distances have the same sign, so their product is positive: color those rectangles blue. In the falling corners the product is negative: red.

Try it

Blue against red

Drag the yellow points, or start from one of the shapes. The dashed lines are the averages; each point’s rectangle reaches to where they cross. Watch how r follows the blue area minus the red.

00551010
Blue area
34.9
Red area
0.5
Correlation r
0.93

Blue far outweighs red: a strong rising pattern, r close to +1.

More blue than red: the points rise, but loosely.

Blue and red nearly cancel: r is near 0, no straight-line pattern. (There may still be a curve.)

More red than blue: the points fall, but loosely.

Red far outweighs blue: a strong falling pattern, r close to −1.

Add up the blue areas and take away the red ones: that sum, ∑(x−xˉ)(y−yˉ) \sum (x - \bar{x})(y - \bar{y}) , is big and positive when most dots are in the rising corners, big and negative when most are in the falling ones, and near zero when they balance. It can’t be used as it is, though: measure the ice cream in single cups instead of thousands and every rectangle becomes a thousand times wider. So it is divided by a number with the same units, made from how spread out each measurement is on its own:

r=∑(x−xˉ)(y−yˉ)∑(x−xˉ)2×∑(y−yˉ)2 r = \frac{\sum (x - \bar{x})(y - \bar{y})}{\sqrt{\sum (x - \bar{x})^2 \times \sum (y - \bar{y})^2}}

This is Pearson’s correlation coefficient, the one Grade 12 maths calculates “by Karl Pearson’s method”. It has no units, and it is always between −1 and +1:

  • +1: every dot exactly on a rising straight line; −1: every dot on a falling one;
  • near 0: no straight-line pattern;
  • in between, how close the dots come to a line. Sabina’s 36 months give r = 0.78.

In the widget, start from Curve (a U shape). What is r, and why?

Pick an answer to see why.

The line of best fit

In the widget above, press Best-fit line. The green line always passes through the point of averages, and it is tilted so that the dots are as close to it, up and down, as they can be. (Its slope is the blue area minus the red divided by ∑(x−xˉ)2 \sum (x - \bar{x})^2 .) Worked out for Sabina’s 36 months, the line says: for every thousand more cups of ice cream sold, about 0.73 more drownings.

That is a perfectly good prediction: told only that a month sold 15 thousand cups, you would bet on a busy month for the rescue teams, and usually be right. What the line can’t tell you is what would happen if somebody changed the ice cream sales. Predicting and changing are different questions. (And a line only describes the range of its dots: Sabina has no month with 30 thousand cups, so it says nothing about one.)

The hidden third thing

Now color Sabina’s months by how hot they were: the average of each day’s highest temperature in that month.

Try it

Hold the heat fixed

Blue months were cool (an average high under 29 °C), amber warm (29 to 33 °C), red hot (34 °C and over). Choose one group at a time and watch r.

0481216051015drownings in the monthice cream sold (thousand cups)
Months shown
36
Correlation r
0.78

All 36 months: the dots rise together, r is about 0.8.

Only the cool months (average high under 29 °C): no pattern left. More ice cream doesn’t go with more drownings.

Only the warm months (29 to 33 °C): the dots are a shapeless cloud, r near zero.

Only the hot months (34 °C and over): many drownings in every one, but no more in the months with more ice cream.

All 36 months together give r = 0.78. But take only the hot months: they all had plenty of drownings, between 7 and 15, and the ones with the most ice cream didn’t have more. Within the hot months r is −0.01; within the warm months −0.10; within the cool months 0.15. Once you compare months that were equally hot, the pattern is gone.

So the heat is behind both. It sends people to the ice cream shop, and it sends them into the water. Something that drives both of two measurements, and so makes them move together, is called a confounding variable (or a lurking variable, when nobody measured it). In made-up numbers the hidden cause can be known for sure; in real data it rarely is, and some confounders are never measured at all.

Holding the third thing fixed, as you just did by comparing months of the same heat, is the first test to try on any surprising correlation. It is not foolproof: it only works for the third things you thought of and measured. And sometimes splitting into groups can even reverse a pattern: that is Simpson’s paradox, the topic Can a Treatment Win in Every Group but Lose Overall?

In a survey of towns, those with more mobile phone towers have more people with high blood pressure. Which is the most likely hidden third thing?

Pick an answer to see why.

Four ways to rise together

The ice cream is one way two things can move together without one causing the other. When you meet a correlation, run through all four:

1. One causes the other2. The other way round3. Something behind both4. Chancer = 0.67hot weatherice cream solddrowningslifeguardsNicolas Cage filmspool drowningshot weatherice creamdrownings
Figure 30.1 An arrow means “causes”; a dashed line joins two things that are seen to go together, neither causing the other.
  1. One causes the other. Hot weather really does make people buy ice cream: a cool, rainy Jestha would sell less. This is the case everyone jumps to.
  2. The other way round. Suppose the beaches and river banks with the most lifeguards also have the most drownings. That doesn’t mean lifeguards cause drowning: lifeguards are sent to the places where people drown. The cause runs the other way, which is called reverse causation.
  3. Something behind both, a confounding variable, as with the heat.
  4. Chance. Two things can go together by pure luck, and the more pairs anyone looks at, the more such lucky pairs turn up.

The fourth is the one people forget. In 2014 Tyler Vigen began publishing what he called spurious correlations, found by comparing thousands of series of numbers with each other. One from his first collection: from 1999 to 2009, the number of people in the United States who drowned by falling into a swimming pool went up and down with the number of films the actor Nicolas Cage appeared in, with r = 0.67. Nobody thinks his films push people into pools.

How lucky is that? A computer can find out by making up pairs of unrelated lists of 11 random numbers, as many as you like, and working out r for each. About 2.5% of the pairs reach Vigen’s 0.666 or more (either way, up or down) by chance alone. That sounds rare until you see how many pairs there are. Take 100 lists: that is 100 × 99 ÷ 2 = 4{,}950 pairs, so about 125 pairs as “strong” as Vigen’s, every one of them meaningless. Look at thousands of lists, as he did, and impressive correlations are guaranteed.

When r misleads

In 1973 the statistician Frank Anscombe published four small sets of numbers, 11 points each, to argue that every set of data should be drawn before it is calculated. The four have the same averages, the same r, 0.816, and the same line of best fit, y = 3 + 0.5x.

A line, loosely51015204812A curve51015204812A line, one point off51015204812One far point51015204812
Figure 30.2 Anscombe’s quartet: four sets of 11 points, each with r = 0.816 and the line of best fit y = 3 + 0.5x, drawn in green.

Only the first is what r = 0.816 makes you imagine. The second is a smooth curve, a perfect relationship that a straight line describes badly. The third is a perfect straight line with one point knocked off it; without that point, r would be 0.99999, as near 1 as makes no difference. The fourth has no pattern at all: ten points in one column, where x tells you nothing about y, and one far point that creates the whole correlation by itself.

Try the last trick in the widget above: start from Far point. Seven points in a shapeless huddle and one far away give r = 0.93; drag the far point down into the middle of the huddle and r falls to about 0.14. One unusual case, a typing mistake or an exceptional month, can make or break a correlation. So: draw the dots first, then believe the number.

How to find a cause: a fair test

If correlation can’t show a cause, what can? The strongest answer is to stop watching and start doing: change the thing yourself, for some people and not others, and see what happens. But it has to be done fairly.

Suppose a company sells a tonic it says keeps children from falling ill. One way to test it is to compare the children whose families bought it with those whose families didn’t. Here the widget knows something you usually can’t: which children are well fed.

Try it

A tonic on trial

120 made-up children. A red dot fell ill this year. Choose who gets the tonic and whether it really works, then run the study a few times.

Took the tonic: 52Didn’t: 68ill: 8 (15%)ill: 30 (44%)
Who gets it:
The tonic:
Well fed, with the tonic
?
Well fed, without
?

The tonic does nothing, yet its group falls ill far less: its families were mostly the well-fed ones.

The tonic works, but the gap looks far bigger than its real effect: the tonic group was also better fed.

With a coin toss the two groups are alike, and a tonic that does nothing shows no real gap.

With a coin toss the groups are alike, so the gap that is left is the tonic’s own: about half as much illness.

Start with Families choose and a tonic that does nothing. The tonic’s group falls ill about half as often (on average 17% against 32%; each run wobbles a little): it looks like a wonder. Now press Show who is well fed. The families who bought the tonic were mostly the better-off ones: about 78% of the tonic group were well fed, against 27% of the others. Good food did it all. The confounding variable sneaked in through who chose the treatment.

Now switch to Toss a coin. A coin doesn’t know who is well fed, so each group gets about half of each kind, and both fall ill about 25% of the time. Make the tonic work and the gap that appears, about 12.5% against 25%, is the tonic’s own. The coin balances every other difference between the children too, including the ones nobody has thought of. That is its whole point.

A study where the people are put into groups by chance, one group given the treatment and the other not, is a randomized controlled experiment (in medicine, a randomized controlled trial). The group without the treatment is the control group. A study that only watches what people do anyway, like Sabina’s months or families choosing a tonic, is an observational study. A survey, a third kind, asks or measures a sample to describe a whole population; the topic Can 1,000 People Speak for 3 Crore? is about getting that right. Only the experiment, with its coin, can show a cause on its own.

When an experiment would be wrong or impossible, you can’t randomize. Nobody may make a thousand children smoke to see what happens. Then scientists have to build the case from observational studies, carefully, and that is what happened with cigarettes.

A story from maths

A young man with round glasses, a high collar and tie, in an old sepia photograph
Figure 30.3 Ronald Fisher in 1913, before his work at Rothamsted. Photo: Unknown author, Public domain

Hill’s viewpoints are still how epidemiologists judge a cause when no experiment can be done: a strong association, found again by different people in different places; the cause coming first; more of the cause giving more of the effect; a way it could work. None is proof alone. Together they made the case against cigarettes. Today the World Health Organization estimates that tobacco kills more than 7 million people a year.

Questions

★ In which of these is the correlation most likely to be caused by a third thing?

Pick an answer to see why.

a.★

A survey of Nepal’s districts finds that districts with more health posts record more cases of a certain disease. Give three different explanations, one for each of the first three ways to rise together.

Answer
b.★★

Find r for the five points (1, 2), (2, 1), (3, 4), (4, 3), (5, 5) by the rectangles.

Hint
Answer
c.★★

Someone compares 100 different things measured in Nepal every year from 2015 to 2025 (11 years), every pair against every other, and reports the most striking correlation they find. If the things were all unrelated random noise, about how many pairs would you expect to reach Vigen’s r = 0.666 or more, up or down? What if they were unrelated things that each drift over the years?

Hint
Answer
d.★★

A school wants to know whether a revision app raises students’ marks. Its first idea is to compare the marks of students who already use the app with those who don’t. Explain what is wrong, and describe a better study.

Answer
e.★★★

Among all applicants, the marks in a college’s entrance test and the marks in the first year correlate with r = 0.6. The college admits only the top 20% by the test. Among the students it admits, r is only about 0.33. Does that mean the test is a poor guide? Explain why r fell.

Hint
Answer

Where to go next

Where these facts come from
  • The ice cream and drowning example as a standard illustration of a confounding variable (hot weather behind both): Wikipedia, “Correlation does not imply causation”, read October 2026. Sabina’s district and its 36 months are made up (checks/textbooks/math-further-9-12/30/tmp/make_data.py).
  • Pearson’s correlation coefficient, from Francis Galton’s idea of the 1880s, its formula published by Auguste Bravais in 1844: Wikipedia, “Pearson correlation coefficient”, read October 2026.
  • Anscombe’s quartet (1973, The American Statistician 27, 17–21; the 44 numbers, the shared averages, r = 0.816 and the line y = 3 + 0.5x): Wikipedia, “Anscombe’s quartet”, read October 2026; every statistic recomputed.
  • Pool drownings and Nicolas Cage’s films, 1999–2009, r = 0.666: Tyler Vigen’s Spurious Correlations, as archived on 1 January 2015; the project’s start in 2014 and the 2024 update: its About page, read October 2026.
  • The Sarlahi vitamin A trial (28,630 children aged 6–72 months, randomized by ward, double-masked with look-alike low-dose capsules, relative risk 0.70, stopped early): K. P. West Jr et al., “Efficacy of vitamin A in reducing preschool child mortality in Nepal”, The Lancet 338 (1991), 67–71, its abstract on PubMed, read October 2026. The earlier Aceh study, the team (Johns Hopkins, Nepal Netra Jyoti Sangh), the 1989–1990 dates, the Jumla trial’s 26%, the program from 1993, all districts by 2002, Baisakh and Kartik, the female community health volunteers and the estimate of over 45,000 lives in 15 years: A. L. Thorne-Lyman et al., “To see, hear, and live: 25 years of the vitamin A programme in Nepal”, Maternal & Child Nutrition 18 (2022), read October 2026.
  • Fisher at Rothamsted from 1919, The Design of Experiments (1935), his dates, his rejection of the smoking evidence and his 1957–58 letters: Wikipedia, “Ronald Fisher”, read October 2026.
  • Fisher’s fertilizer plots, Fisher’s pipe, his genetic explanation, and his words on the experiment nobody could do: Ben Christopher, “Why the Father of Modern Statistics Didn’t Believe Smoking Caused Cancer”, Priceonomics, 2016, read October 2026.
  • That Fisher consulted for the tobacco industry and was himself a smoker, and the title “When genius errs”: P. D. Stolley, American Journal of Epidemiology 133 (1991), 416–425, its abstract on PubMed, read October 2026.
  • Doll and Hill’s 1950 study (“heavy smokers were fifty times as likely as non-smokers to contract lung cancer”), the 1953 mouse experiments, and the World Health Organization’s estimate of over 7 million deaths a year from tobacco: Wikipedia, “Health effects of smoking tobacco”; the British Doctors Study (letters in October 1951, 40,701 doctors, the 1956 report, and its survival curves of ex-smokers against those who kept smoking): Wikipedia, “British Doctors Study”; both read October 2026.
  • Cornfield and five colleagues, 1959 (the six authors): its PubMed record and Wikipedia, “Jerome Cornfield”; their argument in their own numbers (smokers’ ninefold risk, so a hidden “hormone X” at least nine times as common among smokers): J. B. Greenhouse, “Commentary: Cornfield, epidemiology and causality”, International Journal of Epidemiology 38 (2009); P. Ding and T. J. VanderWeele, “Generalized Cornfield conditions for the risk difference”, Biometrika 101 (2014), its abstract; all read October 2026.
  • Hill as the statistician of the Medical Research Council’s streptomycin trial, generally accepted as the first modern randomized clinical trial, Doll and Hill’s 1950 case-control study, and Fisher’s criticism from 1957: Wikipedia, “Austin Bradford Hill”, read October 2026.
  • Hill’s nine viewpoints (1965) and his words “before we cry causation”: Wikipedia, “Bradford Hill criteria”, read October 2026.
  • The photograph of Fisher in 1913 (public domain): its Wikimedia Commons page, read October 2026.
  • Every number on this page (Sabina’s r = 0.78 and the three groups’ −0.01, −0.10 and 0.15, the hot months’ 7 to 15 drownings, the slope 0.73, the widget’s shapes and their r, Anscombe’s statistics and set III’s 0.99999 without its far point, Vigen’s 0.666, the 2.5% and 24% chances and the 4,950 pairs, the tonic’s 17%, 32%, 78%, 27%, 25% and 12.5%, and every answer to the questions) was computed by a script (checks/textbooks/math-further-9-12/30/tmp/answers.py).