HLM Paper Examples
Using SAS Proc Mixed to Fit Multilevel Models, Hierarchical Models, and Individual Growth Models
by Judith Singer

This paper can be downloaded from Professor Singer's web site at http://gseweb.harvard.edu/~faculty/singer/Papers/sasprocmixed.pdf . The HLM SSM files used are hsb.SSM, willett.SSM and willett_wave.MDM.  

Page 329: Unconditional Means Model. The estimation method is REML (default).

 Sigma_squared =     39.14831
 Tau
 INTRCPT1,B0      8.61431 
Tau (as correlations)
 INTRCPT1,B0  1.000
 ----------------------------------------------------
  Random level-1 coefficient   Reliability estimate
 ----------------------------------------------------
  INTRCPT1, B0                        0.901
 ----------------------------------------------------
The value of the likelihood function at iteration 4 = -2.355840E+004
 Final estimation of fixed effects:
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.636972   0.244412    51.704       159    0.000
 ----------------------------------------------------------------------------
 Final estimation of fixed effects
 (with robust standard errors)
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.636972   0.243628    51.870       159    0.000
 ----------------------------------------------------------------------------
 Final estimation of variance components:
 -----------------------------------------------------------------------------
 Random Effect           Standard      Variance     df    Chi-square  P-value
                         Deviation     Component
 -----------------------------------------------------------------------------
 INTRCPT1,       U0        2.93501       8.61431   159    1660.23264    0.000
  level-1,       R         6.25686      39.14831
 -----------------------------------------------------------------------------
 Statistics for current covariance components model
 --------------------------------------------------
 Deviance                       = 47116.793475
 Number of estimated parameters = 2

Page 331

 Sigma_squared =     39.15708
 Tau
 INTRCPT1,B0      2.63870 
Tau (as correlations)
 INTRCPT1,B0  1.000
 ----------------------------------------------------
  Random level-1 coefficient   Reliability estimate
 ----------------------------------------------------
  INTRCPT1, B0                        0.740
 ----------------------------------------------------
The value of the likelihood function at iteration 6 = -2.347972E+004
 Final estimation of fixed effects:
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.649436   0.149280    84.736       159    0.000
 For  MEANSES slope, B1
    INTRCPT2, G10           5.863538   0.361457    16.222      7183    0.000
 ----------------------------------------------------------------------------
 Final estimation of fixed effects
 (with robust standard errors)
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.649436   0.148377    85.252       159    0.000
 For  MEANSES slope, B1
    INTRCPT2, G10           5.863538   0.320211    18.311      7183    0.000
 ----------------------------------------------------------------------------
 Final estimation of variance components:
 -----------------------------------------------------------------------------
 Random Effect           Standard      Variance     df    Chi-square  P-value
                         Deviation     Component
 -----------------------------------------------------------------------------
 INTRCPT1,       U0        1.62441       2.63870   159     633.51740    0.000
  level-1,       R         6.25756      39.15708
 -----------------------------------------------------------------------------
 Statistics for current covariance components model
 --------------------------------------------------
 Deviance                       = 46959.446955
 Number of estimated parameters = 2

Page 335

 Sigma_squared =     36.70356
 Tau
 INTRCPT1,B0      8.68087       0.04701 
      SES,B1      0.04701       0.68038 
Tau (as correlations)
 INTRCPT1,B0  1.000  0.019
      SES,B1  0.019  1.000
 ----------------------------------------------------
  Random level-1 coefficient   Reliability estimate
 ----------------------------------------------------
  INTRCPT1, B0                        0.908
       SES, B1                        0.260
 ----------------------------------------------------
The value of the likelihood function at iteration 18 = -2.335620E+004
 Final estimation of fixed effects:
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.636197   0.244503    51.681       159    0.000
 For      SES slope, B1
    INTRCPT2, G10           2.193157   0.127879    17.150       159    0.000
 ----------------------------------------------------------------------------
 Final estimation of fixed effects
 (with robust standard errors)
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.636197   0.243738    51.843       159    0.000
 For      SES slope, B1
    INTRCPT2, G10           2.193157   0.127846    17.155       159    0.000
 ----------------------------------------------------------------------------
 Final estimation of variance components:
 -----------------------------------------------------------------------------
 Random Effect           Standard      Variance     df    Chi-square  P-value
                         Deviation     Component
 -----------------------------------------------------------------------------
 INTRCPT1,       U0        2.94633       8.68087   159    1770.85120    0.000
      SES slope, U1        0.82485       0.68038   159     213.43769    0.003
  level-1,       R         6.05835      36.70356
 -----------------------------------------------------------------------------
 Statistics for current covariance components model
 --------------------------------------------------
 Deviance                       = 46712.398925
 Number of estimated parameters = 4

