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:
count1int

Number of events in first sample

exposure1float

Total exposure (time * subjects) in first sample

count2int

Number of events in first sample

exposure2float

Total exposure (time * subjects) in first sample

ratiofloat

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.

alternativestr

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

ygridNone or 1-D ndarray

Grid values for counts of the Poisson distribution used for computing the pvalue. By default truncation is based on an upper tail Poisson quantiles.

Returns:
stat_samplefloat

test statistic for the sample

pvaluefloat

References

Gu, Ng, Tang, Schucany 2008: Testing the Ratio of Two Poisson Rates, Biometrical Journal 50 (2008) 2, 2008