The numbers

Bayes model inputs

% of people have the condition. The test catches % of them, but it also flags % of healthy people.

Percent, from 0 to 100.

Percent, from 0 to 100.

Percent, from 0 to 100.

After a positive test, how likely is the condition?

16.1%

Among people with a positive test, 16.1% have the condition.

It is not 95.0%. Among people who have the condition, 95.0% receive a positive test.

Out of 10,000 people

The counts are in the key next to this picture.
Each mark is one expected case.

590 positive tests. 95 of them come from people with the condition.

A and B
95
not A, but B
495
A, not B
5
not A, not B
9,405

Calculations

2 × 2 count table
Expected counts out of 10,000.
Positive testNegative testTotal
Condition present955100
Condition absent4959,4059,900
Total5909,41010,000
Derivation and odds form

Bayes calculation

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

Odds form

Likelihood ratio
19x —
Odds update

Base-rate sensitivity

Varying only the prior

Expected evidence per 10,000 with the current test quality
PriorTrue BFalse BPosteriorChange

Beta–Binomial model

Beta–Binomial model

Beta(alpha, beta) → Beta(alpha + heads, beta + tails)

Prior and observations
Shape weight for heads.

Shape weight for tails.

Whole number from 0 to 10,000.

Whole number from 0 to 10,000.

Prior and posterior density

Both curves share the same scales.

Coin bias prior and posterior distributionsPrior Beta 1,1 and posterior Beta 9,3 after eight heads and two tails.
  • Prior: solid line
  • Posterior: dashed line
  • Means: dotted lines

The chart as numbers
DistributionParametersMeanStandard deviation
PriorBeta(1, 1)50.0%28.9%
PosteriorBeta(9, 3)75.0%12.0%