statsmodels.stats.rates.confint_poisson_2indep

statsmodels.stats.rates.confint_poisson_2indep(count1, exposure1, count2, exposure2, method='score', compare='ratio', alpha=0.05, method_mover='score')[source]

Confidence interval for ratio or difference of 2 indep poisson rates.

Parameters:
  • count1 (int) – Number of events in first sample.

  • exposure1 (float) – Total exposure (time * subjects) in first sample.

  • count2 (int) – Number of events in second sample.

  • exposure2 (float) – Total exposure (time * subjects) in second sample.

  • method (string) –

    Method for the test statistic and the p-value. Defaults to ‘score’. see Notes.

    ratio:

    • ’wald’: NOT YET, method W1A, wald test, variance based on observed rates

    • ’waldcc’ :

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

    • ’wald-log’: W3A, uses log-ratio, variance based on observed rates

    • ’score-log’ W4A, uses log-ratio, variance based on estimate under the Null hypothesis

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

    • ’sqrtcc’ :

    • ’exact-cond’: NOT YET, exact conditional test based on binomial distribution This uses binom_test which is minlike in the two-sided case.

    • ’cond-midp’: NOT YET, midpoint-pvalue of exact conditional test

    • ’mover’ :

    diff:

    • ’wald’,

    • ’waldccv’

    • ’score’

    • ’mover’

  • compare ({'diff', 'ratio'}) – Default is “ratio”. If compare is diff, then the hypothesis test is for diff = rate1 - rate2. If compare is ratio, then the hypothesis test is for the rate ratio defined by ratio = rate1 / rate2.

  • alternative (string) –

    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

  • alpha (float in (0, 1)) – Significance level, nominal coverage of the confidence interval is 1 - alpha.

Returns:

tuple (low, upp)

Return type:

confidence limits.