🎉 Add WID wealth composition of households and NPISH - #6755
Draft
paarriagadap wants to merge 1 commit into
Draft
Conversation
Four new indicators for the balance sheet of the households and NPISH sector combined, as a share of national income: net wealth, debt, housing and land, and financial assets and business capital. These are WID's aggregate balance-sheet series (the `w` series type, a ratio to net national income), which sit outside the distributional data the pipeline already carries. The extraction is a new section of `wid_indices.do`, guarded by a toggle so it can be rebuilt on its own in minutes without re-running the distributional extraction that takes hours. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Quick links (staging server):
Login: chart-diff: ✅No charts for review.data-diff: ❌ 1 changed · 1 identical — full report~ garden/wid/2026-06-18/world_inequality_database
+ wealth_aggregates (new table, 1 column(s))= 1 compared dataset(s) turned out identical; details in the full report Automatically updated datasets matching excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included. Run locally with Edited: 2026-08-24 17:51:26 UTC |
paarriagadap
marked this pull request as draft
August 28, 2026 10:30
paarriagadap
added a commit
that referenced
this pull request
Aug 28, 2026
Population was a standalone one-table dataset with its own snapshot script, meadow and garden steps. It is now the `population` table of wid/2026-06-18/world_inequality_database, so any garden step reads it from the same dataset as the rest of WID. The extraction is consolidated too: the npopul block moves into wid_indices.do, and its CSV joins the FILES map in the snapshot script, so one .do and one .py cover all six WID snapshots. The block records why unit i is correct -- the population dimension exists only for distributed series, so aptinc992j / npopul992i is the right pairing. The .dvc moves to 2026-06-18 keeping its md5. Snapshot storage is content-addressed, so it resolves to the blob already uploaded: no Stata re-run and no re-upload, and the data is unchanged. Verified: the population table is identical to the standalone one it replaces (55,581 rows, 249 countries, zero differing values, origins preserved), and every 2023 between share is unchanged to four decimals. Note for #6755, which also edits these four files: the meadow, garden, garden .meta.yml and wid_indices.do changes here are additive, so the conflict should resolve mechanically. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the wealth composition of the households and NPISH sector to the World Inequality Database dataset — the breakdown the GC Wealth Project's "Mountains of Assets" Country View chart shows, built from WID's own balance-sheet series.
We already publish WID's distributional wealth data (shares, Gini, averages and thresholds of household net wealth) but nothing about what that wealth is made of. These series exist in WID; they are aggregate balance-sheet variables rather than distributional ones, and the "share of national income" form is a series type (the
wprefix) rather than a separate concept, which is why they are easy to miss on the site.Four new indicators
All expressed as a share of net national income, for the households and NPISH sector combined (which WID calls the private sector).
wpwealwpwdebwpwhouwpwbus+wpwfinNet wealth reaches back to 1800 while the three components start in 1980 because that is WID's own limit: the component series are served from 1980 for every country, in both the household and the household-plus-NPISH sector, and in every series type. Verified directly against the API with no percentile, age or population filter.
The category definitions follow the GC Wealth Project's, which states the WID formulas in the Metadata tab of its chart. WID publishes financial assets and business assets as two series; they are added together in garden.
2025 values (% of national income): United States 653 net wealth (97 debt, 228 housing and land, 522 financial and business) · France 593 (83 / 347 / 329) · Japan 731 (81 / 239 / 574) · Chile 352 (57 / 175 / 234).
Implementation
wid_indices.dogains a section for the aggregate balance sheet, plus aaggregate_wealth_onlytoggle so it can be rebuilt on its own in a few minutes rather than re-running the distributional extraction that takes hours. No PPP conversion applies: thewseries is already a unitless ratio.2026-06-18version, with its own script (the existing one refuses to run unless all five of its CSVs are present). No version bump, so existing WID variable IDs are untouched — no ghost variables, no chart remapping.wealth_aggregatestable with awealth_typedimension, and asserts WID's balance-sheet identity, the sign each category can take, that the identity check has not gone vacuous, and the magnitude of the ratios.extrapolateddimension on this table: with and without extrapolations these series are bit-identical across all 341,475 rows WID returns, so the dimension would have doubled the indicators for nothing.Verification
p-hn-agg-*varcodes, sourceWID_topo). Over 3,000 shared country-years the median divergence is 0.26–0.67 percentage points of net wealth; United States 2015 matches to a decimal. Divergence above 2 pp is confined to Greece, Russia, Singapore, Denmark, Uruguay, Finland, South Africa, China and the Netherlands — their snapshot carries the components for only 26 of 70 countries and ends in 2022, and where it disagrees our levels are the ones consistent with WID's current release and with known macro history.wpwealequalsmpweal / mnnincto 5e-5, confirming the denominator is net national income.etl diff REMOTE data/ --include world_inequality_database: every pre-existing table byte-identical, only the new table added.make check,version-tracker, codespell clean. 773 tests pass; the 4 failures (test_app_indicator_upgrade,test_app_producer_analytics, 2×test_explorer_migration) fail identically on clean master — they need a local MySQL.Still open
mpwealitself is negative there, with national income staying positive. It is 3 rows of 21,094, butyAxis.min: 0means a zero-baseline chart will not show the dip. Kept at0to match every other indicator in this dataset rather than special-casing one; happy to switch it toautoif a reviewer prefers.ds_regions["regions"].reset_index()cannot becomeds_regions.read("regions"): the latter returns nullable string dtypes, which stops the country merge from matching and makes unmatched rows read"<NA>"instead of the"nan"sentinelharmonize_countriesfilters on, so rows that should be dropped survive and the index gains duplicates. Reverted with a NOTE; fixing it properly means changing that sentinel for all five tables.wealth_widMDim, or whether the separate financial and business components are worth publishing on their own. Both raw series are already in the snapshot, so splitting them later is a small change.