Skip to contents

\(w_i^{ps} = w_i \cdot N_h / \hat{N}_h\).

Usage

morie_weights_poststratify(weights, strata, population_totals)

Arguments

weights

Numeric vector of unit-level design weights.

strata

Optional vector of stratum identifiers aligned with weights.

population_totals

Named numeric vector of target totals to calibrate to.

Value

A numeric value (scalar).

Examples

set.seed(1)
res <- morie_weights_poststratify(rep(1, 20), rep(c("a", "b"), 10),
                                  c(a = 60, b = 40))
str(res, max.level = 1)
#>  num [1:20] 6 4 6 4 6 4 6 4 6 4 ...