Bayes Theorem Calculator: Base Rates and Diagnostic Testing

Use base rate, sensitivity, and specificity to see posterior probability through natural frequencies.

At a glance

Computes
Posterior probability after a positive or negative result, shown as natural frequencies.
You supply
Base rate, sensitivity, specificity, and a population size.
Use when
You need to see why a positive test for a rare condition often misleads.
Not for
Updating on several dependent pieces of evidence at once.

Use sensitivity and specificity, not one overall accuracy number.

Probability condition is present after a positive signal

Ready

Default rates create many false positives.

Absent after a negative signal
100.0%
Positive signals that are true
99 of 594
Simulated PPV
Not run
Natural frequencies
CellExpected count

Run the simulation to fill Monte Carlo metrics and convergence.

Positive predictive value against Trial; reference at Exact Bayesian PPV

0204060801000.00.20.40.60.81.0Exact Bayesian PPVSimulated positive predicti…
Chart label shortened to “Simulated positive predicti…”. Full series label: “Simulated positive predictive value”.
Monte Carlo convergence
TrialTrue positivesPositive signalsSimulated PPV
Export

PPV = sensitivity * base rate / total positive-signal probability How?

How this is calculated

Positive predictive value uses Bayes theorem and the law of total probability. Natural frequencies show true positives and false positives in the same population size so the denominator is visible.

Formula: PPV = sensitivity * base rate / total positive-signal probability

Sources

  1. StatLect Bayes rule. StatLect. Retrieved .
  2. Positive and negative predictive values. Wikipedia. Retrieved .

Method last reviewed