if (FALSE) { # rlang::is_installed("survey")
# load libraries for models and data
library(survey)
set.seed(123)
data(api)
# survey design
dstrat <-
svydesign(
id = ~1,
strata = ~stype,
weights = ~pw,
data = apistrat,
fpc = ~fpc
)
# model
m <- svyglm(
formula = sch.wide ~ ell + meals + mobility,
design = dstrat,
family = quasibinomial()
)
glance(m)
}
Run the code above in your browser using DataLab