View source: R/23_Chatterjee.R
| xi_stable | R Documentation |
Computes Chatterjee's xi B times with random tie-breaking and returns the average. This stabilizes the estimate against tie-breaking variability, which is important for ordinal data with many ties (e.g., Likert-scale items).
xi_stable(x, y, B = 1000, seed = NULL)
x |
Numeric or ordered factor (predictor) |
y |
Numeric or ordered factor (response) |
B |
Number of bootstrap replications. Default 1000. |
seed |
Optional integer seed for reproducibility. |
For each of the B replications, ties in x are broken randomly via
rank(x, ties.method = "random") inside chatterjee_xi().
The standard error of the mean shrinks as 1 / sqrt(B); B = 1000 typically
yields SE around 0.001 for moderately tied data.
A list with elements:
Mean of the B Chatterjee xi values.
Standard deviation of the B values (tie-breaking spread).
Standard error of the mean (sd / sqrt(B)).
Number of bootstrap replications used.
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)
xi_stable(x, y, B = 500, seed = 42)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.