# NOT RUN {
library(survey)
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
rstrat<-as.svrepdesign(dstrat)
glm.mod <- svyglm(api00~ell+meals+mobility, design=rstrat)
gnm.mod <- svygnm(api00~ell+meals+mobility, design=rstrat, ncpus=1)
# Both functions give the same result for GLMs
summary(glm.mod)
summary(gnm.mod)
# }
# NOT RUN {
# GNM, can only be fitted with svygnm()
summary(svygnm(api00~ell+meals+mobility, design=rstrat, family=poisson, ncpus=1))
# }
Run the code above in your browser using DataLab