Pl. II
Explorable

Pl. II · Explorable · Statistics, seen 2/3

Statistics, seen · 2 of 3

A thousand people and a test

A test that is right 90% of the time comes back positive. How worried should you be? Usually much less than 90%, and the reason is easier to see in people than in formulas.

§1 · Try it

Try it

Picture 1000 people, one square each. Three settings decide what happens: how common the condition is, how often the test catches it (sensitivity), and how often it correctly clears people who don't have it (specificity). Pick a scenario, then move the sliders.

Scenario
  • 9 have the condition and test positive
  • 1 has the condition but is missed
  • 89 don't, but test positive anyway
  • 901 don't, and are cleared
Fig. 1 · 1000 people, one square each Filled: tested positive. Outlined: tested negative. Vermilion: has the condition.

Of the 98 people who test positive, 9 actually have the condition: 9.2% (exactly 9.2% before rounding to whole people)

A fairly good test for an uncommon condition: most positives are still false alarms.

Fig. 2 · Only the positives Vermilion: true positives. Teal: false positives.
Positive results
98
True positives
9
False positives
89
Share true
9.2% exact 9.2%

§2 · Notice

What the squares show

In the screening scenario only 10 of the 1000 people have the condition, and the test catches 9 of them. But 990 people don't have it, and even a 9% false-alarm rate among that many makes about 89 false positives. So a positive result lands you in a group of 98 people, of whom only 9 are actually ill: about 9%, not 90%.

The rare-disease scenario pushes this further. With 99% accuracy in both directions, a positive result still means only about 1 chance in 11. The spam filter goes the other way: when the thing you look for is common, a positive result is very likely to be right.

Move the first slider and watch the answer swing. The test hasn't changed; only how common the condition is. That number is the base rate, and forgetting it is called base-rate neglect.

§3 · Rule

The same thing as a formula

Bayes' rule says the chance of having the condition given a positive test is

P(ill | +) = sensitivity × base ratesensitivity × base rate + (1 − specificity) × (1 − base rate)

The top line counts the true positives and the bottom line counts every positive, which is exactly what the bar in Fig. 2 does with people. Counting whole people rounds a little, so the page also shows the exact value.