{ } Raw JSON

bundles / scipy 1.18.0 / scipy / stats / _stats_py / tiecorrect

function

scipy.stats._stats_py:tiecorrect

source: /scipy/stats/_stats_py.py:8419

Signature

def tiecorrect(rankvals)

Summary

Tie correction factor for Mann-Whitney U and Kruskal-Wallis H tests.

Parameters

rankvals : array_like

A 1-D sequence of ranks. Typically this will be the array returned by rankdata.

Returns

factor : float

Correction factor for U or H.

Examples

from scipy.stats import tiecorrect, rankdata
✓
tiecorrect([1, 2.5, 2.5, 4])
✗
np.float64(0.9)
ranks = rankdata([1, 3, 2, 4, 5, 7, 2, 8, 4])
✓
ranks
tiecorrect(ranks)
✗
np.float64(0.9833333333333333)

See also

kruskal

Kruskal-Wallis H test

mannwhitneyu

Mann-Whitney rank test

rankdata

Assign ranks to the data

Aliases

  • scipy.stats.tiecorrect