Pages 337/338

 Sigma_squared =     36.70313
 Tau
 INTRCPT1,B0      2.37996       0.19058 
      SES,B1      0.19058       0.14892 
Tau (as correlations)
 INTRCPT1,B0  1.000  0.320
      SES,B1  0.320  1.000
 ----------------------------------------------------
  Random level-1 coefficient   Reliability estimate
 ----------------------------------------------------
  INTRCPT1, B0                        0.733
       SES, B1                        0.073
 ----------------------------------------------------
The value of the likelihood function at iteration 61 = -2.325094E+004
 Final estimation of fixed effects:
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.096006   0.198734    60.865       157    0.000
      SECTOR, G01           1.226384   0.306272     4.004       157    0.000
     MEANSES, G02           5.333056   0.369161    14.446       157    0.000
 For      SES slope, B1
    INTRCPT2, G10           2.937981   0.157135    18.697       157    0.000
      SECTOR, G11          -1.640954   0.242905    -6.756       157    0.000
     MEANSES, G12           1.034427   0.302566     3.419       157    0.001
 ----------------------------------------------------------------------------

 Final estimation of fixed effects
 (with robust standard errors)
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.096006   0.173699    69.638       157    0.000
      SECTOR, G01           1.226384   0.308484     3.976       157    0.000
     MEANSES, G02           5.333056   0.334600    15.939       157    0.000
 For      SES slope, B1
    INTRCPT2, G10           2.937981   0.147620    19.902       157    0.000
      SECTOR, G11          -1.640954   0.237401    -6.912       157    0.000
     MEANSES, G12           1.034427   0.332785     3.108       157    0.002
 ----------------------------------------------------------------------------
 Final estimation of variance components:
 -----------------------------------------------------------------------------
 Random Effect           Standard      Variance     df    Chi-square  P-value
                         Deviation     Component
 -----------------------------------------------------------------------------
 INTRCPT1,       U0        1.54271       2.37996   157     605.29503    0.000
      SES slope, U1        0.38590       0.14892   157     162.30867    0.369
  level-1,       R         6.05831      36.70313
 -----------------------------------------------------------------------------
 Statistics for current covariance components model
 --------------------------------------------------
 Deviance                       = 46501.875635
 Number of estimated parameters = 4

Page 339, model with random intercepts only, getting the -2LL value

Sigma_squared =     36.76611
 Tau
 INTRCPT1,B0      2.37524 
Tau (as correlations)
 INTRCPT1,B0  1.000
 ----------------------------------------------------
  Random level-1 coefficient   Reliability estimate
 ----------------------------------------------------
  INTRCPT1, B0                        0.732
 ----------------------------------------------------
The value of the likelihood function at iteration 6 = -2.325148E+004
 Final estimation of fixed effects:
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.096251   0.198643    60.894       157    0.000
      SECTOR, G01           1.224401   0.306117     4.000       157    0.000
     MEANSES, G02           5.336698   0.368978    14.463       157    0.000
 For      SES slope, B1
    INTRCPT2, G10           2.935860   0.150705    19.481      7179    0.000
      SECTOR, G11          -1.642102   0.233097    -7.045      7179    0.000
     MEANSES, G12           1.044120   0.291042     3.588      7179    0.001
 ----------------------------------------------------------------------------
 Final estimation of fixed effects
 (with robust standard errors)
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00          12.096251   0.173691    69.642       157    0.000
      SECTOR, G01           1.224401   0.308507     3.969       157    0.000
     MEANSES, G02           5.336698   0.334617    15.949       157    0.000
 For      SES slope, B1
    INTRCPT2, G10           2.935860   0.147580    19.893      7179    0.000
      SECTOR, G11          -1.642102   0.237223    -6.922      7179    0.000
     MEANSES, G12           1.044120   0.332897     3.136      7179    0.002
 ----------------------------------------------------------------------------
 Final estimation of variance components:
 -----------------------------------------------------------------------------
 Random Effect           Standard      Variance     df    Chi-square  P-value
                         Deviation     Component
 -----------------------------------------------------------------------------
 INTRCPT1,       U0        1.54118       2.37524   157     604.29893    0.000
  level-1,       R         6.06351      36.76611
 -----------------------------------------------------------------------------
 Statistics for current covariance components model
 --------------------------------------------------
 Deviance                       = 46502.952734
 Number of estimated parameters = 2

The difference in -2LL is 46502.952734 - 46501.875635 = 1.077099 on two degrees of freedom, which is not significant.


Second set of examples using willett.SSM file. To download the SSM file, you may right-click on the link and choose "Save Target As" option.

Page 342

 Sigma_squared =    159.47717
 Tau
 INTRCPT1,B0   1198.77673    -179.25554 
     TIME,B1   -179.25554     132.40055 
