Diagnostic Likelihood Ratios
Prevalence-independent summaries of a test's evidentiary weight — the positive likelihood ratio LR+ = sensitivity/(1 - specificity) and negative likelihood ratio LR- = (1 - sensitivity)/specificity — that multiply pre-test odds into post-test odds (post-test odds = pre-test odds x LR) and can be applied to any baseline probability via the Fagan nomogram.
In plain language
A diagnostic likelihood ratio tells you how much a single test result should change your belief that a patient actually has the condition. The positive likelihood ratio (LR+) says how many times more often a positive result shows up in people who truly have the disease than in people who don't, and the negative likelihood ratio (LR-) does the same for a negative result. Its big selling point is that it does not depend on how common the disease is in your population, so the same LR+ and LR- can be carried from one cohort to another. You build both numbers entirely from a test's sensitivity (how often it catches true cases) and specificity (how often it correctly clears true non-cases).
A diagnostic likelihood ratio (LR) expresses how much a particular test result changes the odds that a patient has the target condition. It combines sensitivity and specificity into a single number per result level while remaining independent of prevalence, which is what makes it portable across populations in a way predictive values are not. For a binary test the two key ratios are the positive likelihood ratio
LR+ = sensitivity / (1 - specificity) = P(T+|D+) / P(T+|D-)
and the negative likelihood ratio
LR- = (1 - sensitivity) / specificity = P(T-|D+) / P(T-|D-).
LR+ is the ratio of the probability of a positive result in true cases to that in true non-cases (how many times more likely a positive is among the diseased); LR- is the analogous ratio for a negative result. LR+ > 1 raises the odds of disease, LR- < 1 lowers them, and a likelihood ratio of exactly 1 is uninformative (the result does not change the odds).
Core idea — odds form of Bayes' theorem
The reason LRs matter operationally is that they convert a pre-test belief into a post-test belief by simple multiplication on the odds scale:
post-test odds = pre-test odds x LR, where odds = p / (1 - p).
So if the pre-test probability of incident HF given a claims algorithm flag is, say, 5% (pre-test odds 0.0526) and the algorithm's LR+ is 7.7, the post-test odds are 0.0526 x 7.7 = 0.405, i.e. a post-test probability of 0.405/1.405 = 0.288 (28.8%). The Fagan nomogram is the classical graphical device that does exactly this: a straight line drawn from the pre-test probability through the likelihood ratio reads off the post-test probability, sparing the analyst the odds/probability conversions. The crucial property is that the same LR+ and LR- apply at any pre-test probability — the test's evidentiary weight is separated from the population's prevalence, which is precisely the separation that predictive values fail to provide.
Rules of thumb and continuous tests
As informal anchors (Jaeschke/Deeks-style): LR+ above ~10 or LR- below ~0.1 produce large, often conclusive shifts in probability; 5–10 / 0.1–0.2 moderate shifts; 2–5 / 0.2–0.5 small shifts; and 1–2 / 0.5–1 minimal-to-no shift. For a continuous or ordinal test the binary LR+ / LR- is wasteful; instead one computes a stratum-specific (interval) likelihood ratio for each result band — the density of that result among cases divided by its density among non-cases — which preserves the full information in the score and is the bridge from likelihood ratios to the ROC curve, whose local slope at any point equals the likelihood ratio at that threshold.
Pros, cons, and trade-offs
- vs PPV/NPV (`ppv-npv-rwe`): A likelihood ratio is prevalence-independent and updates any pre-test probability, so it transports across cohorts; a predictive value is the post-test probability fixed at one prevalence. Prefer likelihood ratios to summarize a test's evidentiary weight portably and to reason about how a flag would behave in a different cohort; prefer PPV/NPV to state the concrete probability in the cohort at hand. - vs sensitivity/specificity (`sensitivity-specificity-rwe`): LRs are derived from the same two numbers but package them into a directly usable odds-multiplier, and stratum-specific LRs extend naturally to multi-level/continuous results. Their cost is one extra layer of abstraction (odds, Bayes) that the raw operating-characteristic pair avoids. They are complements: report sensitivity/specificity for transparency and LRs for bedside/decision use. - vs ROC/AUC (`roc-auc-discrimination-rwe`): The likelihood ratio at a threshold equals the local slope of the ROC curve there; the AUC integrates discrimination across all thresholds into one number. Prefer likelihood ratios when you need to update an individual's probability at a specific result level; prefer AUC for a single threshold-free discrimination summary.
When to use
Report LR+ and LR- (each with a 95% CI) when you want a prevalence-independent statement of how much a test result changes the odds of the condition; when you must apply the same test across cohorts of differing prevalence and need a portable evidentiary weight; when communicating to clinicians who reason from a pre-test probability to a post-test probability (the Fagan-nomogram workflow); and, using stratum-specific LRs, when the test is continuous or ordinal and collapsing it to a single cut-point would discard information.
When NOT to use — and when it is actively misleading or dangerous
- Treating the LR as a probability. A likelihood ratio is an odds multiplier, not a probability; quoting "LR+ = 7.7" as if it were the chance of disease, or skipping the pre-test-odds step, badly miscommunicates risk. Always combine it with an explicit pre-test probability. - Forgetting the odds scale. Multiplying probabilities by the LR instead of odds is a common and serious error; convert probability to odds, multiply, then convert back. The Fagan nomogram exists precisely to avoid this slip. - Binary LRs for a continuous score. Dichotomizing a continuous biomarker or risk score to compute a single LR+ throws away graded information and can give a misleading single shift; use stratum-specific (interval) LRs. - Reusing LRs across a shifted case spectrum. LRs are prevalence-independent but not spectrum-independent: if the severity mix of cases or the comorbidity mix of non-cases differs from the validation population, sensitivity and specificity (and hence the LRs) change. Transport requires checking the spectrum, not just the prevalence. - Undefined LR+ at perfect specificity. When specificity = 1 in a finite sample, LR+ = sensitivity/0 is undefined; report with a continuity correction or an interval rather than an infinite point estimate.
Data-source operational depth
- Claims (FFS): Because LRs are built from sensitivity and specificity, estimating them honestly requires a validation design that observes both false negatives and false positives — i.e. charting algorithm-negatives as well as positives, not the cheap algorithm-positive-only design that yields PPV. The payoff is portability: an LR+ estimated in one FFS cohort can be applied to a different-prevalence cohort to project how informative a flag is there. Restrict the validation frame to FFS-observable person-time (Medicare Advantage spans generate no fee-for-service claims and create spurious algorithm-negatives that distort specificity and thus LR+). - EHR: Continuous predictors (labs, vitals, risk scores) make stratum-specific LRs natural and far more informative than a single dichotomized LR; encounter-driven capture (leakage) depresses apparent sensitivity and must be handled before the LRs are trusted. - Registry/linked: Registry adjudication supplies the reference standard needed for both the case and non-case densities; linked data let interval LRs be estimated across the full score distribution and transported to target cohorts of differing prevalence.
Worked claims example
From the incident-HF claims algorithm with sensitivity 93.5% and specificity 87.9% (validated by stratified chart review on FFS-observable person-time), compute LR+ = 0.935 / (1 - 0.879) = 0.935 / 0.121 = 7.73 and LR- = (1 - 0.935) / 0.879 = 0.065 / 0.879 = 0.074. A positive flag is about 7.7 times more likely in a true HF case than in a non-case; a negative result is about 1/0.074 = 13.5 times more likely in a non-case. Now apply the same LRs in two cohorts using post-test odds = pre-test odds x LR. In an enriched cohort with pre-test probability 0.20 (odds 0.25): post-test odds for a flag = 0.25 x 7.73 = 1.93, post-test probability = 1.93/2.93 = 0.659 (66%). In a rare-outcome commercial cohort with pre-test probability 0.02 (odds 0.0204): post-test odds = 0.0204 x 7.73 = 0.158, post-test probability = 0.158/1.158 = 0.136 (13.6%) — identical to the Bayes-projected PPV at 2% prevalence, as it must be, because the LR carries exactly the prevalence-independent evidentiary content that PPV expresses at a fixed prevalence. Reporting the single pair (LR+ 7.73, LR- 0.074) therefore lets a reader compute the post-test probability for their cohort without re-running the validation.
Interpreting the output
The full validation in the worked example yields LR+ = 7.73 and LR− = 0.074, computed from sensitivity 0.935 and specificity 0.879. Applied to a pre-test probability of 25%, the post-test probability for a positive flag rises to ≈ 66%.
(1) Formal interpretation. LR+ = sensitivity / (1 − specificity) = 0.935 / 0.121 ≈ 7.73 quantifies how much more likely a positive result is in a true case than in a true non-case. LR− = (1 − sensitivity) / specificity = 0.065 / 0.879 ≈ 0.074 quantifies how much less likely a negative result is in a true case than in a non-case. To update a pre-test probability P to a post-test probability: convert P to pre-test odds (P / (1 − P)), multiply by the LR, convert back to probability. LRs are invariant to prevalence — the same pair transports across populations with different baseline rates, unlike PPV/NPV. Values of LR+ ≥ 10 or LR− ≤ 0.1 are conventionally regarded as large; LR+ ≈ 7.73 and LR− ≈ 0.074 approach those thresholds and represent a moderately strong diagnostic test.
(2) Practical interpretation. Reporting (LR+ 7.73, LR− 0.074) rather than PPV/NPV allows any reader to compute the post-test probability for their own study population using their own prevalence — no re-running of the validation is needed. In a community cohort with 2% baseline prevalence, LR+ 7.73 projects a post-test probability of ≈ 13.6% for a positive flag — still low because the pre-test odds are very small. In a high-risk subgroup at 50% prior probability, the same LR+ gives a post-test probability of ≈ 89%. This portability is the primary reason to report LRs alongside or instead of fixed PPV/NPV values in phenotyping validation studies.
Worked example
Scenario
A team validated a claims-based algorithm that flags incident heart failure (HF). They pulled 300 patients and charted each one against a trusted reference standard: 200 truly had HF and 100 truly did not. We want to compute the algorithm's sensitivity and specificity from this 2x2 table, then turn those into the positive and negative likelihood ratios.
Dataset
The 2x2 validation table an analyst would actually build: each patient's algorithm result (rows) cross-tabulated against the charted truth (columns). TP/FP/FN/TN are the four cell counts.
| algorithm_result | truth_HF_positive | truth_HF_negative |
|---|---|---|
| algorithm positive | 180 | 20 |
| algorithm negative | 20 | 80 |
Steps
Read the four cells: among the 200 true cases, 180 were flagged (TP) and 20 were missed (FN); among the 100 true non-cases, 20 were wrongly flagged (FP) and 80 were correctly cleared (TN).
Sensitivity = TP / (TP + FN) = 180 / (180 + 20) = 180 / 200 = 0.90.
Specificity = TN / (TN + FP) = 80 / (80 + 20) = 80 / 100 = 0.80.
Positive likelihood ratio uses the formula LR+ = sensitivity / (1 - specificity) = 0.90 / (1 - 0.80) = 0.90 / 0.20.
Negative likelihood ratio uses the formula LR- = (1 - sensitivity) / specificity = (1 - 0.90) / 0.80 = 0.10 / 0.80.
Result
LR+ = 0.90 / 0.20 = 4.5, so a positive flag is 4.5 times more likely in a true HF case than in a non-case. LR- = 0.10 / 0.80 = 0.125, so a negative flag is far more common in non-cases (1 / 0.125 = 8 times more likely in a non-case than in a case). The same pair (LR+ 4.5, LR- 0.125) can be applied to any cohort's pre-test probability without re-running the validation.
Runnable example
python implementation
Compute LR+ and LR- (with normal-approximation 95% CIs on the log scale) from a 2x2 validation table, and apply them to a pre-test probability via the odds form of Bayes' theorem to obtain the post-test probability (Deeks & Altman 2004). Inputs: cell counts...
import numpy as np
from scipy.stats import norm
def likelihood_ratios(tp: int, fp: int, fn: int, tn: int, conf: float = 0.95) -> dict:
sens = tp / (tp + fn)
spec = tn / (tn + fp)
lr_pos = sens / (1 - spec)
lr_neg = (1 - sens) / spec
z = norm.ppf(1 - (1 - conf) / 2)
# Simel (1991) log-scale standard errors for LR+ and LR-.
se_log_pos = np.sqrt((1 - sens) / (sens * (tp + fn)) + spec / ((1 - spec) * (tn + fp)))
se_log_neg = np.sqrt(sens / ((1 - sens) * (tp + fn)) + (1 - spec) / (spec * (tn + fp)))
ci_pos = (lr_pos * np.exp(-z * se_log_pos), lr_pos * np.exp(z * se_log_pos))
ci_neg = (lr_neg * np.exp(-z * se_log_neg), lr_neg * np.exp(z * se_log_neg))
return {"lr_pos": lr_pos, "lr_pos_ci": ci_pos, "lr_neg": lr_neg, "lr_neg_ci": ci_neg}
def post_test_prob(pretest_prob: float, lr: float) -> float:
# post-test odds = pre-test odds x LR; convert back to a probability.
pre_odds = pretest_prob / (1 - pretest_prob)
post_odds = pre_odds * lr
return post_odds / (1 + post_odds)
# Worked claims example: HF algorithm, then apply LR+ in two cohorts.
lr = likelihood_ratios(tp=261, fp=39, fn=18, tn=282)
print(f"LR+ = {lr['lr_pos']:.2f} (95% CI {lr['lr_pos_ci'][0]:.2f}-{lr['lr_pos_ci'][1]:.2f})")
print(f"LR- = {lr['lr_neg']:.3f} (95% CI {lr['lr_neg_ci'][0]:.3f}-{lr['lr_neg_ci'][1]:.3f})")
print(f"Post-test prob, enriched cohort (pre 0.20): {post_test_prob(0.20, lr['lr_pos']):.3f}") # ~0.659
print(f"Post-test prob, rare cohort (pre 0.02): {post_test_prob(0.02, lr['lr_pos']):.3f}") # ~0.136r implementation
Compute likelihood ratios from a 2x2 validation table with epiR::epi.tests() (returns LR+ and LR- with 95% CIs alongside sensitivity, specificity, and predictive values), then apply LR+ to a pre-test probability via the odds form of Bayes' theorem to get...
library(epiR)
# rows = algorithm (+/-), columns = truth (D+/D-).
tab <- as.table(matrix(c(261, 39, 18, 282), nrow = 2, byrow = TRUE,
dimnames = list(Algorithm = c("pos", "neg"),
Truth = c("Dpos", "Dneg"))))
res <- epi.tests(tab, conf.level = 0.95)
res$detail[res$detail$statistic %in% c("lr.pos", "lr.neg"), ] # LR+ and LR- with 95% CIs
# Apply LR+ to a pre-test probability: post-test odds = pre-test odds x LR.
post_test <- function(pre, lr) {
pre_odds <- pre / (1 - pre)
post_odds <- pre_odds * lr
post_odds / (1 + post_odds)
}
lr_pos <- res$detail$est[res$detail$statistic == "lr.pos"]
post_test(0.20, lr_pos) # enriched cohort ~ 0.659
post_test(0.02, lr_pos) # rare cohort ~ 0.136