Tutorials › Biostatistics › Sensitivity, Specificity, and Predictive Values

Diagnostic Test Evaluation

Sensitivity, Specificity, and Predictive Values

A practical guide to diagnostic-test performance, including 2×2 contingency tables, sensitivity, specificity, positive and negative predictive values, likelihood ratios, prevalence, Bayes' theorem, diagnostic accuracy, ROC curves, clinical interpretation, and implementation in R.

Intermediate 20 min read

What You'll Learn

  • How diagnostic-test performance is represented in a 2×2 table
  • How sensitivity and specificity are calculated
  • Why PPV and NPV depend strongly on prevalence
  • How likelihood ratios connect diagnostic tests with Bayes' theorem
  • How ROC curves evaluate sensitivity and specificity across thresholds
  • How to calculate and report diagnostic performance in R

Introduction

Diagnostic tests are used throughout clinical medicine to classify patients according to whether a disease, condition, or clinical state is present.

Examples include laboratory assays, imaging tests, pathology tests, biomarkers, screening instruments, clinical prediction rules, and point-of-care devices.

A diagnostic test can produce false-positive and false-negative results. Therefore, simply reporting the percentage of patients correctly classified is often insufficient.

Four fundamental quantities provide a much more informative description:

  • Sensitivity
  • Specificity
  • Positive predictive value (PPV)
  • Negative predictive value (NPV)

These measures answer different questions.

Key idea: Sensitivity and specificity describe test performance conditional on the patient's true disease status. Predictive values describe the probability of the true disease status conditional on the test result. This difference in conditioning is the source of many interpretation errors.

The 2×2 Diagnostic Table

The starting point for almost every diagnostic-test calculation is the 2×2 contingency table.

The rows represent the actual or reference-standard disease status. The columns represent the diagnostic-test result.

Figure 1. The Basic Diagnostic 2×2 Table
Every patient belongs to exactly one of the four cells when disease status and test result are binary.
Disease Present Disease Absent
Test Positive True Positive (TP)
Test correctly identifies disease
False Positive (FP)
Test incorrectly indicates disease
Test Negative False Negative (FN)
Test misses disease
True Negative (TN)
Test correctly excludes disease

True Positives

A true positive occurs when the disease is actually present and the diagnostic test is positive.

For example, if 80 patients truly have a disease and the test correctly identifies 72 of them as positive, then:

$$ TP=72 $$

False Negatives

A false negative occurs when disease is present but the diagnostic test is negative.

If 8 of the 80 diseased patients receive negative test results:

$$ FN=8 $$

False negatives are particularly important when missing the disease has serious clinical consequences.

True Negatives

A true negative occurs when the disease is absent and the test is negative.

False Positives

A false positive occurs when the disease is absent but the test result is positive.

False positives can lead to unnecessary diagnostic procedures, treatment, anxiety, cost, and potential harm.

Four Fundamental Measures

Measure Question Answered Formula
Sensitivity Among patients with disease, how many test positive? TP / (TP + FN)
Specificity Among patients without disease, how many test negative? TN / (TN + FP)
PPV Among patients testing positive, how many actually have disease? TP / (TP + FP)
NPV Among patients testing negative, how many actually do not have disease? TN / (TN + FN)

Sensitivity

Sensitivity measures the ability of a diagnostic test to identify patients who truly have the disease.

$$ \text{Sensitivity} = \frac{TP}{TP+FN} $$

The denominator is therefore:

$$ TP+FN $$

which represents all patients who actually have the disease.

Memory aid: Sensitivity starts with the disease-positive population. Ask: "Among those who truly have disease, how many did the test detect?"

Example: Calculating Sensitivity

Suppose 100 patients truly have a disease. The diagnostic test identifies 90 as positive and misses 10.

$$ TP=90,\qquad FN=10 $$

Therefore:

$$ \text{Sensitivity} = \frac{90}{90+10} = 0.90 = 90\% $$

The appropriate interpretation is:

Interpretation: Among patients who truly have the disease, 90% have a positive test result.

Specificity

Specificity measures the ability of a diagnostic test to correctly identify patients who do not have the disease.

$$ \text{Specificity} = \frac{TN}{TN+FP} $$

The denominator is:

$$ TN+FP $$

which represents all patients who are truly disease-free.

