Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Explorations › Odds in real life › lesson 4 of 6

Medical tests and false alarms

A 95% accurate test can still be wrong most of the time it says yes. Line up 1,000 people and see why.

A test for an illness is "95% accurate". You test positive. What is the chance you are ill? Most people say 95%. For a rare illness, the real answer can be under 20%.

Count the people, not the percentages

Set the illness to 1% and accuracy to 95%. Of 1,000 people:

  • 10 are ill. The test catches about 95% of them: roughly 10 blue true positives.
  • 990 are healthy. The test wrongly flags 5% of them: about 50 yellow false alarms.

So about 60 people test positive, and only 10 of them are ill:

P(ill∣positive)=1010+50≈17%P(\text{ill} \mid \text{positive}) = \frac{10}{10 + 50} ≈ 17\%P(ill∣positive)=10+5010​≈17%

Press Lift the positives and look at the raised group: it is mostly yellow.

Why it happens

When an illness is rare, the healthy crowd is huge, so even a small error rate on them produces more false alarms than there are real cases. This is called the base rate: how common the thing is before you test.

Slide the illness up to 20%. Now a positive is far more trustworthy, because there are many more ill people to find.

how commonchance ill if positive (95% test)
0.1%about 2%
1%about 16%
10%about 68%

What doctors do

A positive screening test is usually followed by a second, different test. Two independent positives are far more convincing than one. Doctors also test people who already have symptoms, which raises the base rate.

What to remember

  • Accuracy alone does not tell you what a positive result means.
  • With a rare condition, false alarms can outnumber true cases.
  • Turn percentages into counts of people to see what is really happening.
  • A second, independent test sharply reduces false alarms.
Expected value: the long-run averageNext