df <- read.csv("ed_gap_and_nces_data_merged.csv")
nrow(df)
## [1] 8903
MI <- subset(df, state_abbrev == "MI")
nrow(MI)
## [1] 568
mean(MI$teacher_to_student_ratio)
## Warning in mean.default(MI$teacher_to_student_ratio): argument is not numeric
## or logical: returning NA
## [1] NA
sum(MI$teacher_to_student_ratio > 18.1)
## [1] 344