Memory aid: Specificity starts with the disease-negative population. Ask: "Among those who truly do not have disease, how many did the test correctly classify as negative?"

Example: Calculating Specificity

Suppose 200 patients do not have the disease. The test is negative in 180 and incorrectly positive in 20.

$$ TN=180,\qquad FP=20 $$

Then:

$$ \text{Specificity} = \frac{180}{180+20} = 0.90 = 90\% $$

Sensitivity and Specificity Are Conditional Probabilities

Sensitivity can be written as:

$$ P(T+ \mid D+) $$

This means the probability of a positive test given that disease is present.

Specificity can be written as:

$$ P(T- \mid D-) $$

This means the probability of a negative test given that disease is absent.

This notation is useful because it makes clear that sensitivity and specificity condition on the true disease state.

Positive Predictive Value

Positive predictive value answers a different question.

$$ \text{PPV} = \frac{TP}{TP+FP} $$

The denominator:

$$ TP+FP $$

represents everyone with a positive test.

Therefore PPV asks:

Among patients who test positive, what proportion actually have the disease?

In probability notation:

$$ PPV=P(D+\mid T+) $$

Negative Predictive Value

Negative predictive value answers the corresponding question for negative tests.

$$ \text{NPV} = \frac{TN}{TN+FN} $$

The denominator:

$$ TN+FN $$

represents everyone with a negative test.

Therefore NPV asks:

Among patients who test negative, what proportion truly do not have the disease?

In probability notation:

$$ NPV=P(D-\mid T-) $$

The Complete Worked Example

Consider a diagnostic study involving 1,000 patients. Suppose the reference standard determines that 100 patients have disease and 900 do not. The diagnostic test produces:

Disease Present Disease Absent Total
Test Positive 90 90 180
Test Negative 10 810 820
Total 100 900 1,000

Thus:

$$ TP=90,\quad FP=90,\quad FN=10,\quad TN=810 $$

Sensitivity

$$ \frac{90}{90+10}=90\% $$

Specificity

$$ \frac{810}{810+90}=90\% $$

Positive Predictive Value

$$ \frac{90}{90+90}=50\% $$

Negative Predictive Value

$$ \frac{810}{810+10} \approx98.8\% $$

This produces an important result:

A test can have both 90% sensitivity and 90% specificity while having a PPV of only 50%. The reason is that predictive values depend on the prevalence of disease in the population being tested.

Why PPV and NPV Depend on Prevalence

Suppose a disease is uncommon. Even a highly specific test can generate a substantial number of false-positive results because there are many more disease-free individuals than diseased individuals.

This is one of the most important concepts in diagnostic-test interpretation.

Figure 2. The Effect of Disease Prevalence
Adjust the prevalence below to see how PPV and NPV change when sensitivity and specificity remain fixed.
10% disease
90% no disease
For sensitivity = 90% and specificity = 90%, a disease prevalence of 10% produces an estimated PPV of 50.0% and NPV of 98.8%.

Bayes' Theorem

The relationship between prevalence, test performance, and predictive values can be expressed using Bayes' theorem.

For a positive test:

$$ P(D+\mid T+) = \frac{ P(T+\mid D+)P(D+) }{ P(T+\mid D+)P(D+) + P(T+\mid D-)P(D-) } $$

Using sensitivity and specificity:

$$ PPV = \frac{ Se\times Prev }{ Se\times Prev + (1-Sp)(1-Prev) } $$

Similarly:

$$ NPV = \frac{ Sp(1-Prev) }{ (1-Se)Prev + Sp(1-Prev) } $$

Worked Bayes Example

Suppose:

  • Sensitivity = 90%
  • Specificity = 90%
  • Prevalence = 1%

Then:

$$ PPV = \frac{ 0.90(0.01) }{ 0.90(0.01)+0.10(0.99) } $$

which gives approximately:

$$ PPV\approx8.3\% $$

Thus, despite a sensitivity and specificity of 90%, most positive tests would be false positives in this very-low-prevalence population.

This is not a contradiction. The test has excellent performance conditional on disease status, but the population contains very few people with disease. Predictive values incorporate that population prevalence.

Negative Predictive Value at Low Prevalence

When disease prevalence is low, NPV can be extremely high.

Using the same sensitivity and specificity:

$$ Se=90\%,\quad Sp=90\%,\quad Prev=1\% $$

