statsmodels.stats.rates.tost_poisson_2indep

statsmodels.stats.rates.tost_poisson_2indep(count1, exposure1, count2, exposure2, low, upp, method='score')[source]

Equivalence test based on two one-sided test_proportions_2indep

This assumes that we have two independent binomial samples.

The Null and alternative hypothesis for equivalence testing are

  • H0: g1 / g2 <= low or upp <= g1 / g2

  • H1: low < g1 / g2 < upp

where g1 and g2 are the Poisson rates.

Parameters
count1int

Number of events in first sample

exposure1float

Total exposure (time * subjects) in first sample

count2int

Number of events in second sample

exposure2float

Total exposure (time * subjects) in second sample

low, upp :

equivalence margin for the ratio of Poisson rates

method: string

Method for the test statistic and the p-value. Defaults to ‘score’. Current Methods are based on Gu et. al 2008 Implemented are ‘wald’, ‘score’ and ‘sqrt’ based asymptotic normal distribution, and the exact conditional test ‘exact-cond’, and its mid-point version ‘cond-midp’, see Notes

Returns
resultsinstance of HolderTuple class

The two main attributes are test statistic statistic and p-value pvalue.

Notes

  • ‘wald’: method W1A, wald test, variance based on separate estimates

  • ‘score’: method W2A, score test, variance based on estimate under Null

  • ‘wald-log’: W3A not implemented

  • ‘score-log’ W4A not implemented

  • ‘sqrt’: W5A, based on variance stabilizing square root transformation

  • ‘exact-cond’: exact conditional test based on binomial distribution

  • ‘cond-midp’: midpoint-pvalue of exact conditional test

The latter two are only verified for one-sided example.

References

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