calculateXI: Compute the cross rank coefficient xi on two vectors.

View source: R/calculateXI.R

calculateXIR Documentation

Compute the cross rank coefficient xi on two vectors.

Description

This function computes the xi coefficient between two vectors x and y.

Usage

calculateXI(xvec, yvec, simple = TRUE)

Arguments

xvec

Vector of numeric values in the first coordinate.

yvec

Vector of numeric values in the second coordinate.

simple

Whether auxiliary information is kept to pass on.

Value

In the case simple = TRUE, function returns the value of the xi coefficient, If simple = FALSE is chosen, the function returns a list:

xi

The xi coefficient

fr

rearranged rank of yvec

CU

mean(gr*(1-gr))

Note

Auxiliary function with no checks for NA, etc.

Author(s)

Sourav Chatterjee, Susan Holmes

References

Chatterjee, S. (2020) A New Coefficient Of Correlation, <arXiv:1909.10140>.

See Also

xicor

Examples

# Compute one of the coefficients
library("psychTools")
data(peas)
calculateXI(peas$parent,peas$child)
calculateXI(peas$child,peas$parent)

XICOR documentation built on April 21, 2023, 5:06 p.m.