
IQR-Based Top/Bottom Coding for a Single Variable
iqr_top_bottom_coding.RdInternal utility that applies top and/or bottom coding to a numeric vector using an IQR rule
on the log() transformation.
Usage
iqr_top_bottom_coding(
x,
w = NULL,
times = 3,
type = c("type_4", "type_2"),
one_sided = NULL
)Arguments
- x
Numeric vector. Variable to be top/bottom coded.
- w
Optional numeric vector of weights.
- times
Numeric. Multiplier for IQR to determine bounds (default is 3).
- type
Character. Quantile estimation type, passed to
compute_weighted_percentilesfunction (e.g.,"type_4","type_2").- one_sided
Character.
"top","bottom", orNULL(default) for two-sided coding.