Chapter 2

Chapter 2: The Statistics of Diagnostic Performance: From the Confusion Matrix to ROC-AUC

Every validation claim in WIA-BIO-004 is ultimately a statement about four counts. This chapter shows how those counts become sensitivity, specificity, predictive values, likelihood ratios and an ROC curve, how a cutoff is chosen, and how much uncertainty each number carries.

2.0 Why a Statistics Chapter Comes Second

Chapter 1 described what a biomarker is and why its data need a standard. Before we look at the WIA-BIO-004 record formats in Chapter 3, we need a precise vocabulary for the question that almost every record ultimately serves: how well does this measurement separate people who have the target condition from people who do not? The standard answers that question with a fixed set of metrics defined in its §4 (Statistical Validation Methods), §5.1 (Likelihood Ratios) and the formula summary of §10.3, and it demonstrates them with a worked example in Appendix A.1. The TypeScript SDK described in Chapter 4 implements the same metrics, and the validation-study record in Chapter 6 stores their results.

The metrics are simple arithmetic, but they are easy to misread. Sensitivity is not the probability that a positive patient has the disease; a high AUC does not tell you where to put the cutoff; and a predictive value computed in a case-control study does not transfer to a clinic with a different disease frequency. The chapter therefore pairs every formula with its interpretation and with the mistake it most commonly invites. All calculations are shown in full so that the reader can reproduce them with a pocket calculator, and so that the same numbers can later be used as test vectors (Chapter 8).

What you will be able to do after this chapter

2.1 The Confusion Matrix

Diagnostic-accuracy statistics start from a binary decision. A quantitative biomarker value becomes a test result only when it is compared with a cutoff: in WIA-BIO-004, as in the SDK, a value at or above the threshold is called positive. Each subject also has a true status, established by the reference standard (for example histology, a clinical follow-up outcome, or an accepted diagnostic criterion). Crossing the two binary variables produces four cells.

Reference standard: condition presentReference standard: condition absentRow total
Test positive (value ≥ cutoff)True positive (TP)False positive (FP)TP + FP
Test negative (value < cutoff)False negative (FN)True negative (TN)FN + TN
Column totalTP + FN (all diseased)FP + TN (all non-diseased)N

Two features of this layout matter throughout the chapter. First, the columns are defined by the truth and the rows by the test. Metrics that divide by a column total (sensitivity, specificity) describe the test's behaviour within a known group; metrics that divide by a row total (PPV, NPV) describe what a result means for the person who received it. Second, the column totals are fixed by study design. In a case-control study the investigator decides how many diseased and non-diseased subjects to enrol, so the ratio between the columns is an artefact of recruitment, not a property of the population.

2.1.1 Sensitivity

Sensitivity is the proportion of subjects with the condition whom the test calls positive: Sens = TP / (TP + FN). It is the true-positive rate. The standard's §4.1.1 example uses 85 diseased patients of whom 75 test positive and 10 test negative, giving 75 / 85 = 88.2 %. A test with high sensitivity rarely misses the condition, which is why sensitive tests are valued for ruling a diagnosis out: when such a test is negative, a missed case is unlikely.

2.1.2 Specificity

Specificity is the proportion of subjects without the condition whom the test calls negative: Spec = TN / (TN + FP). It is the true-negative rate, and 1 − Spec is the false-positive rate. In the §4.1.2 example, 95 of 100 healthy individuals test negative and 5 test positive, so Spec = 95 / 100 = 95.0 %. Highly specific tests are valued for ruling a diagnosis in, because a positive result from a test that rarely fires in healthy people is informative.

Note that the two §4.1 examples come from different illustrative groups (85 diseased, 100 healthy); they are not the two columns of one study, and they should not be combined into a single table without saying so. A validation report must always present sensitivity and specificity at the same cutoff on the same subjects, because each can be pushed towards 100 % at the other's expense simply by moving the threshold.

2.1.3 Accuracy and prevalence

