Do Swing State Voters Support Democrats and Republicans Equally at the Local Level?

Eliana Grosof
Data, Explained
Published in
9 min readSep 17, 2020

A deep data analysis of the 2018 midterm general election.

A map of the 2016 Presidential Election Results, from 270towin.com

Introduction

Swing states — states where the two major political parties have roughly equal levels of support among voters — are crucial in determining the winner of American presidential races. Since most states give all of their electoral votes to a single party, sometimes only a few thousand votes in a swing state can determine the winner of the entire national presidential election, such as in the 2016 election.

While both Democrats and Republicans have equal support overall among voters in swing states, I want to understand if this dynamic extends to more local politics. In other words: do swing state voters support Democrats and Republicans at fairly equal rates within each county, or is the support only equal at the state level?

Methodology

I looked at 11 swing states — Colorado, Florida, Iowa, Michigan, Minnesota, New Hampshire, North Carolina, Ohio, Pennsylvania, Virginia, and Wisconsin, and calculated various statistics based on the 2018 midterm general election, held on November 6, 2018. The data comes from openelections.net, which seeks to “create the first free, comprehensive, standardized, linked set of election data for the United States”. I transformed the data using Python and Excel. Most of the visualizations were generated using Tableau. I did the statistical analysis with R and Excel.

Caveats and Limitations

I chose to limit myself to the 2018 midterm elections due to lack of time.

Most of my analysis centers on the difference in votes for Democrats and Republicans overall within each county rather vote counts for races for particular candidates.

When I do look at individual races, for the sake of simplicity and ease of calculation:

  • I exclude races where a non-Democrat or Republican was a major contender.
  • When I calculate the winner of a race, I simply look at which party won the most votes in each county. Note that “races won” is not reflective of actual candidates elected — most of the races I analyzed were actually held for state-wide positions and therefore simulate the winner of the race if it been for a county-level office.

I made these choices to simulate which party has majority support within the county, rather than to directly reflect the realities of party power within the state.

Summary Statistics

Voters cast 928 million total votes total in all of the swing states I analyzed. On average, voters cast 84 million votes in each state. However, the votes cast in each state varied from 7 million votes in New Hampshire to 200 million votes in Florida.

Because the number of votes cast in each state varies so much, and many of them were cast for candidates that did not belong to a major political party, I focus my analysis on the margin.

Margin

The margin is the percentage of votes cast for Democrats or Republicans that the party won by. For example, the margin for all elections in Alamosa County, Colorado was 5%. That means that one party got 5% more votes than the other (in this case, Democrats got 5% more votes than Republicans).

We can think of a close margin as a margin of 10% or less, and a very close margin as a margin of 2% or less.

Are races close at the county level?

That is, within each county, did Democrats and Republicans tend to get equal number of votes?

First of all, which party tended to win races?

In every state except New Hampshire, Republicans won most of the elections held in the 2018 midterms. This means that Republicans have at least a plurality of the votes within most counties in most swing states.

Note: “races won” is not reflective of actual candidates elected. Most of the races I analyzed were actually held for state-wide positions. This gives us an idea of what would have happened if the race had been held for a county-level office.

Okay, but which party received the most votes?

This chart shows the difference in total votes in each state that were cast for Democrats and Republicans. If the difference was negative, Republicans received more votes, and if it was positive, Democrats received more votes.

Interesting. In each state, Democrats received more total votes than Republicans, generally by at least 1 million. In a few states, Republicans and Democrats were fairly evenly matched: in Iowa and New Hampshire, the difference was only 185,000, and in North Carolina it was only 60,000. This stands in contrast to the fact that Democrats lost most of the races within counties, suggesting that certain counties hold most of the Democratic voters.

How often did close races happen, at the county level?

In general, the races (elections) were not close. However, in several states (Iowa, Minnesota, Wisconsin), about a quarter of the races were close or very close. In the case of New Hampshire, half of the races were close. Although the number of close races in each race was not high, it was not insignificant.

Note: In the future, it would be interesting to compare these numbers to non-swing states and in different election years.

When the margin was small, which party tended win?

This graph has a dot for each county within each state where the difference in total votes for Democrats and Republicans within the county was 10% or less. The dot is red if Republicans received more votes, and blue if Democrats received more votes.

