WelfareWeights Engine
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
- Replicate the gold-standard approach (Salomon et al.) that derives disability weights from paired-comparison and valuation survey data.
- Open-source it as a clean, well-documented library with user-friendly guides, so anyone can run survey data through it.
- 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:
- Code: Apache License 2.0. Use it freely, including commercially; it carries an explicit patent grant.
- Data, estimated weights, and documentation: Creative Commons Attribution 4.0 (CC-BY-4.0). Reuse freely with attribution.
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.
Metadata
Release files for welfareweights 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| welfareweights-0.1.1.tar.gz | 70.1 kB | With provenance | Details for welfareweights-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| welfareweights-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for welfareweights-0.1.1-py3-none-any.whl |
Total release size: 118.7 kB
Release files / welfareweights-0.1.1.tar.gz
| Download URL | welfareweights-0.1.1.tar.gz |
|---|---|
| Size | 70.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ebb18ad80630cf204a70042424d17a81470909f29436e66c24c1be7c2f5e085a
|
|
BLAKE2b-256 checksum How to use checksums |
2f29d6d9d2c29cc9b8b124d82215b7aa9d0c1463d9bb6ee00092225ffade2eba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logRelease files / welfareweights-0.1.1-py3-none-any.whl
| Download URL | welfareweights-0.1.1-py3-none-any.whl |
|---|---|
| Size | 48.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f31744310389ee009be238b7f050af3db83559709ff66d49bb7955a059fe0d9e
|
|
BLAKE2b-256 checksum How to use checksums |
b495853df58b6c642a4c7c2a3936c951af7e05ee6b7eac44c02d68287e27b053
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logSecurity for welfareweights 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for welfareweights-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.