method = "percentile" clips at the specified percentiles;
method = "winsorize" replaces outliers with the boundary values.
Usage
morie_weights_trim(
weights,
lower_percentile = 1,
upper_percentile = 99,
method = c("percentile", "winsorize")
)
Arguments
- weights
Numeric vector of unit-level design weights.
- lower_percentile
Lower percentile cut for trim.
- upper_percentile
Upper percentile cut for trim.
- method
Character; calibration / smoothing / variance method.
Allowed values depend on the caller.
Value
A numeric vector of trimmed weights.
Examples
set.seed(1)
res <- morie_weights_trim(runif(30, 0.5, 5))
str(res, max.level = 1)
#> num [1:30] 1.69 2.17 3.08 4.59 1.41 ...