Method document
Sample size for non-inferiority of a rate ratio
How many participants are needed in each of two groups to show that a new treatment’s event rate is not worse than a comparator’s by more than a chosen margin on the rate-ratio scale, for Poisson or over-dispersed negative binomial counts. Covers unequal allocation, clustering and dropout.
https://statwisely.com/methods/rates-noninferiority/
When to use it
- A trial of a simpler, safer or cheaper treatment whose aim is to show that it does not raise the rate of exacerbations, infections or falls by more than an acceptable amount.
Not for
- Showing that the treatment lowers the rate. Use the rate-ratio tests.
- A margin that has not been justified in advance from earlier trials and clinical judgement.
Notation
- Participants in groups 1 (treatment) and 2 (comparator)
- Expected event rates per unit of time in groups 1 and 2
- Follow-up time per participant
- Negative binomial dispersion: variance μ + kμ²; 0 is Poisson
- Non-inferiority margin on the rate-ratio scale
- Allocation ratio n₂ / n₁
- Significance level: the chance of a false positive
- Power: the chance of detecting the effect if it is real
- Intracluster correlation coefficient (ICC)
- Average number of participants per cluster
- Coefficient of variation of cluster size
- Clusters per group
- Expected loss of whole clusters
- Expected dropout
Formulas
Participants in group 1
The one-sided Wald test that the log rate ratio lies on the right side of ln M: below it for a margin above 1, above it for a margin below 1. Each log rate has variance (1/(λt) + k)/n at the expected rates [1, 2]. Equal true rates are the usual planning assumption.
Clustering
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)ρ [3, 4].
Few clusters
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 [5].
All adjustments together
The adjustments multiply, in this order, and the result is rounded up once. Any adjustment not used contributes a factor of 1.
Dropout
Applied last, to the participants actually recruited.
Clusters to recruit
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
Expected rate with the treatment
Values: Above 0
Usually the comparator’s rate: the treatment is expected to be as good.
Rate with the comparator
Values: Above 0
From earlier trials of the comparator.
Non-inferiority margin
Values: Above 0 and not 1; the expected ratio λ₁/λ₂ on its non-inferior side
Above 1, such as 1.2, for an event the treatment must not make much more common; below 1, such as 0.8, for one it must not make much rarer. A narrower margin needs many more participants.
Follow-up per participant
Values: Above 0, in the rates’ time unit
Longer follow-up yields more events per participant; with over-dispersion it helps less.
Dispersion (negative binomial k)Optional
Values: 0 or more; 0 (the default) for Poisson counts
Take k from earlier trials of the comparator; a Poisson plan for over-dispersed counts is too small.
Allocation ratioOptional
Values: Above 0; 1 for equal groups
The planned size of group 2 divided by group 1.
Significance level
Values: One-sided; usually 0.025
One-sided, since only one direction is being ruled out. 0.025 matches a two-sided 0.05 test.
Power
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 dropoutOptional
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)Optional
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 [6]; prefer an estimate from a comparable trial.
Average cluster sizeOptional
Values: At least 1
The average number of participants per cluster. Given with the ICC.
Variation in cluster sizeOptional
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 [4].
Expected loss of whole clustersOptional
Values: 0% up to, but not including, 100%
Clusters, such as practices or schools, expected to withdraw entirely.
Correction for few clustersOptional
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, each followed for the same time, and each group’s rate is constant over it.
- Counts are Poisson, or negative binomial with the same stated dispersion in both groups.
- 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 [3].
- Dropout is unrelated to the outcome; recruiting more participants restores the numbers but cannot remove bias.
Worked examples
Equal rates, a margin of 1.2
Rates of 1 and 1 a year over one year, margin 1.2, one-sided α = 0.025, 80% power, Poisson counts: (1.96 + 0.84)² × (1 + 1) / (ln 1.2)² = 472.2, rounded up to 473 per group.
Group 1: 473 · Group 2: 473 · Total: 946
Open this example in the calculatorProtocol statement
To show non-inferiority within a rate-ratio margin of 1.2 with 80% power at a one-sided significance level of 0.025, using a one-sided test of the rate ratio against the margin, and assuming event rates of 1 with the treatment and 1 with the comparator per unit of time and follow-up of 1 per participant, the required sample size is 473 per group (946 in total). Calculated with StatWisely (statwisely.com) using: n₁ = (z_(1-α)+z_(1-β))² × (1/(λ₁t) + k + (1/(λ₂t) + k)/r) / (ln(λ₁/λ₂) - ln M)²; n₂ = r × n₁. These are planning estimates; confirm the final design with a qualified statistician.
Over-dispersed counts
With dispersion k = 0.5 the variance term grows from 2 to 3: 708.4, so 709 per group.
Group 1: 709 · Group 2: 709 · Total: 1418
Open this example in the calculatorTwo years of follow-up
Following each participant for 2 years halves the Poisson variance: 237 per group.
Group 1: 237 · Group 2: 237 · Total: 474
Open this example in the calculatorA treatment expected to be slightly better
Expecting 0.9 against 1 with k = 0.5, the distance from the margin grows to ln 1.2 − ln 0.9 = 0.288: 296 per group.
Group 1: 296 · Group 2: 296 · Total: 592
Open this example in the calculatorA rate the treatment must keep up
For an event that should not become much rarer, a margin of 0.8: (1.96 + 0.84)² × 2 / (ln 0.8)² = 315.3, so 316 per group.
Group 1: 316 · Group 2: 316 · Total: 632
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.
- An independent implementation in R recomputes this test every night and before each production release, and the results are compared with the engine’s.
- Simulated Poisson and negative binomial trials at the planned sizes, analysed with Wald tests in generalised linear models, gave power of 0.79 to 0.84 against a target of 0.80, with the dispersion known or estimated, and a type I error of 0.020 to 0.029 at the margin against a nominal 0.025.
How to cite
StatWisely. Sample size for non-inferiority of a rate ratio. Method document, engine version 1.0.0, reviewed 2026-10-09. https://statwisely.com/methods/rates-noninferiority/
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.Chow SC, Shao J, Wang H. Sample Size Calculations in Clinical Research. 2nd ed. Boca Raton: Chapman & Hall/CRC; 2008.
- 3.Donner A, Klar N. Design and Analysis of Cluster Randomization Trials in Health Research. London: Arnold; 2000.
- 4.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
- 5.Hayes RJ, Moulton LH. Cluster Randomised Trials. 2nd ed. Boca Raton: CRC Press; 2017.
- 6.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