For each continuous column, standardize by median and MAD, then apply a robust weight function (Huber or Tukey bisquare) to obtain a weight in \([0, 1]\) per cell. Categorical (factor, character, logical) columns receive weight 1.

cellWeights(X, method = "huber", alpha = NULL)

Arguments

X

a data frame or matrix of dimension \(n \times p\)

method

weight function: "huber" or "tukey", Default: "huber"

alpha

tuning constant. If NULL, the default for the chosen method is used (1.345 for Huber, 4.685 for Tukey).

Value

an \(n \times p\) numeric matrix of weights

Author

Matthias Templ