The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

weightflow: Declarative API for Staged Survey Weights

Builds survey weights from design base weights by chaining the stages of a weighting workflow (unknown-eligibility redistribution, nonresponse adjustment, calibration to known population totals, and weight trimming) through a declarative, pipeable, 'tidymodels'-style API, with nonresponse handled by weighting classes, by response-propensity models fitted with logistic regression or machine-learning learners (trees, random forests and gradient boosting), or by calibration. Calibration follows Deville and Sarndal (1992) <doi:10.2307/2290268>, and a range-restricted variant trims the weights into a fixed interval while preserving the calibration totals, following the generalized exponential method of Folsom and Singh (2000). Variances are obtained with a recipe-aware bootstrap and jackknife that resample primary sampling units and re-apply the whole cascade on each replicate, following the rescaling bootstrap of Rao and Wu (1988) <doi:10.1080/01621459.1988.10478591>, so the replicate weights carry the variability of every adjustment. A self-contained HTML report documents each step with diagnostics, and the weights bridge to the 'survey' and 'srvyr' packages for design-based inference.

Version: 1.0.0
Depends: R (≥ 4.1.0)
Imports: stats, utils, graphics, parallel
Suggests: MASS, rpart, ranger, testthat (≥ 3.0.0), survey, srvyr, dplyr, tidyr, ggplot2, haven, archive, knitr, rmarkdown, spelling, xgboost
Published: 2026-08-04
DOI: 10.32614/CRAN.package.weightflow
Author: Juan Pablo Ferreira [aut, cre], Andrés Gutiérrez ORCID iD [ctb] (affiliation: ECLAC - Statistics Division)
Maintainer: Juan Pablo Ferreira <juanpablo.ferreira at fcea.edu.uy>
BugReports: https://github.com/jpferreira33/weightflow/issues
License: MIT + file LICENSE
URL: https://github.com/jpferreira33/weightflow, https://jpferreira33.github.io/weightflow/
NeedsCompilation: no
Language: en-US
Citation: weightflow citation info
Materials: README, NEWS
In views: OfficialStatistics
CRAN checks: weightflow results

Documentation:

Reference manual: weightflow.html , weightflow.pdf
Vignettes: Machine learning, cross-fitting and robust calibration (source, R code)
Ways to specify calibration totals (source, R code)
Calibration: raking, post-stratification and GREG (source, R code)
Model calibration (model-assisted weighting) (source, R code)
Nonresponse: weighting classes, propensities and calibration (source, R code)
Preparing the sample: eligibility and response before weighting (source, R code)
Documenting and auditing the weights: the quality report (source, R code)
From raw sample to final weights (source, R code)
Validation against the survey package (source, R code)
Variance estimation (source, R code)
Staged survey weighting: the adjustment logic (source, R code)

Downloads:

Package source: weightflow_1.0.0.tar.gz
Windows binaries: r-devel: weightflow_1.0.0.zip, r-release: weightflow_1.0.0.zip, r-oldrel: weightflow_1.0.0.zip
macOS binaries: r-release (arm64): weightflow_1.0.0.tgz, r-oldrel (arm64): weightflow_1.0.0.tgz, r-release (x86_64): weightflow_1.0.0.tgz, r-oldrel (x86_64): weightflow_1.0.0.tgz
Old sources: weightflow archive

Linking:

Please use the canonical form https://CRAN.R-project.org/package=weightflow to link to this page.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.