the NPV is approximately:

$$ NPV\approx99.9\% $$

A negative test is therefore highly reassuring in this low-prevalence setting.

Predictive Values Can Change Without Any Change in the Test

Consider the same test used in two populations.

Population Prevalence Sensitivity Specificity Approx. PPV
Low-risk population 1% 90% 90% 8.3%
Moderate-risk population 10% 90% 90% 50.0%
High-risk population 50% 90% 90% 90.0%

The diagnostic test has not changed. The sensitivity and specificity have not changed. Yet the PPV changes dramatically.

Clinical interpretation: Predictive values are properties of a test in a particular testing population, not immutable characteristics of the test itself.

Diagnostic Accuracy

Overall diagnostic accuracy is sometimes defined as:

$$ \text{Accuracy} = \frac{TP+TN}{TP+FP+FN+TN} $$

In the 1,000-patient example:

$$ \text{Accuracy} = \frac{90+810}{1000} = 90\% $$

Accuracy can be useful, but it must be interpreted cautiously.

For highly imbalanced outcomes, accuracy can be misleading.

Why Accuracy Alone Can Be Misleading

Suppose a disease occurs in only 1% of a population. A test that simply declares everyone disease-free would have:

$$ 99\% $$

accuracy.

Yet its sensitivity would be:

$$ 0\% $$

because it detects none of the diseased patients.

Lesson: High accuracy does not necessarily imply useful diagnostic performance, particularly when disease prevalence is very low or very high.

False-Positive Rate

The false-positive rate is:

$$ FPR = \frac{FP}{FP+TN} $$

Because specificity is:

$$ Sp = \frac{TN}{TN+FP} $$

we have:

$$ FPR=1-Sp $$

Thus, a specificity of 95% corresponds to a false-positive rate of 5%.

False-Negative Rate

Similarly:

$$ FNR = \frac{FN}{TP+FN} $$

and:

$$ FNR=1-Se $$

A sensitivity of 95% therefore corresponds to a false-negative rate of 5%.

Likelihood Ratios

Likelihood ratios provide another way to summarize diagnostic-test performance. They are especially useful for moving from a pretest probability to a post-test probability.

The positive likelihood ratio is:

$$ LR+ = \frac{Sensitivity}{1-Specificity} $$

The negative likelihood ratio is:

$$ LR- = \frac{1-Sensitivity}{Specificity} $$

Interpreting LR+

A larger LR+ provides stronger evidence in favor of disease after a positive test.

For example, if:

$$ Se=90\%,\qquad Sp=90\% $$

then:

$$ LR+ = \frac{0.90}{1-0.90} = 9 $$

A positive result is therefore about nine times as likely in patients with disease as in patients without disease.

Interpreting LR−

A smaller LR− provides stronger evidence against disease after a negative test.

With the same sensitivity and specificity:

$$ LR- = \frac{1-0.90}{0.90} \approx0.111 $$

Lower LR− values are generally more useful for ruling out disease.

Common Qualitative Likelihood-Ratio Interpretation

Likelihood Ratio General Interpretation
LR+ > 10 Large increase in probability
LR+ 5–10 Moderate increase
LR+ 2–5 Small increase
LR+ near 1 Little or no diagnostic information
LR− 0.5–1 Little decrease
LR− 0.2–0.5 Small to moderate decrease
LR− 0.1–0.2 Moderate to large decrease
LR− < 0.1 Large decrease

These are useful rules of thumb rather than universal clinical thresholds. The appropriate interpretation depends on the clinical context and the consequences of diagnostic error.

Pretest Probability and Post-Test Probability

Likelihood ratios can be used through odds.

First convert probability to odds:

$$ \text{Pretest odds} = \frac{P}{1-P} $$

Then:

$$ \text{Post-test odds} = \text{Pretest odds}\times LR $$

Finally convert odds back to probability:

$$ P = \frac{\text{odds}}{1+\text{odds}} $$

Worked Likelihood-Ratio Example

Suppose the pretest probability of disease is 20%.

$$ P=0.20 $$

The pretest odds are:

$$ \frac{0.20}{0.80}=0.25 $$

Suppose the test has:

$$ LR+=9 $$

Then:

$$ \text{Post-test odds}=0.25\times9=2.25 $$

Converting back to probability:

$$ P=\frac{2.25}{1+2.25} \approx69.2\% $$

