|
|
|
||||
|
|
|||||
After creating and estimating a model, we can create predicted values using the Predictions option from Model menu and graph the predicted values against a predictor variable.
Let's look at Table 2.1 Part 2, an example from Chapter 2 of Multilevel Analysis Techniques and Applications by Joop Hox. It uses the data file popular.ws and you can download it from here. The model is the following:

The result of the estimation using IGLS is:

For predicted value from the random slopes model we just estimated, select Predictions from Model menu. In the Predictions window, click on the word variables and choose Include all explanatory variables. Click on the level 1 error term to remove it from the prediction equation. The last thing to do is to specify the variable to output the prediction. We can choose an unused variable, for example, c11 and change its name if we want. Now we can click on Calc to calculate the prediction. The prediction calculation can be different depending on different situations. For more detailed information how to calculated the predicted values, see our FAQ page on how to create the predicted values.

Now we have the predicted values stored in column c11. We click on Graphs menu and select Customised Graph. We can then choose c11 for y variable and a predictor variable, say variable texp (for teaching experience in years). Then click on Apply to create the graph below.


To reshape the plot, simply drag a corner of the Graph display to the desired size. To copy the graph to another application, say Word, click on the graph and then Ctrl-C. You can choose not to Include window border to exclude the border that MLwiN produces.
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