kendall_cor_test {kendallknight}R Documentation

Kendall Correlation Test

Description

kendall_cor_test() calculates p-value for the the 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.

Usage

kendall_cor_test(
  x,
  y,
  alternative = c("two.sided", "greater", "less"),
  conf.level = 0.95
)

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.

Value

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.

References

Knight, W. R. (1966). "A Computer Method for Calculating 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++

Examples

x <- c(1, 0, 2)
y <- c(5, 3, 4)
kendall_cor_test(x, y)


[Package kendallknight version 0.7.0 Index]