Calculator · deterministic
Sensitivity / specificity sample size calculator
Estimating a diagnostic test's accuracy with a confidence interval: diseased cases from the expected value and CI half-width.
Calculator
No AI, no sign-up — the arithmetic runs in the server-side deterministic solver, validated against G*Power and R pwr.
When to use it
"What is this test's sensitivity?" is not a hypothesis test — it is an estimation problem: the sample size comes from the CI width you can accept, not from a power calculation. Most diagnostic accuracy studies are in this class. The full treatment is in the diagnostic accuracy guide.
Where the inputs come from
- Expected value: from a study with a similar population; near the extremes (0.90+) the sample shrinks fast, and the Wilson method handles that correctly.
- Do not skip the prevalence step: the result is the number of DISEASED cases; the total to screen comes from dividing by prevalence. Specificity needs the same calculation on the healthy side.
Worked example
For an expected sensitivity of 0.85 and a target 95% CI of ±0.05, the solver requires 196 diseased cases (Wilson method). If prevalence in your stream is 20%, roughly 980 consecutive patients must be screened; with 10% unevaluable exams the target rises to 218 cases.
How to write it in the protocol
“The primary aim is estimation of sensitivity and specificity. For an expected sensitivity of [value] [with source], a Wilson 95% CI of ±[half-width] required [n] diseased cases; with [x]% prevalence, approximately [N] patients will be screened. The reference standard will be applied to all patients regardless of the index test result.”
Sources
- Cohen J. Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Lawrence Erlbaum; 1988.
- Faul F, Erdfelder E, Lang A-G, Buchner A. G*Power 3: a flexible statistical power analysis program. Behav Res Methods. 2007;39:175–191.
- Champely S. pwr: Basic Functions for Power Analysis (R package).
- Newcombe RG. Two-sided confidence intervals for the single proportion: comparison of seven methods. Stat Med. 1998;17:857–872.