Clinical Epidemiology Biostatistics Evidence-Based Medicine 42 min read July 6, 2026
BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

Sensitivity and Specificity Explained: Understanding Diagnostic Test Accuracy

Before a medical test reaches patients, researchers ask two questions: how often does it catch the disease when it is there, and how often does it give a clean result when the disease is absent? Those two questions map directly to sensitivity and specificity. Every diagnostic test in medicine, from a blood glucose strip to an MRI scan, is evaluated on these two measures. Getting them wrong costs lives; interpreting them correctly is the foundation of evidence-based clinical decision-making.

This guide, part of the Statistics Fundamentals library, builds both concepts from first principles. It covers definitions, formulas, the confusion matrix, positive and negative predictive values, ROC curves, likelihood ratios, and three fully worked clinical examples. No prior medical statistics knowledge is needed.

What You Will Learn
  • ✓ What sensitivity measures, how to calculate it, and when to prioritise it
  • ✓ What specificity measures, with the false positive trade-off explained
  • ✓ How the confusion matrix connects every diagnostic metric in one table
  • ✓ Positive predictive value and negative predictive value, and why prevalence matters
  • ✓ What a ROC curve is and how AUC summarises test performance
  • ✓ Likelihood ratios and how they update pre-test probability
  • ✓ Three worked examples: COVID-19 testing, breast cancer screening, diabetes diagnosis
  • ✓ Common misconceptions clinicians make when reading test results
  • ✓ Cheat sheet, glossary, and test-selection decision guide

What Are Sensitivity and Specificity?

Quick Answer — Sensitivity and Specificity

Sensitivity is the proportion of people who have the disease that the test correctly identifies as positive. Specificity is the proportion of people who do not have the disease that the test correctly identifies as negative. Together, they measure how accurately a diagnostic test performs across both the sick and healthy populations. A perfect test would have both at 100%; in practice, raising one often lowers the other.

Imagine a screening program for tuberculosis in a hospital. Some patients genuinely have TB; others do not. A chest X-ray is used to screen everyone. The key questions are: among patients who truly have TB, what fraction does the X-ray flag as positive? That fraction is sensitivity. Among patients who genuinely do not have TB, what fraction does the X-ray correctly flag as negative? That fraction is specificity.

These two measures capture different types of test accuracy. Sensitivity is about not missing the disease. Specificity is about not raising false alarms. Clinical decisions about which to prioritise depend on the consequences of each type of error, not on a single universal rule.

90–99%
Sensitivity of PCR tests for COVID-19 under optimal conditions (WHO)
~83%
Sensitivity of mammography for breast cancer detection (varies by age and tissue density)
99%+
Specificity required for HIV confirmatory tests to minimise false positives
0.5
AUC of a test no better than random guessing — the baseline to beat

Understanding the Confusion Matrix

Every diagnostic test produces four possible outcomes. A patient either has the disease or does not, and the test either flags them as positive or negative. These four combinations form the confusion matrix, the foundation from which every diagnostic accuracy metric is calculated.

Disease Present (D+)
Disease Absent (D−)
Test Positive (T+)
TPTrue Positive
FPFalse Positive
Test Negative (T−)
FNFalse Negative
TNTrue Negative

Each cell has a precise meaning that carries clinical weight:

  • True Positive (TP): The patient has the disease and the test correctly identifies them as positive. The test worked as intended.
  • False Positive (FP): The patient does not have the disease but the test incorrectly flags them as positive. Also called a Type I error. Can lead to unnecessary anxiety, further invasive testing, or harmful treatment.
  • False Negative (FN): The patient has the disease but the test incorrectly reports them as negative. Also called a Type II error. The most dangerous outcome when missing a diagnosis leads to delayed or absent treatment.
  • True Negative (TN): The patient does not have the disease and the test correctly identifies them as negative. The test correctly ruled out disease.
💡
Reading the matrix: which direction matters

Sensitivity is calculated by reading down the left column (among disease-positive people). Specificity is calculated by reading down the right column (among disease-negative people). Predictive values are calculated by reading across the rows. The column you read determines whether prevalence affects the result — column-based measures do not change with prevalence; row-based ones do.

Sensitivity Explained

Definition — Sensitivity
Sensitivity (also called the true positive rate or recall) is the proportion of people who actually have the disease that the test correctly classifies as positive. A test with high sensitivity rarely misses true cases of disease, meaning it produces few false negatives.

Formula and Calculation

Formula — Sensitivity (True Positive Rate)
Sensitivity = TP / (TP + FN)
TP = True Positives (sick people who test positive) FN = False Negatives (sick people who test negative) TP + FN = Total number of people who actually have the disease

The denominator is the total count of disease-positive individuals, regardless of what the test said. Sensitivity asks: among every person who truly has the disease, what proportion did the test correctly catch?

Interpretation

A sensitivity of 0.95 means the test correctly identifies 95 out of every 100 true disease cases. The remaining 5 are false negatives — missed diagnoses. A sensitivity of 0.70 means 30 out of every 100 cases are missed, which would be unacceptable for a cancer screening test but potentially tolerable for a low-stakes initial triage.

