Skip to contents

For multi-variable marginals use morie_weights_rake(); this helper is the single-variable convenience.

Usage

morie_survey_calibrate(
  df,
  aux_vars,
  population_totals,
  max_iter = 50,
  tol = 1e-06
)

Arguments

df

A data.frame holding the (unit-level) sample data plus any weight/strata/cluster/domain columns referenced by name.

aux_vars

Character vector of column names of auxiliary variables used for calibration (raking, GREG, etc.).

population_totals

Named numeric vector of population totals to calibrate to (one entry per aux_vars element).

max_iter

Iteration cap for the iterative calibration loop.

tol

Convergence tolerance for calibration.