Thus, a positive test increases the estimated probability of disease from 20% to approximately 69%.

High Sensitivity and "Rule Out"

A highly sensitive test produces relatively few false negatives.

This can make a negative result useful for ruling out disease, particularly when the pretest probability is appropriate and the test has a sufficiently small LR−.

The traditional mnemonic is:

SnNout: a highly Sensitive test, when Negative, helps rule out disease.

This mnemonic is only a heuristic. The actual diagnostic value depends on the magnitude of LR− and the patient's pretest probability.

High Specificity and "Rule In"

A highly specific test produces relatively few false positives.

A positive result can therefore be useful for ruling in disease, particularly when LR+ is large.

SpPin: a highly Specific test, when Positive, helps rule in disease.

Again, the likelihood ratio and clinical context are more informative than the mnemonic alone.

Trade-Off Between Sensitivity and Specificity

Many diagnostic tests produce a continuous or ordinal measurement. A threshold is then selected to define a positive result.

Changing the threshold can change sensitivity and specificity.

For example, if a biomarker is considered positive when:

$$ X\ge50 $$

raising the threshold to:

$$ X\ge70 $$

will often reduce the number of positive tests. Depending on the underlying distributions, this may increase specificity while reducing sensitivity.

ROC Curves

A receiver operating characteristic, or ROC, curve displays sensitivity against the false-positive rate across possible thresholds.

The x-axis is:

$$ 1-\text{Specificity} $$

and the y-axis is:

$$ \text{Sensitivity} $$
Figure 3. Illustrative ROC Curve
An ROC curve shows the sensitivity/specificity trade-off across diagnostic thresholds.
False Positive Rate (1 − Specificity) Sensitivity 0 1.0 1.0 Better discrimination

The diagonal line represents random discrimination. A curve closer to the upper-left corner generally represents better discrimination.

Area Under the ROC Curve

The area under the ROC curve, or AUC, summarizes discrimination across the range of thresholds.

An AUC of:

$$ AUC=0.5 $$

corresponds to discrimination no better than random classification in the standard binary setting.

An AUC of:

$$ AUC=1.0 $$

corresponds to perfect discrimination in the sample/population being evaluated.

AUC General Interpretation
0.50 No discrimination beyond chance
0.60–0.70 Limited discrimination
0.70–0.80 Moderate discrimination
0.80–0.90 Good discrimination
>0.90 Excellent discrimination
Caution: AUC is a measure of discrimination, not clinical utility. A test can have a high AUC and still be unsuitable for a particular clinical decision if its operating characteristics, consequences of errors, cost, or implementation requirements are unfavorable.

Choosing an Optimal Threshold

There is no universally optimal diagnostic threshold.

The appropriate cutoff depends on the clinical objective.

For example, if missing disease is especially harmful, investigators may favor higher sensitivity.

If false positives lead to invasive procedures or substantial harm, higher specificity may be prioritized.

Youden's Index

One commonly used statistical criterion is Youden's index:

$$ J=Sensitivity+Specificity-1 $$

The threshold maximizing \(J\) maximizes the vertical distance between the ROC curve and the diagonal reference line.

However, maximizing Youden's index is not automatically equivalent to choosing the clinically optimal cutoff.

Screening Versus Confirmatory Testing

Different clinical applications may prioritize different characteristics.

Screening

Screening programs often place substantial value on sensitivity because missed cases can undermine the purpose of early detection.

Confirmatory Testing

Confirmatory testing may place greater emphasis on specificity because false positives can lead to unnecessary treatment or invasive follow-up.

Do not assume that "higher sensitivity is always better." The desired balance depends on the clinical decision, disease consequences, available follow-up testing, prevalence, and costs or harms associated with false-positive and false-negative results.

Sequential Testing

Diagnostic tests are sometimes used sequentially.

For example, a highly sensitive screening test may be followed by a highly specific confirmatory test.

The strategy can reduce the number of people exposed to expensive or invasive confirmatory testing while maintaining a desired level of case detection.

Parallel Testing

In parallel testing, multiple tests may be performed at approximately the same time. Depending on the rule used to classify the combined result, parallel testing can increase sensitivity but may reduce specificity.

The precise operating characteristics depend on the combination rule and the dependence between tests.

Independent Tests and Conditional Probability

