Created
July 22, 2020 19:45
-
-
Save dgkeyes/3ed1e3a31e328dfa31454b0a77213d4b to your computer and use it in GitHub Desktop.
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
third_grade_math_proficiency_18_19 <- read_excel(path = here("data", "math-scores-18-19.xlsx")) %>% | |
filter(student_group == "Total Population (All Students)") %>% | |
filter(grade_level == "Grade 3") %>% | |
select(school_id, contains("number")) %>% | |
pivot_longer(cols = contains("number"), | |
names_to = "proficiency_level", | |
values_to = "number_proficient") %>% | |
mutate(number_proficient = na_if(number_proficient, "*")) %>% | |
mutate(number_proficient = na_if(number_proficient, "--")) %>% | |
mutate(number_proficient = as.numeric(number_proficient)) %>% | |
mutate(proficiency_level = parse_number(proficiency_level)) %>% | |
mutate(proficiency_level_dichotomous = case_when( | |
proficiency_level < 3 ~ "Not Proficienct", | |
TRUE ~ "Proficient" | |
)) %>% | |
group_by(school_id, proficiency_level_dichotomous) %>% | |
summarize(number_proficient = sum(number_proficient)) %>% | |
drop_na(number_proficient) %>% | |
ungroup() %>% | |
group_by(school_id) %>% | |
mutate(pct = number_proficient / sum(number_proficient)) %>% | |
view() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment