kendalw

utils.kendalw(data, ranked=False)[source]

Calculates Kendall’s W for a n*m array with n items and m ‘judges’.

Parameters:
  • data (list or np.ndarray) – The data in the form of an n*m array with n items and m ‘judges’
  • ranked (bool, optional) – If the data has already been ranked or not. Default False
Returns:

w – The Kendall’s W

Return type:

float

Notes

Based on Legendre, P. (2010). Coefficient of Concordance. In Encyclopedia of Research Design (pp. 164–169). 2455 Teller Road, Thousand Oaks California 91320 United States: SAGE Publications, Inc. http://doi.org/10.4135/9781412961288.n55

Examples

>>> data = np.array([[2., 0., 5., 1.], [3., 3., 3., 4.], [1., 5., 3., 5.], [1., 1., 4., 2.], [2., 4., 5., 1.], [1., 0., 0., 2.]])
>>> kendalw(data)
0.22857142857142856
>>> data = np.array([[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3], [4, 4, 4, 4], [5, 5, 5, 5], [6, 6, 6, 6]])
>>> kendalw(data)
1.0