Skip to main content

    Method document

    Sample size to estimate a difference between two event rates

    How many participants are needed in each of two groups, each followed for a stated time, to estimate the difference between their event rates within a chosen margin, for Poisson or over-dispersed negative binomial counts. Covers unequal groups and non-response.

    Engine version 1.0.0 · Reviewed 9 October 2026

    https://statwisely.com/methods/precision-rate-difference/

    When to use it

    • A trial or cohort reporting how many events per person-year an intervention or exposure adds or prevents.

    Not for

    • Showing that the rates differ. Use a powered rate test under “Detect an effect”.

    Notation

    n1, n2n_1,\ n_2
    Sample sizes of groups 1 and 2
    λ1, λ2\lambda_1,\ \lambda_2
    Expected event rates in groups 1 and 2
    rar_a
    Allocation ratio n₂ / n₁
    tt
    Follow-up per participant, in the rate’s time unit
    kk
    Negative binomial dispersion: a count with mean μ has variance μ + kμ²; 0 is Poisson
    EE
    Margin of error, in events per participant per unit of time
    z1−α/2z_{1-\alpha/2}
    Standard normal quantile for confidence 1 − α (1.960 for 95%)
    qq
    Non-response rate

    Formulas

    Poisson or negative binomial counts

    n1=⌈z1−α/22[λ1(1+kλ1t)+λ2(1+kλ2t)/ra]t E2⌉,n2=⌈ra n1⌉n_1 = \left\lceil \frac{z_{1-\alpha/2}^{2}\left[\lambda_1(1 + k\lambda_1 t) + \lambda_2(1 + k\lambda_2 t)/r_a\right]}{t\,E^{2}} \right\rceil, \qquad n_2 = \lceil r_a\, n_1 \rceil

    The variance of a difference between independent rates is the sum of their variances, each λ(1 + kλt)/(n t) [1]. One dispersion k is assumed for both groups.

    Non-response

    napproach=⌈n1−q⌉n_{\text{approach}} = \left\lceil \frac{n}{1 - q} \right\rceil

    The number to approach in each group so that n respond. Applied last, after any clustering.

    Parameters

    Confidence level1−α1-\alpha

    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 errorEE

    Values: Above 0, in the rates’ units

    0.3 means the interval for the difference runs 0.3 events per person-year either side of the estimate.

    Expected event rate in group 1λ1\lambda_1

    Values: Above 0

    Events per participant per unit of time.

    Expected event rate in group 2λ2\lambda_2Optional

    Values: Above 0; left blank, taken to equal λ₁

    Often the comparison group’s rate, known from routine data.

    Follow-up per participantttOptional

    Values: Above 0; 1 by default

    In the same time unit as the rates: with rates per person-year, two years of follow-up is 2.

    Dispersion (negative binomial k)kkOptional

    Values: 0 or more; 0 for Poisson counts

    Clinical events, such as exacerbations or falls, usually vary between people more than a Poisson process allows. Take k from a negative binomial fit to earlier data, and try plausible values: the plan grows with k.

    Allocation ratiora=n2/n1r_a = n_2/n_1Optional

    Values: Above 0; 1 for equal groups

    The planned size of group 2 divided by group 1. Equal groups give the most precision for a given total; use another ratio when one group is easier or cheaper to recruit.

    Expected non-response rateqqOptional

    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

    • The two groups are independent, with the same follow-up t and the same dispersion k.
    • Participants are independent, each followed for the same time t, and the event rate is constant over that time.
    • Counts are Poisson, or negative binomial with the stated dispersion; the interval is the large-sample Wald interval, which needs enough events to apply.
    • Non-response is unrelated to the outcome.

    Worked examples

    Two equal groups

    Rates of 2 and 1.5 per person-year over one year, margin ±0.3, Poisson counts: 1.96² × (2 + 1.5) / 0.3² = 149.4, so 150 per group.

    Group 1: 150 · Group 2: 150 · Total: 300

    Open this example in the calculator

    Over-dispersed counts

    With dispersion k = 0.5 the variance term is 2 × 2 + 1.5 × 1.75 = 6.625: 1.96² × 6.625 / 0.3² = 282.8, so 283 per group.

    Group 1: 283 · Group 2: 283 · Total: 566

    Open this example in the calculator

    Twice as many in group 2

    With r_a = 2: 1.96² × (2 + 1.5/2) / 0.3² = 117.4, so 118 in group 1 and 236 in group 2.

    Group 1: 118 · Group 2: 236 · Total: 354

    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.
    • The basic result agrees with the closed form: 1.96² × 3.5 / 0.3² = 149.4, rounded up to 150 per group. In simulation, Poisson and negative binomial counts drawn at the planned sizes and analysed with Wald intervals on the empirical variance of the counts gave median half-widths and factors within 1% of the targets, and coverage of 94.4% to 95.2% for a 95% interval. An independent implementation in R recomputes these sizes and is compared with the engine’s.

    How to cite

    StatWisely. Sample size to estimate a difference between two event rates. Method document, engine version 1.0.0, reviewed 2026-10-09. https://statwisely.com/methods/precision-rate-difference/

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

    References

    1. 1.Zhu H, Lakkis H. Sample size calculation for comparing two negative binomial rates. Statistics in Medicine. 2014;33(3):376–387.