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
| x | a numeric vector. |
| y | a numeric vector. |
| alternative | a character string specifying the alternative hypothesis. The possible values are "two.sided", "greater", and "less". |
| conf.level | confidence 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:
| statistic | The Kendall correlation coefficient. |
| p_value | The p-value of the test. |
| alternative | A 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++