Kendall Correlation Test

Description

Kendall correlation using the exact values when the number of observations is less than 50. For larger samples, it uses an approximation as in base R.

Arguments

xa numeric vector.
ya numeric vector.
alternativea character string specifying the alternative hypothesis. The possible values are "two.sided", "greater", and "less".
conf.levelconfidence level for the returned confidence interval. Must be a single number between 0 and 1. Default is 0.95.

Return

A list with the following components:

statisticThe Kendall correlation coefficient.
p_valueThe p-value of the test.
alternativeA character string describing the alternative hypothesis.

Examples

x <- c(1, 0, 2)
y <- c(5, 3, 4)
kendall_cor_test(x, y)
##
## 	Kendall's rank correlation tau
##
## data:  x and y
## tau = 0.33333, p-value = 1
## alternative hypothesis: true tau is not equal to 0
## 95 percent confidence interval:
##  -0.9176818  1.0000000
## 

References

Kendall's Tau with Ungrouped Data". Journal of the American Statistical Association, 61(314), 436–439.

Abrevaya J. (1999). Computation of the Maximum Rank Correlation Estimator. Economic Letters 62, 279-285.

Christensen D. (2005). Fast algorithms for the calculation of Kendall's Tau. Journal of Computational Statistics 20, 51-62.

Emara (2024). Khufu: Object-Oriented Programming using C++

Last updated: 2025-10-12 22:30:06