Predicting Senate Races with Linear Regression (and R)
By: Matt Thoburn
Tags: Regression, R, Politics And Elections

## Call:

## lm(formula = "Result ~ PVI*Incumbency", data = df)

##

## Residuals:

## Min 1Q Median 3Q Max

## -38.264 -5.231 0.820 5.902 23.872

##

## Coefficients:

## Estimate Std. Error t value Pr(>|t|)

## (Intercept) -8.1858 2.3454 -3.490 0.000666 ***

## PVI 1.4950 0.1898 7.876 1.35e-12 ***

## Incumbency0 11.3086 3.3896 3.336 0.001116 **

## Incumbency1 20.4877 2.7111 7.557 7.41e-12 ***

## PVI:Incumbency0 0.3209 0.3130 1.025 0.307210

## PVI:Incumbency1 0.0143 0.2430 0.059 0.953157

## ---

## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

##

## Residual standard error: 10.38 on 126 degrees of freedom

## (6 observations deleted due to missingness)

## Multiple R-squared: 0.8199, Adjusted R-squared: 0.8127

## F-statistic: 114.7 on 5 and 126 DF, p-value: < 2.2e-16

Results as a function of PVI and Incumbency with regression lines

Results

Modeling against PVI and Incumbency, we get our best results yet with an Adjusted R² of .81 and an RSE of 10.38. It does in fact seem to indicate that being an incumbent is associated with better results for your party (based on this data at least). We see that democratic incumbents tend to receive a higher share of the vote than non-incumbents for a given PVI, and we see that democratic non-incumbents running against republican senators receive a lower share of the vote for a given PVI. However, as before we still have too much unexplained variability to make any meaningful predictions.

Conclusion

The initial motivation for this line of inquiry was to try to see how much variability in election results can be described with publicly available data rather than something like polling that costs time and money to gather data on. These efforts to understand voting trends in a rigorous quantitative sense could be beneficial for party strategists to understand the effect of historical voting trends on future ones in order allocate their efforts into races where they have the best chance of winning, particularly if money was tight or reliable polling data wasn’t readily available in a given state. If you were the DCCC or the RSCC and you only had a finite amount of money, time, and personnel, how much should you invest defending ostensibly safe seats? How much should you invest trying to strike deep into the heart of enemy territory unseating an incumbent in a traditionally safe state? How much should you invest in swing states?

For the time being it looks like I’ll have to put any ambitions I may have of being a political strategist or forecaster on hold and keep my day job. It doesn’t seem like one can make any particularly accurate predictions about voting results, at least in terms of trying to pinpoint a specific numeric value based on these metrics alone. At the end of the day, not every exploration will end in a satisfying conclusion, and that’s just part of the process. I’m certainly not going to go through all the time to compile and analyze the data just to shelve it when it doesn’t make for a compelling conclusion. I’m going to try to score some internet points off it, prediction accuracy be damned.

If anything, we should take some comfort in knowing that PVI alone isn’t a silver bullet for predicting senate elections. If it were, it would imply that elections are set in stone and predetermined; it wouldn’t matter who was running or what kind of strategy they employed. Red states would be red states, and blue states would be blue states. In that regard we can breathe a sigh of relief knowing that voters aren’t completely mindless automatons who vote strictly along party lines (for better or for worse).

Future ideas

If I were to expand on this work in the future, I would be interested in exploring additional data that could potentially be informative in making these kinds of predictions such as fundraising data, social media engagement, or Google search trends. Google search trends in particular seem like an especially interesting line of inquiry to me. How much of non-presidential races comes down to name recognition? In the era of the fast moving 24-hour news cycle, is it advantageous to get your name into the ether by any means necessary, or can low profile, slow and steady campaigns win the race? (pun intended) The answers to these questions could lie in Google’s search traffic data and could have relevance for campaign strategy and election forecasting. However, the effort to aggregate this data for the hundred or so races I already have is non-trivial, seeing as Google Trends doesn’t have an API to query this kind of data programmatically and I don’t feel particularly inclined to spend more time entering data into a spreadsheet at the moment. (If any Google engineers are reading this, please publicly expose a Trends API. It would make me very happy)

Another additional line of question would be to take the existing data and the problem more probabilistically (i.e. given a set of initial conditions what is the probability that a candidate will win the election?), perhaps that would be more fruitful than trying to pin down precise values.

Postface (the opposite of preface?)

If you’ve made it this far, congratulations and thank you for bearing with me. What did you think? Did you love it? Did you hate it? Do you want to hire me to run your next campaign for office? Let me know in the comments so I can get better at this.