Sensitivity and Specificity

Statistics
Introduced by
Multiple sources in medical diagnosis and signal detection
Year
1978
Type
Concept
Family
diagnostic-testing

What does it do?

Sensitivity and specificity are the two basic measures of diagnostic test accuracy.

Sensitivity is the proportion of people with the disease whom the test correctly identifies as positive (TP / (TP + FN)); specificity is the proportion of people without the disease whom the test correctly identifies as negative (TN / (TN + FP)). Making a test easier to call positive usually raises sensitivity and lowers specificity, so the threshold is chosen according to the clinical goal: screening favours sensitivity, while confirming a diagnosis favours specificity.

The intuition behind the method

Imagine a cancer screening test. Sensitivity asks: 'Of people who actually have cancer, how many does the test catch?' High sensitivity (e.g., 95%) means the test misses few cancers, which is reassuring for screening. Specificity asks: 'Of people without cancer, how many does the test correctly identify as cancer-free?' High specificity (e.g., 90%) means few false positives and fewer unnecessary biopsies. However, the two measures tend to move in opposite directions as the threshold changes: to catch more cancers, the test must be less strict, which generates more false alarms. A screening test therefore often has high sensitivity to catch early disease, but many people with positive results do not actually have cancer and undergo unnecessary follow-up. The choice of threshold (where on a continuous scale a result is declared 'positive') depends on clinical context: early screening prioritizes sensitivity, while diagnostic confirmation prioritizes specificity.

History

The page does not identify a single originator for sensitivity and specificity; its facts field lists multiple sources in medical diagnosis and signal detection. Two of the page's references deal directly with these measures and with ROC analysis: Altman and Bland's 1994 BMJ note 'Diagnostic tests 1: Sensitivity and specificity' and Metz's 1978 'Basic principles of ROC analysis'. Fawcett's 'An introduction to ROC analysis' is a later tutorial on the same method.

When to use it

Use sensitivity and specificity to evaluate a binary diagnostic test or classifier against a reference standard that gives the true status of each participant. Sensitivity is the key measure for screening tests that aim to identify all potential cases, such as mammography for breast cancer or colonoscopy for colorectal cancer, where missing disease is costly. Specificity is the key measure for confirmatory tests that follow a positive screen, such as biopsy, where false positives lead to unnecessary procedures. ROC curves show the trade-off across thresholds and allow several tests to be compared. Do not use these two measures alone to answer 'what is the chance this patient has the disease after a positive result?'; that question requires PPV and NPV together with the prevalence in the relevant population. The measures are also not suitable when no reliable reference standard is available.

Limitations and considerations

  • Reporting sensitivity and specificity without prevalence, PPV or NPV omits the quantities that determine what a positive or negative result means for an individual patient.
  • Estimates depend on the gold standard; an imperfect reference misclassifies some participants, which biases both measures.
  • Although defined conditionally on disease status, the measured values can vary with the spectrum of disease in the sample (for example, severity, age, sex or comorbidities), so an estimate from one population may not transfer directly to another.
  • Both measures depend on the chosen threshold; different thresholds give different pairs of values, and there is no universally optimal threshold.
  • Small numbers of diseased or non-diseased participants give unstable estimates with wide confidence intervals.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Defined with respect to true disease status, so they do not change when the prevalence of disease changes; this separates the test's own performance from the mix of people who happen to be tested.
  • Give a direct summary of how often the test is positive in people with the disease and negative in people without it, which is the basis for comparing tests.
  • ROC curves let several tests or several thresholds be compared visually across the full range of cut-offs.
  • Easy to communicate to patients, for example: 'This test catches 95% of cases but has a 10% false positive rate.'

Applications

  • Cancer screening: evaluating tests (mammography, PSA, colonoscopy) for sensitivity (catching early cancers) and specificity (avoiding unnecessary biopsies).
  • Infectious disease diagnosis: assessing rapid tests (COVID-19 rapid antigen tests, rapid strep tests) for sensitivity (catching infections) and specificity (avoiding unnecessary antibiotics).
  • Pathology: evaluating biomarkers (histological scores, protein levels) for discriminating disease subtypes, guiding treatment selection.
  • Machine learning and AI: evaluating classification algorithms (e.g., image recognition for detecting lesions) using ROC curves and AUC (Area Under Curve).
  • Genetic testing: evaluating whether genetic tests accurately identify carriers of disease alleles; high sensitivity and specificity are critical for clinical validity.
  • Cardiovascular risk prediction: assessing whether risk calculators (e.g., Framingham Risk Score) correctly identify high-risk individuals for prevention interventions.

How it works

How it works

1

Recruit a sample of participants: some with confirmed disease (by gold standard: biopsy, imaging, clinical follow-up) and some without. Apply the diagnostic test to all participants. Record test results (positive/negative, or a continuous score like PSA level, imaging intensity) for each participant. Also record true disease status from the gold standard. Create a 2×2 contingency table: rows = test result (positive/negative), columns = true disease status (disease/no disease). This yields four counts: TP (test positive, disease present), FN (test negative, disease present), FP (test positive, disease absent), TN (test negative, disease absent).