Glancing at this graph, it seems like Republicans may have won most of the close elections, but not conclusively. So we can’t really say whether mostly Democrats or Republicans tended to win close races.

If you want to see a map of these margins for each state, you can find it here.

How does having a city in the county affect votes?

There’s a common narrative in American political discourse that people in cities tend to vote for Democrats, and people tend to vote for Republicans everywhere else. Is that true?

In order to answer this question, I set up a chi-square test of independence to see if having a city in a county was related to whether the majority of a county’s votes went to Democrats. I also ran a Fisher’s R test, because the total number of counties I analyzed was fairly small and chi-square tests are less accurate on small sample sizes. I defined a big city as a city that had a population of over 100,000 in the 2010 census.

I calculated values for the following table, and used it to run the independence tests:

The p-value for both the chi-square test and Fisher’s R was under 2.2 x 10¹⁶, or just about 0, which means that whether a county contains a city and which party the majority of the votes in that county went to are related. However, it does not tell us whether cities voted for Democrats or Republicans in general.

How can we find that out? It’s actually a fairly simple thing to eyeball. I plotted the margin between votes for Democrats and Republicans in each county (below) on a graph, with a negative margin for Republicans and a positive margin for Democrats.

It’s pretty clear from this graph that Democrats won the most votes within counties that contained cities, because most margins in counties that contained cities are very positive. This suggests that most of the time Democrats won by a lot in counties with cities.

Though Democrats generally won in cities, did they win by more than Republicans did outside of cities? In other words, were people outside of cities more likely to vote for Democrats and Republicans in equal numbers than people in counties with big cities?

This is another way to help us determine if big cities have similar levels of support among Democrats and Republicans. Why? If counties with cities are no more likely to have close margins than counties without cities, and we find that most counties in swing states have close elections, then it would suggest that Democrats and Republicans are evenly matched in swing states, even in cities.

We will use margin to determine the answer to this question. If the margin was greater than 10%, then people in the county did not vote for Democrats and Republicans in similar numbers. If it was less than 10%, then people in the county voted for Democrats and Republicans in roughly equal numbers. Since sometimes 10% is still a little big, I also look at counties with margins with greater and less than 2% margins.

I again ran chi-square and Fisher’s R tests for the tables to see if the variables were related.

The p-values are well over 0.10 in all cases, ranging from 0.30 to 0.67. This tells us that counties that contained cities were no more likely to have big (or small) margins than counties that didn’t contain cities.

So far, we’ve answered:

  • Who wins the most races? Republicans.
  • Who gets the most votes? Democrats.
  • Do cities affect which party get the most votes? Yes, and Democrats get the most votes within counties that contain cities.
  • Are rural/suburban counties more likely to have equal numbers of Democrat and Republican voters in them than urban counties? No.

Do Democrats and Republicans generally receive similar percentages of the vote at the county level?

We partially answered that with our analysis of counties with cities, but we can do better.

We can think of a close margin as 10% or less, and a very close margin of 2% or less. Anything above 10% is not a close margin.

What was the average margin in each state? In other words, what was the average amount of votes that a party won by in a given county?

In general, parties won by over 10%. That means that most elections within the counties were not close, suggesting that Democrats and Republicans are not evenly distributed geographically across swing states.

This is consistent with the finding that Democrats and Republicans are no more likely to have equal levels of support within counties that don’t contain big cities as counties that do have big cities because it seems like every county prefers one party over another, not just cities.

Conclusions

My main question in this analysis was:

Do swing state voters support Democrats and Republicans at fairly equal rates at across the counties within each state, or is the support only near-equal when you tally up all of the votes cast in the entire state?

I learned that:

  • Republicans tended to win the most elections held in counties, but Democrats won the most votes overall.
  • Counties with big cities voted overwhelmingly for Democrats.
  • Most counties, in most states, voted for one party over the other by a large margin.
  • Close races happened about a quarter (25%) of the time within each swing state.
  • When the margin was close, neither party seemed to win consistently.

Taken together, this confirms a well-known narrative of Democrats having more support in areas with large cities and Republicans having more support in less urban areas.

So the answer to my question is: in general, Democrats and Republicans only enjoy near-equal levels of support at the state level, not the local level.

You can find all of my code here, my statistical analysis here, and my visualizations here.

--

--

Eliana Grosof
Data, Explained

I write about computers and also about having emotions as a twenty-something. Professional me: elianagrosof.com.