https://rpubs.com/kimberlyyliuu/1256168

Following the outcomes of the recent election, I wanted to explore the factors that influenced voter margins more deeply. Although the media portrayed this election as one of the closest in history leading up to voting day, the results told a different story. What truly transpired, and was it as tight as anticipated? Additionally, this election brought to light a critical question: Is the United States still unprepared for a female leader? Through this project, I aim to uncover the underlying forces that shaped this pivotal election and critically examine the narratives that emerged in its aftermath.

Currently, our electoral votes are spread unevenly across states, with larger states like California, Texas, and Florida holding substantial influence due to their high population and electoral vote count, while smaller states like Kentucky and Oklahoma maintain a disproportionately larger influence per voter due to the guaranteed minimum electoral votes allocated to each state. This disparity underscores the disproportionate power smaller states hold in the electoral system, raising questions about the fairness and equity of representation in shaping national outcomes.

https://public.tableau.com/app/profile/kimberly.liu/viz/Book1_17325943948730/Sheet2?publish=yes

The proportional electoral votes were calculated by redistributing the total number of U.S. electoral votes (538) based on each state’s share of the national popular vote. Specifically, we determined the proportion of total votes cast in each state compared to the overall popular vote across all states. This percentage was then multiplied by the total electoral votes (538) to calculate how many electoral votes a state would receive if the system were strictly proportional. The formula is the state’s total votes divided by total national votes, multiplied by 538.

In contrast, the actual allocation of electoral votes is based on the U.S. Electoral College system, which gives each state electoral votes equal to the sum of its congressional representation: two votes for its senators and a number of votes based on its representatives in the House (which is determined by population). This system results in a minimum of 3 votes per state, regardless of population, giving disproportionate weight to smaller states.

Swing states like Pennsylvania, Michigan, and North Carolina hold outsized influence because their electoral votes are pivotal in determining presidential outcomes. This dynamic incentivizes candidates to focus heavily on swing states, often at the expense of larger, more politically predictable states.

The proportional method reveals how electoral power could shift if votes were more equitably distributed, minimizing the influence of swing states and equalizing representation across the country.

https://public.tableau.com/app/profile/kimberly.liu/viz/ElectoralVotes_ActualvsProportional/Sheet6?publish=yes (I wanted to go back and color this orange and green but my activation pass expired and my desktop won’t let me open it again)

For the remainder of the project, I will focus on swing states, analyzing the factors that contribute to shifts in voting patterns.

https://kimberlyyliuu.shinyapps.io/ElectionYear/

In this shiny app, the differences in voting margins are depicted using a bar chart. The red bars represent GOP votes, while the blue bars represent Democratic votes. It is noteworthy that in all three of these election years, the GOP candidate was Donald Trump. To gain deeper insights into the factors influencing voting patterns, I created a correlation matrix to examine the relationships between key variables across swing states.

This correlation matrix provides insights into the relationships between key demographic, socioeconomic, and electoral variables, focusing on factors that may influence voting outcomes, particularly in swing states. The variables analyzed include demographic percentages (Hispanic, White, Black populations), vote margins, median income, and the percentage of residents with a bachelor’s degree. Green cells represent positive correlations, while orange cells indicate negative correlations, with the intensity reflecting the strength of the relationship.

Notable patterns include a strong positive correlation between median income and the percentage of bachelor’s degree holders, suggesting that higher education levels are often associated with higher income areas. The vote margin shows moderate correlations with demographic factors such as the percentage of White and Black populations, indicating that racial composition may play a significant role in election results. The weaker correlations with the Hispanic population highlight regional variations and the need for further exploration in specific states. This visualization emphasizes the multifaceted nature of voting behavior and the demographic and economic factors that drive outcomes in highly contested swing states.

https://kimberlyyliuu.shinyapps.io/Shiny1Project/

In this shiny app, we can explore more of the voting trends, finding patterns with specific % college-educated range, and median income range.

Analyzing the correlation matrix for median income reveals a clear pattern in its relationships with other demographic and voting variables. Median income shows a strong positive correlation with the percentage of individuals holding a bachelor’s degree, indicating that counties with higher educational attainment often report higher income levels. Additionally, there is a moderate negative correlation between median income and vote margins for the GOP, suggesting that counties with higher median incomes tend to lean more Democratic. This trend aligns with broader observations about income dynamics in recent elections, where wealthier, urban, or suburban areas increasingly favor Democratic candidates. Conversely, counties with lower median incomes often lean Republican, highlighting the divide between socioeconomic status and voting preferences. These insights underline the significant role of economic factors in shaping electoral behavior, particularly in swing states where such divides can be critical.

