This analysis uses 2020 Pennsylvania election data to predict the upcoming 2024 election results in Wisconsin. The data includes demographic factors such as poverty rates, median income, and education levels. If similar patterns hold in Wisconsin, I expect to see a strong relationship between these variables and Republican votes. However, significant shifts in demographics or political dynamics may affect the prediction, challenging the consistency of these trends across states.
The dataset contains county-level data from the 2020 Presidential Election in Pennsylvania, along with demographic data from both Pennsylvania and Wisconsin from 2018-2022. The following key variables are included:
Key variables included:
The linear regression model was developed to predict the number of Republican votes in the 2020 Presidential Election based on county-level demographic data. The independent variables included the percentage of families below the poverty line, median family income, and the percentage of residents with a bachelor’s degree in each county. To address skewness in the data, log transformations were applied to both the dependent and independent variables.
The model formula is as follows: log(Votes)=β0+β1(log(Families Below Poverty))+β2(log(Median Income))+β3(log(Bachelor’s Degree Holders))+ϵ
The model output indicates that several demographic factors significantly impact Republican votes. The intercept of 7.25 represents the baseline log vote count. The coefficient for Log(Families Below Poverty) is -0.85, suggesting an inverse relationship, where higher poverty levels are associated with fewer Republican votes. In contrast, Log(Median Income) has a positive coefficient of 0.14, indicating that higher income levels correlate with an increase in Republican votes. Similarly, Log(Bachelor’s Degree Holders) has a coefficient of -0.67, suggesting that higher education levels are associated with lower Republican support. The model’s R^2 of 0.68 and adjusted R^2 of 0.67 show that the model explains 67% of the variance in Republican votes, indicating a strong fit. Additionally, the p-values for all coefficients are below 0.05, confirming that these variables are statistically significant predictors of Republican vote counts.
This chart demonstrates the positive linear relationship between the log of families below the poverty line and the log of Republican votes, as predicted by the model. The fitted regression line in blue highlights the overall trend, showing that as the percentage of families below the poverty line increases, the number of Republican votes tends to increase, even after log transformation, indicating a consistent pattern across the data.
This analysis does not account for external political factors such as voter turnout initiatives, campaign spending, or national trends, which could significantly influence voting behavior. Additionally, because the model is based on 2020 Pennsylvania data, it may not fully capture unique demographic or political dynamics in Wisconsin. Future research could improve model accuracy by incorporating these external influences and more granular data specific to Wisconsin, providing a stronger foundation for predicting the 2024 election outcomes.
Actual Trump Percentage: 49.6%
Predicted Trump Percentage: 50.4%
Error Margin: 0.79%
The actual outcome of the 2024 Presidential Election in Wisconsin shows that Donald Trump received 49.6% of the vote, while the model predicted he would receive 50.4%, resulting in an error margin of 0.79%. This close alignment between the predicted and actual results demonstrates the model’s strong performance and highlights the effectiveness of demographic factors—such as poverty rates, median income, and education levels—in forecasting voting behavior. I am happy with the results however, the slight error likely stems from limitations such as variations in voter turnout, campaign strategies, or unique political events in Wisconsin that were not accounted for in the model. Despite these constraints, the model provides valuable insights and reinforces the importance of demographic analysis in understanding and predicting election outcomes.
Sources included:
Pennsylvania Election Returns, 2020. Available at Pennsylvania Election Returns Report Center
Wisconsin/Pennsylvania Demographic Data, 2020. Available at NIMHD Health Disparities Pulse Data Portal
ChatGPT was used to generate code for the 2nd and the last graph, as well as debug an error with the dataset
Wisconsin’s Election data for 2024 by county.