The lancor package implements the methods described in Holzmann, Klar (2024). Lancaster correlation is a correlation coefficient which equals the absolute value of the Pearson correlation for the bivariate normal distribution, and is equal to or slightly less than the maximum correlation coefficient for a variety of bivariate distributions. Rank and moment-based estimators and corresponding confidence intervals are implemented, as well as independence tests based on these statistics.
The Lancaster correlation coefficient and the linear Lancaster
correlation coefficient are estimated via the lcor
function:
n <- 1000
x <- matrix(rnorm(n*2), n)
lcor(x, type = "rank")
lcor(x, type = "linear")Confidence intervals are given by the lcor.ci
function:
n <- 1000
x <- matrix(rnorm(n*2), n)
nu <- 2
y <- x / sqrt(rchisq(n, nu)/nu)
lcor(y, type = "rank")
lcor.ci(y, type = "rank")Finally the Lancaster correlation test of bivariate independence
lcor.test:
n <- 200
x <- matrix(rnorm(n*2), n)
nu <- 2
y <- x / sqrt(rchisq(n, nu)/nu)
cor.test(y[,1], y[,2], method = "spearman")
lcor.test(y, type = "rank") The lancor package can be installed from within R
via
install.packages("lancor")Hajo Holzmann, Bernhard Klar
GPL-2
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.