The mnemonic SnNout helps with clinical application: a test with high Snsitivity, when it returns a Negative result, is good at ruling out disease. A highly sensitive test that comes back negative provides strong evidence the patient does not have the condition.

When High Sensitivity Matters

High sensitivity is the priority when missing a diagnosis is more dangerous than making a false alarm. Screening programs that cast a wide net over a population — checking for HIV in blood donors, detecting COVID-19 in high-risk contacts, or ruling out meningitis in a child with a fever — need high sensitivity above all else. Missing a true case in these contexts has severe consequences: delayed treatment, ongoing transmission, or preventable death.

⚠️
The cost of high sensitivity

Increasing sensitivity typically reduces specificity. A test set to catch every possible case will also flag many healthy people as positive. Those false positives then face unnecessary follow-up testing, potential harm from further procedures, anxiety, and wasted healthcare resources. This trade-off cannot be eliminated — only managed through thoughtful threshold selection and two-step diagnostic pathways.

Specificity Explained

Definition — Specificity
Specificity (also called the true negative rate) is the proportion of people who do not have the disease that the test correctly classifies as negative. A test with high specificity rarely flags healthy people as sick, meaning it produces few false positives.

Formula and Calculation

Formula — Specificity (True Negative Rate)
Specificity = TN / (TN + FP)
TN = True Negatives (healthy people who test negative) FP = False Positives (healthy people who test positive) TN + FP = Total number of people who actually do not have the disease

Interpretation

A specificity of 0.90 means the test correctly identifies 90 out of every 100 healthy people as negative. The remaining 10 receive false positive results. In a population where millions of people are screened, even 90% specificity generates enormous numbers of false alarms.

The mnemonic SpPin applies here: a test with high Specificity, when it returns a Positive result, is good at ruling in disease. A highly specific test that comes back positive provides strong evidence the patient genuinely has the condition.

When High Specificity Matters

High specificity is the priority when a false positive carries serious consequences. Confirmatory testing for conditions where positive results trigger invasive or irreversible interventions — such as HIV confirmation before starting lifelong antiretroviral therapy, biopsy decisions in cancer diagnosis, or surgical referrals — must minimise false positives. A wrong positive here causes real harm: unnecessary surgery, stigma, medication side effects, or treatment toxicity in a patient who was never sick.

Sensitivity vs. Specificity: Complete Comparison

Featured Snippet — Sensitivity vs. Specificity

Sensitivity measures how well a test detects true disease (true positive rate). Specificity measures how well a test rules out disease in healthy people (true negative rate). Sensitivity = TP / (TP + FN). Specificity = TN / (TN + FP). High sensitivity means few missed diagnoses. High specificity means few false alarms. The two cannot both be maximised simultaneously at a single threshold; clinicians choose based on whether missing disease or falsely diagnosing it causes greater harm.

Feature Sensitivity Specificity
DefinitionProportion of truly sick people the test correctly flags as positiveProportion of truly healthy people the test correctly flags as negative
Clinical question"Of all patients with the disease, how many does this test detect?""Of all patients without the disease, how many does this test correctly clear?"
FormulaTP / (TP + FN)TN / (TN + FP)
Also calledTrue Positive Rate, RecallTrue Negative Rate
Measures performance amongDisease-positive patients onlyDisease-negative patients only
Error it minimisesFalse Negatives (missed cases)False Positives (false alarms)
Clinical mnemonicSnNout: high Sensitivity, Negative result rules OutSpPin: high Specificity, Positive result rules In
Priority whenMissing diagnosis is dangerous (HIV screening, cancer detection, meningitis)False positive triggers harmful treatment (surgery, toxic therapy, stigma)
Best study phaseInitial screening of a broad populationConfirmatory testing after a positive screen
Affected by prevalence?No — calculated within disease-positive group onlyNo — calculated within disease-negative group only
Trade-offRaising sensitivity typically lowers specificityRaising specificity typically lowers sensitivity
Threshold effectLowering the cutoff increases sensitivity, decreases specificityRaising the cutoff increases specificity, decreases sensitivity

Positive and Negative Predictive Values

Sensitivity and specificity describe what a test does to known groups. Predictive values answer the question a clinician faces in practice: given this result, what does it actually mean for the patient in front of me?

Definition — Positive Predictive Value (PPV)
PPV is the probability that a patient who receives a positive test result actually has the disease. It tells the clinician: if this test is positive, how confident should I be that the disease is present?
Formula — Positive Predictive Value
PPV = TP / (TP + FP)
TP = True Positives FP = False Positives PPV rises as disease prevalence rises and as specificity rises
Definition — Negative Predictive Value (NPV)
NPV is the probability that a patient who receives a negative test result genuinely does not have the disease. It tells the clinician: if this test is negative, how confident should I be that the disease is absent?
Formula — Negative Predictive Value
NPV = TN / (TN + FN)
TN = True Negatives FN = False Negatives NPV rises as disease prevalence falls and as sensitivity rises
⚠️
Why prevalence changes PPV and NPV but not sensitivity and specificity