Accuracy is the proportion of all subjects correctly classified: (TP + TN) / N. Prevalence in the study sample is (TP + FN) / N. Accuracy is a weighted average of sensitivity and specificity, with prevalence as the weight: Acc = Sens × p + Spec × (1 − p). This identity explains why accuracy alone is a poor summary. If prevalence is 1 %, a "test" that calls everybody negative is 99 % accurate while detecting nothing. WIA-BIO-004 lists accuracy in its formula set (§10.3) and in the performance report (§5.3.1), but it should always be reported next to sensitivity and specificity, never instead of them.

2.2 Predictive Values and the Role of Prevalence

A clinician holding a positive result wants to know the probability that the patient actually has the condition. That is the positive predictive value, PPV = TP / (TP + FP). Correspondingly, the negative predictive value is NPV = TN / (TN + FN), the probability that a negative patient is truly free of the condition. Both are row-wise proportions, so both depend on how many diseased and non-diseased people are in the rows, which is to say on prevalence.

2.2.1 Two ways to compute the same quantity

§4.1.3 of the standard gives PPV and NPV in two forms. The count form above is only meaningful when the study sample has the same prevalence as the population in which the test will be used, as in a consecutive-enrolment cohort. The Bayes form separates the properties of the test (Sens, Spec) from the property of the population (prevalence p) and therefore lets a result from a case-control study be re-expressed for any clinical setting:

PPV = Sens × p / [ Sens × p + (1 − Spec) × (1 − p) ]
NPV = Spec × (1 − p) / [ Spec × (1 − p) + (1 − Sens) × p ]

When the study sample was deliberately balanced (for example 50 cases and 50 controls), the count-based PPV silently assumes a prevalence of 50 %. Reporting such a PPV as if it applied to a screening population is one of the most frequent errors in biomarker papers. A WIA-BIO-004 report should therefore state the prevalence at which any predictive value was calculated. The SDK takes the second route explicitly: its validation function derives PPV and NPV from a prevalence parameter rather than from the counts, a design choice discussed in Chapter 4.

2.2.2 How far predictive values move

The table below keeps the test fixed at Sens = 84 % and Spec = 90 % (the operating point of the Appendix A.1 example, §2.7) and varies only the prevalence. These values are the same five prevalence scenarios (10, 20, 50, 70 and 90 %) that the SDK's sensitivity analysis uses by default. They were recomputed for this book from the Bayes form above.

Prevalence pPPVNPVAccuracy
10 %48.3 %98.1 %89.4 %
20 %67.7 %95.7 %88.8 %
50 %89.4 %84.9 %87.0 %
70 %95.1 %70.7 %85.8 %
90 %98.7 %38.5 %84.6 %

The same test, with unchanged sensitivity and specificity, gives a positive result that is right less than half the time at 10 % prevalence and almost always right at 90 %. NPV moves in the opposite direction, collapsing to 38.5 % when nine in ten tested people are diseased. Two practical conclusions follow. A biomarker intended for population screening, where prevalence is low, needs very high specificity for its positive results to be useful. And a biomarker intended to rule out disease in a high-risk referral clinic needs very high sensitivity, because the prior probability of disease is already high. Readers should also be aware that some published tables of this kind contain arithmetic slips; the values above can be regenerated with the two formulas in §2.2.1 and are used as test vectors in Chapter 8.

2.3 Likelihood Ratios

Predictive values mix test and population. Likelihood ratios keep them apart while still speaking the clinician's language of probabilities. The positive likelihood ratio is the ratio of the true-positive rate to the false-positive rate; the negative likelihood ratio is the ratio of the false-negative rate to the true-negative rate (§5.1):

LR+ = Sens / (1 − Spec)
LR− = (1 − Sens) / Spec

An LR+ of 8 means a positive result is eight times as likely in a diseased person as in a non-diseased one. Because LRs are built only from sensitivity and specificity, they are, like those two metrics, independent of prevalence in the Bayesian model (in practice both can still vary with disease spectrum, see Chapter 6).

2.3.1 From pre-test to post-test probability

Likelihood ratios act on odds, not on probabilities. The update rule is Bayes' theorem in odds form:

pre-test odds  = p / (1 − p)
post-test odds = pre-test odds × LR
post-test probability = post-test odds / (1 + post-test odds)

