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

bundles / scipy latest / scipy / stats / _mstats_basic / kendalltau

function

scipy.stats._mstats_basic:kendalltau

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

Signature

def kendalltau(x, y, use_ties = True, use_missing = False, method = auto, alternative = two-sided)

Summary

Computes Kendall's rank correlation tau on two variables x and y.

Parameters

x : sequence

First data list (for example, time).

y : sequence

Second data list.

use_ties : {True, False}, optional

Whether ties correction should be performed.

use_missing : {False, True}, optional

Whether missing data should be allocated a rank of 0 (False) or the average rank (True)

method : {'auto', 'asymptotic', 'exact'}, optional

Defines which method is used to calculate the p-value [1]. 'asymptotic' uses a normal approximation valid for large samples. 'exact' computes the exact p-value, but can only be used if no ties are present. As the sample size increases, the 'exact' computation time may grow and the result may lose some precision. 'auto' is the default and selects the appropriate method based on a trade-off between speed and accuracy.

alternative : {'two-sided', 'less', 'greater'}, optional

Defines the alternative hypothesis. Default is 'two-sided'. The following options are available:

  • 'two-sided': the rank correlation is nonzero

  • 'less': the rank correlation is negative (less than zero)

  • 'greater': the rank correlation is positive (greater than zero)

Returns

res : SignificanceResult

An object containing attributes:

statistic

The tau statistic.

pvalue

The p-value for a hypothesis test whose null hypothesis is an absence of association, tau = 0.

Aliases

  • scipy.stats._mstats_basic.kendalltau

Referenced by