Attic › Mathematics › Bayes' theorem

A positive test for a rare disease is often wrong because healthy people outnumber sick people

Human intuition is bad at judging evidence when the prior probability is very low. In a medical test for a rare disease, even a highly accurate test produces more false alarms than correct diagnoses. Bayes' theorem shows why you must include the base rate—the natural frequency of an event in a population—before you trust a piece of evidence.

Suppose a disease affects 1 in 1,000 people. You take a test that has 99% sensitivity and specificity: it correctly gives a positive result for 99% of sick people, and it correctly gives a negative result for 99% of healthy people (which means 1% of healthy people get a false positive). Your test comes back positive. Most people guess that there is a 99% chance they have the disease, because they confuse the likelihood, P(Positive | Sick), with the posterior probability, P(Sick | Positive).

To find the true probability with Bayes' theorem, set up the numbers:

1. Prior probability, P(Sick): 1 in 1,000 = 0.001. Therefore, P(Healthy) = 0.999.

2. Likelihood, P(Positive | Sick): 99% = 0.99.

3. Marginal likelihood, P(Positive): Calculate this with the law of total probability. Add the chance of a sick person testing positive (0.001 × 0.99 = 0.00099) to the chance of a healthy person testing positive (0.999 × 0.01 = 0.00999). The total probability of a positive test is 0.00099 + 0.00999 = 0.01098.

Now apply Bayes' theorem:

P(Sick | Positive) = (0.99 × 0.001) / 0.01098 ≈ 0.09

Even with a positive result from a 99% accurate test, the probability that you have the disease is only 9%.

You can see why if you put the results for 100,000 people into a contingency table (a grid that shows how many people fall into each category):

* Sick people (100 total): The test catches 99 of them (99 true positives).

* Healthy people (99,900 total): The test wrongly flags 1% of them, which is 999 people (999 false positives).

In total, 1,098 people get a positive result (99 + 999), but only 99 of them actually have the disease. Because healthy people outnumber sick people by so much, the small 1% error rate creates ten times more false positives than true positives. Forgetting to include the prior probability is a common error in logic called the base rate fallacy. It causes similar mistakes in statistical inference across law, security screening, and scientific research.

Fact-checked against Bayes' theorem on Wikipedia

Part of the Mathematics syllabus: Probability and Statistical Inference

See it on the timeline of Probability and Statistical Inference