Skip to contents

weightflow 0.1.0

First release.

A dependency-free, pipeable API to compute survey weights from design base weights through a chain of hierarchical adjustment stages. Build a recipe lazily, estimate it with prep(), and extract the weights with collect_weights(). Separating define from apply makes the whole process reproducible and auditable, and lets the bootstrap re-run the entire cascade on each replicate.

Adjustment steps

Inspection and reporting

Variance estimation

Data

  • Bundled example datasets population, sample_survey (take-all roster) and sample_one (multistage select-one design), all with stratum, PSU and design weight.

Development version

The following are available in the development version on GitHub and are planned for a future CRAN release:

  • Machine-learning response propensities (CART, random forest and gradient boosting via xgboost) for step_nonresponse() and step_model_calibration().
  • k-fold cross-fitting (crossfit) to estimate each unit out-of-sample, with folds formed by cluster to avoid leakage.
  • Ridge (penalized) calibration (penalty) to keep weights stable with many auxiliaries.
  • Potter MSE-optimal trimming (method = "potter"), a data-driven cutoff.

Install with remotes::install_github("jpferreira33/weightflow") to use them today.