Example (Sens 84 %, Spec 90 % → LR+ = 8.4, LR− ≈ 0.178), pre-test probability 20 %:
  pre-test odds         = 0.20 / 0.80        = 0.25
  positive result: odds = 0.25 × 8.4         = 2.10   → probability 2.10 / 3.10 = 67.7 %
  negative result: odds = 0.25 × 0.178       = 0.0444 → probability ≈ 4.3 %

The positive post-test probability, 67.7 %, is exactly the PPV at 20 % prevalence in the table of §2.2.2, and 100 % − 4.3 % = 95.7 % is the NPV. This is not a coincidence: predictive values are post-test probabilities in which the "pre-test probability" is the prevalence. The advantage of the LR route is that a clinician can apply one published LR to an individual patient's own pre-test estimate, which may differ from the population average.

2.3.2 Interpretation bands

WIA-BIO-004 §5.1 attaches qualitative labels to ranges of LR values. They are rules of thumb widely used in evidence-based medicine rather than hard thresholds, and a report should always give the numeric LR as well.

LR+LR−Effect on disease probability (§5.1)
> 10< 0.1Large change (increase / decrease)
5 – 100.1 – 0.2Moderate change
2 – 50.2 – 0.5Small change
1 – 20.5 – 1Minimal change
= 1= 1No change

The README's performance-metric table sets aspirational targets of LR+ > 10 and LR− < 0.1, i.e. the "large change" band in both directions. Few single biomarkers reach both at the same cutoff; the Appendix A.1 example (LR+ 8.4, LR− 0.18) sits in the moderate band on both sides. A related single-number summary, the diagnostic odds ratio DOR = LR+ / LR− (47 for that example), is sometimes reported, but because it merges the two directions it hides whether a test is better at ruling in or ruling out, and it is not part of the standard's metric set.

2.4 Constructing the ROC Curve and Computing AUC

Everything so far depended on one cutoff. A quantitative biomarker, however, offers a whole family of cutoffs, and the receiver operating characteristic (ROC) curve displays all of them at once. §4.2.1 defines it: for every threshold t, compute TPR(t) = TP(t) / (TP(t) + FN(t)) and FPR(t) = FP(t) / (FP(t) + TN(t)), and plot the points (FPR(t), TPR(t)). Lowering the threshold moves the point up and to the right; the curve always runs from (0, 0), where nothing is called positive, to (1, 1), where everything is.

2.4.1 A small worked ROC

To keep the arithmetic visible, consider an illustrative data set of five cases and five controls (the values are invented for teaching and carry no clinical meaning):

Using every observed value as a threshold, from the highest downwards, and calling "value ≥ t" positive, gives the following operating points. The last two columns anticipate the cutoff rules of §2.5.

Threshold tTP / FNFP / TNTPR (Sens)FPR (1 − Spec)Youden JDistance to (0,1)
(above 82)0 / 50 / 50.00.00.01.000
821 / 40 / 50.20.00.20.800
762 / 30 / 50.40.00.40.600
713 / 20 / 50.60.00.60.400
693 / 21 / 40.60.20.40.447
644 / 11 / 40.80.20.60.283
585 / 01 / 41.00.20.80.200
555 / 02 / 31.00.40.60.400
505 / 03 / 21.00.60.40.600
475 / 04 / 11.00.80.20.800
405 / 05 / 01.01.00.01.000
t = 58, J = 0.8 False-positive rate (1 − Spec) True-positive rate (Sens) 0 1 0 1 chance (AUC 0.5)
Figure 2-1. ROC curve of the illustrative data set. The step curve (purple) is the empirical ROC; the dashed diagonal is a non-informative test. The green vertical segment is the Youden index J at the optimal threshold, the largest vertical distance between the curve and the diagonal.

2.4.2 Trapezoidal AUC

§4.2.2 computes the area under the curve with the trapezoidal rule, summing strips between consecutive points ordered by FPR:

AUC = Σ_i (FPR_{i+1} − FPR_i) × (TPR_{i+1} + TPR_i) / 2

