View source: R/23_Chatterjee.R
| chatterjee_xi | R Documentation |
Computes Chatterjee's (2021) rank-based correlation coefficient xi. Unlike Pearson or Spearman, xi is asymmetric: xi(x, y) and xi(y, x) may differ. This asymmetry is the basis for direction-detection in graphical models.
chatterjee_xi(x, y, ties_method = "random")
x |
Numeric or ordered factor (predictor) |
y |
Numeric or ordered factor (response) |
ties_method |
How to break ties in x. Default "random". |
For tied x values, ranks are broken using ties_method. With
"random" (the default), each call may produce a slightly
different value due to random tie-breaking. Use xi_stable()
to average over many randomizations.
Numeric scalar: Chatterjee's xi value.
Chatterjee, S. (2021). A new coefficient of correlation. Journal of the American Statistical Association, 116(536), 2009-2022.
x <- rnorm(100)
y <- x^2 + rnorm(100, sd = 0.1)
chatterjee_xi(x, y) # near 1, since y is determined by x
chatterjee_xi(y, x) # smaller, since x is not determined by y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.