← 🩺 Medicine

🧮 Bayes Lab

Sort into test-result groups
True positive (sick, test +)
False negative (sick, test −)
False positive (well, test +)
True negative (well, test −)
P(sick | test positive)
Truly sick:
Test positive:
↳ true positives:
↳ false positives:
NPV (test − ⇒ well):
FPS:
Drag — rotate · Scroll — zoom

🧮 Bayes' Theorem and the Medical Testing Paradox

A 3D crowd of simulated patients sorts itself into four glowing pens — true positive, false negative, false positive and true negative — showing exactly why a highly accurate test can still be wrong more often than right when the disease is rare.

🔬 What It Demonstrates

Each sphere is one simulated person; disease status is drawn from prevalence, then a diagnostic test is applied using sensitivity and specificity. The four resulting pens are the four cells of a confusion matrix, and the live positive predictive value is Bayes' theorem in action.

🎮 How to Use

Lower the prevalence slider toward rare-disease territory and watch the false-positive pen swell relative to the true-positive pen, even with a highly sensitive and specific test. Toggle sorting off to see the same crowd as an unsorted population.

💡 Did You Know?

A test that is "99% accurate" on a disease affecting 1 in 1,000 people can still mean fewer than 1 in 10 positive results are real — the base rate, not the test's headline accuracy, dominates the answer.