View source: R/apply_iqr_top_bottom_coding.R
iqr_top_bottom_coding | R Documentation |
Internal utility that applies top and/or bottom coding to a numeric vector using an IQR rule
on the log()
transformation.
iqr_top_bottom_coding(
x,
w = NULL,
times = 3,
type = c("type_4", "type_2"),
one_sided = NULL
)
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 |
one_sided |
Character. |
A numeric vector with values above or below the threshold replaced (on the original scale).
## Not run:
data <- lissyrtools::lissyuse(data = "it16", vars = c("dhi"))
iqr_top_bottom_coding(data$it16h$dhi)
iqr_top_bottom_coding(data$it16h$dhi, data$it16h$hwgt, one_sided = "top")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.