7.2 q-weighted Weights
Regarding the incorporation of sampling weights in multilevel models, although there is a general consensus on the need to use them to guarantee inferences that are representative of the target population (Cai, 2013), there is no single methodological strategy for their implementation. In this context, Pfeffermann et al. (1998) and Asparouhov (2006) propose approaches based on pseudo-maximum likelihood, particularly through weighted generalized least squares procedures. Alternatively, Rabe-Hesketh & Skrondal (2006) propose methods based on EM algorithms for the estimation of hierarchical models with weights.
From a general perspective, the maximum likelihood approach consists of estimating the parameters of the model by identifying those values that maximize the probability of observing the available data under the assumed specification. An important extension of this approach is restricted maximum likelihood (REML), which improves the estimation of variance components by correcting the bias associated with the estimation of degrees of freedom, producing in many cases more stable estimates than conventional maximum likelihood (Kreft & De Leeuw, 1998).
In the context of multilevel models with survey data, an additional difficulty lies in the coherent incorporation of sampling weights across the different levels of the hierarchy. As Pfeffermann et al. (1998) point out, the clustered structure of the data implies that the observations are not independent, so the log-likelihood function cannot be decomposed as a simple sum of individual contributions. Instead, it is necessary to explicitly consider the dependence between the different levels of the sample design in order to obtain appropriate inferences.
To fit a multilevel model with data from complex surveys, it is recommended to redefine the expansion factors using the q-weighted weights approach proposed by Pfeffermann (2011). This procedure seeks to eliminate the systematic part of the weights associated with the covariates included in the model, preserving only the residual component of the selection mechanisms. The steps are as follows:
Fit a regression model for the final expansion factors of the survey, using as explanatory variables the same set of covariates that will be used in the multilevel model. Let \(w_k\) be the original expansion factor of unit \(k\) and \(\mathbf{x}_k\) the vector of covariates. Then the following model is fitted
\[ w_k = f(\mathbf{x}_k, \boldsymbol{\beta}) + \varepsilon_k, \]
where \(f(\cdot)\) represents the functional relationship between the weights \(w_k\) and the covariates \(\mathbf{x}_k\), through the coefficients \(\boldsymbol{\beta}\).
Obtain the predicted values from the model for each observation unit, such that:
\[ \hat{w}_k = f(\mathbf{x}_k, \hat{\boldsymbol{\beta}}). \]
These values represent the component of the expansion factors explained by the covariates included in the model.
Construct the q-weighted weights by dividing the original expansion factors by their corresponding predicted values,
\[ q_k = \frac{w_k}{\hat{w}_k}. \]
In this way, the new weights reflect only the residual variation of the expansion factors after controlling for the effect of the covariates.
Define the new sample design using the adjusted weights \(q_k\) instead of the original weights \(w_k\), and use this design to estimate the parameters of the multilevel model.
The following code implements the q-weighted weight construction procedure. First, it fits a linear regression model that explains the original expansion factors based on the explanatory variable expenditure. In this way, the resulting weights retain only the component of variation not explained by the covariates included in the multilevel model.