An election model, built this morning
It's midterm election day in the US. I spent this morning building a forecast model and a dashboard to watch it against the live count: what's expected, what's actually happening, and how the second is changing the first. Writing down what it says now, before the counting really starts, so I can come back afterwards and see how it did.
What it is, in five lines:
- I read the forecasting literature first and built the model out of that, so every constant in it traces back to a published study.
- Each race gets a pre-election margin from its Cook rating blended with a structural model: state lean, the generic ballot, incumbency, open seats, and how exposed each party is this cycle. Polling error is then drawn as one national miss shared by every race, not 35 independent ones, because polls miss together.
- Live returns come in from civicAPI: all 35 Senate seats, all 435 House districts and 36 governor races, refreshed every minute.
- Iowa, Ohio and Texas publish county-level results. There the model measures each county that reports against its own 2024 result and carries that swing to the counties still outstanding. Backtested against real 2024 data, that is 58-95% more accurate than a statewide correction at a third of the vote counted.
- A partial count isn't a random sample of the final one. The ballots counted last lean one way, and which way depends on the state. Correcting for that cuts the error by 15-26%.
What it predicts

- Senate: 54% chance of Democratic control. Most likely 51 seats of 100, probably somewhere between 48 and 54. This is the hard one. Democrats need a net gain of four, and 50-50 is not a tie, because the Vice-President breaks it for Republicans.
- House: 93% chance of a Democratic majority. Most likely 236 seats, probably between 220 and 255. 218 wins it.
- Governors: 19 of the 36 on the ballot go Democratic.

Six races decide the Senate, and the model has Republicans narrowly ahead in five of them: Iowa (51%), Texas (52%), Ohio's special (56%), Alaska (58%) and Kansas (62%). Maine is the exception at 69% for Democrats against Susan Collins. "Narrowly ahead" here means a point or two, which is well inside the error, so read all six as coin flips.

Two things I already know are weak. Maine is the closest race and the one most likely to be settled late, and it's also the only state here with no live feed to read: the results are hand-posted and the ranked-choice count runs for days. And the pre-election House number is a national-vote projection rather than 435 separate district forecasts.
Back after the count.