Sensitivity, Specificity and Predictive Values

Describes how a test performs. Sensitivity is the share of sick people it flags; specificity is the share of healthy people it clears. The predictive values are the probabilities as seen by someone receiving a result, and they shift dramatically with prevalence.

Several numbers describe how good a test is, and they mean quite different things depending on which direction you look from. The figures that describe the test are not the figures that matter to the person receiving a result.

From the test's side come sensitivity and specificity.

Se=TPTP+FNSp=TNFP+TNSe = \dfrac{TP}{TP + FN} \qquad Sp = \dfrac{TN}{FP + TN}

From the patient's side come the predictive values.

PPV=TPTP+FPNPV=TNFN+TNPPV = \dfrac{TP}{TP + FP} \qquad NPV = \dfrac{TN}{FN + TN}

Sensitivity is the ability not to miss sick people; specificity is the ability not to alarm healthy ones. The positive predictive value is the probability that someone told they are positive really is ill, and the negative predictive value the probability that someone cleared really is well.

Example

The default input describes 10000 people tested: 90 true positives, 900 false positives, 10 false negatives and 9000 true negatives.

That means 90+10=10090 + 10 = 100 sick people and 900+9000=9900900 + 9000 = 9900 healthy ones, a prevalence of 1%.

Sensitivity is 90÷10090 \div 100, or 90%, and specificity is 9000÷99009000 \div 9900, about 90.91%. Both are high, and the test looks good.

Yet the positive predictive value is 90÷99090 \div 990, only about 9.09%. Of everyone told they tested positive, barely one in eleven is actually ill.

Why the predictive value collapses

The headcounts explain it. There are only 100 sick people but 9900 healthy ones. A specificity of 90.91% means just over 9% of those 9900 are wrongly flagged, which is 900 people. Against 90 correct positives stand 900 incorrect ones, so of 990 positives only 90 are real.

The test is not at fault; the underlying numbers are lopsided. When hunting a rare condition, false positives are drawn from the vast healthy majority and simply swamp the true positives. This is Bayes' theorem in action: a low prior probability keeps the posterior low as well.

Points to watch

Sensitivity and specificity are properties of the test and hold in any population. Predictive values swing with prevalence. The same test applied to people with symptoms predicts well; applied to a mass of asymptomatic people it predicts poorly. When reading test figures, always establish which kind you are looking at.

This is why screening for rare conditions is staged. A first test casts a wide net, and only those flagged go on to a more precise second test. Having passed the first stage, the group now has a much higher prevalence, so the second test's predictive value is far better.