lcor.comp | 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. |
For more details see lcor
.
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". \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1111/sjos.12733")}
lcor, lcor.comp, lcor.test
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.