Hi Angela,
Good question
Consider the following commands which fit a two-level bivariate response model to students' written exam score and students' coursework scores where students are nested within schools:
Code: Select all
use http://www.bristol.ac.uk/cmm/media/runmlwin/gcsemv1, clear
bysort school: egen propfemale = mean(female)
runmlwin ///
(written cons female propfemale, eq(1)) ///
(csework cons female propfemale, eq(2)), ///
level2(school: ///
(cons, eq(1)) ///
(cons, eq(2))) ///
level1(student: ///
(cons, eq(1)) ///
(cons, eq(2)) ///
)
The runmlwin output associated with these commands is as follows
Code: Select all
MLwiN 2.24 multilevel model Number of obs = 1905
Multivariate response model
Estimation algorithm: IGLS
-----------------------------------------------------------
| No. of Observations per Group
Level Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
school | 73 2 26.1 104
-----------------------------------------------------------
Run time (seconds) = 304.24
Number of iterations = 4
Log likelihood = -13397.034
Deviance = 26794.068
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
written |
cons_1 | 57.30624 3.262535 17.56 0.000 50.91179 63.7007
female_1 | -2.361196 .5635149 -4.19 0.000 -3.465665 -1.256727
propfemale_1 | -13.68515 5.454531 -2.51 0.012 -24.37584 -2.994468
-------------+----------------------------------------------------------------
csework |
cons_2 | 71.94487 4.224108 17.03 0.000 63.66577 80.22397
female_2 | 6.79795 .6733461 10.10 0.000 5.478216 8.117684
propfemale_2 | -3.957516 7.04136 -0.56 0.574 -17.75833 9.843295
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: school |
var(cons_1) | 43.18563 8.56542 26.39772 59.97355
cov(cons_1,cons_2) | 23.77094 8.551468 7.010365 40.5315
var(cons_2) | 74.78298 14.49797 46.36747 103.1985
-----------------------------+------------------------------------------------
Level 1: student |
var(cons_1) | 124.5577 4.346989 116.0377 133.0776
cov(cons_1,cons_2) | 73.00115 4.177027 64.81433 81.18797
var(cons_2) | 180.0967 6.245744 167.8553 192.3382
------------------------------------------------------------------------------
And so we enter as covariates student gender (a level-1 variable) and the proportion of students in each school (a level-2 variable)
If you now look at the MLwiN equations window (simply fit the model without the nopause option) all covariates, irrespective of the level at which they are measured, have ijk subscripts. Your question is: Why is this?
The reason why all covariates have ijk subscripts is to do with the way that the multivariate response models are setup in MLwiN.
While the data are in wide format in Stata (there is one row per student and two response variables). In MLwiN the data are automatically reshaped to long format (two rows per student, one for written and one for coursework, and one combined response variable). MLwiN then creates two binary response indicator variables (dummy variables) one for each of the two responses. Multivariate response models in MLwiN then interact each covariate with the relevant binary response indicator variable (i.e. dummy variables).
For example we want to include gender twice in the model, once to predict written scores and once to predict coursework scores. The way we do this is to enter gender once interacted with the indicator variable for written scores and once interacted with the indicator variable for coursework scores. The indicator variables vary at level 1 and so any covariate (irrespective of its level) which is interacted with the indicator variable will also be at level 1. Hence the ijk subscripts on all variables.
Suggest you read Chapter 14, Section 14.2, of the MLwiN manual for full details.
http://www.bristol.ac.uk/cmm/software/m ... f#page=230
I hope this helps
George