Skip to content

Instantly share code, notes, and snippets.

@ryanburge
Created January 27, 2024 23:45
Show Gist options
  • Save ryanburge/3b1a475a57165fbc7aa13972bddc0275 to your computer and use it in GitHub Desktop.
Save ryanburge/3b1a475a57165fbc7aa13972bddc0275 to your computer and use it in GitHub Desktop.
tt1 <- gss %>%
filter(year <= 2018) %>%
mutate(white = case_when(race == 1 ~ 1, TRUE ~ 0)) %>%
mutate(prot = case_when(relig == 1 ~ 1, TRUE ~ 0)) %>%
mutate(pid7 = partyid + 1) %>%
mutate(dem = case_when(pid7 == 1 | pid7 == 2 | pid7 == 3 ~ 1,
TRUE ~ 0)) %>%
mutate(all = white + prot + dem) %>%
mutate(all = case_when(all == 3 ~ 1,
TRUE ~ 0)) %>%
group_by(year) %>%
mean_ci(all, wt = wtssall)
tt2 <- gss %>%
filter(year >= 2021) %>%
mutate(white = case_when(race == 1 ~ 1, TRUE ~ 0)) %>%
mutate(prot = case_when(relig == 1 ~ 1, TRUE ~ 0)) %>%
mutate(pid7 = partyid + 1) %>%
mutate(dem = case_when(pid7 == 1 | pid7 == 2 | pid7 == 3 ~ 1,
TRUE ~ 0)) %>%
mutate(all = white + prot + dem) %>%
mutate(all = case_when(all == 3 ~ 1,
TRUE ~ 0)) %>%
group_by(year) %>%
mean_ci(all, wt = wtssnrps)
graph1 <- bind_rows(tt1, tt2) %>% mutate(type = "Protestant")
tt1 <- gss %>%
filter(year <= 2018) %>%
mutate(white = case_when(race == 1 ~ 1, TRUE ~ 0)) %>%
mutate(prot = case_when(relig == 2 ~ 1, TRUE ~ 0)) %>%
mutate(pid7 = partyid + 1) %>%
mutate(dem = case_when(pid7 == 1 | pid7 == 2 | pid7 == 3 ~ 1,
TRUE ~ 0)) %>%
mutate(all = white + prot + dem) %>%
mutate(all = case_when(all == 3 ~ 1,
TRUE ~ 0)) %>%
group_by(year) %>%
mean_ci(all, wt = wtssall)
tt2 <- gss %>%
filter(year >= 2021) %>%
mutate(white = case_when(race == 1 ~ 1, TRUE ~ 0)) %>%
mutate(prot = case_when(relig == 2 ~ 1, TRUE ~ 0)) %>%
mutate(pid7 = partyid + 1) %>%
mutate(dem = case_when(pid7 == 1 | pid7 == 2 | pid7 == 3 ~ 1,
TRUE ~ 0)) %>%
mutate(all = white + prot + dem) %>%
mutate(all = case_when(all == 3 ~ 1,
TRUE ~ 0)) %>%
group_by(year) %>%
mean_ci(all, wt = wtssnrps)
graph2 <- bind_rows(tt1, tt2) %>% mutate(type = "Catholic")
both <- bind_rows(graph1, graph2)
both %>%
ggplot(., aes(x = year, y = mean, color = type, group = type)) +
geom_point(stroke = .75, shape = 21, alpha = .45) +
geom_labelsmooth(aes(label = type), method = "loess", formula = y ~ x, family = "font", linewidth = 1, text_smoothing = 30, size = 5.5, linewidth = 1, boxlinewidth = 0.3) +
scale_y_continuous(labels = percent, limits = c(0, .30)) +
theme_rb() +
scale_color_calc() +
labs(x = "Year", y = "", title = "Share of All Adults Who are White Protestant or Catholic Democrats", caption = "@ryanburge\nData: General Social Survey, 1972-2022")
save("gss_white_dem_christians.png")
aaa1 <- gss %>%
filter(year <= 2018) %>%
filter(relig == 1) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssall, show_na = FALSE)
aaa2 <- gss %>%
filter(year > 2018) %>%
filter(relig == 1) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssnrps, show_na = FALSE)
one <- bind_rows(aaa1, aaa2) %>% mutate(type = "Protestants")
aaa1 <- gss %>%
filter(year <= 2018) %>%
filter(relig == 2) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssall, show_na = FALSE)
aaa2 <- gss %>%
filter(year > 2018) %>%
filter(relig == 2) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssnrps, show_na = FALSE)
two <- bind_rows(aaa1, aaa2) %>% mutate(type = "Catholics")
both <- bind_rows(one, two)
both %>%
ggplot(., aes(x = year, y = pct, color = pid3, group = pid3)) +
geom_point(stroke = .75, shape = 21, alpha = .45, show.legend = FALSE) +
geom_smooth(se = FALSE) +
facet_wrap(~ type) +
pid3_color() +
theme_rb(legend = TRUE) +
theme(strip.text = element_text(size = 20)) +
scale_y_continuous(labels = percent, limits = c(0, .70)) +
labs(x = "", y = "", title = "The Partisan Composition of White Christians, 1972-2022", caption = "@ryanburge\nData: General Social Survey, 1972-2022")
save("white_christian_pid3.png")
aaa1 <- gss %>%
filter(year <= 2018) %>%
filter(reltrad == 1) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssall, show_na = FALSE)
aaa2 <- gss %>%
filter(year > 2018) %>%
filter(reltrad == 1) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssnrps, show_na = FALSE)
one <- bind_rows(aaa1, aaa2) %>% mutate(type = "Evangelicals")
aaa1 <- gss %>%
filter(year <= 2018) %>%
filter(reltrad == 2) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssall, show_na = FALSE)
aaa2 <- gss %>%
filter(year > 2018) %>%
filter(reltrad == 2) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssnrps, show_na = FALSE)
two <- bind_rows(aaa1, aaa2) %>% mutate(type = "Mainline")
aaa1 <- gss %>%
filter(year <= 2018) %>%
filter(reltrad == 7) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssall, show_na = FALSE)
aaa2 <- gss %>%
filter(year > 2018) %>%
filter(reltrad == 7) %>%
filter(race == 1) %>%
mutate(pid7 = partyid + 1) %>%
cces_pid3(pid7) %>%
group_by(year) %>%
ct(pid3, wt = wtssnrps, show_na = FALSE)
three <- bind_rows(aaa1, aaa2) %>% mutate(type = "Nones")
both <- bind_rows(one, two)
both %>%
ggplot(., aes(x = year, y = pct, color = pid3, group = pid3)) +
geom_point(stroke = .75, shape = 21, alpha = .45, show.legend = FALSE) +
geom_smooth(se = FALSE) +
facet_wrap(~ type) +
pid3_color() +
theme_rb(legend = TRUE) +
theme(strip.text = element_text(size = 20)) +
scale_y_continuous(labels = percent, limits = c(0, .70)) +
labs(x = "", y = "", title = "The Partisan Composition of White Evangelicals and Mainline Protestants, 1972-2022", caption = "@ryanburge\nData: General Social Survey, 1972-2022")
save("white_protestant_nones_pid3.png")
one <- cces20 %>%
mutate(trad = frcode(religpew_baptist == 1 ~ "Southern Baptist",
religpew_baptist == 2 ~ "ABCUSA",
religpew_baptist == 3 ~ "Natl. Baptist Convention",
religpew_baptist == 4 ~ "Progressive Baptist Convention",
religpew_baptist == 5 ~ "Independent Baptist",
religpew_baptist == 6 ~ "Baptist General Conference",
religpew_baptist == 7 ~ "Baptist Miss. Association",
religpew_baptist == 8 ~ "Conservative Bapt. Association",
religpew_baptist == 9 ~ "Free Will Baptist",
religpew_baptist == 10 ~ "Gen. Assoc. of Reg. Bapt.",
religpew_baptist == 90 ~ "Other Baptist",
religpew_methodist == 1 ~ "United Methodist",
religpew_methodist == 2 ~ "Free Methodist",
religpew_methodist == 3 ~ "African Methodist Episcopal",
religpew_methodist == 4 ~ "AME - Zion",
religpew_methodist == 5 ~ "Christian Methodist Episcopal",
religpew_methodist == 90 ~ "Other Methodist",
religpew_nondenom == 1 ~ "Nondenom Evangelical",
religpew_nondenom == 2 ~ "Nondenom Fundamentalist",
religpew_nondenom == 3 ~ "Nondenom Charismatic",
religpew_nondenom == 4 ~ "Interdenominational",
religpew_nondenom == 5 ~ "Community Church",
religpew_nondenom == 90 ~ "Other Nondenom",
religpew_lutheran == 1 ~ "ELCA",
religpew_lutheran == 2 ~ "Lutheran - Missouri Synod",
religpew_lutheran == 3 ~ "Lutheran - Wisconsin Synod",
religpew_lutheran == 4 ~ "Other Lutheran",
religpew_presby == 1 ~ "PCUSA",
religpew_presby == 2 ~ "PCA",
religpew_presby == 3 ~ "Associated Reformed Presbyterian",
religpew_presby == 4 ~ "Cumberland Presbyterian",
religpew_presby == 5 ~ "Orthodox Presbyterian",
religpew_presby == 6 ~ "Evangelical Presbyterian",
religpew_presby == 90 ~ "Other Presbyterian",
religpew_pentecost == 1 ~ "Assemblies of God",
religpew_pentecost == 2 ~ "Church of God Cleveland TN",
religpew_pentecost == 3 ~ "Four Square Gospel",
religpew_pentecost == 4 ~ "Pentecostal Church of God",
religpew_pentecost == 5 ~ "Pentecostal Holiness Church",
religpew_pentecost == 6 ~ "Church of God in Christ",
religpew_pentecost == 7 ~ "Church of God of the Apostolic Faith",
religpew_pentecost == 8 ~ "Assembly of Christian Churches",
religpew_pentecost == 9 ~ "Apostolic Christian",
religpew_pentecost == 90 ~ "Other Pentecostal",
religpew_episcop == 1 ~ "ECUSA",
religpew_episcop == 2 ~ "Church of England",
religpew_episcop == 3 ~ "Anglican Orthodox",
religpew_episcop == 4 ~ "Reformed Episcopal",
religpew_episcop == 90 ~ "Other Episcopal",
religpew_christian == 1 ~ "Church of Christ",
religpew_christian == 2 ~ "Disciples of Christ",
religpew_christian == 3 ~ "Christian Church",
religpew_christian == 90 ~ "Other Christian Church",
religpew_congreg == 1 ~ "United Church of Christ",
religpew_congreg == 2 ~ "Conservative Cong. Christian",
religpew_congreg == 3 ~ "National Assoc. of Cons. Cong.",
religpew_congreg == 90 ~ "Other Cong.",
religpew_holiness == 1 ~ "Church of the Nazarene",
religpew_holiness == 2 ~ "Wesleyan Church",
religpew_holiness == 4 ~ "Christian and Missionary Alliance",
religpew_holiness == 5 ~ "Church of God",
religpew_holiness == 6 ~ "Salvation Army",
religpew_reformed == 1 ~ "Reformed Church in America",
religpew_reformed == 2 ~ "Christian Reformed",
religpew_reformed == 90 ~ "Other Reformed",
religpew_advent == 1 ~ "Seventh Day Adventist",
# religpew_advent == 2 ~ "Church of God",
religpew_advent == 3 ~ "Advent Christian",
religpew_advent == 90 ~ "Other Adventist")) %>%
mutate(white = case_when(race == 1 ~ 1, TRUE ~ 0)) %>%
group_by(trad) %>%
mean_ci(white, wt = commonweight) %>%
filter(n > 100) %>%
filter(mean > .5) %>%
filter(trad != "NA") %>%
arrange(-n) %>%
head(20) %>%
mutate(sort = "a") %>%
select(trad, sort, tot = n)
two <- cces22 %>%
mutate(trad = frcode(religpew_baptist == 1 ~ "Southern Baptist",
religpew_baptist == 2 ~ "ABCUSA",
religpew_baptist == 3 ~ "Natl. Baptist Convention",
religpew_baptist == 4 ~ "Progressive Baptist Convention",
religpew_baptist == 5 ~ "Independent Baptist",
religpew_baptist == 6 ~ "Baptist General Conference",
religpew_baptist == 7 ~ "Baptist Miss. Association",
religpew_baptist == 8 ~ "Conservative Bapt. Association",
religpew_baptist == 9 ~ "Free Will Baptist",
religpew_baptist == 10 ~ "Gen. Assoc. of Reg. Bapt.",
religpew_baptist == 90 ~ "Other Baptist",
religpew_methodist == 1 ~ "United Methodist",
religpew_methodist == 2 ~ "Free Methodist",
religpew_methodist == 3 ~ "African Methodist Episcopal",
religpew_methodist == 4 ~ "AME - Zion",
religpew_methodist == 5 ~ "Christian Methodist Episcopal",
religpew_methodist == 90 ~ "Other Methodist",
religpew_nondenom == 1 ~ "Nondenom Evangelical",
religpew_nondenom == 2 ~ "Nondenom Fundamentalist",
religpew_nondenom == 3 ~ "Nondenom Charismatic",
religpew_nondenom == 4 ~ "Interdenominational",
religpew_nondenom == 5 ~ "Community Church",
religpew_nondenom == 90 ~ "Other Nondenom",
religpew_lutheran == 1 ~ "ELCA",
religpew_lutheran == 2 ~ "Lutheran - Missouri Synod",
religpew_lutheran == 3 ~ "Lutheran - Wisconsin Synod",
religpew_lutheran == 4 ~ "Other Lutheran",
religpew_presby == 1 ~ "PCUSA",
religpew_presby == 2 ~ "PCA",
religpew_presby == 3 ~ "Associated Reformed Presbyterian",
religpew_presby == 4 ~ "Cumberland Presbyterian",
religpew_presby == 5 ~ "Orthodox Presbyterian",
religpew_presby == 6 ~ "Evangelical Presbyterian",
religpew_presby == 90 ~ "Other Presbyterian",
religpew_pentecost == 1 ~ "Assemblies of God",
religpew_pentecost == 2 ~ "Church of God Cleveland TN",
religpew_pentecost == 3 ~ "Four Square Gospel",
religpew_pentecost == 4 ~ "Pentecostal Church of God",
religpew_pentecost == 5 ~ "Pentecostal Holiness Church",
religpew_pentecost == 6 ~ "Church of God in Christ",
religpew_pentecost == 7 ~ "Church of God of the Apostolic Faith",
religpew_pentecost == 8 ~ "Assembly of Christian Churches",
religpew_pentecost == 9 ~ "Apostolic Christian",
religpew_pentecost == 90 ~ "Other Pentecostal",
religpew_episcop == 1 ~ "ECUSA",
religpew_episcop == 2 ~ "Church of England",
religpew_episcop == 3 ~ "Anglican Orthodox",
religpew_episcop == 4 ~ "Reformed Episcopal",
religpew_episcop == 90 ~ "Other Episcopal",
religpew_christian == 1 ~ "Church of Christ",
religpew_christian == 2 ~ "Disciples of Christ",
religpew_christian == 3 ~ "Christian Church",
religpew_christian == 90 ~ "Other Christian Church",
religpew_congreg == 1 ~ "United Church of Christ",
religpew_congreg == 2 ~ "Conservative Cong. Christian",
religpew_congreg == 3 ~ "National Assoc. of Cons. Cong.",
religpew_congreg == 90 ~ "Other Cong.",
religpew_holiness == 1 ~ "Church of the Nazarene",
religpew_holiness == 2 ~ "Wesleyan Church",
religpew_holiness == 4 ~ "Christian and Missionary Alliance",
religpew_holiness == 5 ~ "Church of God",
religpew_holiness == 6 ~ "Salvation Army",
religpew_reformed == 1 ~ "Reformed Church in America",
religpew_reformed == 2 ~ "Christian Reformed",
religpew_reformed == 90 ~ "Other Reformed",
religpew_advent == 1 ~ "Seventh Day Adventist",
# religpew_advent == 2 ~ "Church of God",
religpew_advent == 3 ~ "Advent Christian",
religpew_advent == 90 ~ "Other Adventist")) %>%
cces_pid3(pid7) %>%
group_by(trad) %>%
ct(pid3, wt = commonweight, show_na = FALSE)
gg <- left_join(two, one) %>% filter(sort == "a")
gg$trad <- fct_reorder(gg$trad, gg$tot, .desc = TRUE)
gg %>%
mutate(lab = round(pct, 2)) %>%
ggplot(., aes(x = 1, y = pct, fill = pid3)) +
geom_col(color = "black") +
coord_flip() +
facet_wrap(~ trad, ncol =1, strip.position = "left") +
theme_rb() +
pid3_fill() +
theme(legend.position = "bottom") +
scale_y_continuous(labels = percent) +
theme(strip.text.y.left = element_text(angle=0, hjust=1)) +
guides(fill = guide_legend(reverse=T, nrow = 1)) +
theme(axis.title.y=element_blank(), axis.text.y=element_blank(), axis.ticks.y=element_blank()) +
theme(panel.grid.minor.y=element_blank(), panel.grid.major.y=element_blank()) +
geom_text(aes(label = ifelse(pct >.05, paste0(lab*100, '%'), '')), position = position_stack(vjust = 0.5), size = 6, family = "font", color = "black") +
labs(x = "", y = "", title = "The Political Partisanship of the 20 Largest Majority White Denominations", subtitle = "Denominations Listed In Order of Sample Size", caption = "@ryanburge\nData: Cooperative Election Study, 2022")
save("pid3_top20n.png", wd = 9, ht = 8)
one <- cces20 %>%
mutate(trad = frcode(religpew_baptist == 1 ~ "Southern Baptist",
religpew_baptist == 2 ~ "ABCUSA",
religpew_baptist == 3 ~ "Natl. Baptist Convention",
religpew_baptist == 4 ~ "Progressive Baptist Convention",
religpew_baptist == 5 ~ "Independent Baptist",
religpew_baptist == 6 ~ "Baptist General Conference",
religpew_baptist == 7 ~ "Baptist Miss. Association",
religpew_baptist == 8 ~ "Conservative Bapt. Association",
religpew_baptist == 9 ~ "Free Will Baptist",
religpew_baptist == 10 ~ "Gen. Assoc. of Reg. Bapt.",
religpew_baptist == 90 ~ "Other Baptist",
religpew_methodist == 1 ~ "United Methodist",
religpew_methodist == 2 ~ "Free Methodist",
religpew_methodist == 3 ~ "African Methodist Episcopal",
religpew_methodist == 4 ~ "AME - Zion",
religpew_methodist == 5 ~ "Christian Methodist Episcopal",
religpew_methodist == 90 ~ "Other Methodist",
religpew_nondenom == 1 ~ "Nondenom Evangelical",
religpew_nondenom == 2 ~ "Nondenom Fundamentalist",
religpew_nondenom == 3 ~ "Nondenom Charismatic",
religpew_nondenom == 4 ~ "Interdenominational",
religpew_nondenom == 5 ~ "Community Church",
religpew_nondenom == 90 ~ "Other Nondenom",
religpew_lutheran == 1 ~ "ELCA",
religpew_lutheran == 2 ~ "Lutheran - Missouri Synod",
religpew_lutheran == 3 ~ "Lutheran - Wisconsin Synod",
religpew_lutheran == 4 ~ "Other Lutheran",
religpew_presby == 1 ~ "PCUSA",
religpew_presby == 2 ~ "PCA",
religpew_presby == 3 ~ "Associated Reformed Presbyterian",
religpew_presby == 4 ~ "Cumberland Presbyterian",
religpew_presby == 5 ~ "Orthodox Presbyterian",
religpew_presby == 6 ~ "Evangelical Presbyterian",
religpew_presby == 90 ~ "Other Presbyterian",
religpew_pentecost == 1 ~ "Assemblies of God",
religpew_pentecost == 2 ~ "Church of God Cleveland TN",
religpew_pentecost == 3 ~ "Four Square Gospel",
religpew_pentecost == 4 ~ "Pentecostal Church of God",
religpew_pentecost == 5 ~ "Pentecostal Holiness Church",
religpew_pentecost == 6 ~ "Church of God in Christ",
religpew_pentecost == 7 ~ "Church of God of the Apostolic Faith",
religpew_pentecost == 8 ~ "Assembly of Christian Churches",
religpew_pentecost == 9 ~ "Apostolic Christian",
religpew_pentecost == 90 ~ "Other Pentecostal",
religpew_episcop == 1 ~ "ECUSA",
religpew_episcop == 2 ~ "Church of England",
religpew_episcop == 3 ~ "Anglican Orthodox",
religpew_episcop == 4 ~ "Reformed Episcopal",
religpew_episcop == 90 ~ "Other Episcopal",
religpew_christian == 1 ~ "Church of Christ",
religpew_christian == 2 ~ "Disciples of Christ",
religpew_christian == 3 ~ "Christian Church",
religpew_christian == 90 ~ "Other Christian Church",
religpew_congreg == 1 ~ "United Church of Christ",
religpew_congreg == 2 ~ "Conservative Cong. Christian",
religpew_congreg == 3 ~ "National Assoc. of Cons. Cong.",
religpew_congreg == 90 ~ "Other Cong.",
religpew_holiness == 1 ~ "Church of the Nazarene",
religpew_holiness == 2 ~ "Wesleyan Church",
religpew_holiness == 4 ~ "Christian and Missionary Alliance",
religpew_holiness == 5 ~ "Church of God",
religpew_holiness == 6 ~ "Salvation Army",
religpew_reformed == 1 ~ "Reformed Church in America",
religpew_reformed == 2 ~ "Christian Reformed",
religpew_reformed == 90 ~ "Other Reformed",
religpew_advent == 1 ~ "Seventh Day Adventist",
# religpew_advent == 2 ~ "Church of God",
religpew_advent == 3 ~ "Advent Christian",
religpew_advent == 90 ~ "Other Adventist")) %>%
mutate(white = case_when(race == 1 ~ 1, TRUE ~ 0)) %>%
group_by(trad) %>%
mean_ci(white, wt = commonweight) %>%
filter(n > 100) %>%
filter(mean > .5) %>%
filter(trad != "NA") %>%
arrange(-n) %>%
head(20) %>%
mutate(sort = "a") %>%
select(trad, sort, tot = n)
two <- cces20 %>%
mutate(trad = frcode(religpew_baptist == 1 ~ "Southern Baptist",
religpew_baptist == 2 ~ "ABCUSA",
religpew_baptist == 3 ~ "Natl. Baptist Convention",
religpew_baptist == 4 ~ "Progressive Baptist Convention",
religpew_baptist == 5 ~ "Independent Baptist",
religpew_baptist == 6 ~ "Baptist General Conference",
religpew_baptist == 7 ~ "Baptist Miss. Association",
religpew_baptist == 8 ~ "Conservative Bapt. Association",
religpew_baptist == 9 ~ "Free Will Baptist",
religpew_baptist == 10 ~ "Gen. Assoc. of Reg. Bapt.",
religpew_baptist == 90 ~ "Other Baptist",
religpew_methodist == 1 ~ "United Methodist",
religpew_methodist == 2 ~ "Free Methodist",
religpew_methodist == 3 ~ "African Methodist Episcopal",
religpew_methodist == 4 ~ "AME - Zion",
religpew_methodist == 5 ~ "Christian Methodist Episcopal",
religpew_methodist == 90 ~ "Other Methodist",
religpew_nondenom == 1 ~ "Nondenom Evangelical",
religpew_nondenom == 2 ~ "Nondenom Fundamentalist",
religpew_nondenom == 3 ~ "Nondenom Charismatic",
religpew_nondenom == 4 ~ "Interdenominational",
religpew_nondenom == 5 ~ "Community Church",
religpew_nondenom == 90 ~ "Other Nondenom",
religpew_lutheran == 1 ~ "ELCA",
religpew_lutheran == 2 ~ "Lutheran - Missouri Synod",
religpew_lutheran == 3 ~ "Lutheran - Wisconsin Synod",
religpew_lutheran == 4 ~ "Other Lutheran",
religpew_presby == 1 ~ "PCUSA",
religpew_presby == 2 ~ "PCA",
religpew_presby == 3 ~ "Associated Reformed Presbyterian",
religpew_presby == 4 ~ "Cumberland Presbyterian",
religpew_presby == 5 ~ "Orthodox Presbyterian",
religpew_presby == 6 ~ "Evangelical Presbyterian",
religpew_presby == 90 ~ "Other Presbyterian",
religpew_pentecost == 1 ~ "Assemblies of God",
religpew_pentecost == 2 ~ "Church of God Cleveland TN",
religpew_pentecost == 3 ~ "Four Square Gospel",
religpew_pentecost == 4 ~ "Pentecostal Church of God",
religpew_pentecost == 5 ~ "Pentecostal Holiness Church",
religpew_pentecost == 6 ~ "Church of God in Christ",
religpew_pentecost == 7 ~ "Church of God of the Apostolic Faith",
religpew_pentecost == 8 ~ "Assembly of Christian Churches",
religpew_pentecost == 9 ~ "Apostolic Christian",
religpew_pentecost == 90 ~ "Other Pentecostal",
religpew_episcop == 1 ~ "ECUSA",
religpew_episcop == 2 ~ "Church of England",
religpew_episcop == 3 ~ "Anglican Orthodox",
religpew_episcop == 4 ~ "Reformed Episcopal",
religpew_episcop == 90 ~ "Other Episcopal",
religpew_christian == 1 ~ "Church of Christ",
religpew_christian == 2 ~ "Disciples of Christ",
religpew_christian == 3 ~ "Christian Church",
religpew_christian == 90 ~ "Other Christian Church",
religpew_congreg == 1 ~ "United Church of Christ",
religpew_congreg == 2 ~ "Conservative Cong. Christian",
religpew_congreg == 3 ~ "National Assoc. of Cons. Cong.",
religpew_congreg == 90 ~ "Other Cong.",
religpew_holiness == 1 ~ "Church of the Nazarene",
religpew_holiness == 2 ~ "Wesleyan Church",
religpew_holiness == 4 ~ "Christian and Missionary Alliance",
religpew_holiness == 5 ~ "Church of God",
religpew_holiness == 6 ~ "Salvation Army",
religpew_reformed == 1 ~ "Reformed Church in America",
religpew_reformed == 2 ~ "Christian Reformed",
religpew_reformed == 90 ~ "Other Reformed",
religpew_advent == 1 ~ "Seventh Day Adventist",
# religpew_advent == 2 ~ "Church of God",
religpew_advent == 3 ~ "Advent Christian",
religpew_advent == 90 ~ "Other Adventist")) %>%
filter(CL_voter_status <= 5) %>%
mutate(vote = CC20_410) %>%
cces_attend(pew_churatd) %>%
mutate(vote = case_when(vote == 2 ~ 1,
vote == 1 ~ 0)) %>%
group_by(trad) %>%
ct(vote, wt = vvweight_post, show_na = FALSE) %>%
filter(vote == 1) %>%
select(trad, pct)
graph <- left_join(one, two)
graph %>%
mutate(lab = round(pct, 2)) %>%
ggplot(., aes(x = reorder(trad, pct), y = pct, fill = pct)) +
geom_col(color = "black") +
coord_flip() +
theme_rb() +
y_pct() +
scale_fill_gradient2(low = "dodgerblue1", mid = "azure3", high = "firebrick1", midpoint = .5) +
geom_text(aes(y = pct + .03, label = paste0(lab*100, '%')), position = position_dodge(width = .9), size = 6, family = "font") +
theme(plot.title = element_text(size = 15)) +
labs(x = "", y = "", title = "Trump's Vote Share in 2020 Among the 20 Largest Majority White Denominations", caption = "@ryanburge\nData: Cooperative Election Study, 2020")
save("trump_share_protestants.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment