This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("remotes") | |
# library(remotes) | |
# remotes::install_github("ryanburge/socsci") | |
# library(socsci) | |
cces20 <- read_csv("https://www.dropbox.com/s/wuixmc67ae786wp/small_ces2020.csv?dl=1") | |
Codebook is here: https://www.dropbox.com/s/s01kefaks4u6g1f/small_ces2020%20Codebook.docx?dl=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coef_names <- c("Education" = "educ", | |
"Age" = "age", | |
"Male" = "male", | |
"Income" = "inc", | |
"White" = "white", | |
"Attendance" = "att", | |
"South" = "south", | |
"Immigrant/First Gen." = "imm", | |
"Political Liberal" = "con") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Each question has four multiple choice response options + not sure or refused | |
Which Bible figure is most closely associated with leading the Exodus from Egypt? | |
Which Bible figure is most closely associated with killing an enemy by slinging a stone? | |
According to the Christian Gospels, who delivered the Sermon on the Mount? | |
What is an atheist? | |
What is an agnostic? | |
Which of the following is NOT one of the Ten Commandments? | |
Which of the following best describes the Jewish holiday of Rosh Hashanah? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pid_fun <- function(df, denom, num, name){ | |
denom <- enquo(denom) | |
df %>% | |
mutate(pid3 = frcode(pid7 == 1 | pid7 == 2 | pid7 == 3 ~ "Democrat", | |
pid7 == 4 ~ "Independent", | |
pid7 == 5 | pid7 == 6 | pid7 == 7 ~ "Republican")) %>% | |
filter(!! denom == num) %>% | |
ct(pid3, wt = commonweight, show_na = FALSE) %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ttt1 <- gss %>% | |
gss_reltrad6(reltrad) %>% | |
filter(year >= 1986 & year <= 2018) %>% | |
mutate(liv = posslq) %>% | |
mutate(liv = frcode(liv == 1 ~ "Married, Living w/Spouse", | |
liv == 2 ~ "Not Married, Living Together", | |
liv == 3 ~ "Have Partner, Don't Live Together", | |
liv == 4 ~ "No Steay Partner")) %>% | |
group_by(year, reltrad) %>% | |
ct(liv, wt = wtssall, show_na = FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Packages ## | |
library(socsci) | |
library(car) | |
install.packages("jtools") | |
library(jtools) | |
install.packages("interactions") | |
library(interactions) | |
REGRESSION TUTORIAL: https://rpubs.com/ryanburge/reg_interact | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("jtools") | |
# install.packages("interactions") | |
# install.packages("ggstance") | |
# install.packages("broom.mixed") | |
library(jtools) | |
library(interactions) | |
library(ggstance) | |
library(broom.mixed) | |
library(socsci) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Read your data in with this line: | |
gss <- read_csv("https://raw.githubusercontent.com/ryanburge/ct/master/gss_small.csv", guess_max = 25000) | |
## Codebook: | |
https://gssdataexplorer.norc.org/ | |
## Fu Ad Wumpaeh Alhassan | |
1. What percentage of people supported access to a legal abortion in the case of rape in 1994? | |
2. How many white women did not finish high school in the 1972 sample? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Read your data in with this line: | |
gss <- read_csv("https://raw.githubusercontent.com/ryanburge/ct/master/gss_small.csv", guess_max = 25000) | |
Codebook: https://gssdataexplorer.norc.org/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cces20 %>% ct(gender) | |
## THIS IS A COMMENT | |
cces20 %>% ct(race) | |
## HOW MANY 25 YEAR OLDS #### | |