Home  /  Products  /  Stata 12  /  Multilevel models with survey data

Multilevel models with survey data were introduced in Stata 12.

See the latest version of multilevel models with survey data. See all of Stata's multilevel models features.

See the new features in Stata 18.


Multilevel models with survey data

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:

  1. Weights can (and should be) specified at every model level unless you wish to assume equiprobability sampling at that level.
  2. Weights at lower model levels need to indicate selection conditional on selection of the higher-level cluster and not merely indicate overall selection.
  3. The scaling of weights at lower levels needs to be considered. Unlike a standard analysis where the scale of the sampling weights is not an issue (only their relative sizes matter), in multilevel models weight scales need to be made "consistent" across lower-level clusters.

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.

Back to highlights

See New in Stata 18 to learn about what was added in Stata 18.