tau: Kendall tau Rank Correlation Coefficients

Description Usage Arguments Value References See Also Examples

Description

tau is the rank correlation coefficient by Kendall, where neither vector can contain tied items. tau_a and tau_b are the versions developed to cope with ties under the scenarios of accuracy and agreement, respectively. See the references for details.

Usage

1
2
3
4
5
tau(x, y)

tau_a(x, y)

tau_b(x, y)

Arguments

x

a numeric vector. In tau_a this is the vector of true scores.

y

a numeric vector of the same length as x. In tau_a this is the vector of estimated scores.

Value

The correlation coefficient.

References

M.G. Kendall (1970). Rank Correlation Methods. Charles Griffin & Company Limited.

See Also

tauAP for AP correlation coefficients.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# No ties
x <- c(0.67, 0.45, 0.29, 0.12, 0.57, 0.24, 0.94, 0.75, 0.08, 0.54)
y <- c(0.48, 0.68, 0.32, 0.09, 0.06, 0.61, 0.87, 0.22, 0.44, 0.84)
tau(x, y)
tau_a(x,y) # same as tau
tau_b(x,y) # same as tau

# Ties in y
y <- round(y, 1)
tau_a(x, y)
tau_b(x, y)

# Ties in x too
x <- round(x, 1)
tau_b(x, y)

Example output

[1] 0.2
[1] 0.2
[1] 0.2
[1] 0.2222222
[1] 0.2247333
[1] 0.25

ircor documentation built on May 2, 2019, 2:10 a.m.

Related to tau in ircor...