
Multilevel models with survey data were introduced in Stata 12.
ORDER STATA |
Stata’s xtmixed command for fitting linear multilevel models now supports survey data. Sampling weights and robust/cluster standard errors are available.
Sampling weights are handled differently by xtmixed than by other commands:
See [XT] xtmixed and, in particular, section Survey data in that entry for all the technical details.
We demonstrate using xtmixed to fit a two-level model for data from a two-stage sampling design with sampling weights at both stages. Schools were sampled at the first stage, students at the second.
In the above, we specified the student-level weights using standard Stata weight syntax [pw=w_fstuwt] and the school-level weights with the pweight(wnrschbw) option as part of the school random-effects equation. We also specified pwscale(size) to rescale the student-level weights using one of three available methods.
As is the case with other commands, sampling weights imply robust standard errors, and in the case of xtmixed, standard errors are clustered at the highest level (schools in this example) unless you specify otherwise.
See [XT] xtmixed for more details.
See New in Stata 17 to learn about what was added in Stata 17.