Each glowing sphere is one person from a simulated population. A random slice of them truly carries the disease (set by prevalence). Everyone then takes the same diagnostic test, which correctly flags sick people some fraction of the time (sensitivity) and correctly clears healthy people some fraction of the time (specificity). When "sort" is on, the crowd splits into four glowing pens: true positives, false negatives, false positives and true negatives — exactly the four cells of a confusion matrix, rendered in space.
P(sick | +) = P(+|sick)·P(sick) / P(+), where P(+) = sensitivity·prevalence + (1−specificity)·(1−prevalence).This is why mass screening for rare conditions is controversial: a mammography or antibody test that is "95% accurate" can still mean most positive results are false alarms if the underlying condition affects only 1 in 1,000 people. Bayes' theorem — not the headline accuracy figure — tells you what a positive result actually means.
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.
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.
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.
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.