Skip to content

Instantly share code, notes, and snippets.

View ryanburge's full-sized avatar

Ryan Burge ryanburge

View GitHub Profile
@ryanburge
ryanburge / 10.20.2021.R
Last active October 27, 2021 23:07
October 20th Graduate Students
cces16 <- read_csv("https://raw.githubusercontent.com/ryanburge/cces/master/CCES%20for%20Methods/small_cces.csv")
cces20 <- read_csv("https://www.dropbox.com/s/wuixmc67ae786wp/small_ces2020.csv?dl=1")
Codebook for 2016
https://github.com/ryanburge/cces/raw/master/Codebooks/CCES_2016_Small_Codebook.pdf
Codebook for 2020
@ryanburge
ryanburge / first_day.R
Last active October 13, 2021 23:25
10/13 Data Analysis
cces <- read_csv("https://raw.githubusercontent.com/ryanburge/cces/master/CCES%20for%20Methods/small_cces.csv")
https://github.com/ryanburge/cces/raw/master/Codebooks/CCES_2016_Small_Codebook.pdf
https://emilhvitfeldt.github.io/r-color-palettes/discrete.html
Abortion scale construction:
1. Always allow a woman to obtain an abortion as a matter of choice. Support = 1, Oppose = 0
2. Prohibit all abortions after the 20th week of pregnancy. Support = 0, Oppose = 1
3. Allow employers to decline coverage of abortions in insurance plans. Support = 0, Oppose = 1
4. Prohibit the expenditure of funds authorized or appropriated by federal law for any abortion. Support = 0, Oppose = 1
5. Make abortions illegal in all circumstances. Support = 0, Oppose = 1.
# https://git.io/JEbT8
compare %>%
ggplot(., aes(x = date, y = r7, group = county, color = county, linetype = county)) +
geom_line() +
scale_color_gdocs() +
theme_rb()+
theme(plot.subtitle = element_text(size = 10)) +
theme(legend.position = c(.2, .8)) +
labs(x = "Date", y = "Cases Per 1000 Per Day", title = "Comparing COVID Cases in Southern Illinois Counties",
subtitle = "",
@ryanburge
ryanburge / wwc_no_college_pres_vote.R
Last active April 14, 2021 23:04
White Working Class without College
library(tidyverse)
library(socsci) #remotes::install_github("ryanburge/socsci")
median(cces08$V246, na.rm = TRUE) #8
yyy1 <- cces08 %>%
filter(V246 <= 7) %>%
arr <- read_csv("D://arrivals.csv")
arr <- arr %>%
mutate(name = replace_na(`Basic data and indicators`, "REMOVE")) %>%
select(-`Basic data and indicators`)
tot <- arr %>%
filter(X3 == "Total arrivals" | name != "REMOVE") %>%
relocate(name)
@ryanburge
ryanburge / grad_class_mean_sd.R
Created November 18, 2020 02:53
Graduate Class for 11/18/2020
## Grab the data here:
pop <- read.csv("https://raw.githubusercontent.com/ryanburge/pls2003_sp17/master/population.csv") %>%
mutate(height = round(height, 1)) %>%
mutate(weight = round(weight, 1))
### More data here:
bball <- read_csv("https://raw.githubusercontent.com/ryanburge/pls2003_sp17/master/bball.csv", guess_max = 25000)
bball <- bball %>%
@ryanburge
ryanburge / cces_2020_reltrad.R
Created November 7, 2020 16:19
CCES 2020 RELTRAD
library(tidyverse)
# library(haven)
library(car)
# cces20 <- read_dta("D://cces/data/cces20.dta")
cces20 <- cces20 %>%
mutate(white = car::recode(race, "1=1; else=0")) %>%
@ryanburge
ryanburge / gist:4ac9e7454f04c82e7ae6ef1a2f5b2ae0
Last active November 11, 2020 23:03
Assignment #1 Graduate Students Fall 2020
TUTORIAL: https://rpubs.com/ryanburge/fall_2019
For each answer, please provide your syntax and a written description of the answer.
This will be due on November 22, 2020 at 8 PM in the Dropbox.
You can take a look at the variable names by typing:
gss %>% glimpse()
@ryanburge
ryanburge / grad_class_day1.R
Last active October 21, 2020 22:01
Grad Class Day 1
1. Go to http://104.248.127.81:8787/auth-sign-in
2. User: your first name (no caps)
3. Password: your last name (no caps)
Type this:
library(socsci)
Paste this in to grab data:
cces <- read_csv("https://raw.githubusercontent.com/ryanburge/cces/master/CCES%20for%20Methods/small_cces.csv")