When multiple diagnostic tests are combined, investigators should not casually assume statistical independence.

For example, two biomarkers may be biologically correlated.

If tests are correlated, multiplying probabilities as if they were independent can produce incorrect estimates.

Important: Sensitivity, specificity, PPV, and NPV should be calculated using the actual joint classification rules specified for the diagnostic strategy.

Confidence Intervals

Sensitivity and specificity are estimated from finite samples. Therefore, point estimates should generally be accompanied by confidence intervals when inferential reporting is appropriate.

For sensitivity:

$$ \widehat{Se} = \frac{TP}{TP+FN} $$

The denominator \(TP+FN\) determines the amount of information available for estimating sensitivity.

For specificity:

$$ \widehat{Sp} = \frac{TN}{TN+FP} $$

The denominator \(TN+FP\) determines the amount of information available for estimating specificity.

Why Wald Confidence Intervals Can Be Problematic

A simple normal approximation interval is sometimes written as:

$$ \hat p \pm z_{1-\alpha/2} \sqrt{ \frac{\hat p(1-\hat p)}{n} } $$

For proportions near 0 or 1, or for small sample sizes, this approximation can perform poorly and can even produce limits outside the interval \([0,1]\).

Wilson or exact binomial intervals may be preferable depending on the analysis objective and reporting requirements.

Sample Size for Sensitivity and Specificity

Diagnostic studies often need sufficient numbers of both disease-positive and disease-negative participants.

If the primary objective is to estimate sensitivity precisely, the number of disease-positive participants is especially important.

If the primary objective is to estimate specificity precisely, the number of disease-negative participants is especially important.

Design implication: A very large diagnostic study can still provide an imprecise sensitivity estimate if very few participants actually have the disease.

Reference Standards Matter

Sensitivity and specificity require a definition of the "true" disease state. This is commonly established through a reference standard, sometimes called a gold standard.

However, reference standards are not necessarily perfect.

If the reference standard misclassifies disease status, estimates of diagnostic performance can be biased.

Verification Bias

Verification bias can occur when only a subset of participants receive the reference standard.

For example, patients with positive screening results may be much more likely to receive definitive diagnostic confirmation.

If verification is related to the index-test result, estimates of sensitivity and specificity can be distorted.

Spectrum Bias

Diagnostic performance can vary according to the spectrum of patients included in the study.

A study containing only patients with severe disease and healthy controls may produce very different estimates from a study containing:

  • Mild disease
  • Early disease
  • Advanced disease
  • Related conditions
  • Healthy individuals

Therefore, diagnostic performance estimates should be interpreted in the population in which the study was conducted.

Prevalence and Generalizability

Sensitivity and specificity are often more transportable than PPV and NPV because predictive values depend directly on disease prevalence.

However, even sensitivity and specificity can change across populations if disease spectrum, comorbidities, treatment status, specimen characteristics, or test implementation differ.

Generalization requires context. A diagnostic-test estimate from one study population should not automatically be assumed to apply unchanged to every clinical population.

Diagnostic Odds Ratio

Another summary measure is the diagnostic odds ratio, or DOR:

$$ DOR = \frac{LR+}{LR-} $$

Equivalently:

$$ DOR = \frac{TP\times TN}{FP\times FN} $$

Higher values generally indicate better discriminatory performance.

However, DOR can be less intuitive for clinical interpretation than sensitivity, specificity, or likelihood ratios.

Comparing Two Diagnostic Tests

Suppose Test A and Test B are being evaluated against the same reference standard.

Measure Test A Test B
Sensitivity 92% 85%
Specificity 82% 94%
LR+ 5.1 14.2
LR− 0.10 0.16

Neither test is universally "better."

Test A has greater sensitivity and a smaller LR−. Test B has greater specificity and a larger LR+.

The preferred test depends on the clinical purpose.

Interactive 2×2 Calculator

The following calculator converts a diagnostic 2×2 table into the major performance measures.

Diagnostic Test Calculator

Enter the four cells of a 2×2 diagnostic table. The calculator reports sensitivity, specificity, PPV, NPV, accuracy, false-positive rate, false-negative rate, LR+, and LR−.

Sensitivity
90.0%
Specificity
90.0%
PPV
50.0%
NPV
98.8%
Accuracy
90.0%
FPR
10.0%
FNR
10.0%
LR+
9.00
LR−
0.11

