How to use this calculator
- Enter or choose prior probability P(H).
- Enter or choose p(evidence | H true).
- Enter or choose p(evidence | H false).
- The posterior P(H | evidence) updates as you type. Use Copy result or Share to keep it.
Method
P(H | E) = P(E | H)·P(H) ÷ P(E), where P(E) = P(E | H)·P(H) + P(E | ¬H)·(1 − P(H)); posterior odds = prior odds × likelihood ratio
- P(H)
- prior probability of the hypothesis
- P(E | H)
- chance of the evidence if H is true
- P(E | ¬H)
- chance of the evidence if H is false
- P(H | E)
- posterior probability
Worked example
- P(E) = 0.80 × 0.01 + 0.096 × 0.99 = 0.008 + 0.09504 = 0.10304.
- P(H | E) = 0.008 ÷ 0.10304 = 0.07764, about 7.8%.
- If the test is negative: P(H | not E) = 0.20 × 0.01 ÷ 0.89696 = 0.22%.
With a 1% base rate, a test with 80% sensitivity and a 9.6% false positive rate gives only a 7.8% chance of the condition after a positive result.
What the result means
The posterior depends heavily on the prior. When the hypothesis starts out rare, most positive evidence comes from false positives, so the posterior stays low even for a fairly accurate test. A likelihood ratio above 1 means the evidence supports H; how far it moves you depends on where you started.
Assumptions and limits
- There are two mutually exclusive possibilities: H is true or it is false.
- The probabilities you enter apply to the situation at hand (for a test, to people like the one tested).
- For more than two competing hypotheses, or repeated pieces of evidence that are not independent, the calculation needs to be extended.
- This is a probability calculation, not a diagnosis.
Questions
Why is the posterior so low when the test is 80% accurate?
Because 99% of people tested do not have the condition, and 9.6% of them test positive. That is about 95 false positives per 1,000 people versus 8 true positives.
Can I chain results?
Yes. Use the posterior from one independent piece of evidence as the prior for the next.