scipy.stats.

tiecorrect#

scipy.stats.tiecorrect(rankvals)[源代码]#

用于 Mann-Whitney U 检验和 Kruskal-Wallis H 检验的关联修正因子。

参数:
rankvalsarray_like

秩的一维序列。 通常,这将是由 rankdata 返回的数组。

返回值:
factorfloat

U 或 H 的修正因子。

另请参阅

rankdata

为数据分配秩

mannwhitneyu

Mann-Whitney 秩检验

kruskal

Kruskal-Wallis H 检验

参考文献

[1]

Siegel, S. (1956) Nonparametric Statistics for the Behavioral Sciences. New York: McGraw-Hill.

示例

>>> from scipy.stats import tiecorrect, rankdata
>>> tiecorrect([1, 2.5, 2.5, 4])
0.9
>>> ranks = rankdata([1, 3, 2, 4, 5, 7, 2, 8, 4])
>>> ranks
array([ 1. ,  4. ,  2.5,  5.5,  7. ,  8. ,  2.5,  9. ,  5.5])
>>> tiecorrect(ranks)
0.9833333333333333