R Implementation

Diagnostic performance can be calculated directly from a 2×2 table in R.

tp <- 90
fp <- 90
fn <- 10
tn <- 810

sensitivity <- tp / (tp + fn)
specificity <- tn / (tn + fp)

ppv <- tp / (tp + fp)
npv <- tn / (tn + fn)

accuracy <- (tp + tn) / (tp + fp + fn + tn)

fpr <- fp / (fp + tn)
fnr <- fn / (tp + fn)

lr_positive <- sensitivity / (1 - specificity)
lr_negative <- (1 - sensitivity) / specificity

results <- data.frame(
  Sensitivity = sensitivity,
  Specificity = specificity,
  PPV = ppv,
  NPV = npv,
  Accuracy = accuracy,
  FPR = fpr,
  FNR = fnr,
  LR_Positive = lr_positive,
  LR_Negative = lr_negative
)

results

Using a Confusion Matrix in R

Suppose the observed reference-standard status and test result are stored as binary variables.

table(
  Reference = reference_status,
  Test = test_result
)

For example:

tab <- table(
  Reference = reference_status,
  Test = test_result
)

tab

The exact indexing depends on how the factor levels are coded, so production programs should explicitly verify which cell represents TP, FP, FN, and TN.

Using the yardstick Package

The yardstick package provides functions for classification metrics.

library(yardstick)

sens_vec(
  truth = truth,
  estimate = estimate
)

spec_vec(
  truth = truth,
  estimate = estimate
)

ppv_vec(
  truth = truth,
  estimate = estimate
)

npv_vec(
  truth = truth,
  estimate = estimate
)

Factor-level definitions should be checked carefully so that the positive class is specified correctly.

ROC Analysis in R

The pROC package is commonly used for ROC analysis.

library(pROC)

roc_object <- roc(
  response = disease_status,
  predictor = biomarker
)

plot(roc_object)

auc(roc_object)

A threshold can then be investigated using:

coords(
  roc_object,
  x = "best",
  best.method = "youden",
  ret = c(
    "threshold",
    "sensitivity",
    "specificity"
  )
)
Important: A "best" threshold selected statistically should not automatically be adopted for clinical use. Threshold selection should consider clinical consequences, prespecified objectives, validation data, and the intended use of the test.

Diagnostic-Test Reporting

A diagnostic-study report should make the denominators and reference standard clear.

For example:

Example reporting language: Using the reference standard as the definition of disease status, the index test demonstrated a sensitivity of 90.0% and specificity of 90.0%. The positive predictive value was 50.0% and the negative predictive value was 98.8%. The positive and negative likelihood ratios were 9.00 and 0.11, respectively.

What Should Be Reported With Sensitivity and Specificity?

  • The reference standard
  • The study population
  • The number of disease-positive participants
  • The number of disease-negative participants
  • The diagnostic threshold
  • Sensitivity
  • Specificity
  • Confidence intervals where appropriate
  • PPV and NPV when clinically relevant
  • Prevalence or disease prevalence in the study population
  • Handling of indeterminate or missing results

Indeterminate Test Results

Some diagnostic tests produce an indeterminate, equivocal, or invalid result.

Such results should not simply be discarded without a prespecified rationale.

Possible analysis strategies include:

  • Repeat testing
  • Classification according to a prespecified rule
  • Separate reporting of indeterminate results
  • Best-case and worst-case sensitivity analyses
  • Exclusion with transparent documentation
Best practice: The handling of indeterminate results should be defined before examining the final diagnostic performance results whenever feasible.

Missing Reference-Standard Results

Missing disease-status information creates a more fundamental problem because the true classification is unknown.

If participants with missing reference-standard results differ systematically from those with complete data, complete-case diagnostic estimates can be biased.

The missing-data strategy should therefore be considered as part of the statistical analysis plan.

Paired Comparison of Diagnostic Tests

When two diagnostic tests are applied to the same patients, their results are paired.

Simple comparison of two independent proportions may therefore be inappropriate.

For paired binary outcomes, methods such as McNemar's test can be relevant for certain comparative questions.

The choice of method depends on whether the objective is to compare sensitivity, specificity, predictive performance, overall classification, or another endpoint.

Diagnostic Test Versus Prognostic Model

Diagnostic performance should be distinguished from prognostic performance.