The app not only highlights these overarching trends but also empowers users to investigate specific states and counties, providing detailed insights into the demographic and socioeconomic forces at play. By engaging with this tool, we can better understand how income and education disparities influence voter behavior and contribute to the broader electoral landscape.

In the 2024 election, Trump secured victory in every swing state, flipping several that had previously voted Democratic in 2020. Below, we take a closer look at one of the key swing states, Pennsylvania.

Pennsylvania is one of the key battleground states. From 1992 to 2012, it consistently voted for Democratic candidates. However, in 2016, Republican candidate Donald Trump narrowly won Pennsylvania by 0.7%, marking a significant shift in its voting pattern.

This visual highlights whether turnout increased (green) or decreased (orange) and incorporates population size with bubble sizes to emphasize the impact of changes in densely populated areas like Philadelphia County.

This chart underscores how turnout shifts, particularly in swing states like Pennsylvania, can significantly influence election outcomes. For instance, while smaller counties like Cameron or Sullivan may see larger proportional turnout changes, populous counties like Philadelphia often carry greater weight in shaping the overall result. This reinforces the importance of demographic and socioeconomic patterns explored throughout the project, as turnout changes often mirror broader trends in voter engagement, economic conditions, and education levels. By examining these turnout shifts, we gain a deeper understanding of how key states evolve politically over time.

Despite significant drops in turnout in several counties, Northampton County was the only one that flipped from Democratic to Republican. This underscores the importance of every vote in a winner-takes-all system, where even small shifts in voter behavior can have a decisive impact on the outcome.

How did these flipped counties impact the overall state votes?

This treemap shows the counties that flipped and their importance, relative to the state, highlighting the vote margins in counties that flipped during the 2024 election and categorizing by their new winning party (Democrat in blue, GOP in red, and grey for counties that did not flip)

When connected to the previous visual, it becomes evident that while North Carolina saw many counties flipping to the Democrats, their margins of victory were relatively small, as shown by the shorter blue squares in this chart. These modest gains were insufficient to overcome the larger Republican strongholds and widespread GOP support elsewhere in the state, explaining why the overall margin of victory for Trump increased in North Carolina despite these county-level shifts.

Interestingly, despite North Carolina experiencing significant shifts with counties flipping to Democrat, the overall state did not change hands, and the margin of victory for Donald Trump actually increased. In both the 2020 and subsequent elections, Trump won North Carolina’s electoral votes. In the latest election, the margin of victory increased by 108,567 votes compared to 2020, indicating a larger win for Trump. This is noteworthy, especially considering the visual shows that more counties have flipped to Democrat.

On the other hand, counties that flipped to the GOP, such as Miami-Dade County in Florida and Maricopa County in Arizona, had significantly larger margins of victory, as illustrated by the long red bars in this visual. These large GOP wins contributed to flipping key battleground states and bolstering the overall Republican performance. This contrast underscores the disproportionate impact that a few high-population counties can have on the electoral outcome, reinforcing the importance of analyzing not just the number of flipped counties but also the magnitude of their vote margins. Together, these visuals emphasize how localized dynamics at the county level contribute to broader state and national trends.

As we continue to observe the shifting dynamics in American politics, it’s evident that demographic factors are significantly influencing voting patterns across the country. The visualizations we explored highlight a striking contrast between two major groups: white voters and college-educated voters.

In areas with a higher percentage of white residents, there is a noticeable trend toward Republican support. This pattern is consistent across a variety of regions, particularly in the South and Midwest, where the GOP has historically had strong roots. These regions tend to align with conservative values, and the correlation between white populations and Republican support speaks to the party’s traditional base.

On the flip side, counties with a higher percentage of college-educated residents are increasingly shifting toward the Democratic Party. This trend is particularly strong in urban centers and swing states, where educated professionals and younger generations are making their voices heard. The visual data shows that the Democratic Party is gaining momentum in these areas, reflecting a broader shift toward progressive policies on issues such as climate change, healthcare, and social justice.

What is particularly striking in this post-Trump era is the way these demographic shifts are shaping electoral maps and influencing political strategy. The divide between regions that are strongly aligned with one party and those that remain more mixed points to a deeply polarized nation. It’s clear that political parties will need to adapt to these changing dynamics in order to appeal to new voter bases and navigate the challenges of a fragmented electorate.

It is important to remember that the voting trends isn’t determined by demographic factors alone. Economic conditions, social issues, and candidate personalities all play a role in shaping voter behavior. For example, COVID-19 cases was a major sociopolitical issue in the 2020 election that impacted how voters reacted to the candidates.

Addressing this polarization is going to be a big challenge. Policymakers and political campaigns need to find ways to bring people together and promote inclusivity. But given how complex these issues are, there are no easy answers. We’ll need a thoughtful and balanced approach to navigate this changing landscape.