library(survey)
data(api)
dstrata <- apistrat %>%
as_survey_design(strata = stype, weights = pw)
dstrata %>%
summarise(api99 = survey_old_quantile(api99, c(0.25, 0.5, 0.75)),
api00 = survey_old_median(api00, vartype = c("ci")))
dstrata %>%
group_by(awards) %>%
summarise(api00 = survey_old_median(api00))
Run the code above in your browser using DataLab