close
close

first Drop

Com TW NOw News 2024

Kendallknight: An R Package for Kendall’s Correlation Coefficient
news

Kendallknight: An R Package for Kendall’s Correlation Coefficient

(This article was first published on pacha.dev/blogand kindly contributed to R-bloggers). (You can report problems with the content of this page here)


Want to share your content on R-bloggers? Click here if you have a blog, or here if you don’t.

Motivation

Existing R packages, such as pcaPP, provide efficient implementations of the Kendall correlation coefficient. However, I wanted to create my own package, solely for this purpose, without additional features, and that also allows for testing hypotheses about the correlation coefficient.

Installation

You can install the development version from GitHub using:

remotes::install_github("pachadotdev/Kendallknight")

Usage

library(kendallknight)

x  kendall_cor(x, y)
(1) -1

> kendall_cor_test(x, y, "two.sided")
$statistic
(1) -1

$p_value
(1) 0.01666667

$alternative
(1) "alternative hypothesis: true tau is not equal to 0"

Details

The package is largely implemented in C++ using cpp11 to export the functions to R.

View more