Raking calibration to known marginal totals (iterative proportional fitting).
Source:R/survey.R
morie_survey_calibrate.RdFor multi-variable marginals use morie_weights_rake(); this helper is the
single-variable convenience.
Arguments
- df
A
data.frameholding 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_varselement).- max_iter
Iteration cap for the iterative calibration loop.
- tol
Convergence tolerance for calibration.