Sensitivity and specificity are calculated within each disease group separately — they are properties of the test. PPV and NPV mix both groups in their denominators, so the ratio of sick to healthy people (prevalence) directly shifts their values. In a low-prevalence population, even a highly specific test generates many false positives relative to true positives, making PPV poor. Clinicians testing high-risk populations get better PPV from the same test than when screening low-risk populations.

Accuracy

Overall accuracy is the proportion of all test results that are correct. It adds the correct answers from both disease groups together.

Formula — Overall Accuracy
Accuracy = (TP + TN) / (TP + FP + FN + TN)
Useful for balanced datasets Misleading when the disease is rare — a test that always says negative looks accurate but has zero sensitivity

Likelihood Ratios

Likelihood ratios are among the most clinically useful measures because they directly update pre-test probability into post-test probability using Bayes' theorem. They do not change with disease prevalence in the tested population, making them portable across clinical settings. You can learn more about this foundational concept in the Bayes' Theorem guide.

Formulas — Likelihood Ratios
LR+ = Sensitivity / (1 − Specificity)
LR− = (1 − Sensitivity) / Specificity
LR+ = how much more likely a positive result is in sick vs. healthy people LR− = how much more likely a negative result is in sick vs. healthy people LR+ > 10 or LR− < 0.1 generally provides strong diagnostic evidence

An LR+ of 15 means a positive result is 15 times more likely in a person with the disease than in a person without it. Combined with the pre-test probability of disease in a given patient, the clinician can calculate a post-test probability that guides the management decision.

ROC Curve and AUC

Most quantitative tests (blood glucose, PSA, troponin) produce a continuous numerical result rather than a simple positive/negative answer. The clinician must choose a threshold: values above it count as positive, below as negative. Different thresholds produce different sensitivity-specificity pairs.

A Receiver Operating Characteristic (ROC) curve plots every possible threshold as a point: sensitivity (y-axis) against 1 minus specificity (x-axis), which equals the false positive rate. Connecting all points traces the full curve. A perfect test curves all the way to the top-left corner — 100% sensitivity with 100% specificity. A worthless test follows the diagonal, performing no better than chance.

AUC Value Interpretation Clinical Context
1.0Perfect discriminationTheoretical only; no real test achieves this
0.90 – 0.99ExcellentHigh-quality confirmatory tests; most molecular assays at peak performance
0.80 – 0.89GoodAcceptable for clinical use; many well-validated biomarkers
0.70 – 0.79AcceptableUseful but imperfect; often requires clinical context to interpret
0.60 – 0.69PoorLimited standalone utility; may contribute to a multi-test panel
0.50 – 0.59No useful discriminationNot better than flipping a coin; do not use as a diagnostic basis
Below 0.50Worse than chancePossible reversed scale; check how the test result is coded

The Area Under the ROC Curve (AUC, also called the c-statistic) summarises the entire curve in a single number. An AUC of 0.85, for example, means there is an 85% probability that the test will rank a randomly chosen sick patient higher than a randomly chosen healthy patient.

Choosing the optimal threshold from the ROC curve

The point on the ROC curve closest to the top-left corner is often selected as the optimal threshold, but the true optimum depends on relative costs. If false negatives are 5 times more harmful than false positives (as in cancer screening), the optimal point shifts upward along the curve, accepting more false positives to prevent more missed cases. Statistical software can calculate the threshold that minimises a weighted error function reflecting these clinical costs.

Disease Prevalence and Test Performance

One of the most counterintuitive facts in diagnostic testing is that the same test, applied to two populations with different disease prevalence, gives very different predictive values — even though its sensitivity and specificity stay exactly the same. Understanding this protects against a common and dangerous error in clinical reasoning. For more on how disease frequency is measured in populations, see the companion guide to incidence vs. prevalence.

Consider a COVID-19 lateral flow test with 95% sensitivity and 97% specificity. Applied to a high-risk hospital emergency department where 20% of patients have COVID-19, the PPV is roughly 88% — a positive result is highly likely to be genuine. The same test applied to routine airport screening where prevalence is 1% yields a PPV closer to 24% — three out of every four positive results are false positives, despite the same test characteristics.

Prevalence Scenario Sensitivity Specificity PPV NPV
High prevalence (50%) — ICU setting95%97%97%95%
Moderate prevalence (20%) — Emergency dept95%97%88%99%
Low prevalence (5%) — General clinic95%97%63%99.7%
Very low prevalence (1%) — Airport screening95%97%24%99.9%

This table makes a critical point: the same 95% sensitive, 97% specific test produces a PPV that varies from 24% to 97% depending on who is being tested. This is not a flaw in the test — it is a mathematical property of how rare events interact with imperfect measurements. Two core takeaways follow from this: test high-risk groups first (pre-test probability matters), and do not treat a positive test result in a low-prevalence screening program the same way you would treat one from a high-risk clinical context.

Worked Example: COVID-19 Rapid Antigen Test

Worked Example — COVID-19 Testing

Calculating all four core metrics from a lateral flow test study

Scenario: A lateral flow antigen test is evaluated in 1,000 people. 200 are confirmed COVID-positive by PCR (the gold standard). 800 do not have COVID.

1

