Learn R Programming

VIM (version 7.3.0)

.robust_scale: Robust scale estimate via MAD

Description

Computes the median absolute deviation with a fallback for zero or near-zero MAD (constant columns). In that case the inter-quartile range scaled to match the normal distribution is used. If both are zero, returns 1 so that standardized values remain unchanged.

Usage

.robust_scale(x)

Value

positive numeric scalar

Arguments

x

numeric vector (NAs are removed internally)

Author

Matthias Templ