Method document
Sample size to estimate a rate ratio
How many participants are needed in each of two groups, each followed for a stated time, to estimate the ratio of their event rates within a chosen factor, for Poisson or over-dispersed negative binomial counts; or several groups each against a reference. Covers unequal groups and non-response.
https://statwisely.com/methods/precision-rate-ratio/
When to use it
- A trial or cohort reporting the incidence rate ratio of an intervention or exposure, such as exacerbations on treatment against placebo.
- Several exposure categories, each compared with a reference category.
Not for
- Showing that the rate ratio differs from 1. Use a powered rate test under “Detect an effect”.
Notation
- Sample sizes of groups 1 and 2 (group 2 is the reference)
- 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
- Precision factor: the interval runs from RR / f to RR × f
- Number of groups, including the reference group
- Standard normal quantile for confidence 1 − α (1.960 for 95%)
- Non-response rate
Formulas
Poisson or negative binomial counts
A rate ratio is estimated on the log scale, where its interval is symmetric, so a margin of ln f there is a factor f on the ratio scale. Each log rate has variance (1/(λt) + k)/n [1, 2]; at k = 0 this is one over the expected number of events.
Several groups against a reference
Optional. With g groups, each of the g − 1 others is compared with the same reference group (rate λ₂). Each comparison has its two-group requirement n₁⁽ʲ⁾; every comparison group is given the largest, so all intervals reach the factor. Choosing simultaneous intervals splits α across the g − 1 comparisons (Bonferroni).
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.
Precision factor
Values: Above 1; 1.25 means the interval runs from RR / 1.25 to RR × 1.25
Rare events make the log rate very variable, so they need many participants, or longer follow-up, for any factor.
Expected event rate in group 1
Values: Above 0
Events per participant per unit of time, for example on treatment.
Expected event rate in group 2, the reference
Values: Above 0
Often the control or unexposed 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.
Number of groups, including the referenceOptional
Values: A whole number of at least 2; 2 for one comparison
For example, two doses compared with placebo is g = 3.
Expected event rate in each comparison groupOptional
Values: g − 1 values above 0
The rate expected in each group compared with the reference; the reference group’s own rate is λ₂.
Simultaneous intervals across comparisonsOptional
Values: On or off
Turn on when the comparisons will be read together, so that every interval holds at once.
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 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
Poisson counts in two equal groups
Rates of 2 and 1.5 per person-year over one year, factor 1.25: the variance term is 1/2 + 1/1.5 = 1.167, and (ln 1.25)² = 0.0498, so n₁ = 1.96² × 1.167 / 0.0498 = 90.0, rounded up to 91 per group.
Group 1: 91 · Group 2: 91 · Total: 182
Open this example in the calculatorOver-dispersed counts
With dispersion k = 0.5 each group adds k to its term: 1.167 + 2 × 0.5 = 2.167, so n₁ = 1.96² × 2.167 / 0.0498 = 167.2, rounded up to 168 per group.
Group 1: 168 · Group 2: 168 · Total: 336
Open this example in the calculatorTwo doses against placebo
Rates of 2 and 1.2 on two doses against 1.5 on placebo, k = 0.5, read together: the 1.2 comparison needs most, 1/1.2 + 0.5 + 1/1.5 + 0.5 = 2.5; with α split two ways z = 2.241, so n = 2.241² × 2.5 / 0.0498 = 252.2, rounded up to 253 in each of the 3 groups.
253 per group · Total: 759
Open this example in the calculatorAllowing for loss to follow-up
Expecting 20% to provide no follow-up: 91 / 0.8 = 113.75, so 114 are recruited in each group.
Group 1: 91 · Group 2: 91 · Total: 182 · To approach: 114 and 114
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² × 1.167 / (ln 1.25)² = 90.0, rounded up to 91 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 rate ratio. Method document, engine version 1.0.0, reviewed 2026-10-09. https://statwisely.com/methods/precision-rate-ratio/
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.
- 2.Gu K, Ng HKT, Tang ML, Schucany WR. Testing the ratio of two Poisson rates. Biometrical Journal. 2008;50(2):283–298.