Skip to content

Instantly share code, notes, and snippets.

@ryanburge
Created August 9, 2024 19:44
Show Gist options
  • Save ryanburge/5f21234a7704070b1ea32763c5ff85b9 to your computer and use it in GitHub Desktop.
Save ryanburge/5f21234a7704070b1ea32763c5ff85b9 to your computer and use it in GitHub Desktop.
gg <- cces %>%
filter(year >= 2022) %>%
mutate(ed3 = frcode(educ == 1 | educ == 2 ~ "HS or Less",
educ == 3 | educ == 4 ~ "Some College",
educ == 5 | educ == 5 ~ "College Degree")) %>% ### <---- This is incorrect.
group_by(trad) %>%
ct(ed3, wt = weight, show_na = FALSE)
gg <- cces %>%
filter(year >= 2022) %>%
mutate(ed3 = frcode(educ == 1 | educ == 2 ~ "HS or Less",
educ == 3 | educ == 4 ~ "Some College",
educ == 5 | educ == 6 ~ "College Degree")) %>% ### <---- It should be this.
group_by(trad) %>%
ct(ed3, wt = weight, show_na = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment