UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

Annotated Mplus Output
Two Level Multilevel Model, Example 2

This page shows an example of a latent growth curve model (LGCM) with footnotes explaining the output. A LGCM can be similar to a multilevel model (a model many people have seen). To help you understand the LGCM and its output, first a multilevel model is shown using HLM and then using Stata, and then the same data is analyzed using Mplus using a LGCM. The Mplus output is related to the multilevel model results. We suggest that you view this page using two web browsers so you can show the page side by side showing the Stata output in one browser and the corresponding Mplus output in the other browser. 

This example is drawn from the Mplus User's Guide (example 6.10) and we suggest that you see the Mplus User's Guide for more details about this example. We thank the kind people at Muthén & Muthén for permission to use examples from their manual.

Example Using HLM

Each subject is observed on the variable Y at four different times. A covariate called a is measured at each of the four time points. Also, the variables x1 and x2 are measured for each person. Conceptualized as a multilevel model, the variables time and a are level 1 variables. (Note that time is coded 0, 1, 2, and 3.) The variables x1 and x2 are level 2 variables. The model uses time and a to predict the values of y at level 1, and uses x1 and x2 to predict the intercept and slope of time at level 2. We can write this model using multiple equations as shown below. This uses the ex610.mdm file.

Level-1 Model
	Y = B0 + B1*(A) + B2*(TIME) + R
Level-2 Model
	B0 = G00 + G01*(X1) + G02*(X2) + U0
	B1 = G10 
	B2 = G20 + G21*(X1) + G	B2 = G20 + G21*(X1) + G22*(X2) + U2

Here is the output from HLM, condensed to save space. Footnotes are included for relating the output to Mplus.

 Sigma_squared =      0.54200I

 Tau
 INTRCPT1,B0      1.08757F       0.05079 
     TIME,B2      0.05079H       0.20495G 

Tau (as correlations)
 INTRCPT1,B0  1.000  0.108
     TIME,B2  0.108  1.000

Final estimation of fixed effects:
----------------------------------------------------------------------------
                                      Standard             Approx.
   Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
----------------------------------------------------------------------------
For       INTRCPT1, B0
   INTRCPT2, G00           0.570413A   0.054807    10.408       497    0.000
         X1, G01           0.560548B   0.054574    10.271       497    0.000
         X2, G02           0.716557B   0.055865    12.827       497    0.000
For        A slope, B1
   INTRCPT2, G10           0.296872E   0.021381    13.885      1993    0.000
For     TIME slope, B2
   INTRCPT2, G20           1.010207C   0.025332    39.879       497    0.000
         X1, G21           0.263030D   0.025223    10.428       497    0.000
         X2, G22           0.473419D   0.025819    18.336       497    0.000
----------------------------------------------------------------------------

Example Using Stata

Combining the two equations into one by substituting the level 2 equation into the level 1 equation, we have the equation below, with the random effects identified by placing them in square brackets.

Composite model
	Y = G00 + G01*(X1) + G02*(X2) + G10*A + G20*TIME + G21*X1*TIME + G22*X2*TIME + [ U0 + U2*TIME + r ]

Based on the composite model, this is the same example using Stata.

infile y1 y2 y3 y4 x1 x2 a1 a2 a3 a4 using http://www.ats.ucla.edu/stat/mplus/output/ex6.10.dat
generate id = _n
reshape long y a, i(id) j(time)
replace time = time-1
generate timeBYx1 = time*x1
generate timeBYx2 = time*x2
xtmixed y x1 x2 a time timeBYx1 timeBYx2 || id: time, cov(un) var mle

Mixed-effects ML regression                     Number of obs      =      2000
Group variable: id                              Number of groups   =       500

                                                Obs per group: min =         4
                                                               avg =       4.0
                                                               max =         4

                                                Wald chi2(6)       =   2871.89