Worked example (only strips where FPR changes contribute):
  FPR 0.0 → 0.2 at TPR 0.6 : 0.2 × (0.6 + 0.6) / 2 = 0.12
  FPR 0.2 → 0.4 at TPR 1.0 : 0.2 × (1.0 + 1.0) / 2 = 0.20
  FPR 0.4 → 0.6 at TPR 1.0 :                       0.20
  FPR 0.6 → 0.8 at TPR 1.0 :                       0.20
  FPR 0.8 → 1.0 at TPR 1.0 :                       0.20
  AUC = 0.12 + 0.20 × 4 = 0.92

Two implementation details matter. The curve must include both end points (0, 0) and (1, 1), or the area of the missing strips is silently lost; and when several subjects share the same value, the points must be generated per distinct value so that tied cases and controls form a diagonal segment rather than a staircase. An implementation that evaluates only a pre-chosen grid of thresholds is computing an approximation of this curve, and its AUC can differ from the exact empirical value; Chapter 4 shows where this matters for the SDK.

2.4.3 AUC as a ranking probability

The empirical AUC has a second, often more useful, meaning. It equals the probability that a randomly chosen case has a higher biomarker value than a randomly chosen control, counting ties as one half. This is the Mann-Whitney U statistic divided by the number of case-control pairs. In the example there are 5 × 5 = 25 pairs. The cases 82, 76 and 71 exceed all five controls (15 pairs); 64 and 58 each exceed four controls but not 69 (8 pairs). So 23 of 25 pairs are correctly ordered, and 23 / 25 = 0.92, the same value as the trapezoidal sum. The equivalence is exact whenever the ROC is built from every distinct value, and it gives a direct check on any AUC implementation.

The interpretation also shows what AUC does not say. It averages performance over all thresholds, including many that nobody would use clinically, and it is insensitive to calibration: multiplying every value by ten, or applying any other strictly increasing transformation, leaves the AUC unchanged. Two biomarkers with the same AUC can have very different sensitivities at the specificity a screening programme actually requires.

2.4.4 Interpretation bands

AUCLabel in WIA-BIO-004 §4.2.2Meaning as a ranking probability
1.0Perfect discriminationEvery case ranks above every control
0.90 – 0.99ExcellentAt least 9 of 10 case-control pairs correctly ordered
0.80 – 0.89Good8 to 9 of 10 pairs
0.70 – 0.79Fair7 to 8 of 10 pairs
0.50 – 0.69PoorBarely better than a coin toss
0.5Random (no discrimination)Ordering is independent of disease status