Concept Diagnostic Model Prognostic Model
Primary question Is the condition present? What outcome will occur?
Typical outcome Current disease status Future event or outcome
Common measures Sensitivity, specificity, PPV, NPV Calibration, discrimination, time-dependent measures
ROC/AUC Common Also possible, with appropriate methods

Diagnostic Versus Screening Performance

A test evaluated in a highly selected diagnostic population may not perform the same way in population screening.

For example, a diagnostic clinic may contain many patients with symptoms, comorbidities, or a high pretest probability. A population-screening program may contain mostly healthy individuals.

As prevalence and disease spectrum change, predictive values and potentially other operating characteristics can change.

Common Interpretation Errors

  1. Confusing sensitivity with PPV. Sensitivity asks how the test behaves among people with disease. PPV asks how disease status behaves among people with positive tests.
  2. Confusing specificity with NPV. Specificity conditions on disease absence; NPV conditions on a negative test.
  3. Ignoring prevalence. PPV and NPV can change substantially when prevalence changes.
  4. Using accuracy alone. Accuracy can be misleading when disease prevalence is highly imbalanced.
  5. Calling a test "90% accurate" without defining the metric. Accuracy, sensitivity, specificity, and predictive values are different quantities.
  6. Assuming PPV is intrinsic to the test. PPV depends on the testing population and disease prevalence.
  7. Assuming a high AUC guarantees clinical usefulness. Discrimination does not automatically establish clinical utility.
  8. Choosing a threshold solely from statistical optimization. Clinical consequences and decision objectives matter.
  9. Ignoring the reference standard. Diagnostic performance estimates depend on how disease status is defined.
  10. Ignoring indeterminate or missing results. These observations can materially affect estimates.

A Simple Memory Framework

1
Start with disease status. Sensitivity asks: among those who have disease, how many test positive?
2
Stay with disease status. Specificity asks: among those who do not have disease, how many test negative?
3
Start with a positive test. PPV asks: among positive tests, how many truly have disease?
4
Start with a negative test. NPV asks: among negative tests, how many truly do not have disease?

The Denominator Is the Key

One of the easiest ways to avoid mistakes is to identify the denominator before remembering the formula.

Measure Denominator Population in Denominator
Sensitivity TP + FN Everyone with disease
Specificity TN + FP Everyone without disease
PPV TP + FP Everyone testing positive
NPV TN + FN Everyone testing negative

One-Sentence Definitions

Sensitivity: probability of a positive test among patients who truly have disease.
Specificity: probability of a negative test among patients who truly do not have disease.
PPV: probability of disease among patients who test positive.
NPV: probability of no disease among patients who test negative.

Clinical Interpretation Example

Suppose a test has:

$$ Sensitivity=95\% $$ $$ Specificity=95\% $$

It is tempting to conclude that a positive result means there is a 95% probability that the patient has disease.

That conclusion is incorrect.

The 95% sensitivity does not describe the probability of disease given a positive test. The relevant quantity is PPV.

PPV must incorporate disease prevalence.

Classic mistake: Sensitivity is not \(P(D+\mid T+)\). It is \(P(T+\mid D+)\). PPV is \(P(D+\mid T+)\).

Worked Example at 1% Prevalence

Imagine screening 10,000 people for a disease with 1% prevalence. Thus:

$$ 100 $$

people have disease and:

$$ 9900 $$

do not.

With sensitivity and specificity both equal to 90%:

Disease No Disease
Positive 90 990
Negative 10 8910

Therefore:

$$ PPV = \frac{90}{90+990} \approx8.3\% $$

while:

$$ NPV = \frac{8910}{8910+10} \approx99.9\% $$

The same test can therefore have a very high NPV and a relatively low PPV in a low-prevalence screening population.

Why This Matters in Screening

When screening millions of people for a relatively uncommon disease, even a small false-positive rate can produce a large number of false-positive results.

This does not necessarily mean the test is poor.

It means that screening is often a two-stage process:

  • Identify potential cases.
  • Confirm positive results with an appropriate diagnostic strategy.

Prevalence Is Not the Same as Sample Proportion in Every Setting

In a diagnostic study, the proportion of participants with disease may have been intentionally selected by the investigators.

For example, a case-control-style diagnostic study might enroll equal numbers of diseased and non-diseased participants even though the disease prevalence in clinical practice is much lower.

