math.vinhnx.ca / statistics / base rates
Statistics that surprise

The 99% accurate test that is usually wrong

A disease affects 1 in 100 people. The test catches 99% of cases and gives a false alarm only 5% of the time. You test positive. How worried should you be? Most people, including many doctors in surveys, say about 95%. The real answer is about 17%.

10,000 people take the test

Everyone who tested positive

the only people a positive result talks about

Chance you’re ill after a positive, by prevalence

Count people, not percentages

Take 10,000 people. With 1% prevalence, 100 are ill; the test flags 99 of them. Of the 9,900 healthy people, 5% get a false alarm: 495. So about 594 positive results, of which only 99 are real:

$$P(\text{ill} \mid +) = \frac{99}{99 + 495} \approx 17\%.$$

The test is excellent. The trouble is that healthy people outnumber ill people 99 to 1, so even a small false-alarm rate on that huge group swamps the true cases. Gerd Gigerenzer showed that people get this right much more often when the problem is stated in counts (“natural frequencies”) like this instead of percentages.

Bayes’ rule, in its friendliest form

Write the chance of illness as odds (ill : healthy). Then a test result simply multiplies the odds by its likelihood ratio:

$$\underbrace{\frac{P(\text{ill}\mid +)}{P(\text{healthy}\mid +)}}_{\text{posterior odds}} = \underbrace{\frac{P(\text{ill})}{P(\text{healthy})}}_{\text{prior odds}} \times \underbrace{\frac{\text{sensitivity}}{1 - \text{specificity}}}_{\text{likelihood ratio } LR_+}.$$

Here: $\tfrac{1}{99} \times \tfrac{0.99}{0.05} = \tfrac{1}{99} \times 19.8 = 0.2$, i.e. 1 : 5, which is 17%. A positive result makes illness 20× more likely, but it started 99× less likely.

Why a second test is so powerful

Run an independent second test on the positives and you multiply by $LR_+$ again: odds $0.2 \times 19.8 \approx 4$, which is 80%. One positive is weak evidence for a rare condition; two independent positives are strong. This is why screening programmes confirm positives with a different test before acting.

Try it: , then press “Retest the positives” twice.

Where this bites

Try it: (1% prevalence, 90% sensitivity, 9% false-positive rate).