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]

两个独立泊松率比率或差异的置信区间。

Parameters:
count1int

第一个样本中的事件数量。

exposure1float

第一个样本中的总暴露量(时间 * 受试者)。

count2int

第二个样本中的事件数量。

exposure2float

总曝光量(时间 * 样本数)在第二个样本中。

methodstr

测试统计量和p值的方法。默认为‘score’。 参见注释。

比率:

  • ‘wald’: 尚未实现, 方法 W1A, wald 检验, 基于观察率的方差

  • ‘waldcc’ :

  • ‘score’: 方法 W2A, 得分检验, 基于零假设下估计的方差

  • ‘wald-log’: W3A, 使用对数比率,方差基于观察到的比率

  • ‘score-log’ W4A,使用对数比率,基于零假设下的估计的方差

  • ‘sqrt’: W5A,基于方差稳定平方根变换

  • ‘sqrtcc’ :

  • ‘exact-cond’: 尚未实现,基于二项分布的精确条件检验 该方法使用 binom_test,在双侧情况下最小似然。

  • ‘cond-midp’: 尚未实现, 精确条件检验的中点p值

  • ‘移动’ :

差异:

  • ‘wald’,

  • ‘waldccv’

  • ‘分数’

  • ‘移动’

compare{‘diff’, ‘ratio’}

默认是“ratio”。 如果 compare 是 diff,那么假设检验是针对 diff = rate1 - rate2。 如果 compare 是 ratio,那么假设检验是针对 由 ratio = rate1 / rate2 定义的率比。

alternativestr

备择假设,H1,必须是以下之一

  • ‘双侧’: H1: 比率之比不等于 ratio_null(默认)

  • ‘larger’ : H1: 比率之比大于 ratio_null

  • ‘smaller’ : H1: 比率之比小于 ratio_null

alphafloat in (0, 1)

显著性水平,置信区间的名义覆盖率为1 - alpha。

Returns:
tuple (low, upp)confidence limits.

Last update: Oct 16, 2024