UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

MLwiN Textbook Examples
Multilevel Analysis Techniques and Applications by Joop Hox
Chapter 9: Multivariate Multilevel Regression Models

Table 9.1 on page 162 using multresp.ws. We first created a variable cons of constant 1 which will be used for level 1 binomial variation. The hierarchical structure is shown below. Also notice that the data set has a variable denom ready for us. This variable is needed for logistic models.
 
Part 1: M0: intercepts for comp. and resp. rate.
First, we need to specify the response distribution, in our case we choose Binomial. Then we add in the two variables comp and resp. They are going to random at level 2 and 3 and are also estimated as fixed parameters.
Finally we add on variable cons that will be level 1 binomial variation and here is what cons is going to be in terms of its effect.
Now we have our model almost ready to run.
The last thing we have to do is to choose the estimation method from the Nonlinear menu. We select PQL estimation and second-order Taylor linearization.
Now let's run the model and the result is shown below.
Part 2: Now we need to create some dummy variables and add them to the model.
->CALCulate "mailcomp"="comp"*"maildum"
->CALCulate "mailresp"="resp"*"maildum"
->CALCulate "telcomp"="comp"*"teldum"
->CALCulate "telresp"="resp"*"teldum"
The result is:
Table 9.3 on page 167 using data set manager.ws. As usual, we will have to create a variable cons of constant 1 first.
We will use MLwiN multivariate multilevel model set up. From Model pull-down menu, select Multivariate. Select variables q5, q9, q12, q16, q21 and q25 as response variables, since these are the six items that we are interested. Then click on add button. Then click on the radio button for X and select cons as the only explanatory variable. Then click on add button. Now we have a window shown below.
Now we have to click on each of the cells defined and we should have all six cells checked. Finally, we need to identify each level. Here level 2 will be pupil and level 3 will be school. Now everything is set and we need to click on Build button to request MLwiN to build the model.
Now let's open Equations window and we will see the following:
The last thing is to specify the effect of each term. For each term, we have following specification.
This completes the setup of our model and we are ready to run it.
The result is:
The first matrix gives the school level covariance matrix and the second gives the pupil level covariance matrix. The correlation matrix can be computed based on the covariance matrix and we omit the computation here.
Table 9.5 on page 170. One way of producing this table from the model specified by equation (9.24) is to turn the data set manager.ws into long format. We have the data file manager_long.ws in long format here to download. The data file looks as follows.
As usual, we have to create a variable cons of constant 1. The rest follows easily. Based on equation (9.24) our model is a 3-level model. The only predictor is the intercept and we include variable cons as random at every level and we also estimate its fixed effect.

           

Now we have built up our model.
We run it using RIGLS estimation and the result is:

How to cite this page

Report an error on this page

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


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California