Screening and Diagnostic Tests

How the accuracy of a medical test is measured and what a result means for the person tested. Sensitivity and specificity against a reference standard, with their intervals and the spectrum and verification biases that distort them; predictive values from Bayes' theorem and their dependence on prevalence; likelihood ratios, pre-test and post-test odds and Fagan's nomogram; and ROC curves, the area under them as a Mann-Whitney probability, and the choice of a cut-off by Youden's index or by expected cost. Worked on HbA1c as a screen for undiagnosed diabetes, defined by fasting glucose, in NHANES adults.

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. Is it a good test? For whom, and at what threshold? And when it is positive, how likely is the patient to have the condition?

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:

  1. 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.
  2. Then, the reverse conditioning, which is what the patient needs, and its strong dependence on how common the condition is.
  3. Next, a single number per test result that updates the odds of disease by one multiplication.
  4. 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

  1. Sensitivity and Specificity: how well does one measurement detect a condition defined by another? 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, or studies that verify only the positive results, overstate accuracy.
  2. Predictive Values and Bayes' Theorem: when the test is positive, how likely is the condition? 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.
  3. Likelihood Ratios for Diagnostic Tests: how much does one result change the odds, 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.
  4. ROC Curves for Diagnostic Tests: how well does a measurement separate the two groups over every cut-off, and which cut-off should be used? 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. 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.

This unit builds on the previous one and points to several later ones.

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 · 3 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 · 45 pages
  • Pagano, M., Gauvreau, K., and Mattie, H. (2022). Principles of Biostatistics (3rd ed.). CRC Press. The course text. record · 35 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