How this calculation works
Compare two empirical ROC areas measured on the same binary-labeled subjects using a paired DeLong covariance estimate. The calculation gives both AUCs, their difference, the estimated covariance matrix, an asymptotic two-sided test and an untruncated difference interval. Tied scores receive half credit. Larger scores consistently mean stronger evidence for the positive class; the page does not reverse score direction to improve an AUC.
K_ij=1(s⁺_i>s⁻_j)+.5·1(tie); AUC=mean K. V_i=mean_j K_ij, W_j=mean_i K_ij; S_ab=Cov_sample(V_a,V_b)/m+Cov_sample(W_a,W_b)/n. Var(Δ)=S_AA+S_BB−2S_AB; z=Δ/SE; CI=Δ±z_(1−α/2)SE.A worked example
For six positive and six negative paired records, the default gives AUC A=.7916667 and AUC B=.6388889. Difference is .1527778. The paired variance of the difference is .004089506, yielding z≈2.38905, two-sided p≈.016892 and 95% interval [.0274396,.2781160]. Ignoring covariance would inflate the variance and change the inference.
Good to know
5–300 positive and 5–300 negative independent subjects, each with one finite score from model A and one from model B. Binary labels 0/1 and aligned vectors; fixed direction higher=positive. Confidence .8–.999. Full unsmoothed empirical AUC only. Reject zero difference variance; no partial AUC, repeated-subject clustering, cross-validation dependency correction, missing values or clinical validity claim. Normal approximation may be poor for small or near-perfect samples.
Reference: Method reference (opens in a new tab) ↗
Pairing is a property of the subjects
Both models must score the same positive subjects and the same negative subjects, with each row retaining that identity. The AUC estimates then share sampling variation because an easy or difficult subject can affect both models.
Equal vector lengths do not establish pairing. If the models were evaluated on different cohorts, the paired covariance calculation is inappropriate. Reordering one score vector without the other and its labels can silently destroy the intended comparison.
Compare this with the ROC AUC tied scores and threshold cost comparison calculator. Existing ROC thresholds and empirical AUC do not infer uncertainty in a paired AUC difference.
AUC is built from positive-negative comparisons
For each model, compare every positive subject’s score against every negative subject’s score. A larger positive score contributes one, a tie contributes one half and a smaller positive score contributes zero. Their mean is the empirical AUC.
The page fixes higher scores as positive evidence. It does not choose a favorable direction after inspecting the data. AUC below one half can reflect reversed scoring or poor ranking, and automatically flipping the direction would change the prespecified comparison.
Placements retain subject-level contributions
A positive subject’s placement is its average kernel value across negative subjects. A negative subject’s placement is its average across positive subjects. These vectors describe how each subject contributes to the ranking summary.
The sample covariance of the two models’ positive placements is divided by the positive class size, and the corresponding negative covariance by the negative class size. Adding them gives the paired DeLong covariance estimate with ordinary sample covariance denominators.
The default comparison worked through
The first model has empirical area .7916667 and the second .6388889, so the paired difference is .1527778. The two areas are positively correlated across subject contributions. Subtracting twice their estimated covariance leaves variance .004089506 for the difference.
Its square root is the standard error. Dividing the difference by that value gives z≈2.38905 and the two-sided normal approximation p≈.016892. The 95 percent difference interval is approximately [.02744,.27812], conditional on the assumptions of this analysis.
Difference uncertainty is not separate area uncertainty
Two large individual AUC standard errors need not imply a large error for their difference when subjects affect both models similarly. Conversely, weak or negative covariance can increase difference variability.
This is why adding the two variances alone discards information from a paired design. The output includes the full covariance matrix so the contrast variance can be checked explicitly as S_AA+S_BB−2S_AB.
Degenerate and near-perfect score patterns
Identical rankings, perfect separation or limited distinct scores can make the estimated difference variance zero. Dividing by zero would manufacture an infinite z value or an arbitrary p value.
The page rejects a zero-variance inference and advises retaining descriptive AUCs. Small class sizes and near-perfect ranking can also weaken the normal approximation even when variance is positive. A resolved arithmetic result does not ensure accurate finite-sample coverage.
What a significant area difference does not establish
AUC summarizes ranking over thresholds. It does not assess probability calibration, cost-sensitive decisions, performance at one selected threshold or whether the improvement is practically useful. A small p value addresses a sampling comparison under the model assumptions.
The score pairs should come from an appropriate independent evaluation set. Reusing training observations or treating dependent cross-validation predictions as independent can invalidate the variance analysis. For diagnostic applications, domain validation and acceptance criteria remain separate from this numerical comparison.
A few questions, answered
Can I compare models on different subjects?
This page requires paired scores on the same subjects. Unpaired cohorts need a different variance calculation.
Are tied scores supported?
Yes. A positive-negative tie contributes one half to the empirical AUC kernel.
Why is the confidence interval not clipped?
It is a normal approximation for a difference. Clipping would alter its stated construction without repairing finite-sample limitations.
Does a higher AUC prove better clinical decisions?
No. Ranking, calibration, threshold costs and clinical validation answer different questions.