The National Health and Nutrition Examination Survey (NHANES) of 2017 to 2018 examined adults who had never been told they had diabetes. About one in seventeen of them had a fasting blood glucose in the diabetic range. A screening program wants to find such people with a simple blood test. HbA1c, the share of hemoglobin carrying glucose, needs no fasting, and the American Diabetes Association accepts it for diagnosis. At its diagnostic threshold of 6.5%, it is positive in fewer than half of the adults whose fasting glucose is diabetic. It is also positive in about one adult in seventy-five whose fasting glucose is below that range. Whether that makes it a good test depends on its purpose: it is a poor screen and a reasonable confirmatory test. Its best threshold depends on how common the condition is and on what each kind of error costs. And when it is positive in these adults, the patient has the condition about two times in three.
A diagnostic test is a classifier with medical consequences. This unit measures how good the classifier is, and then turns its accuracy into statements about patients. It builds on the previous unit, Probability: every measure here is a conditional probability, and Bayes' theorem connects them.
The unit runs in four steps:
- First, the two basic measures of accuracy, which condition on the true state, and the question of what the "true state" is when it is itself defined by a measurement.
- Then, the reverse conditioning, which is what the patient needs, and its strong dependence on how common the condition is.
- Next, a single number per test result that updates the odds of disease by one multiplication.
- Finally, every threshold at once, the area under the resulting curve, and how to choose the threshold.
The examples use one population throughout: 1,975 nonpregnant adults in NHANES 2017 to 2018. Each met the fasting requirement, had both an HbA1c and a fasting plasma glucose measured, and had no diabetes diagnosis. The reference standard is a fasting plasma glucose of 126 mg/dL or more, the American Diabetes Association's criterion, applied to a single measurement. The articles are explicit that this is a definition, not an independent fact about each patient, and that a clinical diagnosis requires confirmation. Body mass index and age serve as two weaker screens for comparison. As in the other units, the survey's sampling weights are not used, so the figures describe these adults rather than the U.S. population. Every number comes from a script in the site's repository.
Articles
- Sensitivity and Specificity: how well one measurement detects a condition defined by another is measured by two conditional probabilities, one within the people who have the condition and one within those who do not. Index test, target condition and reference standard, and what changes when the reference standard is a definition. The 2 by 2 table, sensitivity and specificity as $P(T^+ \mid D)$ and $P(T^- \mid D^c)$, and why accuracy misleads. The same table read with each test as the reference, which makes the other test look like the one that misses cases. Wald and Wilson intervals and the number of cases a study needs. Sensitivity by age and by severity. Spectrum bias in a simulated case-control design, and verification bias with the Begg–Greenes correction, checked by simulation: studies of severe cases and healthy controls overstate both measures, and studies that verify mostly the positive results overstate sensitivity and understate specificity. Four worked problems.
- Predictive Values and Bayes' Theorem: how likely the condition is after a positive result depends on the test and, strongly, on how common the condition is. Positive and negative predictive values from the table and from Bayes' theorem, and natural frequencies. Predictive values at prevalences from 0.5% to 50%, and base-rate neglect. The same test that is right two times in three in NHANES would be right one time in seven where the condition is rare. A check of the theorem's predictions in three age groups, and why they miss when specificity varies. Why a case-control study cannot estimate predictive values. Apparent prevalence and the Rogan–Gladen correction, and the arithmetic of confirmatory testing. Four worked problems.
- Likelihood Ratios for Diagnostic Tests: one result multiplies the odds of the condition by the same factor, whatever the patient's starting point. Positive and negative likelihood ratios, and Bayes' theorem in odds form, proved and checked by age group. The log-odds scale and the construction of Fagan's nomogram. Confidence intervals as for a risk ratio, and the diagnostic odds ratio. Likelihood ratios for HbA1c bands instead of one cut-off. Combining HbA1c with BMI, where the product of likelihood ratios overstates the evidence because the tests are not conditionally independent. Four worked problems.
- ROC Curves for Diagnostic Tests: the area under the ROC curve measures how well a measurement separates the two groups over every cut-off, and the cut-off to use depends on prevalence and costs. The empirical ROC curve with tied results. The AUC as $P(X > Y) + \tfrac12 P(X = Y)$, proved, and as the Mann–Whitney $U$. A single cut-off as a curve, and Youden's index. The variance of the AUC derived, and standard errors by Hanley and McNeil, by DeLong's method and by the bootstrap. Comparing HbA1c, BMI and age on the same adults with correlated AUCs. The slope of the curve as a likelihood ratio, and cut-offs chosen by expected cost with iso-cost lines, which show how the best threshold depends on prevalence and on the costs of the two errors. Four worked problems.
Related topics
This unit builds on the previous one and points to several later ones.
- Sensitivity, specificity and the predictive values are conditional probabilities. Bayes' theorem, which connects them, is introduced in Conditional Probability and the Law of Total Probability.
- The likelihood ratio and the diagnostic odds ratio take their intervals from Intervals and Adjustment for Relative Risks and Odds Ratios. The result of Relative Risk and the Odds Ratio that a case-control study cannot estimate risk has a counterpart here for predictive values.
- Every accuracy measure is a proportion, and its interval comes from Confidence Intervals for a Proportion.
- The area under the ROC curve is the statistic of The Wilcoxon Rank-Sum Test.
- The same measures appear outside medicine under other names. The library's Binary Classification Metrics treats the confusion matrix, ROC curves and calibration for machine-learning classifiers. The Academics section's Evaluating Classifiers treats precision and recall for text classification, where sensitivity is called recall and the positive predictive value precision.
- The next unit, Theoretical Probability Distributions, moves from single events to random variables. It begins with Random Variables, Expectation and Variance, which defines them, and goes on to The Binomial Distribution, the distribution of a count of successes in a fixed number of independent trials.
References
- American Diabetes Association Professional Practice Committee (2025). 2. Diagnosis and classification of diabetes: Standards of Care in Diabetes–2025. Diabetes Care, 48(Suppl. 1), S27–S49. https://doi.org/10.2337/dc25-S002 record · 7 pages
- Deeks, J. J., and Altman, D. G. (2004). Diagnostic tests 4: Likelihood ratios. BMJ, 329(7458), 168–169. record · 2 pages
- Hanley, J. A., and McNeil, B. J. (1982). The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology, 143(1), 29–36. record · 3 pages
- National Center for Health Statistics (2020). National Health and Nutrition Examination Survey 2017–2018: DEMO_J, DIQ_J, BMX_J, GLU_J and GHB_J data files. Centers for Disease Control and Prevention. https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx?BeginYear=2017 record · 109 pages
- Pagano, M., Gauvreau, K., and Mattie, H. (2022). Principles of Biostatistics (3rd ed.). CRC Press. The course text. record · 48 pages
- Ransohoff, D. F., and Feinstein, A. R. (1978). Problems of spectrum and bias in evaluating the efficacy of diagnostic tests. New England Journal of Medicine, 299(17), 926–930. record · 2 pages
Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 19 Nov 2026 · 7 revisions