Week 9: Final Prediction

Grant Williams

2024/11/03

Introduction

In this final blog post, published two days before the election (Sunday Nov 3), I am going to explain how I prepared my final model and the results derived from it.

Before I do so, however, I want to share what is perhaps my main takeaway from this class thus far:

Predicting elections is hard.

In many ways, it is a somewhat impossible task. Forecasting elections is not difficult because procuring data is challenging or because training models is computationally expensive; rather, predicting the outcomes of US elections is fundamentally hard because there are relatively few elections from which we can construct our models.

Since (and including) the United States’ first election in 1789, there have been a grand total of 59 presidential elections (270 To Win). This means we only have 59 outcomes from which we can identify patterns and create a model to predict the two-party vote share at the national level. Once we consider that polling data only goes as far back as 1968, we are left with only 14 elections from which to base our models. While it could be tempting to believe that we actually have closer to 14 times 50 elections, or 700 elections, from which to make our models (if we used the election results from each state), this isn’t quite the case. Polling can be expensive, so generally, state-level polling studies are conducted in more competitive states, and we may not have sufficient polling data to produce models for all of our states in every election cycle. For this reason, we have relatively few outcomes, especially in recent years, from which we can produce models. This is an issue because, with limited testing data, we run the risk of overfitting, creating models that generalize poorly.

Though outcome data is a significant limitation, the same cannot be said of covariate data. Through lab sections, we have explored voter file data sets, turnout data sets, demographic data sets, macroeconomic data sets, polling data sets, campaign spending data sets, campaign event data sets, and other data sets on political fundamentals (incumbent candidate, June approval rate, etc.). There is an incredible volume of predictors that we could theoretically include in our model (national unemployment rate, mean polling averages, lagged vote share, etc.) We could even imagine breaking down these predictors: should we include the latest week’s polling average by state, or the latest month’s, or the average in the last year? Over the past several weeks, we have also explored a variety of regression tools including OLS, Bayesian priors, logistic regression, LASSO and Ridge, and other machine learning models.

One approach to handling this overabundance of covariate data and the various regression modelling techniques at our disposal is to use all of the outcome and predictor data that we possess, and then use cross-validation to determine which permutation of covariate features and machine learning models yields the lowest RMSE for predicting these outcomes. While this is tempting, it is also likely to produce a very complicated model that is highly sensitive to decisions in the validation process:

For something that, at face value, might seem like a scientific prediction problem, the process of constructing a 2024 election forecast is, in my opinion, in many ways, a subjective art. We are making assumptions about voter behavior that could actually vary across years.

Given how much space there is for bias, I want to keep this model as simple as possible. This choice is a bold one, but I want to test how well a model with few covariates compares to other classmates’ more complex models models.

The code used to produce these visualizations is publicly available in my github repository and draws heavily from the section notes and sample code provided by the Gov 1347 Head Teaching Fellow, Matthew Dardet.

My Model

Both Sabato’s Crystal Ball of the Center for Politics and the Cook Political Report list the same seven states as “toss-ups.” Almost universally across news platforms and forecasting models, the following seven states are identified as the key swing states which will, most likely, determine the election:

Interestingly, both of these preeminent forecasting websites, as of November 3rd, do not rank a single state as either lean Republican or lean Democrat. There are only “solid"s, “likely"s, and “toss-up"s. Thus, for the purposes of both this week’s final prediction, I will forecast the two-party vote share in each of these battleground states and assume other states and districts vote as they did in 2020.

This gives us the following initial electoral college map:

Preparing My Electoral College Model

Using national-level polling average data since 1968 from FiveThirtyEight, I will construct a model that uses the following polling features to predict the national two-party vote share.

I am opting to only consider the polling averages within the last ten weeks of the campaign rather than the entirety of the campaign as I believe these to be most predictive of the ultimate election outcome. I am concerned that introducing averages from earlier periods would lead to overfitting, and, considering the unique candidate swap of 2024, I do not believe Biden nor Harris’s polling averages from the stage in the election before Harris could establish a proper campaign strategy are informative. These averages also occur after both parties have held their respective conventions and show the leanings of a more settled electorate. I will also be rescaling all polling averages so that the two-party vote share sums to 100. After doing this, I will only use Democratic polls to create a model (which is possible because Republican two-party vote share is just 100 - Democratic two-party vote share).

While there are a number of fundamental and economic covariates I considered exploring (whether a candidate is only a party incumbent, GDP growth in the second quarter of the election year, RDPI growth in the second quarter of the election year, unemployment rate in the second quarter of the election year, June approval rating, etc.), I found that my forecasts were highly variable depending on which fundamental variables I decided to include. It is my belief that many of the trends explained by fundamental variables (incumbency bias, high growth is good for candidates, high inflation is bad for candidates, etc.) is already baked into the polls, so I will focus on constructing a polls-only model.

We will train a two-party vote share model for to predice Democratic vote share, and then apply this model to our 2024 data to generate predictions.

First, I want to assess whether modern national polls are systematically more accurate than older polls.

Because the year with the highest polling error was the first year in which polls were conducted in our data set, there is reason to think the science of polling was still developing. Since this outlier could skew the results of our regression and is plausibly not representative of current possibilities, I feel comfortable removing the year 1968 from our sample. Otherwise, the polling errors look reasonably uncorrelated with time.

