Skip to contents

Smooth survey weights via shrinkage toward the mean (or log-mean).

Usage

morie_weights_smooth(
  weights,
  method = c("linear_shrinkage", "log_transform"),
  shrinkage_factor = 0.5
)

Arguments

weights

Numeric vector of unit-level design weights.

method

Character; calibration / smoothing / variance method. Allowed values depend on the caller.

shrinkage_factor

Numeric in [0, 1]; smoothing pull-toward- mean factor.

Value

A numeric value.

Examples

set.seed(1)
res <- morie_weights_smooth(runif(30, 0.5, 5))
str(res, max.level = 1)
#>  num [1:30] 2.24 2.48 2.94 3.69 2.1 ...