lcor.comp {lancor} | R Documentation |
Computes the Lancaster correlation coefficient and its components.
lcor.comp(x, y = NULL, type = c("rank", "linear"), plot = FALSE)
x |
a numeric vector, or a matrix or data frame with two columns. |
y |
NULL (default) or a vector with same length as x. |
type |
a character string indicating which lancaster correlation is to be computed. One of "rank" (default), or "linear": can be abbreviated. |
plot |
logical; if TRUE, scatterplots of the transformed x and y values and of their squares are drawn. |
lcor.comp
returns a vector containing the two components rho1
and rho2
and the sample Lancaster correlation.
Hajo Holzmann, Bernhard Klar
Holzmann, Klar (2024) Lancester correlation - a new dependence measure linked to maximum correlation. arXiv:2303.17872
Sigma <- matrix(c(1,0.1,0.1,1), ncol=2)
R <- chol(Sigma)
n <- 1000
x <- matrix(rnorm(n*2), n)
nu <- 8
y <- x / sqrt(rchisq(n, nu)/nu) #multivariate t
cor(y[,1], y[,2])
lcor.comp(y, type = "linear")
x <- matrix(rnorm(n*2), n)
nu <- 2
y <- x / sqrt(rchisq(n, nu)/nu) #multivariate t
cor(y[,1], y[,2], method = "spearman")
lcor.comp(y, type = "rank", plot = TRUE)