WiNDC State Disaggregation
December 05, 2025
An early build of the WiNDC State Disaggregation tool is now available in the open PR in WiNDCRegional.jl. This post will demonstrate how to build the data and provide a rough overview of the disaggregation methodology.
Building the Data
The raw state data can be downloaded from the following link:
here. Unzip this file to a directory on
your computer and update the state_dir variable in the code
below to point to that directory.
The disaggregation is built using the following code:
using DataFrames
using WiNDCContainer
using WiNDCNational
using WiNDCRegional
summary_raw = WiNDCNational.build_us_table()
df = table(summary_raw) |>
x -> subset(x,
:row => ByRow(y -> !(y in (:Used, :Other)))
)
summary_raw = National(df, sets(summary_raw), elements(summary_raw))
summary,_ = calibrate(summary_raw)
state_dir = "path/to/raw/state/data"
state_table = create_state_table(summary, state_dir)
## Verify Balance
WiNDCRegional.zero_profit(state_table) |>
x -> sort(x, :value)
WiNDCRegional.market_clearance(state_table) |>
x -> sort(x, :value)
WiNDCRegional.margin_balance(state_table) |>
x -> sort(x, :value)In this early build we exclude the commodities Used and
Other from the summary due to data quality issues,
primarily negative values. The resulting state_table object
contains the disaggregated state data.
The Raw Data
The raw data comes from a variety of sources, here we detail the sources and the data used from each source.
- Bureau of Economic Analysis (BEA): The BEA provides state-level GDP and PCE data, which is used to disaggregate economic output and value-added components.
- US Census: From the Census we get state government finance data, used to disaggregate government final demand
- Freight Analysis Framework (FAF): The FAF provides state-level freight flow data, which is used to determine state demands
- USA Trade Online: This source provides state-level import and export data, used to disaggregate international trade components.
Disaggregation Methodology
For the most part, the order of disaggregation is not important. However, there are a few parameter that depend on the values of previously disaggregated parameters. We will note when this is the case.
- Intermediate Demand/Supply: Disaggregated using state GDP shares.
- Value Added (labor demand and capital demand): There are a lot of issues with the state GDP data for capital demand, primarily negative values. To rectify this we use a model to estimate the share of total value added due to labor and use this to disaggregate labor demand. Capital demand is then the difference between total value added and labor demand. This process will be detailed in the state disaggregation documentation.
- Output Tax: This is derived from the National level output tax rate multiplied by state output.
- Investment Final Demand: GDP Shares
- Personal Consumption and Household Supply: PCE Shares
- Government Final Demand: Disaggregated using state government expenditure data from the US Census.
- Foreign Exports: Disaggregated using state export data from USA Trade Online, for commodities where this data is available. For commodities without state export data, we use state GDP shares.
- ReExports: Defined as the difference between total supply and exports.
- Foreign Imports: Disaggregated using absorption
shares. This requires components of absorption to be defined, which are
intermediate_demandand non-export components of final demand. - Margin Demand: Also disaggregated using absorption shares.
- Duty: Similar to
Output_Tax, this is derived from the National level duty rate multiplied by state imports. - Tax: Similar to
Output_Tax, this is derived from the National level absorption tax rate (which includes the subsidy rate) multiplied by absorption. - Local/National Demand: Local demand is the regional demand times the regional purchase coefficient. The regional demand is the state absorption minus imports and margins. The regional purchase coefficient comes from the FAF data. National demand is the difference between total demand and local demand.
- Local/National Margin Supply: Local margin supply is the larger of domestic absorption times the trade shares and total margin supply times the regional purchase coefficient. National margin supply is the difference between total margin supply and local margin supply.
Further Work
The code provided is rough, slow, and relies on hard links within the data. I plan to:
- Create a
yamlfile similar to the National data file that loads the data in a more flexible manner. - Load all necessary data before disaggregation begins to speed up the process.
- Simplify and clean up the disaggregation code.
- Add more detailed documentation on the disaggregation process and data sources.
- Add tests to verify the disaggregation process.