kendall

Syntax

kendall(X, Y)

Arguments

X is a scalar, vector, matrix or in-memory table.

Y is a scalar, vector, matrix or in-memory table.

Details

Calculate the Kendall rank correlation coefficient between X and Y. NULL values are ignored in the calculation.

If X or Y is a matrix, perform the aforementioned calculation on each column and return a vector.

If X or Y is an in-memory table, perform the aforementioned calculation on each numeric column of the table and return a table (where NULLs are returned for non-numeric columns).

Examples

x = [33,21,46,-11,78,47,18,20,-5,66]
y = [1,NULL,10,6,10,3,NULL,NULL,5,3]
kendall(x, y)
// output
0.05

If X is a matrix, Y can be a vector of the same length as the number of rows in X, or a matrix of the same dimension as X. The result is a vector of the same length as the number of columns in X.

m=1..20$10:2
kendall(x,m)
// output
[-0.0222,-0.0222]

n=rand(20,20)$10:2
kendall(m,n)
// output
[0.3865,-0.1591]

If X is a table, Y can be a vector of the same length as the number of rows in X, or a table of the same dimension as X. The result is a vector of the same length as the number of columns in X.

t=table(2..11 as id, "a"+string(2..11) as name)
kendall(t,x)
// output
id	     name
-0.0222	

t1=table(x as col1, y as col2)
kendall(t,t1)
// output
id	     name
-0.0222