Skip to content
K Knidox Search…
Statistics · Epidemiology

Sensitivity & Specificity

Sensitivity, specificity, predictive values, and likelihood ratios from a 2×2 table.

Condition present, test positive.
Condition absent, test positive.
Condition present, test negative.
Condition absent, test negative.
Sensitivity
80%

Of the 100 cases where the condition was present, the test caught 80. A sensitive test rules the condition out when negative.

Specificity
90%

Of the 300 cases where the condition was absent, the test correctly cleared 270. A specific test rules the condition in when positive.

Predictive values
PPV 72.7% · NPV 93.1%

At a prevalence of 25%. Unlike sensitivity and specificity, predictive values shift with how common the condition is in the population tested.

Likelihood ratios
LR+ 8 · LR− 0.22

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 = TP ÷ (TP + FN) Specificity = TN ÷ (TN + FP) PPV = TP ÷ (TP + FP) NPV = TN ÷ (TN + FN) LR+ = Sens ÷ (1 − Spec) LR− = (1 − Sens) ÷ Spec

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. 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. 2
    Compute sensitivity. 80 ÷ (80 + 20) = 80% — the test found 80 of the 100 true cases.
  3. 3
    Compute specificity. 270 ÷ (270 + 30) = 90% — it correctly cleared 270 of the 300 without the condition.
  4. 4
    Compute the positive predictive value. 80 ÷ (80 + 30) = 72.7%. Of everyone testing positive, only about three in four truly have it.
  5. 5
    Compute the negative predictive value. 270 ÷ (270 + 20) = 93.1%, a more reassuring figure because the condition is uncommon.
  6. 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.

PrevalencePPVNPV
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.

What is the difference between sensitivity and PPV?
Sensitivity asks how often the test is positive among people who have the condition; PPV asks how often people with a positive test truly have it. Sensitivity is fixed for the test, while PPV moves with prevalence.
Why does PPV fall so much in screening?
Because a low-prevalence population contains a very large healthy majority, and even a small false-positive rate applied to that majority produces more false positives than there are true cases. At 1% prevalence this test yields a PPV of just 7.5%.
What do SnNout and SpPin mean?
A highly Sensitive test that is Negative rules the condition out; a highly Specific test that is Positive rules it in. They are helpful shorthand but only apply at the extremes of each property.
Why are likelihood ratios preferred clinically?
They do not depend on prevalence, so one figure applies in any setting. Combined with a pre-test probability they give a post-test probability directly. An LR+ above 10 or an LR− below 0.1 usually changes a diagnosis.
Is accuracy a good summary?
It is the weakest of the six. A test that called everyone negative would score 75% accuracy on this data while detecting nothing, because accuracy rewards guessing the majority class. Never report it on its own.
Can a test have high sensitivity and high specificity?
Yes, but there is usually a trade-off through the decision threshold: lowering it catches more true cases while creating more false positives. ROC analysis maps that trade-off across all thresholds.
How do I report these values?
Give sensitivity and specificity with confidence intervals, plus the prevalence of the sample, since predictive values are only meaningful in that context. Stating the reference standard used to define true disease status is also expected.