M3 · Diagnostic tests

Diagnostic test performance

Enter a test's results and read sensitivity, specificity and predictive values, then move prevalence and watch the predictive values change.

Disease +
Disease −
Test +
Test −

Sensitivity

95% CI —

Specificity

95% CI —

PPV

95% CI —

NPV

95% CI —

LR+

LR−

Accuracy

PPV and NPV move with the prevalence slider below; Sensitivity, Specificity, LR+, LR− and Accuracy are fixed properties of the test.

Disease prevalence in the population

Set to your sample's prevalence, drag to ask what happens in another population.

Enter the test results to see performance.

Confusion matrix

Disease +Disease −Test +Test −True positiveFalse positiveFalse negativeTrue negative

PPV / NPV vs prevalence

0%25%50%75%100%0%25%50%75%100%Prevalence →PPVNPV

Sensitivity and specificity stay fixed, only the predictive values move with prevalence.

ROC space Youden's J =

Ideal0101False positive rate (1 − Sp)True positive rate (Se)
Build a full ROC curve
ThresholdSensitivity (%)Specificity (%)
Threshold 1
Threshold 2
Threshold 3
Threshold 4
Threshold 5
Threshold 6
Threshold 7

Add at least two thresholds to draw a curve.

How it's computed

Inputs TP= FP= FN= TN=  N=
Se = TP/(TP+FN) = / =
Sp = TN/(TN+FP) = / =
PPV = TP/(TP+FP) = / = (at the sample's own prevalence)
LR+ = Se/(1−Sp) = / =
Bayes PPV at prevalence :
= Se·p / (Se·p + (1−Sp)·(1−p)) = (·) / ((·) + (·)) =
Show confidence-interval maths (Wilson)
Se: centre = (TP + 1.96²/2)/((TP+FN) + 1.96²) ± halfwidth → [, ]
Sp: centre = (TN + 1.96²/2)/((TN+FP) + 1.96²) ± halfwidth → [, ]
PPV: centre = (TP + 1.96²/2)/((TP+FP) + 1.96²) ± halfwidth → [, ]
NPV: centre = (TN + 1.96²/2)/((TN+FN) + 1.96²) ± halfwidth → [, ]