Build the confusion matrix. Of the 200 true COVID cases, the lateral flow test correctly detects 185 (TP = 185) and misses 15 (FN = 15). Of the 800 healthy people, the test correctly clears 776 (TN = 776) and wrongly flags 24 as positive (FP = 24).

2

Calculate sensitivity. Sensitivity = TP / (TP + FN) = 185 / (185 + 15) = 185 / 200 = 0.925, or 92.5%. The test detects 92.5% of true COVID cases and misses 7.5%.

3

Calculate specificity. Specificity = TN / (TN + FP) = 776 / (776 + 24) = 776 / 800 = 0.97, or 97%. The test correctly clears 97% of disease-free people and produces 3% false positives.

4

Calculate PPV. PPV = TP / (TP + FP) = 185 / (185 + 24) = 185 / 209 = 0.885, or 88.5%. When this test returns positive, there is an 88.5% chance the person genuinely has COVID — given this 20% prevalence setting.

5

Calculate NPV. NPV = TN / (TN + FN) = 776 / (776 + 15) = 776 / 791 = 0.981, or 98.1%. When this test returns negative, there is a 98.1% chance the person genuinely does not have COVID.

6

Interpret likelihood ratios. LR+ = 0.925 / (1 − 0.97) = 0.925 / 0.03 = 30.8. A positive lateral flow result is about 31 times more likely in a COVID-positive person than a COVID-negative one — strong confirmatory evidence. LR− = (1 − 0.925) / 0.97 = 0.075 / 0.97 = 0.077. A negative result is 13 times less likely in a COVID-positive person — good but not perfect for ruling out.

✓ Results: Sensitivity 92.5%, Specificity 97%, PPV 88.5%, NPV 98.1%, LR+ 30.8, LR− 0.077. In a hospital setting with 20% COVID prevalence, positive results reliably indicate true infection. In an airport with 1% prevalence, PPV would drop to roughly 24% from the same test numbers.

Worked Example: Breast Cancer Screening with Mammography

Mammography is one of the most studied and debated screening tests in medicine. Its performance figures are widely discussed in clinical literature, and its sensitivity-specificity trade-off illustrates the challenges of population-level cancer screening.

Worked Example — Breast Cancer Screening

Interpreting mammography performance and the false positive challenge

1

Establish test performance figures. Based on data reviewed by the National Cancer Institute, mammography has a sensitivity of approximately 80–87% for detecting breast cancer, with specificity around 85–90%. These figures vary by age, breast tissue density, and imaging technique.

2

Apply to a screening population. Consider 10,000 women aged 50 screened by mammography. Breast cancer prevalence in this age group is roughly 0.4% (4 per 1,000). So approximately 40 women have breast cancer and 9,960 do not.

3

Calculate the confusion matrix. With 85% sensitivity: TP = 40 × 0.85 = 34; FN = 6 missed cancers. With 87% specificity: TN = 9,960 × 0.87 = 8,665; FP = 1,295 false alarms.

4

Calculate PPV. PPV = 34 / (34 + 1,295) = 34 / 1,329 = 0.026, or 2.6%. A positive mammogram in this population means roughly a 1-in-38 chance of cancer. This is not a test failure — it is the mathematical consequence of low prevalence. This is why positive mammograms trigger biopsy rather than immediate surgery.

5

Interpret the clinical implications. Over 10 years of annual screening, a woman has roughly a 60% probability of receiving at least one false-positive mammogram. These generate callbacks, additional imaging, biopsies, anxiety, and healthcare costs. The U.S. Preventive Services Task Force weighs these harms against the mortality reduction from early detection when developing screening guidelines.

✓ Lesson: Low PPV in population screening does not mean the test is bad — it reflects the mathematics of low-prevalence testing. The clinical value of screening comes from the lives saved through early detection, weighed against the harms from false positives. Both numbers are needed to evaluate the program.

Worked Example: Diabetes Screening with Fasting Blood Glucose

Worked Example — Diabetes Diagnosis

How threshold choice shifts sensitivity and specificity for HbA1c testing

1

The test and threshold problem. HbA1c (glycated haemoglobin) is a continuous measure used to diagnose Type 2 diabetes. The WHO and CDC recommend a threshold of ≥6.5% (48 mmol/mol) for a diabetes diagnosis. Changing this cutoff directly moves the sensitivity-specificity balance.

2

Effect of lowering the threshold to 6.0%. More patients are classified as positive. This catches more early-stage cases (higher sensitivity) but also flags more non-diabetic individuals as positive (lower specificity). The result is more diagnoses, more interventions, but also more unnecessary treatment for people who would not have progressed.

3

Effect of raising the threshold to 7.0%. Fewer patients are classified as positive. Only clear-cut cases are diagnosed (higher specificity), but borderline cases who could benefit from early intervention are missed (lower sensitivity). Late diagnosis means more complications — neuropathy, nephropathy, retinopathy — before treatment begins.

4

Using the ROC curve to choose the threshold. Researchers construct a ROC curve by plotting sensitivity vs. 1 minus specificity at every possible HbA1c cutoff. The area under the curve for HbA1c as a diabetes diagnostic test is approximately 0.93 — excellent discrimination. The clinically chosen cutoff of 6.5% represents a balance between catching early disease and avoiding excessive false positives in healthy people with naturally variable HbA1c levels.

