statsmodels.sandbox.stats.multicomp.homogeneous_subsets

statsmodels.sandbox.stats.multicomp.homogeneous_subsets(vals, dcrit)[source]

递归检查所有值对的最小距离

如Newman-Keuls和Ryan程序中的逐步下降方法。这不是一个封闭的过程,因为并非所有分区都被检查。

Parameters:
valsarray_like

成对比较的值

dcritarray_like or float

拒绝的关键距离,可以是浮点数,或者是二维数组,上三角部分为距离。

Returns:
rejslist of pairs

成对索引列表,其差值(严格)大于临界差值

nrejslist of pairs

小于临界差异的配对指数列表

llilist of tuples

小于临界差异的子集列表

restree

所有比较的结果(用于检查)

this follows description in SPSS notes on Post-Hoc Tests
Because of the recursive structure, some comparisons are made several
times, but only unique pairs or sets are returned.

示例

>>> m = [0, 2, 2.5, 3, 6, 8, 9, 9.5,10 ]
>>> rej, nrej, ssli, res = homogeneous_subsets(m, 2)
>>> set_partition(ssli)
([(5, 6, 7, 8), (1, 2, 3), (4,)], [0])
>>> [np.array(m)[list(pp)] for pp in set_partition(ssli)[0]]
[array([  8. ,   9. ,   9.5,  10. ]), array([ 2. ,  2.5,  3. ]), array([ 6.])]

Last update: Oct 16, 2024