Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
567 B
3
Indexable
Never
s <- read.csv("schoolDenmark_small.csv")
#problem3

s %>% group_by(t_mohammad, t_good) %>%
  summarize(n(),
                   mean(above_median_student, na.rm = 1),
                   mean(above_median_non_danes,na.rm = 1),
                   mean(above_median_grades, na.rm = 1),
                   mean(bigcity, na.rm = 1),
                   mean(school_type, na.rm = 1))

#problem5
colMeans(s[, c(8,11)], na.rm=1)
aggregate(s[,c(8,11)],list(s$t_mohammad), mean, na.rm=1)

#problem 6
ggplot(s, aes(t_mohammad, accept1))+
  stat_summary(fun.data = "mean_cl_boot")