Method document
Sample size to estimate the area under the ROC curve
How many people must be tested to estimate the area under the ROC curve (AUC) of a continuous diagnostic marker within a chosen margin, from the expected AUC and the prevalence in a consecutive sample. Reports the expected reference-standard positives and negatives. Covers non-response.
https://statwisely.com/methods/precision-auc/
When to use it
- Validating a continuous marker, such as a biomarker or a risk score, against a reference standard, when its overall discrimination is the aim.
Not for
- Comparing the AUCs of two markers measured on the same people; that needs their correlation.
- A marker with a strongly skewed or very unequal spread between the groups; the binormal variance then needs its second parameter.
Notation
- Expected area under the ROC curve
- Reference-standard positives and negatives, N Prev and N(1 − Prev)
- Probability that one diseased value exceeds two non-diseased values, or two diseased exceed one non-diseased
- Margin of error, in AUC units
- Standard normal quantile for confidence 1 − α (1.960 for 95%)
- Non-response rate
Formulas
Variance of the empirical AUC
The structure is Hanley and McNeil’s [1]. Their own Q₁ = A/(2 − A) and Q₂ = 2A²/(1 + A) come from an exponential model and overstate the variance of a continuous binormal marker, so both are computed exactly under the equal-variance binormal model. N is the smallest total with z_(1−α/2)√V ≤ E.
Non-response
The number to approach so that n respond. Applied last, after any clustering.
Parameters
Confidence level
Values: 90%, 95% or 99%
95% is the convention in health research. A higher level widens the interval, so the same margin needs a larger sample.
Margin of error
Values: Above 0 and below 0.5
In AUC units: 0.05 means the interval runs from AUC − 0.05 to AUC + 0.05.
Expected AUC
Values: Above 0.5 and below 1
From a previous study of the marker. An AUC near 0.5 is the hardest to estimate precisely.
Expected prevalence
Values: Greater than 0 and less than 1
In the people who will actually be tested. It splits the sample into reference-standard positives and negatives.
Expected non-response rateOptional
Values: 0% up to, but not including, 100%
The share of people approached who will not take part; use the response rate of a comparable study. Approaching more people restores the number of respondents, not their representativeness: if non-responders differ, the estimate can still be biased.
Assumptions
- Participants are independent; the marker is roughly normal with similar spread in diseased and non-diseased people, possibly after a transformation; the reference standard is accurate.
- Non-response is unrelated to the outcome.
Worked examples
Balanced disease status
AUC 0.8, prevalence 0.5, margin ±0.05: N = 292, half diseased.
Sample size: 292
Open this example in the calculatorA stronger marker at 20% prevalence
AUC 0.9 and prevalence 0.2: N = 218, about 44 of them diseased.
Sample size: 218
Open this example in the calculatorA wider margin
AUC 0.75, prevalence 0.3, margin ±0.1: N = 107.
Sample size: 107
Open this example in the calculatorValidation
- Every worked example on this page is recomputed by the StatWisely engine whenever the software is built. If a number or formula here stopped matching the calculator, the release would be stopped until this document was corrected.
- Simulating 4,000 binormal samples in R at each planned size gave empirical-AUC interval half-widths of 0.0497, 0.0495, 0.0993 and 0.0296 against targets of 0.05, 0.05, 0.10 and 0.03. With Hanley and McNeil’s exponential Q terms, the 20%-prevalence example would have needed 345 people for a half-width of 0.039. An independent R integration of Q reproduces the engine’s sizes.
How to cite
StatWisely. Sample size to estimate the area under the ROC curve. Method document, engine version 1.0.0, reviewed 2026-10-06. https://statwisely.com/methods/precision-auc/
Cite the original references for the formulas your design uses as well.
References
- 1.Hanley JA, McNeil BJ. The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology. 1982;143(1):29–36. doi:10.1148/radiology.143.1.7063747