Bayes and base rates · free, no sign-up
Bayes calculator with an icon array
Enter a base rate, a hit rate and a false-alarm rate to see how many flags are real, drawn as an icon array of 1,000 cases with every step written out.
In short
Bayes' theorem answers a question people routinely get wrong: when a test flags a case, how likely is the case to be real? The answer depends on how common real cases were to begin with, the base rate, as much as on how good the test is. This calculator turns three rates into counts of cases and draws them, so the answer can be read off the picture.
A worked example
A sniffer dog at a border sits beside 90% of bags that hold smuggled goods and, by mistake, beside 5% of bags that do not. One bag in a hundred holds smuggled goods. The dog sits beside a bag: how likely is it that the bag holds smuggled goods?
Picture 1,000 bags. 10 hold smuggled goods, and the dog sits beside 9 of them. 990 are clean, and the dog sits beside about 50 of those anyway. So it sits beside about 59 bags, and only 9 of them are real finds: roughly 15%, not 90%. The calculator does the same thing for any three rates you enter.
Why counts work better than percentages
Gigerenzer and Hoffrage showed in 1995 that people solve problems like this far more often when the numbers are given as natural frequencies, counts out of a population, than as probabilities. A later meta-analysis by McDowell and Jacobs found the advantage across many studies, although most people still do not reach the right answer even with counts. The icon array is the same idea drawn: one square per case, coloured by what happened to it.
The formula, if you want it
The share of flagged cases that are real is the true positives divided by all positives: base rate times hit rate, divided by that same product plus the rate of clean cases times the false-alarm rate. The calculator shows each of those counts as a step, rounded to whole cases.
The examples here are invented detectors, not medical tests, and the calculator gives no advice about any real test result.
Sources
- Gigerenzer and Hoffrage (1995), How to improve Bayesian reasoning without instruction: Frequency formats, Psychological Review
- McDowell and Jacobs (2017), Meta-analysis of the effect of natural frequencies on Bayesian reasoning, Psychological Bulletin
- Bayes (1763), An essay towards solving a problem in the doctrine of chances, Philosophical Transactions of the Royal Society
Text, questions and code on this page are original to MyTestAtlas. The cited studies describe the classic procedure; none of their items is reproduced.