|
|
|
||||
|
|
|||||
This chapter uses data set alcohol1_pp.ws.
Table 4.1, pages 94-95.
Model A:
In this model, we have only the intercept. The intercept, called cons, has a fixed component, and has a random component at both level 1 and level 2. To build this model, open the workbook (data file), and click on model and then equations. The first two lines shown below will appear. Click on the "y" on the left-hand side of the equation (either one), and select alcuse as the y variable, two levels, id as the level 2 variable and age_14 as the level 1 variable. Next, click on the beta and select one and check all three boxes, allowing the constant to have a fixed component, and to have a random component for both level 1 and level 2. To see the random components (shown in the bottom two lines of the output), click on the "+" button at the bottom. To see the names of the variables, click on the "name" button at the bottom. To see the variables associated with the subscripts, click on the "subs" button at the bottom. After doing these things, the model appears as shown below.

Click on "start" at the top of the window to obtain the estimates for this equation. To see the estimates, click twice on "estimates" at the bottom of the window. The results are shown below.

Model B:
In this model, we have the intercept (as before), and a predictor, age_14, which is the age variable centered at 14. As before, the intercept (cons) has a fixed component and has a random component at both level 1 and level 2. The variable age_14 has a fixed component and a random component at level 2. Adding these terms to the model produces the equation shown below. (NOTE: To conserve space, for the rest of the models, we will show only the contents of the equations box, instead of the whole program, as we did for Model A.)

The results of running this model are shown below.

Model C:
In this model, we have an intercept (cons), variables age_14 and coa and the interaction of the two predictors, age_14*coa. The intercept and age_14 are specified as before, and coa and age_14*coa have only fixed effects and no random components. The model is shown below.

The results of running this model are shown below.

Model D:
This model adds the predictor peer and the interaction of age_14 and peer (called age_14*peer). Both of these terms have fixed but no random components.

The results of running this model are shown below.

Model E:
Model E is the same as Model D except that the age_14 by coa interaction (called age_14*coa) has been omitted.

The results of running this model are shown below.

Model F:
Model F is the same as Model E, except that the variable peer has been centered and that centered variable, called cpeer, has been used instead of peer both as a predictor and in the interaction term with age_14 (age_14*cpeer).

The results of running this model are shown below.

Model G:
Model G is the same as Model F except that the variable coa has been centered, and this centered variable, called ccoa, has been used instead of coa.

The results of running this model are shown below.

Figure 4.3, page 99
Left panel: Model B: Unconditional growth model
After running Model B, you need to create the predicted values. You can do this by clicking on "model" and then "predictions" and saving the values to a new variable. Once the predicted values have been created (we called this variable yhat), click on "graphs" and then "customized graph(s)". Make the selections as shown below.

Once you have made your selections, click on "apply" to create the graph. You will notice that the default settings make the graph look a little different from the one in the text. To modify the settings, click on the graph and change the graph options so that they look like the ones below. Click on "apply" to have the changes take effect. If you want to add the title and the labels to the axes, click on the graph and then select "titles". Note that you need to apply the changes that you make under one tab before clicking on another tab.

The resulting graph looks like the one in the text.

Middle panel: Model C: Uncontrolled effects of coa

Right panel: Model E: "Final" model for the controlled effects of coa - this has been skipped for now.
Figure 4.4, page 130
This figure has been skipped for now.
Figure 4.5, page 131
Top left panel:
The graphs in this figure can be created in two different ways. One way is to click on "graphs" and then "custom graph(s)" as we did before. The other way is to click on "model" and then "residuals" and then select the type of graph that you want. To create this graph, we clicked on "model" and then "residuals". The default setting under the "settings tab" is to calculate everything for the level 1 residual, so all you have to do is click on "calculate" at the bottom of the dialogue box. After you do that, you can click on the "plots" tab and made the following selections.

After clicking on "apply", we clicked on the graph and added the titles and changed the values on the axes as we did above. The resulting graph is shown below.

Top right panel:
To obtain this graph, we went back to the residuals dialogue box (shown above) and selected the fourth radio button from the top. We selected the "standardised residual" x id. After clicking on "apply" we then clicked on the graph and modified the labeling of the axes and the titles of the axes, and the graph below is the result.

Middle and lower left panels:
Because the remaining four graph use the level 2 residuals, we need to return to the "settings" tab of the residuals dialogue box and change the level of the residuals. This drop-down menu is located in the lower left-hand corner of the dialogue box. After making this change, you need to click on "calculate" to calculate the new numbers. Once you have done this, you can click on the "plots" tab and continue making the graphs. The two graphs shown below were created at the same time in MLwiN. You can modify the axes and titles of the two graphs independently by clicking on the graph that you want to modify and using the graph editor as before. Changes made to one graph will not effect the other graph.

Middle and lower right panels:
The graph below was made by clicking on the fourth radio button from the top of the residuals dialogue box under the "plots" tab and selecting "standarised residual" x id. MLwiN produced both of these graphs together, and the titles and axes were modified in the same way as the previous graph.

Figure 4.6, page 133
Top left panel:
As with the previous graphs, the graph below was made using the residuals dialogue box.

Middle and lower left panels:

Right panels:

Figure 4.7, page 136
This figure has been skipped for now.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services