<jupyter_start><jupyter_text>Local politics: small town Nebraska is further right than ever**By <NAME>**In the 2016 election, 84 of Nebraska's 93 counties gave a higher percentage to a GOP candidate than any election since 2000. It's the most visible sign of a shift in rural Nebraska politcs that's been quietly unfolding for more than a decade. As most of the state's counties shrink, they're tilting to the right. And in the process, they're becoming less politically diverse, some dramatically so.<jupyter_code>library(ggplot2)
library(dplyr)
library(scales)
pct <- read.csv("data/pctgop.csv")
head(pct)<jupyter_output><empty_output><jupyter_text>The pctgop.csv file has a single record for each county and election year going back to 2000. The PCTGOP field is the percent of the vote that went to the GOP candidate for president that election. So in 2016, that was <NAME>, in 2000 and 2004, it was <NAME>, and so on. By charting each county, you can see the trend: With the exception of a noticeable dip for President Obama's 2008 election, the majority of counties bend up to the right, meaning a continuously higher percentage of the vote in those counties is going to the Republican candidate.<jupyter_code>ggplot(pct, aes(x=Year, y=PCTGOP, group=County, colour = PCTGOP)) + geom_line() + theme(axis.text.x = element_blank(), axis.ticks = element_blank()) + scale_colour_gradient(low="blue", high="red") + facet_wrap(~County)<jupyter_output><empty_output><jupyter_text>Viewed another way, we can see that Trump counties *vastly* outnumber counties where other GOP candidates did better.<jupyter_code>tiltbar <- read.csv("data/tiltbar.csv")
ggplot(aes(x=Top), data=tiltbar) + geom_bar() + theme_bw()<jupyter_output><empty_output><jupyter_text>So that raises the question of what is going on in these counties? A partial answer statewide is that the number of registered Democrats is slowly shrinking while the number of registered Non Partisans is rising quickly.<jupyter_code>statewidevoters <- read.csv("data/statewidevoters.csv")
head(statewidevoters)
ggplot(statewidevoters, aes(x=Year, y=Registered, group=Party, colour = Party)) + geom_line() + scale_y_continuous(labels = comma) + theme_bw()<jupyter_output><empty_output><jupyter_text>But that statewide trend masks a near collapse of the Democractic party in many counties. In the smaller places in Nebraska, the number of registered Democrats is plunging.<jupyter_code>voters <- read.csv("data/voters.csv")
head(voters)
ggplot(voters, aes(x=Year, y=Voters, group=Party, colour = Party)) + geom_line() + theme(axis.text.x = element_blank(), axis.text.y = element_blank(), axis.ticks = element_blank()) + facet_wrap(~ County, scales = "free")<jupyter_output><empty_output><jupyter_text>Since the 2000 presidential election in Nebraska, 67 counties have lost registered voters. It's no secret that parts of Nebraska are shrinking as people move away from rural areas toward cities. But of those 67 counties that shrunk, 64 of them went stronger for Trump than any other presidential candidate in the last five elections. And 61 of those shrinking counties became more Republican as a percentage over the same period of time. That shift to the right in smaller places has an impact on political discourse in small towns across the state. Using a measure of diversity -- the USA Today Diversity Index, which measures the probability that two people chosen at random will be different -- political diversity in Nebraska's smaller counties is plunging.<jupyter_code>diversitychange <- read.csv("data/diversitychange.csv")
head(diversitychange)
diversitychangesorted <- arrange(diversitychange, desc(Change)) %>% mutate(County = factor(County, County)) %>% mutate(pos = Change >= 0)
ggplot(diversitychangesorted, aes(x=County, y=Change, fill=pos)) + geom_bar(stat='identity', position='identity') + coord_flip()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08668889458835599, 'fraction_numerical': 0.011797896896640164, 'mean_word_length': 6.2356215213358075, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '309489', 'license': 'MIT', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1072, 'n_words': 450, 'path': 'NebraskaVoters.ipynb', 'repo_name': 'mattwaite/nebraskavoters', 'size': '3920'}