Closed-form linear calibration to match population totals on auxiliary X.
When survey is installed, defers to survey::calibrate() for a fully
design-aware result; otherwise computes the linear adjustment in base R.
Arguments
- weights
Numeric vector of unit-level design weights.
- X
A numeric matrix or
data.frameof auxiliary variables (one row per unit) used by GREG / nonresponse propensity models.- population_totals
Named numeric vector of target totals to calibrate to.
- max_iter
Iteration cap for calibration / IPF.
- tol
Convergence tolerance for calibration.