Weightflow:R 中声明式、可感知配方的调查加权
weightflow: declarative, recipe-aware survey weighting in R
AI总结:
研究为复杂调查生成权重的方法,提出 Weightflow 包,通过声明式 API 构建权重,将定义与应用分离,可重现可审计,能传播各阶段不确定性,实现多种校准及调整,经验证在实际数据中能恢复已知贫困率。
摘要:
为复杂调查生成分析权重需要一系列分层调整(解决未知资格、剔除范围外单位、恢复家庭内选择、校正无应答以及校准到已知总体总量),之后设计一致的方差必须考虑到一些调整本身是从样本中估计出来的这一事实。现有的 R 工具涵盖了此工作流程的部分内容,但没有一个将整个级联表示为单个可审计对象,也没有将每个阶段的变异性传播到重复权重中。我们提出了 Weightflow,一个无依赖(基于基础 R)的包,它通过声明式、可管道化、tidymodels 风格的 API 构建调查权重:一个配方被惰性定义为一系列 step_*()调整,并通过 prep()进行估计。将定义与应用分离使过程可重现和可审计,并允许重新缩放自举和删除一个 PSU 的刀切法在每个重复上重新应用整个配方,因此重复权重承载了每个估计阶段的不确定性,而不仅仅是最终校准的不确定性。该包实现了拉平、事后分层和线性/GREG 校准(有边界、岭惩罚以及域划分和综合变体)、模型辅助(Wu-Sitter)校准、带交叉拟合的加权类和机器学习响应倾向调整以及代表性(R-)指标。权重和重复权重与 survey 和 srvyr 包桥接以进行基于设计的推断。我们对照 survey 验证了校准和方差结果,并在捆绑样本和真实家庭调查微观数据(乌拉圭 ECH)上说明了整个级联,在那里它以基于设计的不确定性恢复了已知的贫困率。
英文摘要:
Producing analysis weights for a complex survey requires a sequence of hierarchical adjustments (resolving unknown eligibility, dropping out-of-scope units, restoring within-household selection, correcting for nonresponse, and calibrating to known population totals), after which design-consistent variances must account for the fact that several adjustments were themselves estimated from the sample. Existing R tools cover parts of this workflow, but none expresses the whole cascade as a single auditable object, nor propagates the variability of every stage into the replicate weights. We present weightflow, a dependency-free (base R) package that builds survey weights through a declarative, pipeable, tidymodels-style API: a recipe is defined lazily as a chain of step_*() adjustments and estimated with prep(). Separating definition from application makes the process reproducible and auditable, and lets a rescaling bootstrap and a delete-a-PSU jackknife re-apply the entire recipe on each replicate, so the replicate weights carry the uncertainty of every estimated stage, not only of the final calibration. The package implements raking, post-stratification and linear/GREG calibration (with bounds, ridge penalisation, and domain-partitioned and integrative variants), model-assisted (Wu-Sitter) calibration, weighting-class and machine-learning response-propensity adjustments with cross-fitting, and representativity (R-)indicators. Weights and replicate weights bridge to the survey and srvyr packages for design-based inference. We validate the calibration and variance results against survey, and illustrate the full cascade on a bundled sample and on real household-survey microdata (the Uruguayan ECH), where it recovers a known poverty rate with design-based uncertainty.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。