Formula
\text{Apply diagnostic test to a sample with known disease status (gold standard); construct 2x2 contingency table}
2

Calculate sensitivity and specificity from the 2×2 table. Sensitivity = TP / (TP + FN), the proportion of participants with the disease who test positive. Specificity = TN / (TN + FP), the proportion of participants without the disease who test negative. The same table also gives positive predictive value (PPV = TP / (TP + FP)), negative predictive value (NPV = TN / (TN + FN)) and accuracy ((TP + TN) / total). Unlike sensitivity and specificity, PPV and NPV change with how common the disease is in the sample or population.

Formula
\text{Sensitivity} = \frac{\text{TP}}{\text{TP}+\text{FN}}, \quad \text{Specificity} = \frac{\text{TN}}{\text{TN}+\text{FP}}
3

Sensitivity and specificity describe how the test performs among people with and without the disease, so they do not change when disease prevalence changes. They can still differ between populations (see spectrum bias under pitfalls). A test with sensitivity 0.95 is expected to return a positive result for about 95 of 100 people with the disease; a test with specificity 0.95 is expected to return a negative result for about 95 of 100 people without the disease. Sensitivity matters most when missing cases is the main concern (screening); specificity matters most when false alarms are the main concern (confirmation). Clinicians often need the PPV, the probability of disease given a positive result, which depends on how common the disease is. For a rare disease, even a test with specificity 0.99 can have a low PPV because most positive results are false positives.

Formula
\text{Sensitivity: ability to detect disease. Specificity: ability to correctly identify non-disease. Choose threshold based on clinical context}

Common pitfalls

  • Reporting sensitivity and specificity without prevalence or PPV/NPV, which misleads clinicians about the probability of disease after a positive test.
  • Assuming sensitivity and specificity transfer unchanged to other populations; they may vary with age, sex, disease severity and comorbidities (spectrum bias).
  • Choosing a test threshold based on overall accuracy rather than the specific clinical goal (screening vs. confirmation).
  • Using self-reported disease status as the 'gold standard' instead of objective verification, leading to misclassification and biased estimates.
  • Comparing tests without checking whether they were evaluated in comparable populations and against the same gold standard.

Frequently asked questions

What is the difference between sensitivity and positive predictive value (PPV)?

Sensitivity: probability a test is positive given disease is present [TP/(TP+FN)]. PPV: probability disease is present given test is positive [TP/(TP+FP)]. Sensitivity is a property of the test; PPV depends on disease prevalence. Example: a test with 90% sensitivity and 85% specificity has very different PPVs in a population where disease prevalence is 50% vs. 1%. Always report both sensitivity/specificity and PPV/NPV to fully characterize a test.

Which is more important: sensitivity or specificity?

Depends on context. Screening tests prioritize sensitivity: you want to catch all potential cases, even if some are false positives (these are then confirmed by a specific test). Diagnostic confirmation prioritizes specificity: you want high confidence disease is present before starting treatment. A good diagnostic pathway combines a sensitive screening test and a specific confirmatory test.

How does disease prevalence affect the results?

Sensitivity and specificity are defined among people with and without the disease, so they do not change when prevalence changes. PPV and NPV depend heavily on prevalence. In a rare disease, even a specific test may have low PPV (most positives are false). In a common disease, even a less-specific test may have high PPV. This follows from Bayes' theorem. Sensitivity and specificity can still vary across populations with different disease spectra, so check that the study population resembles the population in which the test will be used.

What is a ROC curve and how do I use it?

A Receiver Operating Characteristic (ROC) curve plots sensitivity (y-axis) vs. 1 - specificity (x-axis) as the test threshold varies. Each point on the curve represents a different threshold. The Area Under the Curve (AUC) quantifies overall accuracy: AUC = 1 (perfect test), 0.5 (random guessing). ROC curves allow: (1) Visual comparison of tests (test with curve furthest to upper-left is best). (2) Selection of optimal threshold based on clinical goals. (3) Calculation of AUC as a summary statistic.

If a test has 95% sensitivity and 90% specificity, is it a good test?

Not necessarily—it depends on prevalence, consequences of errors, and the clinical context. Also ask: (1) In the population of interest, what is prevalence? (2) What are PPV and NPV? (3) Are false positives or false negatives more costly? (4) How does this test compare to alternatives? A test with these metrics might be good for screening a common disease but inadequate for confirming a rare disease.

Related methods

Sources

  1. Altman, D. G., & Bland, J. M. (1994). Diagnostic tests 1: Sensitivity and specificity. BMJ, 308(6943), 1552.

    Open publication reference
  2. Fawcett, T. (2006). An introduction to ROC analysis. Pattern Recognition Letters, 27(8), 861–874.

    Open DOI reference
  3. Metz, C. E. (1978). Basic principles of ROC analysis. Seminars in Nuclear Medicine, 8(4), 283–298.

    Open DOI reference