QiLing Tools

🎲Bayes’ Theorem Calculator - Posterior Probability and Positive Predictive Value

Enter a prior and the likelihood of the evidence and get the posterior immediately. The medical mode takes prevalence, sensitivity and specificity and returns the positive and negative predictive values, then restates the result as natural frequencies — how many people out of ten thousand — which is far easier to reason about than bare percentages.

Free · No sign-up · Runs in your browserLast updated:

Loading tool...

How to use Bayes’ Theorem

  1. 1Choose the general form or the medical testing mode
  2. 2Enter the prior and the likelihoods (percentages such as 0.5% are accepted)
  3. 3Read the posterior and how far the probability moved
  4. 4Use the natural frequency table to sanity-check the result

FAQ

Why can a 90%-accurate test be positive and still probably wrong?
Because the condition is rare. With 1% prevalence, 90% sensitivity and 91% specificity: out of ten thousand people, 100 are affected and 90 test positive, while about 891 of the 9,900 healthy ones also test positive. Of 981 positives only 90 are real — about 9%. That is what the frequency table makes visible.
How do I choose the prior?
The base rate in the population (prevalence or incidence) is the safe default. If the individual has extra risk factors — family history, symptoms — a higher prior is appropriate, and the same test result then leads to a very different posterior.
What is the difference between sensitivity and specificity?
Sensitivity is the share of affected people the test catches; specificity is the share of unaffected people it correctly clears. The false positive rate is 1 − specificity, and that is what determines how many false alarms come out of the healthy majority.
How are likelihood ratios used?
LR+ = sensitivity / (1 − specificity). In odds form the arithmetic is easy: posterior odds = prior odds × LR+. A large LR+ moves your belief a lot, while an LR+ near 1 means the test carries almost no information.
Is Bayes’ theorem only for medicine?
Not at all. Spam filtering, weighing evidence in court, machine fault diagnosis and A/B testing all use the same formula. The general mode is there for those: P(A) is the prior and P(B|A) the chance of seeing the evidence if the hypothesis holds.