statsmodels.stats.rates.tost_poisson_2indep

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

基于两个单侧的等效性检验 test_proportions_2indep

这假设我们有两个独立的泊松样本。

等效性检验的零假设和备择假设是

对于 compare = ‘ratio’

  • H0: rate1 / rate2 <= low 或 upp <= rate1 / rate2

  • H1: 低 < rate1 / rate2 < 高

对于 compare = ‘diff’

  • H0: rate1 - rate2 <= low 或 upp <= rate1 - rate2

  • H1: 低 < 比率 - 比率 < 高

Parameters:
count1int

第一个样本中的事件数量

exposure1float

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

count2int

第二个样本中的事件数量

exposure2float

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

low, upp

泊松率比值或差异的等效边际

method: string

TOST 使用 test_poisson_2indep 并且具有相同的方法。

比率:

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

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

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

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

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

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

    这使用了 binom_test,它在双侧情况下类似于最小似然法。

  • ‘cond-midp’: 精确条件检验的中点p值

  • ‘etest’ 或 ‘etest-score: 带分数的etest统计量

  • ‘etest-wald’: 使用wald检验统计量的etest

差异:

  • ‘wald’,

  • ‘waldccv’

  • ‘分数’

  • ‘etest-score’ 或 ‘etest: etest with score test statistic

  • ‘etest-wald’: 使用wald检验统计量的etest

Returns:
resultsinstance of HolderTuple class

两个主要属性是检验统计量 statistic 和 p 值 pvalue

参考文献

Gu, Ng, Tang, Schucany 2008: 测试两个泊松率的比例, 生物计量学杂志 50 (2008) 2, 2008


Last update: Oct 16, 2024