Method document
Sample size for diagnostic sensitivity and specificity
Plans a diagnostic-accuracy study so that sensitivity and specificity each have the chosen confidence-interval margin. It reports the reference-standard positive and negative cases required, then uses prevalence to estimate how many consecutive people must be screened.
https://statwisely.com/methods/precision-diagnostic/
When to use it
- A study that compares an index test with a reference standard and aims to estimate both sensitivity and specificity.
- Consecutive screening or recruitment from a population whose disease prevalence can be estimated.
Not for
- A study designed to test whether accuracy exceeds a target. That needs a powered diagnostic hypothesis test.
- A case-control accuracy study with a deliberately fixed number of cases and controls. Recruit the positive and negative reference-standard case counts directly instead of interpreting the screening total.
Notation
- Expected sensitivity and specificity
- Expected disease prevalence in the screened population
- Confidence-interval half-width for each accuracy measure
- Reference-standard positive and negative cases required
Formulas
Required cases and screening total
The usual normal-approximation sample sizes for two binomial proportions, converted to a screening total through prevalence [1]. The larger requirement determines N.
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 1; 0.05 means ±5 percentage points
Use the largest uncertainty acceptable for each measure. This version applies the same margin to sensitivity and specificity.
Expected sensitivity
Values: Greater than 0 and less than 1
Use a comparable validation study or pilot data. The positive-case requirement is largest near 50%.
Expected specificity
Values: Greater than 0 and less than 1
Use data from the same setting and reference standard where possible. The negative-case requirement is largest near 50%.
Expected prevalence
Values: Greater than 0 and less than 1
Use the prevalence in the people who will actually be screened. Low prevalence can make recruiting enough disease-positive cases the limiting step.
Assumptions
- The index test and reference standard are measured independently across participants, and the reference standard classifies disease status without material error.
- The expected sensitivity, specificity and prevalence are appropriate for the intended population. If prevalence is lower than expected, more people must be screened to obtain the required positive cases.
- The normal approximation is adequate for the planned reference-standard positive and negative counts. For small or extreme accuracy estimates, analyse with Wilson or exact intervals [2].
Worked examples
A low-prevalence validation study
With sensitivity 80%, specificity 90%, prevalence 10%, 95% confidence and ±5 points: 246 positive and 139 negative reference-standard cases are required. The positive-case requirement means screening 2460 people.
Sample size: 2460
Open this example in the calculatorProtocol statement
To estimate the sensitivity and specificity of a diagnostic test with 95% confidence and a margin of error of ±5 percentage points, assuming an expected sensitivity of 80%, specificity of 90% and prevalence of 10%, the required sample size is 2460 participants. Calculated with StatWisely (statwisely.com) using: n₊ = z_(1-α/2)² × Se(1-Se) / E²; n₋ = z_(1-α/2)² × Sp(1-Sp) / E²; N = max(ceil(n₊/Prev), ceil(n₋/(1-Prev))). These are planning estimates; confirm the final design with a qualified statistician.
Validation
- The example follows the closed forms: ceil(1.96² × 0.8 × 0.2 / 0.05²) = 246 and ceil(1.96² × 0.9 × 0.1 / 0.05²) = 139; max(ceil(246 / 0.10), ceil(139 / 0.90)) = 2460.
How to cite
StatWisely. Sample size for diagnostic sensitivity and specificity. Method document, engine version 1.0.0, reviewed 2026-10-04. https://statwisely.com/methods/precision-diagnostic/
Cite the original references for the formulas your design uses as well.
References
- 1.Buderer NMF. Statistical methodology: I. Incorporating the prevalence of disease into the sample size calculation for sensitivity and specificity. Academic Emergency Medicine. 1996;3(9):895–900. doi:10.1111/j.1553-2712.1996.tb03538.x
- 2.Brown LD, Cai TT, DasGupta A. Interval estimation for a binomial proportion. Statistical Science. 2001;16(2):101–133. doi:10.1214/ss/1009213286