This project is by no means an endorsement or an indication of my
political beliefs
Thesis)
Based on party incumbency and cumulative inflation over the previous
4 years, I am predicting Donald Trump to win the election with 58% of
the electoral college.
Due to the restrictions of my data and model, a 95% confidence
interval places Trump’s electoral college win between 38% and 78%. This
is a wide margin, but it skews over 50%
Exploratory Data Analysis)
After assembling and cleaning the data, I created this plot to
visualize trends based on whether the candidate was Democrat or
Republican, whether their party is incumbent, and most importantly-
cumulative inflation over the previous 4 year period.

This graph demonstrates that Republicans do better both as
incumbents and non-incumbents when inflation during the previous period
is high.
Creating a Refined Model)
I created a linear regression model to predict the current election
by focusing on data points for Republican, non-incumbent candidates
The result of my model was a positive correlation with a p-value of
0.04 for y-intercept, and 0.03 for total inflation percent. The model
has an R^2 of .60 which I found to be satisfactory

The plot above shows the data points and regression line for
Republican candidates when their party is non-incumbent. A vertical line
is shown at 21.2% cumulative inflation to represent the current
circumstances. This line intersects with the regression line at 58%
which is what the model predicts Trump’s electoral college winning
percent to be.
You may have noticed that the model is influenced by a high outlier
in the upper right quadrant of the plot. This outlier is from the 1980
election in which Ronald Reagan won 91% of the electoral college with
cumulative inflation of 45% during the previous administration. Removing
this outlier results in the following plot:

The above plot and associated regression model result in a predicted
electoral college win of 59% for DJT.

Lastly, this plot shows Trump’s predicted electoral college %
regardless of incumbency and without removing the 1980 election results.
It results in a 60% predicted electoral college win, but an R^2 value of
just 0.28
Conclusion)
Based on the model I have created, it is likely that Trump will win
the 2024 election with about 58% of the electoral college or 312
electoral votes. My model has a wide confidence interval, but I find the
correlation between inflation, party incumbency, and a candidate’s
electoral college winning percent to be convincing.
Discussion)
Donald Trump ended up winning 312 electoral votes to Kamala Harris’
226 votes in the 2024 presidential election. This puts Trump at an
electoral college win of 58%, which falls exactly in line with the model
I created and the outcome I predicted. It is quite neat that my
prediction was exactly the same as the actual outcome, so I am happy
with the prediction model I created. The only thing I wish I could have
done better was narrow my condifence interval.
Resources)
I also used Chat GPT to occasionaly fix coding bugs and errors, but
avoided using it in creating entirely new code