Bayes' Theorem — Positive Predictive Value
Answer: just 16.7%. Even doctors get this question wrong half the time — and the deciding factor isn't sensitivity or specificity, but **prevalence**. Trace the numbers in the "town of 1,000" diagram below.
Bayes' Theorem — The Posterior Plot Twist
"The test has 99% sensitivity & 95% specificity, and you tested positive" — is there a 99% chance you're sick?
…Answer: only 16.7%. More than half of doctors get this classic quiz wrong.
Walk through the numbers. In a town of 1,000, 10 people are sick and 990 are healthy. Test everyone and 60 come back positive — 10 truly sick (true positives) + 50 healthy but wrongly flagged (false positives). If you're one of those 60, your chance of actually being sick is 10 ÷ 60 = 16.7%. The larger the healthy majority, the more false positives dilute the real cases.
- Step 1: Sweep prevalence between 0.001 (general population) and 0.4 (high-risk group) → with the same 99% sensitivity and 95% specificity, PPV swings from 1.96% to 92.86%. Feel how strongly the prior dominates.
- Step 2: At prevalence 0.001, PPV is just 1.96% — only ~2 of 100 positives are actually sick. Feel the gap from intuition.
- Step 3: Keep prevalence at 0.001 but raise specificity to 99.9% → false positives plummet, PPV improves dramatically.
- Step 4: Watch the "town of 1,000" diagram and compare TP (true positive) vs FP (false positive) counts.
// Formula used here
Here A = "truly sick" and B = "tested positive"
P(A|B) = probability of being sick given a positive test (PPV), P(B|A) = sensitivity, P(A) = prevalence, P(B) = overall probability of testing positive.
When prevalence is tiny the numerator shrinks while the denominator, swollen with false positives, stays large — that's exactly the "10 out of 60" above.
// Common misconceptions
With 1% prevalence, 95% sensitivity, and 90% specificity, the positive predictive value is only about 8.8%. Of 100 people who test positive, roughly 9 actually have the disease — the other 91 are healthy false positives. Drag the prevalence slider down in the simulation above and watch this ratio shift before your eyes.
Screen a low-prevalence population and even with 99% sensitivity and 99% specificity, the positive predictive value is only about 50%. Who you test (the prior probability) matters as much as how good the test is.
The posterior from the first test can become the prior for the second. Two consecutive positives dramatically raise the posterior probability. This is the idea behind Bayesian updating.
// Shapes you'll meet again
Bayes' theorem keeps reappearing in the same handful of shapes.
- The classic scenario shape: "Prevalence p%, sensitivity a%, specificity b%. Given a positive test, what's the probability of disease?" — the numbers change, the structure doesn't
- Total probability sitting in the denominator: is the shape Bayes' denominator always takes. The "true positives + false positives" picture above is this same equation
- The natural-frequency picture: split 1,000 people into a table and the same problem looks like simple counting instead of fractions
The law of total probability that assembles Bayes' denominator P(B) lives at Probability Rules.