Bayes' theorem calculator
A test that is 99% accurate for a disease affecting one person in a thousand still gives mostly false positives. This is why.
%
%
%
Chance of really having it after a positive test
9.0164%
- Chance of really being clear after a negative test
- 99.998 989 %
- True positives per 10 000 tested
- 9.90
- False positives per 10 000 tested
- 99.90
Show the working
- Prevalence in the population = 0.1
- Sensitivity (true positive rate) = 99
- Specificity (true negative rate) = 99
- p = 0.1 / 100 = 0.001
- sens = 99 / 100 = 0.99
- spec = 99 / 100 = 0.99
- true_pos = 0.001 * 0.99 = 0.000 99
- false_pos = (1 - 0.001) * (1 - 0.99) = 0.009 99
- Chance of really having it after a positive test = (0.000 99 + 0.009 99) > 0 ? 0.000 99/(0.000 99 + 0.009 99)*100 : 0 = 9.016 39
- false_neg = 0.001 * (1 - 0.99) = 0.000 01
- true_neg = (1 - 0.001) * 0.99 = 0.989 01
- Chance of really being clear after a negative test = (0.989 01 + 0.000 01) > 0 ? 0.989 01/(0.989 01 + 0.000 01)*100 : 0 = 99.999
- True positives per 10 000 tested = 0.000 99 * 10000 = 9.9
- False positives per 10 000 tested = 0.009 99 * 10000 = 99.9
Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.
Scenarios & local history
Compare a saved scenario
Recent calculations
The formula
- P(disease | positive) = P(pos | disease) P(disease) / P(positive)
- P(positive) = sensitivity x prevalence + (1 - specificity)(1 - prevalence)
At the default values — 0.1% prevalence and 99% on both accuracy measures — a positive result means only about a 9% chance of actually having the condition.
This is the single most consequential piece of arithmetic in screening policy.