Learn R Programming

exametrika (version 1.14.0)

xi_stable: Bootstrap-averaged Chatterjee's xi

Description

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).

Usage

xi_stable(x, y, B = 1000, seed = NULL)

Value

A list with elements:

xi

Mean of the B Chatterjee xi values.

sd

Standard deviation of the B values (tie-breaking spread).

se

Standard error of the mean (sd / sqrt(B)).

B

Number of bootstrap replications used.

Arguments

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.

Details

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.

References

Chatterjee, S. (2021). A new coefficient of correlation. Journal of the American Statistical Association, 116(536), 2009-2022.

Examples

Run this code
# \donttest{
x <- rnorm(100)
y <- x^2 + rnorm(100, sd = 0.1)
xi_stable(x, y, B = 500, seed = 42)
# }

Run the code above in your browser using DataLab