Counts and Rates
Sample size for comparing two negative binomial event rates when count outcomes are overdispersed. Uses the negative binomial regression framework of Zhu and Lakkis (2014), with the maximum-likelihood estimate of the null variance. Runs entirely in your browser.
Negative binomial regression is useful for count outcomes whose variance exceeds the mean. this method describes the model with a negative binomial dispersion parameter κ and uses a log-link regression model in which the treatment coefficient represents the log of the event-rate ratio.
This calculator implements the two-group sample-size calculation described by Zhu and Lakkis (2014) and reproduced in the this method procedure Tests for the Ratio of Two Negative Binomial Rates. The calculation is for a Wald or likelihood-ratio test of the treatment regression coefficient.
Here, λ1 is the control event rate, λ2 is the treatment event rate, and RR = λ2/λ1. The average exposure time is denoted by μt. The allocation ratio is R = N2/N1.
The alternative variance component used by Zhu and Lakkis is VA:
For the maximum-likelihood estimate of the null variance, the corresponding component is:
For a two-sided test, the required number of subjects in Group 1 is:
For a one-sided test, z1−α/2 is replaced by z1−α. Group 2 is then obtained from N2 = R N1. The displayed group sample sizes are rounded upward to whole subjects.
The negative binomial dispersion parameter is κ. Under the parameterization used by this method, κ is the additional variance component beyond the Poisson mean-variance relationship. Larger κ values increase the variance component used in the sample-size calculation and therefore generally increase the required sample size.
this method provides a validation example based on Zhu and Lakkis (2014). The design is two-sided with 80% power and α = 0.05, equal allocation, average exposure time 0.75 years, control event rate 0.8 events per patient-year, treatment rate ratio 0.85, and κ = 0.4.
The implementation reproduces the this method validation result: 1,311 subjects per group, with calculated power approximately 0.800.
Note that these asymptotic Wald and likelihood-ratio calculations are most appropriate when the sample size exceeds approximately 50 subjects per group. When the resulting sample size is smaller, the calculation should be regarded as a rough planning estimate rather than a substitute for simulation or small-sample methods.
Zhu, H., & Lakkis, H. (2014). Sample size calculation for comparing
two negative binomial rates. Statistics in Medicine, 33(3),
376–387. doi:10.1002/sim.5947.
Publisher / article record
the software / this method. Tests for the Ratio of Two Negative Binomial Rates,
Chapter 438. the relevant methodological literature describes the negative binomial
regression model, variance calculations, sample-size formula, and
validation against Zhu and Lakkis (2014).
this method procedure documentation