Bayes' Theorem and the Medical Test You Probably Misunderstand
You test positive for a rare disease. The test is 99% accurate. How worried should you be? In many real scenarios, the answer is: not very. Here is the exact math.
You test positive for a rare disease. The test is 99% accurate. How worried should you be?
Most people answer: very worried — 99% accurate means a 99% chance I have the disease. In many real scenarios, the correct answer is: probably fine. You likely do not have the disease.
Setting up the problem
Define the scenario: disease prevalence 0.01%(1 in 10,000), test sensitivity 99%, test specificity 99%. Imagine testing 1,000,000 people.
| Group | Count | Test result |
|---|---|---|
| People with disease | 100 | 99 positive (true), 1 negative (false) |
| People without disease | 999,900 | 9,999 positive (false!), 989,901 negative (true) |
| Total positives | 10,098 | Only 99 actually have the disease |
Bayes' Theorem formally
P(Disease | Positive) = P(Positive | Disease) × P(Disease)
─────────────────────────────────────
P(Positive)
Plugging in our numbers:
= (0.99 × 0.0001) / (0.99 × 0.0001 + 0.01 × 0.9999)
= 0.000099 / 0.010098
≈ 0.0098 = 0.98%Why this happens
The test is very accurate. But the disease is very rare. For every person who truly has the disease and tests positive, there are roughly 100 healthy people who test positive by false alarm. The false positives outnumber the true positives because the healthy population is 10,000 times larger than the sick population.
What changes the picture
If you test a high-risk subgroup — people with known exposure or presenting with symptoms — the prior probability P(Disease) increases dramatically. If prior probability is 10% rather than 0.01%, the posterior probability after a positive test rises to over 91%.
This is why diagnostic protocols use screening tests (high sensitivity) to identify candidates, then confirmatory tests (high specificity) to confirm diagnosis. The two-stage process uses Bayes' reasoning: the first positive test updates the prior probability enough that a second positive test becomes much more meaningful.
Our Bayes' Theorem Calculator lets you adjust all three inputs — prior probability, sensitivity, specificity — and watch the posterior probability update in real time. As you drag the prevalence slider from 10% down toward 0.01%, watch a 99% accurate test's positive predictive value collapse from high confidence to near-worthlessness.