Sensitivity & Specificity
Sensitivity, specificity, predictive values, and likelihood ratios from a 2×2 table.
Of the 100 cases where the condition was present, the test caught 80. A sensitive test rules the condition out when negative.
Of the 300 cases where the condition was absent, the test correctly cleared 270. A specific test rules the condition in when positive.
At a prevalence of 25%. Unlike sensitivity and specificity, predictive values shift with how common the condition is in the population tested.
Overall accuracy 87.5%. An LR+ above 10 or an LR− below 0.1 usually shifts a diagnosis meaningfully.
Sensitivity is TP ÷ (TP + FN) and specificity is TN ÷ (TN + FP). With 80 true positives, 20 false negatives, 270 true negatives, and 30 false positives, sensitivity is 80% and specificity 90%, while the positive predictive value is only 72.7% at this prevalence.
Four numbers, two directions
Every diagnostic test produces the same four counts, and the metrics differ only in which direction you read them. Sensitivity and specificity read down the columns: given that the condition is present, how often is the test positive? They are properties of the test itself and do not change with how common the condition is.
Predictive values read across the rows: given that the test came back positive, how likely is the condition? This is the question a patient actually asks — and it depends heavily on prevalence, because the same test performs very differently in a screening population than in a specialist clinic.
The mnemonics, and their limits
Two familiar aids: SnNout — a highly Sensitive test, when Negative, rules the condition out — and SpPin — a highly Specific test, when Positive, rules it in. They are useful shorthand but only hold at the extremes, since a sensitivity of 80% leaves one case in five missed, which rules nothing out.
Sensitivity and specificity are fixed properties of the test. Predictive values shift with prevalence, which is why they must always be reported alongside the population they were measured in.
Worked example: 80 / 30 / 20 / 270
Columns first for the test properties, then rows for what a result means:
- 1 Lay out the four counts. TP = 80, FP = 30, FN = 20, TN = 270, so N = 400 and 100 people actually have the condition.
- 2 Compute sensitivity. 80 ÷ (80 + 20) = 80% — the test found 80 of the 100 true cases.
- 3 Compute specificity. 270 ÷ (270 + 30) = 90% — it correctly cleared 270 of the 300 without the condition.
- 4 Compute the positive predictive value. 80 ÷ (80 + 30) = 72.7%. Of everyone testing positive, only about three in four truly have it.
- 5 Compute the negative predictive value. 270 ÷ (270 + 20) = 93.1%, a more reassuring figure because the condition is uncommon.
- 6 Compute the likelihood ratios. LR+ = .80 ÷ .10 = 8.0 and LR− = .20 ÷ .90 = 0.22.
How PPV changes with prevalence
The same test — 80% sensitivity, 90% specificity — applied to populations with different prevalence. Sensitivity and specificity never move; the predictive value does.
| Prevalence | PPV | NPV |
|---|---|---|
| 1% | 7.5% | 99.8% |
| 5% | 29.6% | 98.8% |
| 10% | 47.1% | 97.6% |
| 25% | 72.7% | 93.1% |
| 50% | 88.9% | 81.8% |
Why screening produces so many false alarms
The table above is the whole argument against screening low-prevalence populations with an imperfect test. At 1% prevalence this test — which sounds good at 80% and 90% — gives a positive predictive value of 7.5%. Roughly twelve of every thirteen positives would be false, because the small true-positive count is swamped by false positives drawn from a very large healthy majority.
Likelihood ratios sidestep prevalence entirely, which is why clinicians favour them. An LR+ above 10 or an LR− below 0.1 usually shifts a diagnosis meaningfully; values between about 0.5 and 2 barely move it. They combine with a pre-test probability to give a post-test one, so the same test can be evaluated across any setting.
One caution about accuracy: at 87.5% here it sounds like the headline number, but it is the least useful of the six. A test that simply declared everyone negative would score 75% accuracy on this data while finding nobody. Accuracy rewards guessing the majority class, so it should never be reported alone.