Academic managers online nowFree quote in 3 minutes. Assignments from $19.Submit assignment →
Free, no account, nothing storedThe arithmetic runs in your browser. Nothing you type is sent to us.All 100 calculators →

Statistics & Data Science · pattern A, Numeric fields

Posterior probability, and the base-rate trap.

Enter a prior, a true positive rate and a false positive rate to get the posterior probability — the calculation that explains why most positive results on a rare condition are false.

Inputs

The formula used

P(A|B) = P(B|A)P(A) ÷ [P(B|A)P(A) + P(B|¬A)P(¬A)]

The denominator is the total probability of the evidence, from both the true and the false positive routes. Forgetting the second route is the classic error.

P(A | B)

0.166667

Posterior as a percentage
16.667 %
True positives in the population
990
False positives in the population
4,950
Total positives
5,940
Probability of the evidence P(B)
0.05940
Posterior after a second positive test
0.79839

A 99% accurate test on a rare condition is mostly wrong.

With a base rate of one in a hundred, a test that catches 99% of cases and falsely flags 5% of healthy people produces 990 true positives and 4,950 false ones per 100,000 people. A positive result therefore carries about a 17% chance of being real. Nothing is wrong with the test; the arithmetic is dominated by the size of the healthy group, and ignoring the base rate is the single most common probability error in professional practice.

Questions about bayes theorem

Why is the posterior so much lower than the test accuracy?
Because the healthy group is so much larger. Even a small false-positive rate applied to a big population produces more false positives than there are true cases.
What does a second positive test do?
It updates the posterior again, using the first posterior as the new prior — which is why repeat testing is standard practice for rare conditions.
Is this only about medical tests?
No. The same arithmetic governs spam filters, fraud detection, security screening and forensic evidence. Anywhere a rare event is screened for, base rates dominate.

A calculator handles the arithmetic. It cannot teach you the method.

If the number is not the part you are stuck on, that is what the service is for — a specialist who explains the working, not just the answer.

Statistical output here is for coursework and learning. Reported p-values and intervals assume the conditions stated on the page; nothing here checks whether those conditions hold for your data.