unspurious.calculators

Epidemiology · Test accuracy

Diagnostic Test Calculator

Sensitivity, specificity, predictive values and likelihood ratios from a 2×2 table — and the part most calculators skip: a prevalence slider that shows how the chance you're actually sick, given a positive test, swings from near-certain to near-zero as the disease gets rarer. This is the base-rate fallacy, live.

The 2×2 table

Sensitivity & specificity come from the table; PPV/NPV are recomputed at the prevalence you choose.

Result

In plain English

This describes how good a yes/no test is — and, crucially, how much a positive result should actually worry you, which depends heavily on how common the condition is.

sensitivity
Of the people who really have the disease, the share the test correctly flags as positive.
specificity
Of the people who are really healthy, the share the test correctly clears as negative.
PPV
Positive Predictive Value: of everyone who tests positive, the share who truly have the disease. This is the number a worried patient actually cares about.
prevalence
How common the disease is in the group being tested. For a rare disease, even an excellent test produces mostly false alarms — slide the prevalence control to watch this happen.
likelihood ratio
How much a result shifts the odds of disease — up for a positive (LR+), down for a negative (LR−).

Frequently asked

My test is 99% accurate and I tested positive — do I have the disease?

Probably not, if the disease is rare. When the base rate is low, most positives are false positives. Move the prevalence slider: at 1-in-1000 prevalence even a very accurate test gives a positive predictive value far below 99%.

What's the difference between sensitivity and PPV?

Sensitivity is the chance a sick person tests positive — a property of the test. PPV is the chance a positive person is actually sick — which depends on how common the disease is. They answer opposite questions and are easily confused.

What are likelihood ratios for?

They convert a result into how much it shifts the odds of disease, independent of prevalence. A positive LR well above 1 rules disease in; a negative LR near 0 rules it out — handy for applying to a particular patient's own pre-test risk.

Why does the same test perform differently in different settings?

Sensitivity and specificity are properties of the test, but the predictive values (PPV and NPV) also depend on how common the condition is among the people being tested. Screen a low-risk population and most positives are false alarms; run the identical test in a high-risk clinic and the same positive result is far more likely to be real. The test did not change — the base rate did. Always interpret a result against the prevalence in the group actually tested.