5

The two-test approach in practice. Clinical guidelines often recommend a second confirmatory test when HbA1c falls in the 5.7–6.4% prediabetes range. This mirrors the high-sensitivity screen followed by a high-specificity confirmer strategy: cast a wide net first, then confirm before committing to a lifetime diagnosis.

✓ Lesson: For continuous tests, sensitivity and specificity are not fixed properties — they depend on the chosen threshold. ROC analysis maps the full range of possible trade-offs, and the clinically selected cutoff reflects the balance between missing early disease versus over-diagnosing healthy individuals.

Choosing Between High Sensitivity and High Specificity

Deciding which measure to prioritise is a clinical judgment, not a statistical one. The right answer depends on three factors: the seriousness of the disease, the consequences of a missed diagnosis, and the harm caused by a false positive.

1
Define the clinical context

Is this a first-line screening test applied to a broad population, or a confirmatory test following a positive screen? The role in the diagnostic pathway determines which metric to optimise.

2
Weigh the cost of each error

What happens if a true case is missed (false negative)? What happens if a healthy person is labelled sick (false positive)? The greater harm determines which error to minimise.

3
Choose the priority metric

If missing disease is more dangerous → prioritise sensitivity. If false positives cause more harm → prioritise specificity. Many pathways use both in sequence.

4
Consider prevalence

In low-prevalence settings, even highly specific tests generate many false positives relative to true positives. Pre-test probability estimation improves test interpretation.

5
Use a two-test strategy when possible

Screen with a sensitive test to avoid missing cases, then confirm with a specific test before taking irreversible action. This is the standard pathway in HIV testing, cancer screening, and infectious disease control.

6
Evaluate with AUC for quantitative tests

For tests with continuous output, use ROC analysis to see the full sensitivity-specificity landscape. AUC tells you overall discriminatory power before committing to any single threshold.

Clinical Scenario Priority Reason Example Tests
HIV screening in blood donorsMaximum sensitivityOne missed case infects others; false positives face confirmatory testing, not immediate harm4th-generation ELISA, nucleic acid testing
HIV confirmatory test after positive screenMaximum specificityA false positive means lifelong stigma and medication with serious side effectsWestern blot, HIV RNA quantification
Meningitis rule-out in emergencyMaximum sensitivityMissing meningitis is fatal; false positive leads to lumbar puncture and antibiotics — uncomfortable but survivableClinical criteria (jolt accentuation, neck stiffness), CT imaging
Biopsy referral in cancer screeningBalanced, leaning specificBiopsy carries procedural risk, anxiety, and cost; false positives must be minimised while still catching true casesPSA + additional biomarkers, core biopsy protocols
Population TB screeningHigh sensitivityUndetected TB drives transmission; false positives proceed to sputum culture confirmationTuberculin skin test, IGRA assay
Surgical referral for appendicitisBalanced to specificUnnecessary surgery causes real harm; missing appendicitis risks perforation — clinical scoring guides the balanceAlvarado score, CT abdomen
Drug testing in elite sportMaximum specificityA false positive ends a career unjustly; confirmatory testing required before sanctionsWADA-accredited laboratory methods

Common Misconceptions About Diagnostic Test Accuracy

Featured Snippet — Common Misconceptions

The most common error is treating accuracy as the primary metric — it is misleading when disease is rare. A test that always says negative achieves 99% accuracy in a 1% prevalence population while having zero clinical utility. Other frequent mistakes include believing sensitivity and specificity change with prevalence (they do not), assuming high sensitivity means no false positives (it does not), and using a single test result to rule in or out disease without considering pre-test probability.

Misconception Why It Is Wrong The Correct Understanding
A highly sensitive test has no false positives Sensitivity only measures performance among sick people. It says nothing about what happens in healthy people — that is specificity's domain. A 99% sensitive test can still produce thousands of false positives if applied to a healthy population with low disease prevalence. Sensitivity and specificity are independent measures of different populations. High sensitivity controls false negatives; high specificity controls false positives. Both are needed to assess the full picture of test performance.
Sensitivity and specificity change depending on who gets tested These are intrinsic test properties calculated within each disease group separately. They remain constant regardless of how many sick or healthy people are in the tested population. PPV and NPV change with prevalence — not sensitivity and specificity. Sensitivity = TP / (TP + FN) uses only disease-positive people. Specificity = TN / (TN + FP) uses only disease-negative people. The ratio of sick to healthy in the population does not affect either calculation. What changes is how useful the test is — reflected in PPV and NPV.
Overall accuracy is the best way to judge a diagnostic test Accuracy = (TP + TN) / Total. In a population where 1% of people have the disease, a test that always says "negative" achieves 99% accuracy while detecting exactly zero cases. Accuracy is heavily influenced by the dominant group and hides how well the test performs for the rare condition. For clinical evaluation, sensitivity and specificity tell you what a test does to each patient group. For rare diseases, PPV is often more informative. For overall discrimination power, the AUC is preferred. Accuracy is most meaningful when disease prevalence is close to 50%.
A positive result means the patient has the disease A positive result means the test responded positively. In low-prevalence settings, the majority of positives can be false positives. Even a test with 97% specificity generates many false alarms when prevalence is below 1%. A positive result shifts the probability of disease upward from the pre-test probability. By how much depends on the LR+ and the pre-test probability via Bayes' theorem. A positive result initiates a diagnostic process; it does not conclude one.
A negative result safely rules out disease The probability of disease after a negative result (1 minus NPV) depends on the test's sensitivity and the pre-test probability. A 90% sensitive test still misses 10% of cases. In a high-prevalence setting, the absolute number of missed cases can be large enough to warrant follow-up. A negative result from a high-sensitivity test in a low-prevalence population is strong evidence against disease. A negative result from a low-sensitivity test in a high-prevalence population is much weaker. Always combine the result with clinical context and pre-test probability.
The best test is the one with the highest AUC AUC measures average performance across all possible thresholds, which may include thresholds never used clinically. A test with a slightly lower AUC may perform much better at the specific threshold relevant to the clinical decision. AUC is a useful summary but the final assessment must compare performance at the clinically relevant threshold — the one actually used in practice. Two tests with similar AUC can differ substantially at any particular cutoff point.

