Thanks Pablo for your answer, it was very insightful, but I guess I got something wrong.
I formed a survey design as: > library(survey) > mydesign <- svydesign(ids=~vill_neigh_code+clust, strata=~strat, > weights=~sweight, data=mydata) where strat: stratum (urban or (sub-county) rural). clust: batch of interviews that were part of the same random walk vill_neigh_code: village or neighbourhood code sweight: probability weights Then, I run a logistic regression as > logit.1 <- svyglm(response~var1+var2+var3+var4+var5+var6, design=mydesign, > data=mydata, nest=TRUE, family=quasibinomial()) And I get this error message: Error in svyglm.survey.design(response ~ var1 + var2 + var3 + var4 + : all variables must be in design= argument What should I change in the syntax in this case? -- View this message in context: http://r.789695.n4.nabble.com/crosstable-and-regression-for-survey-data-weighted-tp4634083p4634617.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.