lcor.comp: Lancaster correlation and its components

View source: R/lcor.comp.R

lcor.compR Documentation

Lancaster correlation and its components

Description

Computes the Lancaster correlation coefficient and its components.

Usage

lcor.comp(x, y = NULL, type = c("rank", "linear"), plot = FALSE)

Arguments

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.

Details

For more details see lcor.

Value

a vector containing the two components rho1 and rho2 and the sample Lancaster correlation.

Author(s)

Hajo Holzmann, Bernhard Klar

References

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")}

See Also

lcor, lcor.comp, lcor.test

Examples

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)



lancor documentation built on Aug. 22, 2025, 9:16 a.m.