Diagnostic Test Metrics Cheat Sheet

Metric Formula What It Answers Affected by Prevalence? Priority When
SensitivityTP / (TP + FN)Of all truly sick patients, what proportion does the test detect?NoMissing disease is dangerous
SpecificityTN / (TN + FP)Of all truly healthy patients, what proportion does the test correctly clear?NoFalse positives cause serious harm
PPVTP / (TP + FP)If the test is positive, what is the probability the patient is truly sick?Yes — rises with prevalenceClinician needs to act on a positive result
NPVTN / (TN + FN)If the test is negative, what is the probability the patient is truly healthy?Yes — rises as prevalence fallsClinician needs to act on a negative result
Accuracy(TP + TN) / TotalWhat proportion of all tests are correct?Yes — inflated when one group dominatesDisease prevalence near 50% (balanced datasets)
LR+Sensitivity / (1 − Specificity)How much more likely is a positive result in a sick patient than a healthy one?NoUpdating pre-test probability after a positive result
LR−(1 − Sensitivity) / SpecificityHow much less likely is a negative result in a sick patient compared to a healthy one?NoUpdating pre-test probability after a negative result
AUCArea under the ROC curveAcross all thresholds, how well does the test separate sick from healthy?NoComparing overall test quality for continuous measures
False Positive RateFP / (TN + FP) = 1 − SpecificityOf all healthy patients, what proportion does the test wrongly flag as sick?NoQuantifying over-referral burden from screening programs
False Negative RateFN / (TP + FN) = 1 − SensitivityOf all sick patients, what proportion does the test miss?NoAssessing the risk of delayed diagnosis
F1 Score2 × (PPV × Sensitivity) / (PPV + Sensitivity)Harmonic mean of precision and recall — balances both error typesYes (via PPV)Machine learning evaluation with imbalanced datasets

Diagnostic Testing Glossary

