# Multi-stage sampling together with hierarchical/ mixed effects models: which R packages?

Analyzing educational datasets we have samples of children from samples of class in samples of schools - we have sampling weights, so I use the survey package e.g. to do a linear model. But this kind of design also requires looking at the mixed effects. But this isn’t possible using the survey package. I can do this in nlme – but then I don't know how to account for the weighting. I guess I could use the sample weights as predictors in nlme regressions but I don’t think that is correct.

It seems that this kind of design (in fact any stratified survey sample which includes nested levels) needs analysing from both perspectives – (survey weights and mixed effects) at once – but the packages of choice for each of these perspectives, survey and nlme, each don’t seem to have slots for the other perspective.

Can someone put me on the right track, or suggest another package which does both at the same time?

I have looked at this recently, and concluded that nothing works in R the way I wanted to. So I analyzed my multilevel complex survey data in Stata using gllamm package, which can account for weights at multiple levels and clustering (but still can't do stratification). I would be happy to hear of otherwise available packages, but generally the multilevel people and the survey people do not overlap that much.
• I know you posted this a few years ago. Since then have you had any luck using sampling weights with mixed effects models in R? I'm particularly interested in using them with the Ordinal package and clmm() function.