Bayes Theorem Calculator

Calculate bayes theorem using your data.

Loading calculator…

What this tool does

Calculate bayes theorem using your data. A rare condition with an imperfect test produces mostly false positives — that is why a 90%-accurate test on a 1%-prevalence condition gives a posterior near 15%, not 90%.

How to use the Bayes Theorem Calculator

  1. Enter or select prior probability p(a) (%).
  2. Enter or select p(evidence | a) — sensitivity (%).
  3. Enter or select p(evidence | not a) — false-positive rate (%).
  4. Read the calculated result; change any measurement to compare alternatives.

Formula

P(A|B) = P(B|A)·P(A) / [ P(B|A)·P(A) + P(B|not A)·P(not A) ]
prior
Prior probability P(A) (%)
sens
P(evidence | A) — sensitivity (%)
fpr
P(evidence | not A) — false-positive rate (%)

A rare condition with an imperfect test produces mostly false positives — that is why a 90%-accurate test on a 1%-prevalence condition gives a posterior near 15%, not 90%.

Worked example

For bayes theorem calculator, the following measurements illustrate the exact method: Prior probability P(A) (%): 1; P(evidence | A) — sensitivity (%): 90; P(evidence | not A) — false-positive rate (%): 5.

Inputs

  • Prior probability P(A) (%)1
  • P(evidence | A) — sensitivity (%)90
  • P(evidence | not A) — false-positive rate (%)5

Result

  • Posterior P(A | evidence) (%)15.38
  • Total probability of the evidence (%)5.85
  • Prior odds0.0101

Results explained

Posterior P(A | evidence) (%)
Posterior P(A | evidence) (%) from the formula above. A rare condition with an imperfect test produces mostly false positives — that is why a 90%-accurate test on a 1%-prevalence condition gives a posterior near 15%, not 90%.
Total probability of the evidence (%)
Total probability of the evidence (%) from the formula above. A rare condition with an imperfect test produces mostly false positives — that is why a 90%-accurate test on a 1%-prevalence condition gives a posterior near 15%, not 90%.
Prior odds
Prior odds from the formula above. A rare condition with an imperfect test produces mostly false positives — that is why a 90%-accurate test on a 1%-prevalence condition gives a posterior near 15%, not 90%.

Frequently asked questions

P(A|B) = P(B|A)·P(A) / [ P(B|A)·P(A) + P(B|not A)·P(not A) ]

A rare condition with an imperfect test produces mostly false positives — that is why a 90%-accurate test on a 1%-prevalence condition gives a posterior near 15%, not 90%.

Enter numbers only, in the units and format each label describes. Remove missing values rather than substituting zero, unless zero is a real observation.

No. Results describe the numbers you entered. Statistical inference also depends on sampling design, independence, model fit and interpretation; a p-value is not the probability that a hypothesis is true.

No. Every calculation, including the distribution algorithms, runs entirely in your browser.