statsmodels.stats.contingency_tables.cochrans_q

statsmodels.stats.contingency_tables.cochrans_q(x, return_object=True)[source]

用于相同二项比例的Cochran’s Q检验。

Parameters:
xarray_like, 2d (N, k)

具有N个案例和k个变量的数据

return_objectbool

返回值作为bunch而不是作为单独的值。

Returns:
Returns a bunch containing the following attributes, or the
individual values according to the value of return_object.
statisticfloat

测试统计量

pvaluefloat

来自卡方分布的p值

注释

Cochran’s Q 是 McNemar 检验的 k 样本扩展。如果只有两个组,那么 Cochran’s Q 检验和 McNemar 检验是等价的。

该过程测试每个组的成功的概率是相同的。备择假设是至少有两个组的成功的概率不同。

在维基百科术语中,行是块,列是处理。行数N应该足够大,以使卡方分布成为良好的近似。

检验的零假设是所有处理具有相同的效果。

参考文献

https://en.wikipedia.org/wiki/Cochran_test SAS 非参数检验手册


Last update: Oct 16, 2024