Learn R Programming

VIM (version 7.3.0)

cellWeights: Compute per-cell contamination weights

Description

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.

Usage

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

Value

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

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

Author

Matthias Templ