Presidential Elections Forecast
By: Engy Fouda
Tags: Elections, Predictions, Election 2020, Voting, Forecasting

Presidential Elections Forecast

Acknowledgment

Thanks to Asma Barakat for helping me in gathering the needed data for this research!

Introduction

Many factors affect the election results as the COVID-19, impeachment, economy, unemployment rate, natural disasters’ response, climate change, foreign policy, people’s loyalty to their party, debates, presidents’ heights, and plenty of other factors. In this article, I will focus solely on historical data of the popular vote in every state.

Model

The programming language used in the modeling and analysis is SAS 9.4. The model used is the PROC UNIVARIATE.

Results

To test my model, I predicted the 2016 elections and compared the results to the actual values. Collectively, the algorithm shows that Trump would win in 2016, which actually happened. Also, it forecasts that he will win the 2020 elections. However, by inspecting the state's results, I found that the code predicted 11 states wrong, further details below.

How far in history should we collect the data?

This model relies solely on people’s loyalty to their parties. It does not include any other factors. We gathered the popular vote percentages for every party since 1960.

Choosing the year 1960 is tentative. I assumed that most people do not change their party. Therefore, I searched the average life expectancy in the USA and found that it is around 78 years, which means that I should go back and gather since the 1940 elections. However, by some trial and error experiments, I found that 1960 gave the most accurate results. Nevertheless, further experiments are needed for more accurate verification.

Model Accuracy

I verified the experiments by using my algorithm to predict the 2016 elections. As shown in Figure 1, the algorithm predicts 39 and the District of Columbia correctly and missed 11 states. However, it predicts that the Republicans win the 2016 elections with 311 electoral votes. The Democrats gain only 224, close to the actual results of 304 and 227 for republicans and democrats, respectively.

Figure 1: The model accuracy measured by the 2016 results

According to Figure 1, the model accuracy is 78.43%. There is vast room for enhancing this model to increase its accuracy. (please read the correction at then end of the article)

Without further ado, here you are the table:

Table 1: The results

You can download the file, listed in Table 1, from here:

http://engyfoda.com/MYPREDICTIONSISA_2.xlsx

You can also download the following files:

The Democrat's 2020 file: http://engyfoda.com/DEMOCRATSISA.xlsx

The Democrat’s 2016 file: http://engyfoda.com/DEMOCRATS2016.xlsx

The Republican’s 2020 file: http://engyfoda.com/REPUBLICANISA.xlsx

The Republican’s 2016 file: http://engyfoda.com/REPUBLICAN2016.xlsx

Note: in the above files, the last variable (L) is the electoral votes for every state.

Visualizations

By comparing the two maps of my forecast for the 2016 elections and the actual 2016 results, Figure 2 and 3, these are the 11 states that the model has missed:

1.Colorado (the actual winning candidate is: Hillary Clinton)

2.Illinois (the actual winning candidate is: Hillary Clinton)

3.Michigan (the actual winning candidate is: Donald Trump)

4.Nevada (the actual winning candidate is: Hillary Clinton)

5.New Hampshire (the actual winning candidate is: Hillary Clinton)

6.New Mexico (the actual winning candidate is: Hillary Clinton)

7.North Carolina (the actual winning candidate is: Hillary Clinton)(This is wrong. Please read the correction at the end of the article)

8.Pennsylvania (the actual winning candidate is: Donald Trump)

9.Virginia (the actual winning candidate is: Hillary Clinton)

10.West Virginia (the actual winning candidate is: Donald Trump)

11.Wisconsin (the actual winning candidate is: Donald Trump)

Figure 2: My forecast for the 2016 elections

Figure 3: The actual 2016 elections results

Below is the visualization of my 2020 forecast, as in Figure 4. By comparing my forecast of 2016 and 2020, Figures 2 and 4, only West Virginia switched from Democrat to Republican, causing the increase of the Republican’s electoral votes from 307 in my 2016 predictions to 311 in the 2020 forecast. Since the algorithm already missed 11 states in the 2016 results, this missing still persists in the 2020 forecast. Therefore, I can conclude that the algorithm’s forecast for 2020 that Trump will win with 78.43% probability.

Figure 4: The 2020 forecast

Model Defects

The model is derived from the people’s loyalty to their political party while in the 2020 elections the people’s preference might change due to other factors. For example, many Republicans are anti-Trump, and many Democrats do not approve of engrossing liberty notion in the sexual liberties of the LGBT and abortion, which violates their religious beliefs.

Moreover, this analysis relies only on two parties’ results and does not consider the other parties’ results. Some states’ results would have enhanced if we collected the third party’s results and injected them into the model.

Further, only two decimal is used. Feeding more precise data to the model will enhance its accuracy.

Raw Data

The raw data for every state can be downloaded from here:

Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin, Wyoming, District of Columbia

Conclusion

This model relies solely on people’s loyalty to their political parties. Several steps can be done for future work. First, doing further experiments needed to verify which year back in time will lead us to more accurate results. Second, increasing the decimal places in the input data files might affect the model’s performance. Third, adding more factors to the model as the response to the COVID-19 in every state, unemployment rates, and the natural disasters’ response. The Natural disasters’ response can be an entirely new article to research and compare their numbers with every president. Since 2016, there is an increase in the number of wildfires, hurricanes, and floods. In conclusion, this article is merely a start, and there is room for enhancing the model’s accuracy.

Whatever your party is, please vote.

Engy Fouda,

​Author, Learn Data Science Using SAS Studio

Correction

I wrote that the model predicted North Carolina wrong in 2016 while it is a correct prediction. DonaldTrump won North Carolina in 2016. I made a mistake in entering the two actual votes; I switched them. This correction increases the model accuracy to 80.39% because it missed 10 states, not 11, in the 2016 elections.