Tau (as correlations)
 INTRCPT1,B0  1.000 -0.450
     TIME,B1 -0.450  1.000
 ----------------------------------------------------
  Random level-1 coefficient   Reliability estimate
 ----------------------------------------------------
  INTRCPT1, B0                        0.915
      TIME, B1                        0.806
 ----------------------------------------------------
The value of the likelihood function at iteration 2 = -6.334114E+002
 Final estimation of fixed effects:
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00         164.374286   6.118848    26.864        34    0.000
 For     TIME slope, B1
    INTRCPT2, G10          26.960000   2.166603    12.443        34    0.000
 ----------------------------------------------------------------------------
 Final estimation of fixed effects
 (with robust standard errors)
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00         164.374286   6.030803    27.256        34    0.000
 For     TIME slope, B1
    INTRCPT2, G10          26.960000   2.135428    12.625        34    0.000
 ----------------------------------------------------------------------------

 Final estimation of variance components:
 -----------------------------------------------------------------------------
 Random Effect           Standard      Variance     df    Chi-square  P-value
                         Deviation     Component
 -----------------------------------------------------------------------------
 INTRCPT1,       U0       34.62336    1198.77673    34     399.10740    0.000
     TIME slope, U1       11.50654     132.40055    34     175.13679    0.000
  level-1,       R        12.62843     159.47717
 -----------------------------------------------------------------------------
 Statistics for current covariance components model
 --------------------------------------------------
 Deviance                       = 1266.822740
 Number of estimated parameters = 4

Page 344

 Sigma_squared =    159.47717
 Tau
 INTRCPT1,B0   1236.41265    -178.23322 
     TIME,B1   -178.23322     107.24917 
Tau (as correlations)
 INTRCPT1,B0  1.000 -0.489
     TIME,B1 -0.489  1.000
 ----------------------------------------------------
  Random level-1 coefficient   Reliability estimate
 ----------------------------------------------------
  INTRCPT1, B0                        0.917
      TIME, B1                        0.771
 ----------------------------------------------------
The value of the likelihood function at iteration 2 = -6.301424E+002
 The outcome variable is        Y
 Final estimation of fixed effects:
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00         164.374285   6.206095    26.486        33    0.000
       COVAR, G01          -0.113553   0.504012    -0.225        33    0.823
 For     TIME slope, B1
    INTRCPT2, G10          26.960002   1.993880    13.521        33    0.000
       COVAR, G11           0.432858   0.161928     2.673        33    0.012
 ----------------------------------------------------------------------------
 The outcome variable is        Y
 Final estimation of fixed effects
 (with robust standard errors)
 ----------------------------------------------------------------------------
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00         164.374285   6.026170    27.277        33    0.000
       COVAR, G01          -0.113553   0.415881    -0.273        33    0.787
 For     TIME slope, B1
    INTRCPT2, G10          26.960002   1.936075    13.925        33    0.000
       COVAR, G11           0.432858   0.121468     3.564        33    0.001
 ----------------------------------------------------------------------------

 Final estimation of variance components:
 -----------------------------------------------------------------------------
 Random Effect           Standard      Variance     df    Chi-square  P-value
                         Deviation     Component
 -----------------------------------------------------------------------------
 INTRCPT1,       U0       35.16266    1236.41265    33     398.49446    0.000
     TIME slope, U1       10.35612     107.24917    33     143.96331    0.000
  level-1,       R        12.62843     159.47717
 -----------------------------------------------------------------------------
 Statistics for current covariance components model
 --------------------------------------------------
 Deviance                       = 1260.284762
 Number of estimated parameters = 4

Page 346-347 HLM takes multivariate approach for repeated measures and the files used for this type of analysis have extension as .MDM files. We converted willett data file  into multivariate format first and created an MDM file, willett_wave.MDM for it.

Compound Symmetry: Notice that this model is different from the paper, since it has intercept as a random effect.

                    Parameter     Standard Error
                   ------------  ----------------
 sigma_squared =    372.32114        51.385200
 Tau
 INTRCPT1     877.16380 
Tau (as correlations)
 INTRCPT1  1.000
 Standard Errors of Tau
 INTRCPT1     232.28819 
 D
   _IND_1    1249.48494    877.16380    877.16380    877.16380 
   _IND_2     877.16380   1249.48494    877.16380    877.16380 
   _IND_3     877.16380    877.16380   1249.48494    877.16380 
   _IND_4     877.16380    877.16380    877.16380   1249.48494 
D (as correlations)
   _IND_1  1.000  0.702  0.702  0.702
   _IND_2  0.702  1.000  0.702  0.702
   _IND_3  0.702  0.702  1.000  0.702
   _IND_4  0.702  0.702  0.702  1.000
The value of the likelihood function at iteration 3 = -6.540559E+002
 Final estimation of fixed effects:
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00         164.374286   5.701600    28.830        34    0.000
 For     TIME slope, B1
    INTRCPT2, G10          26.960000   1.458612    18.483       138    0.000

 Statistics for current covariance components model
 --------------------------------------------------
 Deviance =   1308.11172
 Number of estimated parameters =    4
Summary of Model Fit
 -------------------------------------------------------------------
 Model                                Number of         Deviance
                                      Parameters
 -------------------------------------------------------------------
 1. Unrestricted                          12           1271.86685
 2. Homogeneous sigma_squared              4           1308.11172
 -------------------------------------------------------------------
 Model Comparison                 Chi_square       df    P-value
 -------------------------------------------------------------------
 Model 1 vs Model 2                  36.24487       8     0.000

Unstructured. Notice that this model is different from the paper, since it has intercept as a random effect.


 D
   _IND_1    1273.56708    948.57291    899.07508    546.55946 
   _IND_2     948.57291   1093.03078    992.98157    830.84891 
   _IND_3     899.07508    992.98157   1260.29185   1049.39588 
   _IND_4     546.55946    830.84891   1049.39588   1374.95666 
D (as correlations)
   _IND_1  1.000  0.804  0.710  0.413
   _IND_2  0.804  1.000  0.846  0.678
   _IND_3  0.710  0.846  1.000  0.797
   _IND_4  0.413  0.678  0.797  1.000
 Standard Errors of D
   _IND_1     304.44076    255.89276    262.59160    242.00512 
   _IND_2     255.89276    261.28433    259.86536    250.32435 
   _IND_3     262.59160    259.86536    301.26738    284.55873 
   _IND_4     242.00512    250.32435    284.55873    328.67751 
The value of the likelihood function at iteration 3 = -6.359334E+002
 Final estimation of fixed effects:
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00         165.832042   5.782419    28.679        34    0.000
 For     TIME slope, B1
    INTRCPT2, G10          26.584650   2.090965    12.714        34    0.000

 Statistics for current covariance components model
 --------------------------------------------------
 Deviance =   1271.86685
 Number of estimated parameters =   12

AR(1) HLM has trouble estimating this model, because HLM does not allow a model without any random effect.


Page 348.

                    Parameter     Standard Error
                   ------------  ----------------
 rho           =     -0.14146         0.257333
 sigma_squared =    140.89501        36.789326
 Tau
 INTRCPT1    1181.85384   -169.89054 
     TIME    -169.89054    103.23221 
Tau (as correlations)
 INTRCPT1  1.000 -0.486
     TIME -0.486  1.000
 Standard Errors of Tau
 INTRCPT1     306.17471     78.71459 
     TIME      78.71459     32.79528 
 D
   _IND_1    1322.74885    992.03261    844.89210    671.78339 
   _IND_2     992.03261   1086.19998    858.71595    814.80765 
   _IND_3     844.89210    858.71595   1056.11553    931.86371 
   _IND_4     671.78339    814.80765    931.86371   1232.49550 
D (as correlations)
   _IND_1  1.000  0.828  0.715  0.526
   _IND_2  0.828  1.000  0.802  0.704
   _IND_3  0.715  0.802  1.000  0.817
   _IND_4  0.526  0.704  0.817  1.000
The value of the likelihood function at iteration 6 = -6.333202E+002
 Final estimation of fixed effects:
                                       Standard             Approx.
    Fixed Effect         Coefficient   Error      T-ratio   d.f.     P-value
 ----------------------------------------------------------------------------
 For       INTRCPT1, B0
    INTRCPT2, G00         164.424411   6.019069    27.317        33    0.000
       COVAR, G01          -0.123696   0.488823    -0.253        33    0.802
 For     TIME slope, B1
    INTRCPT2, G10          26.906451   1.919652    14.016        33    0.000
       COVAR, G11           0.435826   0.155900     2.796        33    0.009

 Statistics for current covariance components model
 --------------------------------------------------
 Deviance =   1266.64047
 Number of estimated parameters =    9
Summary of Model Fit
 -------------------------------------------------------------------
 Model                                Number of         Deviance
                                      Parameters
 -------------------------------------------------------------------
 1. Unrestricted                          14           1262.13753
 2. Homogeneous sigma_squared              8           1266.90091
 3. First-order Autoregressive             9           1266.64047
 -------------------------------------------------------------------
 Model Comparison                 Chi_square       df    P-value
 -------------------------------------------------------------------
 Model 1 vs Model 2                   4.76338       6     >.500
 Model 1 vs Model 3                   4.50294       5     >.500
 Model 2 vs Model 3                   0.26044       1     >.500

How to cite this page

Report an error on this page or leave a comment

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.