This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / stats / _stats_py / tiecorrect

function

scipy.stats._stats_py:tiecorrect

source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_stats_py.py:8451

Signature

def tiecorrect(rankvals)

Summary

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

Extended Summary

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.

Notes

Array API Standard Support

tiecorrect is not in-scope for support of Python Array API Standard compatible backends other than NumPy.

See dev-arrayapi for more information.

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