Log likelihood = -3075.8518                     Prob > chi2        =    0.0000
------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x1 |    .560547B  .0544035    10.30   0.000     .4539181    .6671759
          x2 |    .716562B  .0556897    12.87   0.000     .6074121    .8257118
           a |   .2967777E  .0213597    13.89   0.000     .2549134    .3386419
        time |   1.010207C  .0252504    40.01   0.000     .9607168    1.059696
    timeBYx1 |   .2630303D  .0251425    10.46   0.000     .2137518    .3123087
    timeBYx2 |   .4734171D  .0257359    18.40   0.000     .4229756    .5238586
       _cons |   .5704131A .0546356    10.44   0.000     .4633293    .6774969
------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Unstructured             |
                   var(time) |   .2030399G  .0203019      .1669053    .2469977
                  var(_cons) |   1.078679F  .0937659      .9097041     1.27904
             cov(time,_cons) |   .0515093H  .0314154     -.0100638    .1130825
-----------------------------+------------------------------------------------
               var(Residual) |   .5416011I  .0242353       .496124    .5912467
------------------------------------------------------------------------------
LR test vs. linear regression:       chi2(3) =  1344.80   Prob > chi2 = 0.0000
Note: LR test is conservative and provided only for reference

Mplus Example

Here is the same example analyzed as a multilevel using Mplus based on the ex6.10.dat data file. 

Title:
  Two level multilevel model in Mplus
Data:
  File is ex6.10.dat ;
Variable:
  Names are id time y x1 x2 a;
  WITHIN = time a;
  BETWEEN = x1 x2;
  CLUSTER = id;
ANALYSIS:
  TYPE = TWOLEVEL RANDOM;
MODEL:
  %WITHIN%
    s | y ON time;
    y on a;
  %BETWEEN%
    y on x1 x2;
    s on x1 x2;
    y with s;

SUMMARY OF ANALYSIS
Number of observations                                        2000

SUMMARY OF DATA
     Number of clusters         500
     Average cluster size   4.000

     Estimated Intraclass Correlations for the Y Variables

                Intraclass              Intraclass
     Variable  Correlation   Variable  Correlation
     Y            0.615

TESTS OF MODEL FIT

Loglikelihood
          H0 Value                       -3075.853

Information Criteria
          Number of Free Parameters             11
          Akaike (AIC)                    6173.706
          Bayesian (BIC)                  6235.316
          Sample-Size Adjusted BIC        6200.369
            (n* = (n + 2) / 24)

MODEL RESULTS
                   Estimates     S.E.  Est./S.E.
Within Level

 Y          ON
    A                  0.297E   0.022     13.300

 Residual Variances
    Y                  0.541I   0.024     22.178

Between Level

 S          ON
    X1                 0.263D   0.027      9.801
    X2                 0.473D   0.025     18.909

 Y          ON
    X1                 0.561B   0.054     10.296
    X2                 0.717B   0.054     13.264

 Y        WITH
    S                  0.050H   0.033      1.529

 Intercepts
    Y                  0.570A   0.055     10.400
    S                  1.010C   0.025     39.763

 Residual Variances
    Y                  1.081F   0.093     11.617
    S                  0.204G   0.020     10.236
  1. This is G00 in the multilevel model. It is the predicted value of y when time and a are both  0.
  2. This is G01 and G02 in the multilevel model. It is the predicted increase in the intercept for a one unit increase in x1 and x2, respectively.
  3. This is G20 in the multilevel model. It is the slope for time when  x1 and x2 are held constant at 0.
  4. This is G21 and G22 in the multilevel model. It is the predicted increase in the time slope for a one unit increase in x1 and x2, respectively.
  5. This is G10 from the multilevel model, representing the regression of y on a.
  6. This is the variance of the intercept, the variance component for the intercept in the multilevel model.
  7. This is the variance of the slope for time, the variance component for the time slope in the multilevel model.
  8. This is the covariance of the intercept and slope, the covariance of B0 and B1 from the multilevel model.
  9. This is the residual variance.

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.