Term Definition Context / Notes
SensitivityThe proportion of people with the disease that a test correctly identifies as positive; the true positive rateCalculated within the disease-positive group only; unaffected by prevalence; mnemonic SnNout
SpecificityThe proportion of people without the disease that a test correctly identifies as negative; the true negative rateCalculated within the disease-negative group only; unaffected by prevalence; mnemonic SpPin
True Positive (TP)A test result that correctly identifies a person who has the disease as positiveAppears in the upper-left cell of the confusion matrix
True Negative (TN)A test result that correctly identifies a person without the disease as negativeAppears in the lower-right cell of the confusion matrix
False Positive (FP)A test result that incorrectly identifies a healthy person as having the disease; also called a Type I error in hypothesis testingCan lead to unnecessary treatment, anxiety, and further invasive procedures
False Negative (FN)A test result that incorrectly identifies a person with the disease as healthy; also called a Type II errorThe most clinically dangerous error when delayed diagnosis causes harm; minimised by high sensitivity
Positive Predictive Value (PPV)The probability that a person who tests positive actually has the disease; TP / (TP + FP)Depends on prevalence; rises in high-prevalence populations; the clinically actionable positive result interpretation
Negative Predictive Value (NPV)The probability that a person who tests negative genuinely does not have the disease; TN / (TN + FN)Depends on prevalence; rises in low-prevalence populations; the clinically actionable negative result interpretation
Confusion MatrixA 2×2 table summarising the four possible test outcomes: TP, FP, FN, and TN; the foundation for all diagnostic accuracy calculationsAlso called a contingency table or error matrix; used identically in machine learning and clinical testing
ROC CurveA graph plotting sensitivity (y-axis) against 1 minus specificity (x-axis) across all possible test thresholds, showing the full sensitivity-specificity trade-offUsed to select optimal thresholds and compare competing tests; a curve closer to the top-left corner indicates better performance
AUC (Area Under the Curve)The area under the ROC curve; a single summary statistic of overall test discrimination ranging from 0.5 (no better than chance) to 1.0 (perfect)Also called the c-statistic; represents the probability that the test ranks a randomly chosen sick patient above a randomly chosen healthy patient
Likelihood Ratio Positive (LR+)Sensitivity divided by (1 minus specificity); indicates how much more likely a positive result is in a person with the disease compared to one withoutLR+ greater than 10 provides strong evidence for the presence of disease; does not change with prevalence
Likelihood Ratio Negative (LR−)(1 minus sensitivity) divided by specificity; indicates how much less likely a negative result is in a person with disease compared to one withoutLR− less than 0.1 provides strong evidence against disease; does not change with prevalence
Pre-Test ProbabilityThe clinician's estimated probability of disease before the test result is known, based on clinical history, risk factors, and population prevalenceCombined with likelihood ratios via Bayes' theorem to calculate post-test probability; context-dependent and patient-specific
Post-Test ProbabilityThe revised probability of disease after incorporating the test result into the pre-test probabilityCalculated using Fagan's nomogram or Bayes' theorem; the probability a clinician acts on when making treatment decisions
Gold StandardThe reference test accepted as the definitive method for establishing whether a patient truly has the disease; used to classify patients into disease-positive and disease-negative groups for test evaluationIn practice, no gold standard is perfect; imperfect reference standards can bias sensitivity and specificity estimates
Cut-off Value (Threshold)The numerical value at which a continuous test result is classified as positive or negative; changing the threshold shifts the sensitivity-specificity trade-offOptimal thresholds depend on the relative clinical costs of false positives and false negatives; ROC analysis reveals the full range
Screening TestA test applied to asymptomatic populations to detect disease at an early stage; generally requires high sensitivity to avoid missing casesPositive screening results typically require confirmatory testing before diagnosis or treatment begins
Confirmatory Test (Diagnostic Test)A test applied after a positive screen to verify the presence of disease; generally requires high specificity to minimise false positives before treatmentOften more expensive, invasive, or technically demanding than screening tests
PrevalenceThe proportion of a defined population that has a specific disease or condition at a given point or period in timeDirectly affects PPV and NPV but not sensitivity and specificity; high-prevalence populations yield better PPV from the same test
Diagnostic AccuracyThe overall ability of a test to correctly identify patients with and without disease; often measured by sensitivity, specificity, and AUC togetherNo single number fully captures diagnostic accuracy; different metrics answer different clinical questions
SnNoutClinical mnemonic: a highly Sensitive test with a Negative result helps rule Out diseaseApplies because a sensitive test rarely misses true cases, so a negative result strongly suggests the disease is absent
SpPinClinical mnemonic: a highly Specific test with a Positive result helps rule In diseaseApplies because a specific test rarely flags healthy people, so a positive result strongly suggests the disease is present

Frequently Asked Questions

