Skip to main content

    Method document

    Sample size for an exact binomial test

    How many participants are needed to show that a proportion differs from a reference value using the exact binomial test, with no normal approximation. Suited to small studies and rare outcomes. Covers clustering and dropout.

    Engine version 1.0.0 · Reviewed 1 October 2026

    https://statwisely.com/methods/proportions-binomial/

    When to use it

    • A single-group study with few participants, or a proportion near 0 or 1, such as an early-phase trial’s response rate.

    Not for

    • Large studies with a proportion away from 0 and 1, where the one-proportion test gives nearly the same answer more simply.

    Notation

    nn
    Number of participants
    XX
    Number with the outcome, binomial(n, p)
    p0, p1p_0,\ p_1
    Proportion under the null hypothesis and in truth
    RnR_n
    Rejection region: the counts that reject the null
    α\alpha
    Significance level: the chance of a false positive
    1−β1-\beta
    Power: the chance of detecting the effect if it is real
    ρ\rho
    Intracluster correlation coefficient (ICC)
    mm
    Average number of participants per cluster
    CV\mathrm{CV}
    Coefficient of variation of cluster size
    CC
    Clusters per group
    ℓ\ell
    Expected loss of whole clusters
    qq
    Expected dropout

    Formulas

    Exact power

    Pr⁡p0(X∈Rn)≤α,power(n)=Pr⁡p1(X∈Rn)=∑x∈Rn(nx)p1x(1−p1)n−x\Pr_{p_0}(X \in R_n) \le \alpha, \qquad \text{power}(n) = \Pr_{p_1}(X \in R_n) = \sum_{x \in R_n} \binom{n}{x} p_1^{x}(1-p_1)^{n-x}

    The rejection region is enumerated from the binomial distribution, with α split equally between the two tails, so the power reported is exact rather than approximated.

    Why the answer is not the first n that reaches the power

    n∗=min⁡{ n:power(m)≥1−β for every m from n to n+39 }n^{*} = \min\{\,n : \text{power}(m) \ge 1-\beta \ \text{for every}\ m \text{ from } n \text{ to } n + 39\,\}

    Because counts are whole numbers, power rises and falls as n grows: one more participant can shift the critical count and lose power. The calculator reports the size from which power stays above the target, and also the first size that reaches it [1]. The actual significance level is below α for the same reason.

    Clustering

    DE=1+[(CV2+1) m−1]ρ\mathrm{DE} = 1 + \left[(\mathrm{CV}^{2} + 1)\,m - 1\right]\rho

    When participants are recruited or randomised in clusters, observations within a cluster repeat information, and the sample is multiplied by the design effect. With equal clusters (CV = 0) this is 1 + (m − 1)ρ [2, 3].

    Few clusters

    Ft=(t2(C−1), 1−α/τ+t2(C−1), 1−βz1−α/τ+z1−β)2F_t = \left(\frac{t_{2(C-1),\,1-\alpha/\tau} + t_{2(C-1),\,1-\beta}}{z_{1-\alpha/\tau} + z_{1-\beta}}\right)^{2}

    Optional. A cluster trial is analysed on cluster-level summaries, so its critical values come from t on 2(C − 1) degrees of freedom rather than the normal distribution. With few clusters this costs participants; because C depends on the sample, it is iterated until it settles [4].

    All adjustments together

    nadj=⌈nDE  Ft⌉n_{\text{adj}} = \left\lceil n \mathrm{DE}\;F_t \right\rceil

    The adjustments multiply, in this order, and the result is rounded up once. Any adjustment not used contributes a factor of 1.

    Dropout

    nrecruit=⌈nadj1−q⌉n_{\text{recruit}} = \left\lceil \frac{n_{\text{adj}}}{1 - q} \right\rceil

    Applied last, to the participants actually recruited.

    Clusters to recruit

    C=⌈nrecruitm⌉,Crecruit=⌈C1−ℓ⌉C = \left\lceil \frac{n_{\text{recruit}}}{m} \right\rceil, \qquad C_{\text{recruit}} = \left\lceil \frac{C}{1 - \ell} \right\rceil

    Per group. Losing a whole cluster loses every participant in it, so an expected loss of clusters inflates the clusters recruited rather than the participants.

    Parameters

    Reference proportionp0p_0

    Values: Between 0 and 1

    The value the study tests against, such as an unacceptable response rate.

    Expected proportionp1p_1

    Values: Between 0 and 1, different from p₀

    The proportion worth detecting.

    Significance levelα\alpha

    Values: Between 0 and 1; usually 0.05

    The false-positive rate you accept. A smaller α, for example to allow for several primary outcomes, needs a larger sample.

    Power1−β1-\beta

    Values: Between 0 and 1; usually 0.80 or 0.90

    The chance of a significant result if the assumed effect is real. Funders and ethics committees commonly expect at least 0.80.

    Expected dropoutqqOptional

    Values: 0% up to, but not including, 100%

    The share of participants expected to provide no outcome, from comparable studies. Recruiting more restores the numbers, not the comparability of the groups: if dropout is related to the outcome, the estimate can still be biased.

    Intracluster correlation (ICC)ρ\rhoOptional

    Values: From 0 to 1

    For clustered designs only. Published ICCs for health outcomes in primary-care and community clusters are mostly small, often below 0.05 [5]; prefer an estimate from a comparable trial.

    Average cluster sizemmOptional

    Values: At least 1

    The average number of participants per cluster. Given with the ICC.

    Variation in cluster sizeCV\mathrm{CV}Optional

    Values: 0 or more; 0 for equal clusters

    The SD of cluster sizes divided by their mean. Unequal clusters cost power on their own account [3].

    Expected loss of whole clustersℓ\ellOptional

    Values: 0% up to, but not including, 100%

    Clusters, such as practices or schools, expected to withdraw entirely.

    Correction for few clustersFtF_tOptional

    Values: On or off

    Worth applying when there are few clusters per group, roughly fewer than 15–20.

    Assumptions

    • Participants are independent apart from any clustering specified, with the same probability of the outcome.
    • The test is two-sided.
    • With clustering: clusters are independent, with the same ICC throughout, and the analysis accounts for the clustering, for example with a mixed model or cluster-level summaries [2].
    • Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.

    Worked examples

    Seventy against fifty per cent

    p₀ = 0.5, p₁ = 0.7, α = 0.05, 80% power: power first reaches 80% at n = 49 but dips below it again for some larger n, and stays above it from n = 54, where the actual significance level is 0.040.

    Sample size: 54

    Protocol statement

    To detect a proportion of 70% against a reference of 50% with 80% power at a two-sided significance level of 0.05, using an exact binomial test, the required sample size is 54 participants. Calculated with StatWisely (statwisely.com) using: n: smallest n whose exact binomial rejection region reaches 1-β. These are planning estimates; confirm the final design with a qualified statistician.

    Open this example in the calculator

    A rare outcome

    p₀ = 0.05, p₁ = 0.15: first reached at n = 67, stable from n = 75.

    Sample size: 75

    Open this example in the calculator

    Validation

    • 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.
    • An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.

    How to cite

    StatWisely. Sample size for an exact binomial test. Method document, engine version 1.0.0, reviewed 2026-10-01. https://statwisely.com/methods/proportions-binomial/

    Cite the original references for the formulas your design uses as well.

    References

    1. 1.Chernick MR, Liu CY. The saw-toothed behavior of power versus sample size and software solutions: single binomial proportion using exact methods. The American Statistician. 2002;56(2):149–155.
    2. 2.Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. London: Arnold; 2000.
    3. 3.Eldridge SM, Ashby D, Kerry S. Sample size for cluster randomized trials: effect of coefficient of variation of cluster size and analysis method. International Journal of Epidemiology. 2006;35(5):1292–1300. doi:10.1093/ije/dyl129
    4. 4.Hayes RJ, Moulton LH. Cluster Randomised Trials. 2nd ed. Boca Raton: CRC Press; 2017.
    5. 5.Adams G, Gulliford MC, Ukoumunne OC, Eldridge S, Chinn S, Campbell MJ. Patterns of intra-cluster correlation from primary care research to inform study design and analysis. Journal of Clinical Epidemiology. 2004;57(8):785–794. doi:10.1016/j.jclinepi.2003.12.013