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.
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
- Sample sizes of groups 1 and 2
- Expected event rates in groups 1 and 2
- Allocation ratio n₂ / n₁
- Follow-up per participant, in the rate’s time unit
- Negative binomial dispersion: a count with mean μ has variance μ + kμ²; 0 is Poisson
- Margin of error, in events per participant per unit of time
- Standard normal quantile for confidence 1 − α (1.960 for 95%)
- Non-response rate
Formulas
Poisson or negative binomial counts
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
The number to approach in each group 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, 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
Values: Above 0
Events per participant per unit of time.
Expected event rate in group 2Optional
Values: Above 0; left blank, taken to equal λ₁
Often the comparison group’s rate, known from routine data.
Follow-up per participantOptional
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)Optional
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 ratioOptional
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 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
- 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 calculatorOver-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 calculatorTwice 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 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.
- 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.Zhu H, Lakkis H. Sample size calculation for comparing two negative binomial rates. Statistics in Medicine. 2014;33(3):376–387.