Sensitivity and Specificity Calculator

Calculate sensitivity, specificity, PPV, NPV, accuracy, and likelihood ratios from a 2x2 contingency table of diagnostic test results.

SENSITIVITY
--
Specificity
--
PPV
--
NPV
--
Accuracy
--

Understanding the 2x2 Table

Diagnostic test evaluation uses a 2x2 contingency table that cross-tabulates test results (positive/negative) against the true disease status (present/absent). From these four cells (TP, FP, FN, TN), all key performance metrics can be derived.

Sensitivity and specificity are intrinsic properties of the test and remain constant regardless of disease prevalence. In contrast, predictive values (PPV and NPV) depend on the prevalence of the disease in the population being tested, making them more clinically relevant but less generalizable across different settings.

Formulas

Sensitivity = TP / (TP + FN)
Specificity = TN / (TN + FP)
PPV = TP / (TP + FP)   |   NPV = TN / (TN + FN)
Accuracy = (TP + TN) / (TP + FP + FN + TN)

Likelihood Ratios

MetricFormulaInterpretation
LR+Sensitivity / (1 - Specificity)How much a positive test increases disease odds
LR-(1 - Sensitivity) / SpecificityHow much a negative test decreases disease odds

Frequently Asked Questions

Why does PPV change with prevalence?

PPV depends on prevalence because in low-prevalence populations, even a highly specific test will generate many false positives relative to true positives. For a test with 95% sensitivity and 95% specificity, the PPV is only 16% when prevalence is 1%, but rises to 95% when prevalence is 50%.

What is the Youden Index?

The Youden Index (J = Sensitivity + Specificity - 1) summarizes diagnostic test performance in a single number ranging from 0 (useless test) to 1 (perfect test). It is used to determine the optimal cutoff point for continuous diagnostic tests.