MerQuR+Statistics Glossary

Statistics Glossary → Sensitivity and specificity

Sensitivity and specificityconcept

The proportion of true positives that a diagnostic test or classifier correctly detects (sensitivity) and the proportion of true negatives it correctly rules out (specificity).

From the confusion matrix, sensitivity = TP / (TP + FN) and specificity = TN / (TN + FP), where TP are true positives, FN false negatives, TN true negatives and FP false positives. Sensitivity answers 'what share of the sick were caught' and specificity 'what share of the healthy were correctly cleared'. For a continuous test score, moving the threshold raises one and lowers the other; the ROC curve shows this trade-off over all thresholds.

Sensitivity and specificity are largely independent of the prevalence in the tested group, whereas the positive and negative predictive values depend heavily on it. So even a highly specific test can produce mostly false alarms for a rare disease. Youden's J = sensitivity + specificity − 1 combines the two into a single criterion for choosing a threshold.

An everyday example

A rapid test is tried on 100 sick and 900 healthy people: 90 of the sick test positive and 810 of the healthy test negative. Sensitivity is 90/100 = 90% and specificity 810/900 = 90%. Yet of the 180 people who test positive, only 90 are actually sick: the positive predictive value is 50%, because the healthy far outnumber the sick.

In MerQur

As core outputs of Confusion Matrix Metrics; with threshold selection and Youden's index in the ROC Curve; as TSS = sensitivity + specificity - 1 in the True Skill Statistic; in the classification tables of Logistic, Weighted Logistic and Probit Regression; and in the test-set performance of Random Forest, Support Vector Machine and Decision Tree.

Analyses where this concept appears

Logistic RegressionROC CurveTrue Skill Statistic (TSS)Confusion Matrix MetricsRandom ForestSupport Vector Machine (SVM)Decision Tree (CART)Weighted Logistic Regression (Survey Logistic Regression)Probit Regression

Related concepts

Positive and negative predictive values (PPV, NPV)Youden's J index (optimal cut-off)Area under the ROC curve (AUC)