Estimating HLM Models Using SPSS Menus: Part 4

Jeremy Albright

Posted on

Intercepts- and Slopes-as-Outcomes Model

R&B present a final model that includes one further generalization of the random coefficients model. They begin again with the level-1 model:

\[ \begin{equation}Y_{ij} = \beta_{0j} + \beta_{1j}(SES)+ e_{ij} \tag{6}\end{equation} \]

The intercept \(\beta_{0j}\) is now modeled as a function of the average SES level of the school and whether or not the school is public or private. The slope \(\beta_{1j}\) is modeled in similar fashion.

\[ \begin{equation}\beta_{0j} = \gamma_{00} + \gamma_{01}(MEAN\ SES)+ \gamma_{02}(SECTOR)+ u_{0j} \tag{10}\end{equation} \]

\[ \begin{equation}\beta_{1j} = \gamma_{10} + \gamma_{11}(MEAN\ SES)+ \gamma_{12}(SECTOR)+ u_{1j} \tag{11}\end{equation} \]

Substituting (10) and (11) into (6) leads to the combined model:

\[ \begin{equation}Y_{ij} = \gamma_{00} + \gamma_{01}(MEAN\ SES)+ \gamma_{02}(SECTOR) \\ + \gamma_{10}(SES) + \gamma_{11}(MEAN\ SES)(SES) \\ +\gamma_{12}(SECTOR)(SES) +u_{0j} + u_{1j}(SES)+ e_{ij} \tag{12}\end{equation} \]

To estimate (12) in SPSS go to Analyze > Mixed Models > Linear. The Specify Subjects and Repeated menu appears again. As before, place schid in the Subjects box and leave Repeated blank.


Click Continue. In the next menu one specifies the dependent and independent variables. The dependent variable is mathach, and the covariates are grp_ses, meanses, and schtype.


To specify the model’s fixed effects click on Fixed. The model includes both main effects for all three variables as well as one interaction between grp_ses and meanses and another between grp_ses and schtype. Choose Main Effects from the drop-down menu in the center. Then bring all three variables over to the Model box.


To specify the interaction, change Main Effects to Interaction. Click on grp_ses, then hold down the Ctrl key and click on meanses. Click the Add button to bring the interaction to the Model box.


Next, click on grp_ses, hold down the Ctrl key, and click on schtype. Click the Add button to bring the second interaction to the Model box.


Make sure Include Intercept is checked and click Continue. Next, click on Random to specify the random effects in the model.

In the Random Effects menu, the grouping variable schid should once again appear in the Combinations box. The level-1 variable grp_ses will have a random slope, so it is necessary to place it in the Model box. The Include Intercept should also be checked to specify a random intercept. Finally, the presence of two random effects means that the dimensions of the covariance matrix G are 2?2. The default in SPSS is to assume a variance components structure, (see the table of covariance structures in A Review of Random Effects ANOVA Models). This assumption can be loosened so that the covariances are free parameters to be estimated from the data. Specify Unstructured for the Covariance Type.


Click Continue. Then click Statistics to specify what appears in the output. Check Parameter Estimates to get results for the fixed effects.


Click Continue, then click OK. A portion of the results is the following:

HLM SPSS Results

These results correspond to Table 4.5 in R&B and the variance-covariance components on page 83. While most estimates are identical, there are some slight differences in the random effects (for example, R&B report a level-1 variance component of 36.68 whereas SPSS reports the estimate to be 36.72). In general, results will vary somewhat across software packages for more complicated models. Thus, researchers should name the software they have used when reporting results for mixed models.

Still have questions? Contact us!