Skip to content

welfareweights/engine

Repository files navigation

WelfareWeights Engine

tests DOI PyPI

Install: pip install welfareweights (Python 3.11+)

Open-source tooling to estimate disability weights from survey data. These are the valuations that turn health states into DALYs (disability-adjusted life years) for burden-of-disease work. Eventually we will extend that methodology to health and welfare states that are not yet well modeled.

This is the academic core of the WelfareWeights project. The companion survey platform (welfareweights.com) is managed separately; this repository is the freely reusable engine and its documentation.

Use

from welfareweights.inference import bootstrap_dws

res = bootstrap_dws(pc_df, phe_df, n_boot=200, rng=0)
print(res.weights)  # one row per health state: dw, lo, hi

pc_df holds paired-comparison responses (respondent_id, state_1, state_2, y) and phe_df holds population-health-equivalence responses (respondent_id, state, n_cases, y); the docstrings in pipeline.py define the columns precisely. welfareweights.estimate_dws gives point estimates and diagnostics without the bootstrap, and welfareweights.simulate generates synthetic survey data from the assumed data-generating process if you have none yet — examples/quickstart.py shows the whole loop, truth to recovery, in about fifteen seconds.

Why

DALYs compress an enormous range of human experience into a single number, and the disability weights underneath them are estimated from public surveys using a methodology that most researchers cannot easily reproduce or extend. The goal here is to democratize and open-source that methodology. I want transparent, reproducible, and open code, so weights can be replicated, scrutinized, and computed for new states. This will help people doing burden-of-disease accounting, policy analysis, and welfare measurement more broadly.

Scope

  1. Replicate the gold-standard approach (Salomon et al.) that derives disability weights from paired-comparison and valuation survey data.
  2. Open-source it as a clean, well-documented library with user-friendly guides, so anyone can run survey data through it.
  3. Extend it to estimate weights for states the current instruments miss.

Understand and audit the method

docs/METHODS.md explains the whole estimator (what the survey questions ask, what each stage assumes, why the tricks work, what must be true for the weights to mean anything, and how to attack it), written for people who did econometrics years ago or who know math and code but never took it; methods.pdf is the same document typeset, with full citations and the validation evidence as an appendix (that link opens the PDF in your browser's own viewer, where the hyperlinks work; GitHub's embedded PDF pane does not support links, so use this one rather than browsing to docs/methods.pdf). examples/quickstart.py runs the full pipeline with uncertainty intervals on synthetic data with known true weights, in about fifteen seconds. A browsable index of all of this, with every link opening in a new tab, is at welfareweights.github.io/engine.

Validation

The original survey microdata is not public, so the estimator is validated the hard way instead: known-truth recovery from the assumed data-generating process, metamorphic invariance tests, loud-failure tests for every identification hazard we found in review, a link-robustness cross-check, held-out fit diagnostics, Monte Carlo coverage tests of the bootstrap intervals, a misspecification battery, and a full-scale run at the published GBD 2010 design size (220 states, 14,000 respondents: rank correlation 0.9997, mean error 0.005). The evidence, including the one documented blind spot, is collected in docs/VALIDATION.md; the studies behind it are reproducible from studies/ with recorded seeds.

Status

Early and under active construction. The estimation pipeline is implemented and validated against synthetic data (see above) while we request the original survey data; the roadmap is in ROADMAP.md. Expect interfaces to change. Watch or star the repo to follow along.

License

Two licenses, by artifact type:

Note that raw survey responses are governed by respondent consent and privacy rules, not by these licenses, and are not published here.

Citation

If you use this work, please cite it via the "Cite this repository" button (see CITATION.cff). The concept DOI 10.5281/zenodo.21401783 always resolves to the latest release.

About

Open-source engine for estimating disability weights from survey data (DALY / burden-of-disease methodology): replicating Salomon et al. and extending it to new health states.

Topics

Resources

License

Apache-2.0, CC-BY-4.0 licenses found

Licenses found

Apache-2.0
LICENSE
CC-BY-4.0
LICENSE-DATA

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages