weighted_mad {robsurvey} | R Documentation |
Weighted Median Absolute Deviation from the Median (MAD)
Description
Weighted median of the absolute deviations from the weighted median
Usage
weighted_mad(x, w, na.rm = FALSE, constant = 1.482602)
Arguments
x |
|
w |
|
na.rm |
|
constant |
|
Details
The weighted MAD is computed as the (normalized) weighted median of the
absolute deviation from the weighted median; see
weighted_median
. The weighted MAD is normalized to be
an unbiased estimate of scale at the Gaussian core model. If
normalization is not wanted, put constant = 1
.
Value
Weighted median absolute deviation from the (weighted) median
See Also
Overview (of all implemented functions)
Examples
head(workplace)
# normalized weighted MAD (default)
weighted_mad(workplace$employment, workplace$weight)
# weighted MAD (without normalization)
weighted_mad(workplace$employment, workplace$weight, constant = 1)
[Package robsurvey version 0.6 Index]