Sensitivity is the proportion of people who actually have the disease that the test correctly identifies as positive. A test with 95% sensitivity will correctly detect 95 out of every 100 true cases and miss 5 as false negatives. Formula: Sensitivity = TP / (TP + FN). High-sensitivity tests are used in initial screening because missing a true case carries serious consequences. The mnemonic SnNout reminds clinicians that a highly Sensitive test with a Negative result rules Out disease.
Specificity is the proportion of people who do not have the disease that the test correctly identifies as negative. A test with 90% specificity correctly rules out 90 out of every 100 disease-free people and incorrectly flags 10 as false positives. Formula: Specificity = TN / (TN + FP). High-specificity tests are used for confirmation before committing to invasive treatment. SpPin: a highly Specific test with a Positive result rules In disease.
Sensitivity measures how well a test detects true disease cases — of all sick people, how many test positive? Specificity measures how well a test rules out disease in healthy people — of all healthy people, how many test negative? A highly sensitive test rarely misses sick patients. A highly specific test rarely mislabels healthy patients as sick. No single test can maximise both simultaneously at one threshold; raising one typically lowers the other. Clinicians choose which to prioritise based on whether a missed diagnosis or a false alarm causes greater harm in their clinical situation.
Both are calculated from the confusion matrix. First, you need four counts: TP (sick people who test positive), FP (healthy people who test positive), FN (sick people who test negative), and TN (healthy people who test negative). Sensitivity = TP / (TP + FN) — divide true positives by everyone who actually has the disease. Specificity = TN / (TN + FP) — divide true negatives by everyone who actually does not have the disease. For worked numerical examples with step-by-step calculations, see the COVID-19 testing example in this guide.
PPV is the probability that a patient who receives a positive test result actually has the disease. Formula: PPV = TP / (TP + FP). Unlike sensitivity, PPV changes with disease prevalence. When prevalence is low, even a highly specific test generates many false positives relative to true positives, pushing PPV down significantly. A test with 95% sensitivity and 97% specificity has a PPV of only about 24% when disease prevalence is 1%, rising to 97% when prevalence is 50%. PPV is the clinically actionable figure after a positive test — it tells the clinician how confident to be that the disease is present.
Sensitivity and specificity are intrinsic properties of the test, calculated within each disease group separately. Sensitivity uses only sick people in both numerator and denominator. Specificity uses only healthy people. So the overall mix of sick and healthy people being tested does not change these calculations. PPV and NPV mix both groups in their denominators: PPV = TP / (TP + FP) includes both sick positive (TP) and healthy false positive (FP) people. The more healthy people there are relative to sick ones (low prevalence), the more false positives accumulate relative to true positives, pulling PPV down. This is why the same test gives very different PPV depending on whether you apply it to a high-risk or low-risk population.
A Receiver Operating Characteristic (ROC) curve graphs a test's true positive rate (sensitivity) on the y-axis against its false positive rate (1 minus specificity) on the x-axis as the decision threshold changes across all possible values. Each point on the curve represents a different threshold. A perfect test traces a path to the top-left corner — 100% sensitivity with 100% specificity. A useless test follows the diagonal from bottom-left to top-right. The area under the curve (AUC) summarises the entire curve: 1.0 is perfect discrimination, 0.5 is no better than chance. AUC values above 0.80 are generally considered good for clinical use. ROC analysis is used to compare competing tests and to select the optimal threshold for a given clinical application.
Neither is universally more important — the right answer depends on the clinical context. Prioritise sensitivity when missing a diagnosis is dangerous and a false positive leads only to further (not harmful) testing. This applies to HIV screening in blood donors, meningitis assessment in emergency settings, and cancer detection programs. Prioritise specificity when a false positive triggers harmful, irreversible, or stigmatising consequences. This applies to confirmatory HIV testing before antiretroviral therapy, biopsy referrals, and antidoping tests in sport. The standard clinical solution is a two-step pathway: a sensitive screening test casts a wide net, and a specific confirmatory test verifies positives before action is taken.
There is no universal standard, as the acceptable level depends on the disease and the consequences of errors. For serious conditions where missing a case is dangerous, sensitivity above 95% is often required for screening. For confirmatory tests where false positives cause serious harm, specificity above 95–99% may be needed. As a rough guide, many clinical guidelines accept 80% as a minimum threshold for either measure before considering a test clinically useful — though this threshold varies considerably by context. AUC values are sometimes used to compare tests: above 0.90 is excellent, 0.80–0.89 is good, 0.70–0.79 is acceptable. Context always determines what is "good enough" for a specific diagnostic application.
Likelihood ratios quantify how much a test result changes the probability of disease. LR+ = Sensitivity / (1 − Specificity). LR− = (1 − Sensitivity) / Specificity. They tell you how much more (or less) likely a result is in a sick person compared to a healthy person. LR+ greater than 10 provides strong evidence for disease; LR− below 0.1 provides strong evidence against it. Their key advantage is that they do not change with prevalence, making them portable across clinical settings. Combined with the pre-test probability via Bayes' theorem, they produce a post-test probability — the updated probability of disease after seeing the test result. This is the foundation of quantitative clinical reasoning.
The confusion matrix is the source table from which every diagnostic metric is derived. It has four cells: TP (sick patients who test positive), FP (healthy patients who test positive), FN (sick patients who test negative), and TN (healthy patients who test negative). Sensitivity reads down the left column — TP / (TP + FN). Specificity reads down the right column — TN / (TN + FP). PPV reads across the top row — TP / (TP + FP). NPV reads across the bottom row — TN / (TN + FN). Accuracy uses all four cells — (TP + TN) / (TP + FP + FN + TN). Filling in the confusion matrix correctly is the first step in any diagnostic test evaluation.
A false positive occurs when a test classifies a healthy person as sick. The consequences depend entirely on what follows the positive result. In a low-stakes screening context, a false positive leads to a follow-up test — inconvenient but not harmful. In higher-stakes contexts, false positives trigger biopsies, surgery, chemotherapy, antiviral medication, or social stigma on people who were never ill. The harm from false positives is why confirmatory testing exists and why high specificity is required before irreversible interventions. The false positive rate equals 1 minus specificity, so a test with 95% specificity has a 5% false positive rate — meaning 5 out of every 100 healthy people tested will receive an incorrect positive result.
For most practical diagnostic tests applied to a continuous measurement, achieving 100% for both simultaneously is not possible at any single threshold. At any given cutoff, improving sensitivity requires lowering the bar for a positive result, which inevitably captures some healthy people (reducing specificity). This trade-off is the fundamental limitation of all diagnostic tests that rely on measured values with overlapping distributions in sick and healthy populations. Exceptions exist when sick and healthy populations are perfectly separated — but this is theoretical rather than real-world. The ROC curve makes this trade-off explicit by showing all possible sensitivity-specificity combinations across every threshold.

Key sources and further reading: WHO Diabetes Fact Sheet · NCI Mammography Fact Sheet · USPSTF Breast Cancer Screening Recommendation · CDC Diabetes Testing · WHO COVID-19 Resources · Statistics Fundamentals — Home · Incidence vs. Prevalence Guide · Bayes' Theorem Guide · Type I and Type II Errors · Altman DG, Bland JM. Diagnostic tests 1: sensitivity and specificity. BMJ. 1994;308:1552 · Deeks JJ, Altman DG. Diagnostic tests 4: likelihood ratios. BMJ. 2004;329:168–169 · Metz CE. Basic principles of ROC analysis. Semin Nucl Med. 1978;8(4):283–298 · Gordis L. Epidemiology (5th ed.). Elsevier, 2014