# Data dictionary (v2) Built by the scripts in `scripts/` from the files in `raw/` (see `SOURCES.md`). The CSVs in `web/explorer/data/downloads/` are the published copies; the JSON files beside them hold the same values in compact form for the explorer. **Missing values are blank (CSV) or `null` (JSON). They are never written as 0.** ## `house_results_districts.csv`: one row per district per certified election (4,350 rows, 2006–2024) | Column | Meaning | |---|---| | `year`, `state`, `district` | Election year, USPS code, district number (`0` = at-large). | | `winner`, `winner_party` | Certified winner and group (`D`/`R`/`O`). Blank for 2018 NC-09 (not certified). | | `dem_candidate`, `rep_candidate` | Top Democratic / Republican candidate **with counted votes**. Blank if none. | | `dem_votes`, `rep_votes` | **Party totals**: all candidates in that party group, each summed across all of their ballot lines (fusion). Same-party races (CA/WA top-two, Louisiana) show the full party vote. Blank if no counted votes. | | `dem_candidates`, `rep_candidates` | Number of candidates in each party with counted votes (2+ means a same-party contest). | | `total_votes` | Votes for all candidates plus scattered/write-ins in the counted round. Excludes blank, void, over/under votes and the Clerk's combined "Blank/Scattering" lines. Blank when no count was reported. | | `two_party_margin` | `100 × (D − R) / (D + R)` on party totals, percentage points; positive = Democratic. Only when both are > 0. | | `party_basis` (candidates file) | Where the candidate's party group comes from: FEC/Clerk ballot lines, the House Clerk line used to settle a disputed district, or a documented override. | | `contest` | `D_vs_R`; `same_party` (2+ candidates of one major party, none of the other); `one_major_party`; `no_major_party`; `unopposed_no_vote_reported` (FL/OK law: unopposed names are not on the ballot); `not_certified`. | | `nominal_opposition` | `1` when one party had under 5% of the two-party vote. Such races are excluded from swing. | | `decided_by_runoff` | `1` when a general-election runoff decided the seat; runoff votes are used. | | `rcv_round` | Ranked-choice races only: `final`, `decided in first round`, or `first (final round not in source)` (2024 AK-AL; excluded from swing). | | `source`, `notes` | `FEC` (2006–2022), `House Clerk` (2024); notes list cells replaced from the Clerk report. | ## `house_results_candidates.csv`: every candidate listed by the source `candidate`, `party_lines` (all ballot labels, `/`-separated), `party_group`, `write_in_only` (1 when every line is a write-in line; not counted as a party nominee), `votes` (counted round; blank = no count), `winner`, `incumbent` (FEC flag; not available for 2024). ## `house_2026_provisional_snapshot.csv`: 435 rows, provisional From NPR's AP-tabulated House results, retrieved **2026-11-24T14:41:12.865Z**. `winner_party` is set only for called races (258 D, 173 R; 4 unresolved, including two runoffs). `dem_votes`/`rep_votes` preserve the source's party aggregates; independent/nonpartisan candidates are not relabeled. A zero aggregate is written blank (`no_D_R_contest_in_snapshot`, or `unopposed_no_vote_reported` when both are zero). No candidate names, third-party votes or all-party totals are included in this compact snapshot. `call_status` keeps the AP status (`Called`, `Too Early to Call`, `Runoff`). `snapshot_at` is the retrieval time, not a claim that every race was updated then; latest individual race update was 2026-11-24T14:37:18.737Z. The original source SHA-256 and derived snapshot hash are in `source-checksums-20261124.json`. ## Reconciliation files `reconciliation_differences.csv` (every cell where this build differs from the corrected aggregate, with the House Clerk value and a classification), `reconciliation_corrections.csv` (FEC party cells replaced by Clerk values), `reconciliation_candidate_corrections.csv`. See `RECONCILIATION.md`. ## `district_acs_districts.csv`: one row per ACS release per district | Column | Meaning (ACS table) | |---|---| | `acs_year`, `acs_congress` | ACS 1-year release and the Congress whose lines it uses (2007/2008: 110th; 2010: 111th; 2012: 113th; 2014: 114th; 2016: 115th; 2018/2019: 116th; 2022: 118th; 2024: 119th). | | `total_pop` | B01003. | | `median_hh_income` | B19013, nominal dollars of the release year. | | `median_age` | B01002. | | `poverty_rate` | B17001: below poverty ÷ poverty universe, %. | | `unemployment_rate` | B23025: unemployed ÷ civilian labor force, %. Blank in 2007–2010 extracts. | | `bachelors_plus_rate` | B15003: bachelor's or higher ÷ population 25+, %. Blank in 2007. | | `pct_white_nh`, `pct_black_nh`, `pct_asian_nh`, `pct_hispanic` | B03002 shares of total population. | | `median_home_value` | B25077, nominal dollars. | **Comparisons in the explorer are district medians over a full ACS release.** For the release used with an election (e.g. ACS 2024, 119th Congress lines, for 2024 and for the unchanged states in 2026; ACS 2019, 116th lines, for 2020), "Median U.S. district" is the median across **all 435 districts in that release** and "Median district in California" the median of all California districts in it; the explorer prints the release, its lines and n next to them. Districts whose own lines differ from the release (NC 2020; the nine states that redrew for 2026) still have their figures withheld; the benchmarks are not recomputed on a subset. Map quintiles use the same full release. These are medians of district estimates, not statewide or national ACS totals, which are not included in this build. ## Elections, boundaries and ACS releases | Election | Congress | Boundaries shown | ACS release | |---|---|---|---| | 2006, 2008, 2010 | 110th–112th | Census cd111 (same lines) | 2007, 2008, 2010 | | 2012 | 113th | cd113 | 2012 | | 2014 | 114th | cd114 | 2014 | | 2016 | 115th | cd115 | 2016 | | 2018 | 116th | cd116 | 2018 | | 2020 | 117th | cd116, **North Carolina from the enacted 2019 plan (HB 1029)** | 2019; withheld for NC | | 2022 | 118th | cd118 | 2022 | | 2024 | 119th | cd119 | 2024 | | 2026 (provisional) | 120th | **Census TIGER/Line 2026 cd120** | 2024 only for states that kept their lines; withheld for AL, CA, FL, LA, NC, OH, TN, TX, UT | ## Redistricting breaks and swing A new map era starts at: every multi-district state in **2012** and **2022** (and Montana in 2022); FL, NC, VA **2016**; PA **2018**; NC **2020**; AL, GA, LA, NC, NY **2024**; AL, CA, FL, LA, NC, OH, TN, TX, UT **2026** (Census 120th Congress guidance; Missouri kept its map). The support package also flags MN 2016/2018 and CO 2018; Census land-area comparisons show no new map there and no redistricting occurred, so they are not treated as breaks. **Change since previous election** is shown only when, in both years: certified results; same map era; a D-vs-R contest with real counts; each party ≥ 5% of the two-party vote; and a complete count (no first-round-only ranked-choice result). **All 2026 rows are excluded** (provisional, partial count): their snapshot margin is shown but never joined into trend lines or used in a change. The per-district CSV's `comparable_for_change` applies this full pairwise rule (`yes` only when a change is shown) and `change_exclusion_reason` says why not. 2018 NC-09 (uncertified) has votes but no winner and no margin. ## Party grouping Labels are tokenized; write-in lines (`W(…)`) are ignored; the first major-party token on the **general-election** ballot lines decides (`D`, `DEM`, `DFL`, `DNL`… → D; `R`, `REP`, `GOP` → R). Documented overrides: 2006 TX-22 Shelley Sekula Gibbs → R (party's write-in nominee); 2008 OR-01 Joel Haugen and 2016 OR-03 David W. Walker → not Republican (House Clerk lists both as Independent).