Other documents in the WIA-BIO-004 set use slightly different bands (the phase annex on quality metrics calls AUC above 0.8 "excellent", and the SDK's clinical-utility categories start at 0.60). The book uses the §4.2.2 bands of the main specification whenever it applies a label, and Chapter 5 collects all of the differing thresholds in one reconciliation table. An AUC below 0.5 does not mean the marker is useless: it means the direction of the rule is reversed, and "value ≤ t is positive" would give 1 − AUC. A validation record should state the direction explicitly.

2.5 Choosing a Cutoff

An ROC curve describes a biomarker; a cutoff turns it into a test. §4.2.3 of the standard names three rules. Whatever rule is used, it must be chosen before the data that will report final performance are examined, or else the reported sensitivity and specificity will be optimistic. In practice this means selecting the cutoff in a development set and reporting its performance in an independent validation set (Chapter 6).

2.5.1 Youden index

The Youden index, introduced by W. J. Youden in 1950, is J = Sens + Spec − 1 = TPR − FPR. Geometrically it is the vertical distance between the ROC point and the chance diagonal, and the optimal cutoff is the one that maximises it. In the example, J peaks at 0.8 for t = 58 (Sens 1.0, Spec 0.8). J weights a missed case and a false alarm equally as rates, which is equivalent to minimising the expected number of errors only when prevalence is 50 % and both error types cost the same. It is the default in the SDK because it needs no external information, which makes it a sensible, reproducible starting point for discovery and analytical work.

2.5.2 Closest to the top-left corner

The second rule minimises the Euclidean distance from the ROC point to the perfect classifier at (0, 1): d = √[(1 − Sens)² + (1 − Spec)²]. In the example it selects the same point (d = 0.200 at t = 58), which is typical for well-behaved curves, but the two rules can disagree when the curve is asymmetric. The distance criterion has no decision-theoretic justification; it is best regarded as a geometric heuristic and reported as such.

2.5.3 Expected-cost rule

The third rule makes the trade-off explicit by assigning a cost to each error type. The standard writes it with counts and prevalence together (Cost = CFN × FN × Prevalence + CFP × FP × (1 − Prevalence)). Written consistently in terms of rates, the expected cost per tested person is

E[cost](t) = C_FN × (1 − Sens(t)) × p + C_FP × (1 − Spec(t)) × (1 − p)

Illustrative example: p = 0.5, a false positive costs four times a false negative
(C_FP = 4, C_FN = 1), same five-case / five-control data:
  t = 58 : 1 × 0.0 × 0.5 + 4 × 0.2 × 0.5 = 0.40
  t = 64 : 1 × 0.2 × 0.5 + 4 × 0.2 × 0.5 = 0.50
  t = 71 : 1 × 0.4 × 0.5 + 4 × 0.0 × 0.5 = 0.20   ← minimum
  t = 76 : 1 × 0.6 × 0.5 + 4 × 0.0 × 0.5 = 0.30

With costly false positives the preferred cutoff moves from 58 to 71, trading 40 % of the sensitivity for perfect specificity. The costs here are invented to show the mechanics; in a real application they come from the clinical consequences of each error (an unnecessary biopsy, a delayed treatment) and should be documented in the validation study together with the prevalence assumed.

2.5.4 When not to use Youden

Youden's J is a poor choice whenever the intended use is asymmetric. A screening or rule-out test should be tuned to a minimum sensitivity (for example "the highest specificity at which sensitivity is at least 95 %"), because a missed case is the error that matters. A rule-in or confirmatory test should be tuned the other way, to a minimum specificity. The SDK's sensitivity analysis reports exactly these two thresholds (the cutoffs that achieve 90 % sensitivity and 90 % specificity), and Chapter 4 shows how to read them. Whichever rule is chosen, the WIA-BIO-004 validation record should name it; a cutoff without a stated selection rule cannot be audited.

RuleCriterionNeeds external inputTypical use
Youden indexmax (Sens + Spec − 1)NoneDiscovery, symmetric problems, SDK default
Closest to (0,1)min √[(1 − Sens)² + (1 − Spec)²]NoneGeometric heuristic, sensitivity check
Expected costmin CFN(1 − Sens)p + CFP(1 − Spec)(1 − p)Costs and target prevalenceDecision-oriented applications
Fixed-sensitivity / fixed-specificitybest Spec at Sens ≥ target (or vice versa)A clinical targetScreening (rule-out) or confirmatory (rule-in) tests

2.6 Uncertainty and Comparison

Every metric in this chapter is an estimate from a finite sample and must be reported with its uncertainty. The WIA-BIO-004 performance report (§5.3.1) accordingly carries 95 % confidence intervals for AUC, sensitivity and specificity.

2.6.1 Standard error of the AUC (Hanley and McNeil)

§10.3 adopts the approximation published by J. A. Hanley and B. J. McNeil in Radiology (1982). With n₁ diseased and n₀ non-diseased subjects:

Q1 = AUC / (2 − AUC)
Q2 = 2 × AUC² / (1 + AUC)
SE(AUC) = √{ [ AUC(1 − AUC) + (n₁ − 1)(Q1 − AUC²) + (n₀ − 1)(Q2 − AUC²) ] / (n₁ × n₀) }
95 % CI ≈ AUC ± 1.96 × SE(AUC)

Q1 is the probability that two randomly chosen cases both rank above one control, and Q2 that one case ranks above two controls; the closed forms above come from assuming the ratings follow an exponential-type distribution. The approximation is quick and adequate for planning, but it is not the same as the nonparametric variance used by the DeLong method, and it can be inaccurate for small samples or AUC close to 1. The normal-approximation interval can also exceed 1, in which case it should be truncated or replaced by a method that respects the [0, 1] range, such as a logit-transformed interval or a bootstrap. For a 99 % interval the multiplier is 2.576 instead of 1.96.

2.6.2 Comparing two correlated AUCs (DeLong)

When two biomarkers, or a biomarker and a combined score, are measured on the same subjects, their AUCs are correlated, and comparing their confidence intervals by eye is not a valid test. §4.3.1 specifies the test of E. R. DeLong, D. M. DeLong and D. L. Clarke-Pearson (Biometrics, 1988). It is built from "structural components": for each case i, V₁₀(i) is the fraction of controls it outranks (ties counting ½); for each control j, V₀₁(j) is the fraction of cases that outrank it. The AUC is the mean of either set of components, and its variance is estimated as

Var(AUC) = S₁₀ / n₁ + S₀₁ / n₀        (S = sample variance of the components)

For markers A and B on the same subjects:
Var(AUC_A − AUC_B) = Var(AUC_A) + Var(AUC_B) − 2 Cov(AUC_A, AUC_B)
Z = (AUC_A − AUC_B) / √Var(AUC_A − AUC_B)      → compare with N(0, 1)

The covariance term is computed the same way from the paired components of the two markers. Because it is usually positive, ignoring it overstates the variance and makes real differences look non-significant. The test is two-sided by default, and the standard treats p < 0.05 as evidence of a difference. As Chapter 4 explains, the v1.0 SDK computes the Hanley-McNeil interval and does not implement the DeLong test, so a comparison of two markers currently requires a separate statistical package.

2.6.3 Intervals for sensitivity and specificity

Sensitivity and specificity are binomial proportions, and their intervals are computed on the column totals: n₁ for sensitivity and n₀ for specificity. The simple Wald interval p̂ ± 1.96 √[p̂(1 − p̂)/n] is widely taught but behaves poorly near 0 or 1 and with small n; it can even exceed 100 %. The Wilson score interval, or the exact Clopper-Pearson interval, is preferred and should be named in the report. For the Appendix A.1 counts:

MetricEstimateWald 95 % CIWilson 95 % CI
Sensitivity (42 / 50)84.0 %73.8 – 94.2 %71.5 – 91.7 %
Specificity (45 / 50)90.0 %81.7 – 98.3 %78.6 – 95.7 %

The Wilson interval is asymmetric, pulled towards 50 %, which reflects the fact that an estimate close to 100 % can only err in one direction. With 50 subjects per group the intervals are about ±10 percentage points wide, far too wide to support a claim such as "sensitivity above 90 %". That observation is the starting point for the sample-size planning of Chapter 6.

2.7 An End-to-End Worked Example

Appendix A.1 of the standard ties the chapter together. It describes a balanced study with 50 diseased patients and 50 healthy controls, and reports the confusion matrix at a threshold of 75 (values ≥ 75 are positive). The individual measurements are not listed in the appendix, so the calculation below starts from the stated counts. Every derived number has been recomputed for this book.

Study: 50 cases, 50 controls (sample prevalence 0.50), cutoff = 75, "value ≥ 75" = positive

Confusion matrix            cases   controls
  test positive              TP 42     FP 5
  test negative              FN 8      TN 45

Sensitivity  = 42 / (42 + 8)          = 0.840  → 84.0 %
Specificity  = 45 / (45 + 5)          = 0.900  → 90.0 %
PPV (counts) = 42 / (42 + 5)          = 0.894  → 89.4 %   (valid only at prevalence 0.50)
NPV (counts) = 45 / (45 + 8)          = 0.849  → 84.9 %   (valid only at prevalence 0.50)
Accuracy     = (42 + 45) / 100        = 0.870  → 87.0 %
LR+          = 0.84 / (1 − 0.90)      = 8.4
LR−          = (1 − 0.84) / 0.90      = 0.178  → 0.18
Youden J     = 0.84 + 0.90 − 1        = 0.74

AUC reported by the standard: 0.91
Hanley-McNeil check (n₁ = n₀ = 50):
  Q1 = 0.91 / 1.09          = 0.8349
  Q2 = 2 × 0.8281 / 1.91    = 0.8671
  SE = √{[0.0819 + 49 × 0.0068 + 49 × 0.0390] / 2500} ≈ 0.0305
  95 % CI = 0.91 ± 1.96 × 0.0305 ≈ 0.85 – 0.97

The recomputed interval agrees with the 0.85–0.97 given in the appendix, which is consistent with the appendix having used the Hanley-McNeil formula of §10.3. Reading the result as a reviewer would, several points stand out. The AUC of 0.91 falls in the "excellent" band, but the chosen cutoff of 75 is only one point on the curve and nothing in the appendix says how it was selected; a complete record would name the rule (§2.5). The count-based PPV of 89.4 % holds only because the study was balanced; at a clinical prevalence of 10 % the same operating point gives a PPV of 48.3 % (§2.2.2). The likelihood ratios place the test in the moderate band in both directions, short of the README's aspirational targets of LR+ > 10 and LR− < 0.1. And the Wilson intervals of §2.6.3 show that with 50 subjects per group the sensitivity could plausibly be anywhere from about 72 % to 92 %.

None of these observations makes the example wrong; they show what a statistically complete report must contain. The table below summarises the formulas used in this chapter in the form in which the later chapters, the SDK and the conformance tests refer to them.

MetricFormulaWhat it answersDepends on prevalence?
Sensitivity (TPR)TP / (TP + FN)Of those with the condition, how many are detected?No (but on spectrum)
Specificity (TNR)TN / (TN + FP)Of those without it, how many are cleared?No (but on spectrum)
Accuracy(TP + TN) / NWhat fraction is classified correctly overall?Yes
PPVTP / (TP + FP), or Bayes formGiven a positive result, how likely is the condition?Yes, strongly
NPVTN / (TN + FN), or Bayes formGiven a negative result, how likely is its absence?Yes, strongly
LR+Sens / (1 − Spec)By how much does a positive result multiply the odds?No
LR−(1 − Sens) / SpecBy how much does a negative result multiply the odds?No
Youden JSens + Spec − 1How far is this cutoff above chance?No
AUCΣ trapezoids = P(case > control)How well does the marker rank cases above controls across all cutoffs?No
SE(AUC)Hanley-McNeil, §2.6.1How precise is the AUC estimate?Depends on n₁ and n₀

Reporting checklist for diagnostic-performance results

Chapter Summary

Diagnostic-performance statistics all descend from the four cells of the confusion matrix. Sensitivity and specificity describe the test within known groups and do not depend on prevalence; predictive values describe what a result means for the person tested and depend strongly on prevalence, which is why they must be recalculated for the intended setting rather than read off a balanced study. Likelihood ratios bridge the two by acting on each patient's pre-test odds. The ROC curve shows the whole range of trade-offs, the AUC summarises it as the probability that a case outranks a control, and a cutoff is a separate, documented decision made with Youden's index, a distance criterion, an explicit cost model or a fixed clinical target. Finally, every estimate needs an interval, and correlated AUCs need a paired test.

Chapter 3 turns from the arithmetic to the containers: the WIA-BIO-004 JSON records in which measurements, reference ranges and the results of these calculations are stored and exchanged. Sample-size planning, which builds directly on the intervals of §2.6, is deferred to Chapter 6.

Review Questions

  1. A study enrols 200 cases and 200 controls and reports a PPV of 92 %. Why can this figure not be quoted for a screening programme, and what additional information is needed to recompute it?
  2. Using Sens 84 % and Spec 90 %, compute the post-test probability after a positive result for a patient whose pre-test probability is 5 %. Compare it with the PPV at 10 % prevalence.
  3. Add a sixth control with value 80 to the illustrative data set of §2.4.1. Recompute the AUC both by the trapezoidal rule and by counting case-control pairs, and check that they agree.
  4. For a rule-out test in an emergency department, which cutoff rule would you choose and why? What would you record in the validation study to make the choice auditable?
  5. Two markers measured on the same 150 patients have AUCs of 0.82 and 0.86 with overlapping 95 % CIs. Explain why overlapping intervals do not settle the question and which test should be used.
  6. Why is the Wilson interval preferred to the Wald interval for a sensitivity of 48 / 50? Estimate the upper limit given by each and comment on the result.