statsmodels.stats.rates.etest_poisson_2indep¶
-
statsmodels.stats.rates.
etest_poisson_2indep
(count1, exposure1, count2, exposure2, ratio_null=1, method='score', alternative='2-sided', ygrid=None)[source]¶ E-test for ratio of two sample Poisson rates
If the two Poisson rates are g1 and g2, then the Null hypothesis is
H0: g1 / g2 = ratio_null
against one of the following alternatives
H1_2-sided: g1 / g2 != ratio_null
H1_larger: g1 / g2 > ratio_null
H1_smaller: g1 / g2 < ratio_null
- Parameters
- count1
int
Number of events in first sample
- exposure1
float
Total exposure (time * subjects) in first sample
- count2
int
Number of events in first sample
- exposure2
float
Total exposure (time * subjects) in first sample
- ratio
float
ratio of the two Poisson rates under the Null hypothesis. Default is 1.
- method{“score”, “wald”}
Method for the test statistic that defines the rejection region.
- alternative
str
The alternative hypothesis, H1, has to be one of the following
‘two-sided’: H1: ratio of rates is not equal to ratio_null (default) ‘larger’ : H1: ratio of rates is larger than ratio_null ‘smaller’ : H1: ratio of rates is smaller than ratio_null
- ygrid
None
or 1-Dndarray
Grid values for counts of the Poisson distribution used for computing the pvalue. By default truncation is based on an upper tail Poisson quantiles.
- count1
- Returns
References
Gu, Ng, Tang, Schucany 2008: Testing the Ratio of Two Poisson Rates, Biometrical Journal 50 (2008) 2, 2008