# Generate example data
set.seed(123)
n <- 50
x <- matrix(rnorm(n * 5), nrow = n) # multivariate data with 5 variables
y <- rbinom(n, 1, 0.5) # binary covariate
# Compute MDC with U-centering
mdc(x, y, center = "U")
# Compute MDC with double-centering
mdc(x, y, center = "D")
Run the code above in your browser using DataLab