Statistics tutorial · Chapter 10
Method comparison and ROC curves
This chapter presents two analyses that evaluate a measurement method rather than an effect: Bland-Altman Agreement, which describes the agreement between two methods measuring the same quantity in the same subjects, and ROC Curve, which describes how well a quantitative test distinguishes diseased from non-diseased subjects. Both are in Analysis › Compare Groups and use a One factor table (chapter 03). General notions (confidence interval, P value, multiple comparisons) are covered in chapter 10; the choice of an analysis, in chapter 11. The ROC curve of a logistic regression model, built on predicted probabilities, is covered in chapter 16.
Bland-Altman Agreement#
When a new measurement method (portable device, cheaper assay, imaging-based estimate) is meant to replace an established one, the question is not whether the two methods are related, but whether they give values close enough to be used interchangeably. The Bland-Altman analysis studies the differences between methods in each subject: their mean, the bias, tells whether one method gives higher values than the other on average; the limits of agreement, bias ± 1.96 standard deviations of the differences, enclose about 95% of the differences expected in a new subject. The plot of the differences against the mean of the two methods shows whether the discrepancy depends on the level measured.
When to use it#
- Two methods measure the same quantity, in the same unit, in the same subjects or samples (two devices, two laboratories, a reference method and a simplified method), and you want to know whether their differences stay within a practically acceptable range.
- The same plot describes the repeatability of a method (two measurements per subject, expected bias of zero).
- Not for a calibration, which relates a signal to known concentrations (Standard Curve Interpolation, chapter 17).
- Deming regression (chapter 16) completes the analysis by describing the linear relationship between the methods (constant and proportional differences).
Agreement and correlation#
Correlation and its test are often presented, wrongly, as proof of agreement (Bland and Altman, 1986):
- r measures the strength of a linear relationship, not the equality of values: if B is always twice A, r = 1 although no value agrees. A constant or proportional bias does not change r.
- r increases with the range of values studied, even though the differences between methods do not change.
- The test of r = 0 is pointless: two methods measuring the same quantity are bound to be related.
- In the worked example, r = 0.94 (P < 0.0001), yet the two devices can differ by more than 70 l/min in the same subject.
Likewise, an ordinary regression slope of B on A different from 1 does not prove a proportional bias: the measurement error of A attenuates the slope (chapter 16). A plot of B against A (XY table) is judged against the line of identity (Format › Y = X Line), not the regression line.
Assumptions and checks#
- Paired measurements, independent subjects: one pair of measurements per subject, taken close enough in time that the quantity has not changed. Several pairs from the same subject are not independent and distort the limits; Bland and Altman (1999) describe suitable methods, which Variance does not offer.
- Subjects representative of the range of values encountered in practice: the limits only hold within that range.
- Constant bias (no proportional bias): no trend in the scatter; slope of the regression of the differences on the means close to 0 (⊞ "Difference vs. average" tab, Analyze These Results, then Simple Linear Regression). If the two methods do not have the same precision, a slope can appear without any true proportional bias; Deming regression helps to decide.
- Constant spread: a scatter that fans out as the mean increases makes the limits too wide for small values and too narrow for large ones; in that case work on the ratio, the percentage or, better, the logarithms (see Calculations).
- Differences approximately normally distributed, so that bias ± 1.96 s contains about 95% of the differences: the paired t test on the same columns (chapter 14) gives, in its "Residuals" tab, normality tests and the QQ plot of the centered differences.
- Repeatability: two methods cannot agree better than each does with itself; two measurements per subject and per method make it possible to know this limit.
Step by step in Variance#
- Create a One factor table: one column per method, one row per subject. A row where one of the two values is missing is ignored.
- Choose Analysis › Compare Groups › Bland-Altman Agreement (or the Analyze button on the ribbon).
- Options tab of the "Bland-Altman Agreement – settings" window:
- "Method A" and "Method B": the two columns to compare (by default, the first two columns checked in the "Data sets" tab);
- "Calculate": "A − B against the mean of A and B" (default), "B − A against the mean of A and B", "A / B against the mean of A and B" or "
100 × (A − B) / mean, against the mean"; - "Limits of agreement (%)" (95 by default, from 50 to 99.99): proportion of the differences expected between the limits, bias ± z·s with z = 1.96 for 95%;
- "Confidence level (%)" (95 by default): level of the confidence intervals of the bias and of the two limits;
- "Significant digits" and "P value format" (not applicable: the analysis gives no P).
- Data sets tab, then OK. With fewer than two complete pairs, the analysis stops ("Bland-Altman needs at least two pairs").
- Variance creates the results sheet and an XY graph (points) of the "Difference vs. average" output table, with the bias line (solid) and the two limits of agreement (dashed), from one edge of the means to the other. Format Graph presents them like fitted curves: color, thickness, style, display. A new graph of this table (New Graph, "Include the fitted curves" box) includes them too.
Calculations#
For each subject i (i = 1 … n complete pairs):
mean mi = (Ai + Bi) / 2
difference di = Ai − Bi "A − B against the mean of A and B"
di = Bi − Ai "B − A against the mean of A and B"
di = Ai / Bi "A / B against the mean of A and B"
di = 100 · (Ai − Bi) / mi "100 × (A − B) / mean, against the mean"
bias d̄ = Σ di / n
SD s = √[ Σ (di − d̄)² / (n − 1) ]
limits of agreement: d̄ − z · s and d̄ + z · s
z = quantile of order (1 + L)/2 of the normal distribution, L = "Limits of agreement (%)"
(z = 1.96 for L = 95%)
The ratio and the percentage are suitable when the discrepancy between methods grows with the value measured. For the ratio, Variance follows Bland and Altman (1999): the calculations are done on the logarithms ln(Ai/Bi), then the bias and the limits (and their intervals) are brought back to the ratio scale by the exponential. The bias is then the geometric mean of the A/B ratios, and the limits are ratios (from x% lower to y% higher), asymmetric around the bias. A ratio that is not positive (a zero or negative value) has no logarithm: the pair is dropped and counted. The percentage is analyzed as is (arithmetic mean of the percentages).
Confidence intervals (Bland and Altman, 1986 and 1999; t is the quantile of order (1 + C)/2 of the Student distribution with n − 1 degrees of freedom, C = "Confidence level (%)", 0.975 for 95%):
CI of the bias d̄ ± t · s / √n
standard error of a limit SE = s · √( 1/n + z² / (2 (n − 1)) ) (≈ s · √(3/n) for z = 1.96)
CI of a limit (d̄ ± z · s) ± t · SE
The interval of the bias is also that of the paired t test (chapter 14, "95% CI" row under "Mean of differences (B - A)", which refers to B − A). The P of this test matters little: a nonsignificant bias does not prove agreement, and a significant but small bias can be inconsequential, or corrected by subtracting it.
Reading the results#
- "Bias & Agreement" tab ("Value" column):
- "Bias": the mean d̄ of the differences (or of the percentages); with the ratio, "Bias (geometric mean ratio)", the geometric mean of the A/B ratios. With "Difference (A - B)", a negative bias means that A gives lower values than B on average.
- "SD of bias": the standard deviation s of the differences (with the ratio, "SD of ln(ratio)", that of the logarithms). Despite its label, it is not the standard error of the bias (s/√n).
- "95% CI of bias": the confidence interval of the bias.
- "95% Limits of Agreement": d̄ − z s "to" d̄ + z s; the difference between methods should fall between these bounds in about 95% of subjects similar to those of the study (the percentage follows the "Limits of agreement (%)" option).
- "95% CI of lower limit" and "95% CI of upper limit": the confidence intervals of the two limits.
- "Number of pairs": number of rows where both values are present.
- "Difference vs. average" output table: X = "Average" (mean of the two methods), Y = "Difference", "Ratio" or "% Difference" depending on the option.
Variance does not draw the conclusion for you. Compare the limits of agreement, and preferably the outer bounds of their confidence intervals, with the maximum acceptable difference set before the study on clinical or analytical grounds. If the limits stay within that range, the methods can be used interchangeably; otherwise, they cannot, whatever r or the P of a test.
Worked example#
Bland and Altman (1986) measured the peak expiratory flow rate (l/min) of 17 subjects with a Wright peak flow meter and a mini Wright peak flow meter. Enter the first measurement of each device in a One factor table (column A "Wright", column B "Mini Wright"; the mean and the difference are computed by the analysis):
Subject Wright Mini Wright Mean A − B
1 494 512 503.0 −18
2 395 430 412.5 −35
3 516 520 518.0 −4
4 434 428 431.0 6
5 476 500 488.0 −24
6 557 600 578.5 −43
7 413 364 388.5 49
8 442 380 411.0 62
9 650 658 654.0 −8
10 433 445 439.0 −12
11 417 432 424.5 −15
12 656 626 641.0 30
13 267 260 263.5 7
14 478 477 477.5 1
15 178 259 218.5 −81
16 423 350 386.5 73
17 427 451 439.0 −24
With the default options, Variance displays:
Bias & Agreement Value
Bias -2.118
SD of bias 38.77
95% CI of bias -22.05 to 17.81
95% Limits of Agreement -78.1 to 73.86
95% CI of lower limit -112.9 to -43.34
95% CI of upper limit 39.1 to 108.6
Number of pairs 17
By hand (t at 16 df = 2.120; Variance takes z = 1.95996, hence small differences beyond the fourth decimal):
Σ di = −36 d̄ = −36 / 17 = −2.118 l/min
Σ (di − d̄)² = 24,043.8 s² = 24,043.8 / 16 = 1,502.7 s = 38.77 l/min
1.96 · s = 75.98 limits: −2.118 − 75.98 = −78.10 and −2.118 + 75.98 = 73.86
bias: s/√n = 38.77 / √17 = 9.402 95% CI = −2.118 ± 2.120 × 9.402 = −22.05 to 17.81
limits: SE = 38.77 × √(1/17 + 1.96²/32) = 38.77 × 0.4229 = 16.40 t · SE = 34.76
lower limit −78.10: 95% CI −112.9 to −43.3
upper limit 73.86: 95% CI 39.1 to 108.6
The paired t test on the same columns recovers the interval of the bias up to the sign ("Mean of differences (B - A)" 2.118, "95% CI" -17.81 to 22.05) and does not reject the normality of the differences ("Residuals" tab, Shapiro-Wilk, P = 0.5931). The regression of the differences on the means gives a slope of 0.02869 (95% CI -0.1593 to 0.2167, P = 0.7495): no detectable proportional bias.
Interpretation. The bias is negligible (−2.1 l/min, 95% CI −22.0 to 17.8), but in a given subject the mini meter can read up to 78 l/min higher or 74 l/min lower than the large one, and the intervals of the limits extend to −113 and +109 l/min. Only subject 15 (−81) falls outside the limits. Yet r = 0.94 (P < 0.0001, Correlation analysis): the correlation is strong, the agreement poor. With an acceptable difference of ± 50 l/min set before the study (a value chosen for the example), the devices are not interchangeable.
With "A / B against the mean of A and B", Variance works on the logarithms: the mean of ln(A/B) is −0.01178 and their standard deviation 0.1219, hence "Bias (geometric mean ratio)" 0.9883 (= exp(−0.01178)), "95% CI of bias" 0.9283 to 1.052 and "95% Limits of Agreement" 0.7783 to 1.255 (exp(−0.01178 ± 1.96 × 0.1219)): the Wright/Mini Wright ratio has a geometric mean of 0.988, and in a given subject it ranges from 22% lower to 25% higher. The limits have intervals 0.6977 to 0.8681 and 1.125 to 1.4.
Reporting the results#
"In 17 subjects, peak expiratory flow rate measured with the Wright peak flow meter differed on average by −2.1 l/min from that of the mini meter (Wright − mini; 95% CI −22.0 to 17.8). The 95% limits of agreement ranged from −78.1 l/min (95% CI −112.9 to −43.3) to 73.9 l/min (95% CI 39.1 to 108.6), with no apparent proportional bias. As these limits exceeded the ± 50 l/min difference judged acceptable before the study, the two devices cannot be used interchangeably."
Common pitfalls#
- Concluding agreement from r or its P (see "Agreement and correlation").
- Setting the acceptable difference after seeing the results: it is decided in the protocol.
- Forgetting the imprecision of the limits: their 95% CI is about ± 0.90 s with 17 subjects, ± 0.49 s with 50 and ± 0.34 s with 100.
- Ignoring a proportional bias or an increasing spread: constant limits then describe no particular level of measurement; look at the plot before the numbers.
- Confusing the absence of a significant bias with agreement (see Calculations).
- Counting several measurements of one subject as different subjects: the limits and their precision are distorted.
- Plotting the differences against only one of the methods, even a reference one: the difference contains the error of that method, hence a spurious trend (Bland and Altman, 1995). Variance rightly uses the mean of the two.
- Non-positive ratio: with "A / B against the mean of A and B", a zero or negative value makes the ratio (or its logarithm) undefined, likewise a zero mean with the percentage: the pair is dropped, and the "Pairs left out" row gives their number.
ROC Curve#
A quantitative diagnostic test (assay of a marker, score) declares a subject positive when their value exceeds a cutoff. Each cutoff has its sensitivity (proportion of diseased subjects declared positive) and its specificity (proportion of non-diseased subjects declared negative); lowering the cutoff increases the former and decreases the latter. The ROC ("receiver operating characteristic") curve plots sensitivity against 1 − specificity for all possible cutoffs; its area summarizes the ability of the test to separate the two populations. Variance computes the curve, its area (with standard error, confidence interval and P) and, for each cutoff, the sensitivity, the specificity and the likelihood ratio.
When to use it#
- Evaluate a continuous or ordinal marker that must distinguish two states known from a reference method: diseased and non-diseased, responders and non-responders.
- Describe all the trade-offs between sensitivity and specificity before choosing a cutoff.
- For a score that combines several variables, use logistic regression, which gives its own ROC curve (chapter 16); for a test that is already binary, a 2 × 2 contingency table gives sensitivity, specificity and predictive values (chapter 15).
Sensitivity, specificity, predictive values#
For a cutoff c, a subject is declared positive if their value is > c:
patients (diseased) controls (non-diseased)
test positive (> c) TP true positives FP false positives
test negative (≤ c) FN false negatives TN true negatives
sensitivity Se = TP / (TP + FN) specificity Sp = TN / (TN + FP)
likelihood ratios LR+ = Se / (1 − Sp) LR− = (1 − Se) / Sp
The clinician needs the predictive values: the probability of being diseased if the test is positive (PPV), of not being diseased if it is negative (NPV). Unlike Se and Sp, they depend on the prevalence p of the disease in the population where the test will be used:
PPV = Se · p / [ Se · p + (1 − Sp) · (1 − p) ]
NPV = Sp · (1 − p) / [ Sp · (1 − p) + (1 − Se) · p ]
odds after the test = odds before the test × LR (odds = p / (1 − p); LR+ if positive, LR− if negative)
When the disease is rare, even a good test gives mostly false positives (see the example). Variance gives LR+ and LR− for each cutoff, but not the predictive values, which depend on the prevalence: compute them from the table of cutoffs. The proportion of patients in your data estimates the prevalence only for a consecutive series of subjects, not for diseased and control subjects recruited separately.
Assumptions and checks#
- Reliable reference, applied to everyone: the status of each subject is established by a reference method independent of the test under study, applied whatever its result (otherwise, verification bias).
- Representative spectrum: comparing severely ill patients with healthy controls overestimates discrimination (spectrum bias).
- One value per subject, independent subjects.
- Direction of the test: by default, Variance assumes that patients have higher values than controls (positive = value > cutoff). If the marker decreases with the disease, choose "Lower values than controls" in the "Patients have" list: a subject is then positive below the cutoff, and the cutoffs are displayed as "< c". Otherwise, the area would be below 0.5.
- Sufficient sample sizes: the precision of the sensitivity depends on the number of patients, that of the specificity on the number of controls; the standard error of the area, a normal approximation, is fragile with small groups or an area close to 1.
Step by step in Variance#
- Create a One factor table with two columns: the values of the controls (non-diseased) and those of the patients (diseased). The columns can have different lengths; empty cells are ignored.
- Choose Analysis › Compare Groups › ROC Curve.
- Options tab of the "ROC Curve – settings" window:
- "Control values" and "Patient values": the two columns (by default, the first and second columns checked);
- "Patients have": "Higher values than controls" (default) or "Lower values than controls" (see Assumptions);
- "Confidence intervals of sensitivity/specificity": "Wilson score" (default) or "Clopper-Pearson";
- "CI of the area": "Score type (recommended)" (default) or "Wald: area ± z·SE" (see How it is calculated);
- "Report results as percentages" (checked): sensitivity, specificity and curve as percentages rather than fractions (the area remains a fraction);
- "Confidence level (%)" (95 by default): level of all the confidence intervals;
- "Significant digits" and "P value format".
- Data sets tab, then OK. A group with no values stops the analysis ("not enough data: both controls and patients are needed").
- Variance creates the results sheet and an XY graph (lines) of the "ROC curve" output table, with the chance diagonal (from 0 to 100%), where the area is 0.5.
Calculations#
Cutoffs. The values of the two groups are pooled, sorted and deduplicated. The cutoffs are the midpoints of two consecutive distinct values, plus one cutoff below the smallest value and one above the largest. For each cutoff c:
Se(c) = (number of patients with value > c) / nP
Sp(c) = (number of controls with value ≤ c) / nC
LR+(c) = Se(c) / (1 − Sp(c)) (undefined if Sp = 1: empty cell)
Intervals for Se and Sp. Each proportion x/n receives a binomial interval (z = quantile of order (1 + C)/2 of the normal distribution, 1.96 for C = 95%; α = 1 − C):
"Wilson score": the Wilson interval, without continuity correction
p = x/n center = (p + z²/(2n)) / (1 + z²/n)
half-width = z / (1 + z²/n) · √( p(1 − p)/n + z²/(4n²) )
"Clopper-Pearson" (exact):
lower bound = quantile α/2 of the Beta(x, n − x + 1) distribution (0 if x = 0)
upper bound = quantile 1 − α/2 of the Beta(x + 1, n − x) distribution (1 if x = n)
The Wilson interval, recommended by Brown, Cai and DasGupta (2001), has coverage close to the stated level; the Clopper-Pearson interval guarantees at least that level, but it is wider.
Area under the curve. The area A is the Mann-Whitney statistic: the proportion of (patient, control) pairs in which the patient has the higher value, ties counting for ½. It equals the area under the empirical ROC curve computed by the trapezoidal method, and it is the probability that a randomly drawn patient has a higher value than a randomly drawn control. The U of the Mann-Whitney test (chapter 14), the smaller of the two, equals nP · nC · (1 − A) when A ≥ 0.5.
Standard error, interval and P (Hanley and McNeil, 1982):
Q1 = A / (2 − A) Q2 = 2A² / (1 + A)
SE(A) = √{ [ A(1 − A) + (nP − 1)(Q1 − A²) + (nC − 1)(Q2 − A²) ] / (nP · nC) }
score-type CI (default): the two areas θ such that |A − θ| = z · SE(θ),
SE(θ) being the formula above evaluated at θ (not at A); θ < A and θ > A
Wald CI (option): A ± z · SE(A), truncated to [0, 1]
P: z = (A − 0.5) / SE0 two-sided P = 2 · [1 − Φ(|z|)]
SE0² = [ (N + 1) − Σ(t³ − t) / (N(N − 1)) ] / (12 · nP · nC) N = nP + nC
(variance of the area under the hypothesis A = 0.5; t: size of each group of ties)
Q1 and Q2 are Hanley and McNeil approximations, established for exponential distributions and reasonable for other shapes. The symmetric Wald interval covers the true area poorly when A is close to 1 with small sample sizes: the standard error, computed at A, is too small there, and the interval collapses to "1 to 1" when A = 1. The score-type interval (in the spirit of the methods studied by Newcombe, 2006) evaluates the standard error at each limit: it stays within [0, 1], it is asymmetric (longer on the side of 0.5) and keeps a width when A = 1 (upper limit 1, lower limit < 1). Variance offers neither the nonparametric variance of DeLong et al. (1988), nor a bootstrap interval. The P, for its part, uses the variance of the area under the hypothesis A = 0.5: it is exactly the normal approximation of the Mann-Whitney test (chapter 14), tie correction included, which tests the same absence of discrimination. With small sample sizes, the exact Mann-Whitney P (chapter 14) is more accurate.
Reading the results#
- "Area under the ROC curve" tab: "Area" (0.5: no discrimination; 1: perfect separation; below 0.5: inverted test, see Assumptions), "Std. Error", "95% CI", "P value" (hypothesis A = 0.5); under "Data", "Controls (Negative)" and "Patients (Positive)", the sample sizes nC and nP; under "Youden index", "Maximum Youden index" and the "Cutoff" at which it is reached.
- "Sensitivity and specificity" tab: one row per cutoff, labeled "> c", from the highest cutoff (low sensitivity, high specificity) to the lowest; columns "Sensitivity", "95% CI", "Specificity", "95% CI" (as percentages if the option is checked), "Likelihood ratio" (LR+, empty when the specificity is 100%), "Likelihood ratio (negative)" (LR−) and "Youden index" (J = Se + Sp − 1, as a fraction). The two extreme cutoffs, beyond all the values, do not appear there.
- "ROC curve" output table: X = "100% - Specificity%", Y = "Sensitivity%" ("1 - Specificity" and "Sensitivity" as fractions), from (0, 0) to (100, 100).
Hosmer, Lemeshow and Sturdivant (2013) describe an area of 0.7 to 0.8 as acceptable, 0.8 to 0.9 as excellent and 0.9 or more as outstanding. These benchmarks are conventional: the usefulness of a test is judged in the region of the curve that matters for the intended use.
The last tab, "Narrative results", states in sentences the area under the curve with its confidence interval (0.5: no discrimination, 1: perfect discrimination), the P value of the test of an area of 0.5 and, when it is computed, the cutoff that maximizes the Youden index.
Choosing a cutoff#
Variance gives the Youden index of each cutoff and its maximum, but no cutoff is "optimal" in the absolute; the choice depends on the use:
- Youden index (1950): J = Se + Sp − 1 ("Youden index" column); the cutoff that maximizes J corresponds to the point of the curve farthest from the diagonal. It weighs false positives and false negatives equally, whatever the prevalence.
- Consequences of errors: favor sensitivity when missing a diseased subject is serious (screening for a curable disease), specificity when a false positive leads to heavy treatment (confirmation). Zweig and Campbell (1993) show that the most favorable cutoff lies where the slope of the curve equals (1 − p)/p × (cost of a false positive / cost of a false negative).
- Cutoff set a priori or validated: a cutoff chosen on the same data, for example the one that maximizes J, overestimates the sensitivity and specificity that will be observed in new subjects, especially in a small sample. Take a cutoff fixed in advance (literature, protocol), or validate yours on other data (second sample, cross-validation), and report its sensitivity and specificity with their intervals.
Worked example#
Example "Two groups (t test)" (welcome window, One factor type, "an example"): a variable measured in 12 "Wild type" mice and 10 "Knock-out" mice. Can the knock-outs be recognized by this measurement? Default settings (controls = Wild type, patients = Knock-out); sorted values:
Wild type 4.432 4.836 5.128 5.206 5.235 5.238 5.303 5.348 5.378 5.584 5.605 5.718
Knock-out 5.578 5.928 6.113 6.222 6.26 6.778 7.028 7.034 7.058 7.277
Variance displays:
Area under the ROC curve
Area 0.975
Std. Error 0.03675
95% CI 0.7688 to 0.9976
P value 0.0002
Data
Controls (Negative) 12
Patients (Positive) 10
and, in the "Sensitivity and specificity" tab (excerpt; 21 cutoffs in all):
Sensitivity 95% CI Specificity 95% CI Likelihood ratio
> 6.0205 80 49.02 to 94.33 100 75.75 to 100
> 5.823 90 59.58 to 98.21 100 75.75 to 100
> 5.6615 90 59.58 to 98.21 91.67 64.61 to 98.51 10.8
> 5.5945 90 59.58 to 98.21 83.33 55.2 to 95.3 5.4
> 5.581 90 59.58 to 98.21 75 46.77 to 91.11 3.6
> 5.478 100 72.25 to 100 75 46.77 to 91.11 4
By hand. Only the knock-out value 5.578 is exceeded by wild-type mice (5.584, 5.605 and 5.718): 3 pairs lost out of 12 × 10 = 120, so A = 117/120 = 0.975.
Q1 = 0.975 / 1.025 = 0.95122 Q2 = 2 × 0.950625 / 1.975 = 0.96266 A² = 0.950625
SE = √{ [0.024375 + 9 × 0.000595 + 11 × 0.012033] / 120 } = √(0.16209 / 120) = 0.03675
score-type 95% CI: θ = 0.7688 (SE(θ) = 0.10519; 0.975 − 0.7688 = 1.96 × 0.10519)
and θ = 0.9976 (SE(θ) = 0.01151; 0.9976 − 0.975 = 1.96 × 0.01151)
Wald CI (option) = 0.975 ± 1.96 × 0.03675 = 0.903 to 1.047, truncated to 0.903 to 1
SE0 = √(23 / (12 × 10 × 12)) = 0.1264 (no ties)
z = 0.475 / 0.1264 = 3.76 P = 0.00017
cutoff 5.823 (midpoint of 5.718 and 5.928): Se = 9/10 = 0.90 Sp = 12/12 = 1
Wilson for 9/10: center = (0.9 + 0.19207) / 1.38415 = 0.78899
half-width = 1.41601 × √(0.009 + 0.0096036) = 0.19314
95% CI = 0.5958 to 0.9821
Youden index: J = 90 + 100 − 100 = 90% at the cutoff 5.823, the maximum of the table (80% at 6.0205; 81.7% at 5.6615; 75% at 5.478).
Interpretation. The two distributions barely overlap (A = 0.975). But the cutoff 5.823, chosen on these 22 mice, still needs to be validated: its specificity of 100% rests on only 12 controls (95% CI 75.8 to 100%). The P from Variance (z = 12.9) overstates the certainty; the Mann-Whitney test on the same columns (U = 3) gives an exact P of 0.00002, which is the one to report.
Predictive values. At the cutoff 5.6615 (Se = 0.90; Sp = 0.917; LR+ = 10.8; LR− = 0.10 / 0.917 = 0.109):
prevalence 45% (10/22, as in the sample): PPV = 0.90 NPV = 0.917
prevalence 5%: odds before = 0.05 / 0.95 = 0.0526 odds after = 0.0526 × 10.8 = 0.568
PPV = 0.568 / 1.568 = 0.362 NPV = 0.994
With 5% knock-outs among the animals tested, a positive result would be right only about one time in three.
Reporting the results#
"The measurement distinguished knock-out mice (n = 10) from wild-type mice (n = 12): area under the ROC curve 0.975 (score-type 95% CI 0.77 to 0.998, Hanley and McNeil standard error), Mann-Whitney test P = 0.0002 (normal approximation). At the cutoff of 5.82, chosen on these data by the Youden index and therefore to be validated, sensitivity was 90% (Wilson 95% CI 60 to 98%) and specificity 100% (76 to 100%)."
Common pitfalls#
- Confusing sensitivity with positive predictive value: the latter depends on the prevalence and drops when the disease is rare.
- Optimizing the cutoff on the data used to evaluate it (see "Choosing a cutoff").
- Area below 0.5: the direction of the test is inverted (see Assumptions); it is not a "significant" test.
- Settling for the P of the area: "better than chance" does not make a test useful; this P is also too small (see Calculations).
- Comparing two tests by the overlap of the CIs of their areas: a suitable test is needed, paired if both tests are performed on the same subjects (DeLong et al., 1988), which Variance does not offer.
- Judging a test on its area alone: two curves with the same area can differ in the useful region (high sensitivity for screening, high specificity for confirmation).
References#
Books:
- Altman DG. Practical Statistics for Medical Research. Chapman & Hall, 1991.
- Hosmer DW, Lemeshow S, Sturdivant RX. Applied Logistic Regression, 3rd ed. Wiley, 2013.
- Motulsky H. Intuitive Biostatistics, 4th ed. Oxford University Press, 2018.
- Pepe MS. The Statistical Evaluation of Medical Tests for Classification and Prediction. Oxford University Press, 2003.
- Zhou XH, Obuchowski NA, McClish DK. Statistical Methods in Diagnostic Medicine, 2nd ed. Wiley, 2011.
Articles:
- Altman DG, Bland JM. Measurement in medicine: the analysis of method comparison studies. The Statistician 1983;32:307-317.
- Bland JM, Altman DG. Statistical methods for assessing agreement between two methods of clinical measurement. Lancet 1986;1:307-310.
- Bland JM, Altman DG. Comparing methods of measurement: why plotting difference against standard method is misleading. Lancet 1995;346:1085-1087.
- Bland JM, Altman DG. Measuring agreement in method comparison studies. Statistical Methods in Medical Research 1999;8:135-160.
- Altman DG, Bland JM. Diagnostic tests 1: sensitivity and specificity. BMJ 1994;308:1552.
- Altman DG, Bland JM. Diagnostic tests 2: predictive values. BMJ 1994;309:102.
- Altman DG, Bland JM. Diagnostic tests 3: receiver operating characteristic plots. BMJ 1994;309:188.
- Youden WJ. Index for rating diagnostic tests. Cancer 1950;3:32-35.
- Hanley JA, McNeil BJ. The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology 1982;143:29-36.
- DeLong ER, DeLong DM, Clarke-Pearson DL. Comparing the areas under two or more correlated receiver operating characteristic curves: a nonparametric approach. Biometrics 1988;44:837-845.
- Zweig MH, Campbell G. Receiver-operating characteristic (ROC) plots: a fundamental evaluation tool in clinical medicine. Clinical Chemistry 1993;39:561-577.
- Wilson EB. Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association 1927;22:209-212.
- Clopper CJ, Pearson ES. The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika 1934;26:404-413.
- Brown LD, Cai TT, DasGupta A. Interval estimation for a binomial proportion. Statistical Science 2001;16:101-133.
- Newcombe RG. Confidence intervals for an effect size measure based on the Mann-Whitney statistic. Part 2: asymptotic methods and evaluation. Statistics in Medicine 2006;25:559-573.