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
gg <- gss %>% | |
mutate(miracles = frcode(miracles == 4 ~ "Definitely Not", | |
miracles == 3 ~ "Probably Not", | |
miracles == 2 ~ "Probably", | |
miracles == 1 ~ "Definitely")) %>% | |
group_by(year) %>% | |
ct(miracles, 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
over <- gss %>% | |
filter(year == 1982 | year == 1987) %>% | |
filter(reltrad == 1 | reltrad == 2 | reltrad == 3 | reltrad == 4) %>% | |
mutate(att = case_when(attend == 6 | attend == 7 | attend == 8 ~ 1, | |
attend <= 5 ~ 0)) %>% | |
group_by(year, reltrad) %>% | |
mean_ci(att, wt = oversamp) | |
## This is the weight for the rest of the 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
In the past seven days, how often have you | |
A. Felt nervous, anxious, or on edge? | |
B. Felt depressed? | |
C. Felt lonely? | |
D. Felt hopeful about the future? (Reversed) | |
E. Had trouble sleeping | |
1. Less than 1 day |
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
graph <- cces %>% | |
filter(year == 2008 | year == 2012 | year == 2016 | year == 2020 | year == 2022) %>% | |
cces_pid3(pid7) %>% | |
mutate(religpew = religion) %>% | |
mutate(rel = frcode(religpew <= 8 ~ "Religious", | |
religpew == 9 | religpew == 10 | religpew == 11 ~ "Secular")) %>% | |
group_by(pid3, year) %>% | |
ct(rel, wt = weight, show_na = FALSE) %>% | |
na.omit() %>% | |
filter(pid3 != "Independent") |
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
error_bar <- function(wd){ | |
if(missing(wd)){ | |
geom_errorbar(aes(ymin=lower, ymax=upper), width=.2, position=position_dodge(.9)) | |
} else{ | |
geom_errorbar(aes(ymin=lower, ymax=upper), width=wd, position=position_dodge(.9)) | |
} | |
} |
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
error_bar <- function(wd){ | |
if(missing(wd)){ | |
geom_errorbar(aes(ymin=lower, ymax=upper), width=.2, position=position_dodge(.9)) | |
} else{ | |
geom_errorbar(aes(ymin=lower, ymax=upper), width=wd, position=position_dodge(.9)) | |
} | |
} |
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/ | |
## Maxwell Abillia | |
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
# install.packages("remotes") | |
# library(remotes) | |
# remotes::install_github("ryanburge/socsci") | |
# library(socsci) | |
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
# 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 |
NewerOlder