In such a design, the observed PPV and NPV may not represent the values that would occur in the target population.

Design warning: If disease prevalence is artificially established by study sampling, predictive values may need to be recalculated for the intended clinical population.

Reporting Diagnostic Performance in a Clinical Study

A strong report should allow the reader to reconstruct the underlying classification.

At minimum, report:

  • Number of participants evaluated
  • Number with disease according to the reference standard
  • Number without disease
  • True positives
  • False positives
  • False negatives
  • True negatives
  • Sensitivity
  • Specificity
  • Confidence intervals where appropriate
  • Diagnostic threshold
  • Reference-standard definition

Suggested Diagnostic Performance Table

Measure Estimate 95% CI
Sensitivity 90.0% 82.4%–95.1%
Specificity 90.0% 88.0%–91.8%
PPV 50.0% —
NPV 98.8% —
LR+ 9.00 —
LR− 0.11 —

The exact confidence intervals should be calculated from the underlying data using an appropriate method rather than copied from an illustrative example.

Quality-Control Checklist

1
Confirm the reference-standard definition.
2
Confirm which test result is defined as positive.
3
Verify TP, FP, FN, and TN counts.
4
Verify the denominators for sensitivity and specificity.
5
Verify PPV and NPV use test-result denominators.
6
Check prevalence in the study population.
7
Confirm the diagnostic threshold.
8
Review indeterminate and missing results.
9
Verify confidence-interval methodology.
10
Confirm that the reported interpretation matches the clinical population.

Practical Comparison of the Four Measures

Measure Starts With Ends With Main Use
Sensitivity True disease Positive test Detect disease
Specificity No disease Negative test Exclude disease correctly
PPV Positive test True disease Interpret positive result
NPV Negative test No disease Interpret negative result

Summary

Sensitivity, specificity, positive predictive value, and negative predictive value are among the foundational measures of diagnostic-test performance.

The most important distinction is the direction of conditioning.

Sensitivity asks:

$$ P(T+\mid D+) $$

Specificity asks:

$$ P(T-\mid D-) $$

PPV asks:

$$ P(D+\mid T+) $$

NPV asks:

$$ P(D-\mid T-) $$

The first two describe test performance conditional on disease status. The latter two describe disease status conditional on the test result.

Bottom line: Sensitivity and specificity describe how well a diagnostic test performs when the true disease state is known. PPV and NPV describe how informative the test result is about the patient's disease state. Because PPV and NPV depend strongly on prevalence, a diagnostic test can have high sensitivity and specificity but a surprisingly low PPV in a low-prevalence population. The 2×2 table is the foundation for understanding all four measures, while likelihood ratios and Bayes' theorem provide a useful framework for translating test results into post-test probabilities.

Key Formulas at a Glance

Measure Formula
Sensitivity \(TP/(TP+FN)\)
Specificity \(TN/(TN+FP)\)
PPV \(TP/(TP+FP)\)
NPV \(TN/(TN+FN)\)
Accuracy \((TP+TN)/N\)
False-positive rate \(1-Sp\)
False-negative rate \(1-Se\)
LR+ \(Se/(1-Sp)\)
LR− \((1-Se)/Sp\)
Diagnostic odds ratio \(LR+/LR-\)
Youden's index \(Se+Sp-1\)

References

Altman, D.G. and Bland, J.M. (1994). Diagnostic tests 1: Sensitivity and specificity. BMJ, 308, 1552.
Altman, D.G. and Bland, J.M. (1994). Diagnostic tests 2: Predictive values. BMJ, 309, 102.
Bossuyt, P.M., Reitsma, J.B., Bruns, D.E., et al. (2015). STARD 2015: An updated list of essential items for reporting diagnostic accuracy studies. BMJ, 351, h5527.
Deeks, J.J. and Altman, D.G. (2004). Diagnostic tests 4: Likelihood ratios. BMJ, 329, 168–169.
Zweig, M.H. and Campbell, G. (1993). Receiver-operating characteristic (ROC) plots: a fundamental evaluation tool in clinical medicine. Clinical Chemistry, 39(4), 561–577.
McNeil, B.J. and Hanley, J.A. (1984). Statistical approaches to the analysis of receiver operating characteristic (ROC) curves. Medical Decision Making, 4(2), 137–150.