What a positive test really means, from base rate and accuracy.
🩺 Posterior = sensitivity × prior ÷ P(positive). With a 1% base rate, 95% sensitivity and 90% specificity, a positive still means only ~8.8% chance of disease — the false positives from the 9,900 healthy people swamp the 95 true catches. That gap is the base-rate fallacy; rarer conditions make it worse, better specificity (not sensitivity) fixes it.
The Bayes Theorem Calculator is based on the following formula:
P(D|+) = Se · π / ( Se·π + (1 − Sp)·(1 − π) ) P(+) = Se·π + (1 − Sp)·(1 − π)
Variables: π = Prior / base rate (prevalence) Se = Sensitivity = P(+ | disease) Sp = Specificity = P(− | no disease) 1 − Sp = False-positive rate P(+) = Overall probability of a positive test P(D|+) = Posterior probability of disease given a positive
The posterior is the share of true positives among all positives. Because the healthy majority usually dwarfs the sick minority, the false-positive term often dominates — the base-rate fallacy in one line. Higher specificity shrinks that term; higher sensitivity only grows the numerator.
Worked example: Step 1: screening a 1% prevalence condition (π = 0.01) with Se = 0.95, Sp = 0.90. Step 2: true-positive rate = 0.95 × 0.01 = 0.0095. Step 3: false-positive rate = (1 − 0.90) × 0.99 = 0.099. Step 4: P(+) = 0.0095 + 0.099 = 0.1085. Step 5: P(D|+) = 0.0095 / 0.1085 = 0.0876 → 8.76%. Step 6: per 10,000 tested: 95 true positives vs 990 false positives (1 in 11.4 positives is real). Result: 8.76% posterior, exactly the calculator output.
Take a test with 95% sensitivity and 90% specificity screening a condition that affects 1% of people. Out of 10,000 tested: 95 sick people are correctly flagged, but so are 990 healthy ones — the 10% false-positive rate applied to 9,900 healthy people dominates everything. A positive result means just an 8.8% chance of disease: about 1 in 11.
Bayes' theorem, P(D|+) = sensitivity × prior ÷ P(+), forces the prior into the arithmetic. Hold the test quality fixed and raise the prevalence to 10%: the same positive now means a 51.4% chance. Drop prevalence to 0.1% and it collapses under 1%. The test never changed — the population did.
Because false positives come from the healthy majority, specificity is what moves the posterior. Cutting the false-positive rate from 10% to 1% (specificity 90% → 99%) lifts the 1%-prevalence posterior from 8.8% to about 49%. Raising sensitivity from 95% to 99% barely moves it. Screening programs buy specificity; confirmatory tests buy a better prior.
The base-rate fallacy is not medical-specific. A spam filter that is right 99% of the time still drowns you in false positives because spam is (hopefully) rare in some folders. Security alerts, fraud flags, doping tests, and rare-disease genomics all follow the identical algebra — and the identical human error of quoting P(+|D) as if it were P(D|+).
More tools you might find useful
Find circle area, circumference, and diameter from radius.
Calculate combinations (n choose r) for probability and odds.
Mean or proportion CI at 90/95/99% with margin of error.
Find cube volume and surface area.