statsmodels.stats.rates.test_poisson

statsmodels.stats.rates.test_poisson(count, nobs, value, method=None, alternative='two-sided', dispersion=1)[source]

Test for one sample poisson mean or rate

Parameters:
countarray_like

Observed count, number of events.

nobsarrat_like

Currently this is total exposure time of the count variable. This will likely change.

valuefloat, array_like

This is the value of poisson rate under the null hypothesis.

methodstr

Method to use for confidence interval. This is required, there is currently no default method. See Notes for available methods.

alternative{‘two-sided’, ‘smaller’, ‘larger’}

alternative hypothesis, which can be two-sided or either one of the one-sided tests.

dispersionfloat

Dispersion scale coefficient for Poisson QMLE. Default is that the data follows a Poisson distribution. Dispersion different from 1 correspond to excess-dispersion in Poisson quasi-likelihood (GLM). Dispersion coeffficient different from one is currently only used in wald and score method.

Returns:
HolderTuple instance with test statistic, pvalue and other attributes.

See also

confint_poisson

Notes

The implementatio of the hypothesis test is mainly based on the references for the confidence interval, see confint_poisson.

Available methods are:

  • “score” : based on score test, uses variance under null value

  • “wald” : based on wald test, uses variance base on estimated rate.

  • “waldccv” : based on wald test with 0.5 count added to variance computation. This does not use continuity correction for the center of the confidence interval.

  • “exact-c” central confidence interval based on gamma distribution

  • “midp-c” : based on midp correction of central exact confidence interval. this uses numerical inversion of the test function. not vectorized.

  • “sqrt” : based on square root transformed counts

  • “sqrt-a” based on Anscombe square root transformation of counts + 3/8.


Last update: Oct 08, 2024