Now, I want to find the optimal way to average my week by week polling averages into an overall estimate for the national two-party Democratic vote share. Intuitively, I can assume that more recent polls are more accurate than less recent polls. I can model the weight of each column (week 1 through 10) with a decay factor, alpha, that compounds exponentially each week further away from week 1 that I get.

Image 1

I will test all decay value within the set of {1, 0.99, 0.98,…, 0.51, 0.5}.

For each decay value, I will use leave-one-out cross validation to calculate the overall RMSE of a linear regression that estimates the two-party Democratic vote share using the weighted average vote share from each election cycle except the cycle that is currently being left out.

This process yields the following RMSE graph. As we can see, 0.78 is the optimal decay value with a root mean squared error of 1.62

This yields the following weights for each week before the election:

Weeks Left Until ElectionWeight
11.0000000
20.7800000
30.6084000
40.4745520
50.3701506
60.2887174
70.2251996
80.1756557
90.1370114
100.1068689

For each fold, the out-of-sample squared error is shown below.

Fold Left OutIn-Sample RMSEOut-of-Sample SE
11.4558631.7409968
21.4784390.0230401
31.16965210.7116157
41.3959063.7339550
51.4790250.0000835
61.4587490.8666411
71.4615360.7915443
81.4093452.6173176
91.4718020.2778467
101.3041426.4688561
111.3107836.1094295
121.4729010.2409560
131.4653020.5564014

This model yields the following Harris-Trump national popular vote prediction.

YearPredicted Democratic Two-Party Vote SharePredicted Republican Two-Party Vote Share
202451.1536548.84635

State-level estimates

I will now use this same decay factor to predict the two-party vote share for each of our battleground states. I chose to find this decay factor from national popular vote data because I have higher confidence in the consistent quality of national polls over time than the consistent quality of state polls over time, especially across states. It also seems like a reasonable assumption to me that this decay factor would remain largely constant over time.

For the same reasons as those I have already mentioned, I want to make this model as simple as possible and will only be considering the polling averages in each of the 10 weeks leading up to the election for each of our battleground states. I will use these 10 polling averages to construct a weighted average for each state. The formula for our weighted average (and our model) is as follows:

Image 2

The weighted average for the Democratic two-party vote share for each state in 2024 is displayed below:

StatePredicted Democratic Two-Party Vote Share
Arizona49.24514
Georgia49.36078
Michigan50.57455
Nevada50.19946
North Carolina49.56858
Pennsylvania50.18314
Wisconsin50.53039

Here, we can see that Arizona, Georgia, and North Carolina are favored to vote red while the other states are favored to vote blue.

For comparison, let’s see how our model would have fared for these same states in 2020.

StatePredicted Democratic Two-Party Vote ShareActual pv2p
Arizona51.9603650.15683
Georgia50.1696650.11933
Michigan54.1105951.41356
Nevada53.1447751.22312
North Carolina51.1203349.31582
Pennsylvania53.0382650.58921
Wisconsin53.7364950.31906

All of our states would have been projected to vote blue, which was the case with the exception of North Carolina, which voted Republican. This is an RMSE of 2.24 percentage points.

Across the 442 state elections since 1968 in which we have polling averages for each of the ten weeks leading up to the election, our model correctly predicts the winner of the state 91.12% of the time with an RMSE of roughly 3.02 percentage points.

I will now use a simulation to get an estimate of how confident we are in these results. I will do this by sampling new state-level polling measurements for each of our 7 states 10,000 times, assuming a normal distribution around the current polling values with a standard deviation determined by the average distance of each state’s poll away from the actual outcome in the past two elections.

To create this standard deviation, I will take the average of the mean polling error of each state in 2016 and 2020 (weighted equally for both years) to capture the “Trump-era” polling error. This assumes that there is no systematic polling error in favor of either candidate, which is plausible given how the 2022 midterm favored Democrats. I will also use a stein adjusted error since I find it more realistic than simply averaging the polling error of a stat in the last two cycles.

StateAverage ErrorStein Adjusted Error
Arizona1.54580141.7387023
Georgia0.48575920.9464523
Michigan3.56678023.2491329
Nevada1.18318511.4676916
North Carolina2.39731822.3751053
Pennsylvania3.19579762.9718696
Wisconsin3.79108593.4167736

Using the above weighted errors as standard deviations yields the following simulation breakdown.

StateD Win Percentage2.5th Percentile97.5th Percentile
Arizona26.8445.9000052.65498
Georgia16.6647.4798551.19328
Michigan60.8144.2153357.12646
Nevada57.0647.3307753.03849
North Carolina40.1544.8685154.21899
Pennsylvania53.4844.3208555.93782
Wisconsin59.6243.8401257.29537

We also get the following distribution of simulations.

This distribution is somewhat misleading, however, because it assumes that the outcomes of each of the seven battleground states are independent from one another (and that the polling errors across the states are not correlated with one another). For this reason, I will project the winner of the election based on which candidate is most likely to win each state. This distribution does show, however, that part of Harris’s weakness is that she is performing well in states with higher average polling errors.

Projections

Using this model, our ultimate electoral college would look as follows, with Vice President Kamala Harris narrowly squeaking out a win.

Citations:

“Historical U.S. Presidential Elections 1789-2020 - 270towin.” 270toWin, www.270towin.com/historical-presidential-elections/. Accessed 3 Nov. 2024.

Data Sources:

Data are from the US presidential election popular vote results from 1948-2020 and state-level polling data for 1968 onwards.