statsmodels.stats.rates.power_poisson_ratio_2indep(rate1, rate2, nobs1, nobs_ratio=1, exposure=1, value=0, alpha=0.05, dispersion=1, alternative='smaller', method_var='alt', return_results=True)[source]

Power of test of ratio of 2 independent poisson rates.

This is based on Zhu and Zhu and Lakkis. It does not directly correspond to test_poisson_2indep.


Poisson rate for the first sample, treatment group, under the alternative hypothesis.


Poisson rate for the second sample, reference group, under the alternative hypothesis.

nobs1float or int

Number of observations in sample 1.


Sample size ratio, nobs2 = nobs_ratio * nobs1.


Exposure for each observation. Total exposure is nobs1 * exposure and nobs2 * exposure.

alphafloat in interval (0,1)

Significance level, e.g. 0.05, is the probability of a type I error, that is wrong rejections if the Null Hypothesis is true.


Rate ratio, rate1 / rate2, under the null hypothesis.


Dispersion coefficient for quasi-Poisson. Dispersion different from one can capture over or under dispersion relative to Poisson distribution.

method_var{“score”, “alt”}

The variance of the test statistic for the null hypothesis given the rates under the alternative can be either equal to the rates under the alternative method_var="alt", or estimated under the constrained of the null hypothesis, method_var="score".

alternativestr, ‘two-sided’ (default), ‘larger’, ‘smaller’

Alternative hypothesis whether the power is calculated for a two-sided (default) or one sided test. The one-sided test can be either ‘larger’, ‘smaller’.


If true, then a results instance with extra information is returned, otherwise only the computed power is returned.

resultsresults instance or float

If return_results is False, then only the power is returned. If return_results is True, then a results instance with the information in attributes is returned.


Power of the test, e.g. 0.8, is one minus the probability of a type II error. Power is the probability that the test correctly rejects the Null Hypothesis if the Alternative Hypothesis is true.

Other attributes in results instance include :


standard error of difference under the null hypothesis (without sqrt(nobs1))


standard error of difference under the alternative hypothesis (without sqrt(nobs1))



Zhu, Haiyuan. 2017. “Sample Size Calculation for Comparing Two Poisson or Negative Binomial Rates in Noninferiority or Equivalence Trials.” Statistics in Biopharmaceutical Research, March.


Zhu, Haiyuan, and Hassan Lakkis. 2014. “Sample Size Calculation for Comparing Two Negative Binomial Rates.” Statistics in Medicine 33 (3): 376–87.


PASS documentation