Contents 1 Conceptual and Statistical Background for Two-Level Models...7 1.1 The general two-level model... 7 1.1.1 Level-1 model... 8 1.1.2 Level-2 model... 8 1.2 Parameter estimation... 9 1.3 Empirical Bayes ("EB") estimates of randomly varying level-1 coefficients, q j... 9 1.4 Generalized least squares (GLS) estimates of the level-2 coefficients, qs... 10 1.5 2 Maximum likelihood estimates of variance and covariance components, at level 1, and T at level 2... 10 1.6 Some other useful statistics... 10 1.7 Hypothesis testing... 11 1.8 Restricted versus full maximum likelihood... 11 1.9 Generalized Estimating Equations... 11 2 Working with HLM2...14 2.1 Constructing the MDM file from raw data... 14 2.2 Executing analyses based on the MDM file... 15 2.3 Model checking based on the residual file... 15 2.4 Windows, interactive, and batch execution... 16 2.5 An example using HLM2 in Window mode... 16 2.5.1 Constructing the MDM file from raw data... 17 2.5.2 Executing analyses based on the MDM file... 26 2.5.3 Annotated HLM2 output... 32 2.5.4 Model checking based on the residual file... 36 2.6 Handling of missing data... 46 2.7 The Basic Model Specifications - HLM2 dialog box... 48 2.8 Other analytic options... 49 2.8.1 Controlling the iterative procedure... 49 2.8.2 Estimation control... 50 2.8.3 Constraints on the fixed effects... 51 2.8.4 To put constraints on fixed effects... 51 2.8.5 Modeling heterogeneity of level-1 variances... 52 2.8.6 Specifying level-1 deletion variables... 55 2.8.7 Using design weights... 55 2.8.8 Hypothesis testing... 58 2.9 Output options... 62 2.10 Models without a level-1 intercept... 63 2.11 Coefficients having a random effect with no corresponding fixed effect... 64 2.12 Exploratory analysis of potential level-2 predictors... 64 1
3 Conceptual and Statistical Background for Three-Level Models...67 3.1 The general three-level model... 67 3.1.1 Level-1 model... 68 3.1.2 Level-2 model... 68 3.1.3 Level-3 model... 70 3.2 Parameter estimation... 71 3.3 Hypothesis testing... 71 4 Working with HLM3...73 4.1 An example using HLM3 in Windows mode... 73 4.1.1 Constructing the MDM file from raw data... 73 4.2 Executing analyses based on the MDM file... 79 4.2.1 An annotated example of HLM3 output... 80 4.3 Model checking based on the residual files... 84 4.4 Specification of a conditional model... 87 4.5 Other program features... 92 4.5.1 Basic specifications... 92 4.5.2 Iteration control... 92 4.5.3 Estimation settings... 92 4.5.4 Hypothesis testing... 93 4.5.5 Output settings... 93 5 Conceptual and Statistical Background for Hierarchical Generalized Linear Models (HGLM)...94 5.1 The two-level HLM as a special case of HGLM... 95 5.1.1 Level-1 sampling model... 95 5.1.2 Level-1 link function... 96 5.1.3 Level-1 structural model... 96 5.2 Two- and three-level models for binary outcomes... 96 5.2.1 Level-1 sampling model... 97 5.2.2 Level-1 link function... 97 5.2.3 Level-1 structural model... 98 5.2.4 Level-2 and Level-3 models... 98 5.3 The model for count data... 98 5.3.1 Level-1 sampling model... 98 5.3.2 Level-1 link function... 99 5.3.3 Level-1 structural model... 99 5.3.4 Level-2 model... 99 5.4 The model for multinomial data... 100 5.4.1 Level-1 sampling model... 100 5.4.2 Level-1 link function... 101 5.4.3 Level-1 structural model... 101 5.4.4 Level-2 model... 101 5.5 The model for ordinal data... 102 5.5.1 Level-1 sampling model... 102 5.5.2 Level-1 structural model... 103 5.6 Parameter estimation... 103 5.6.1 Estimation via PQL... 104 5.6.2 Properties of the estimators... 108 5.6.3 Parameter estimation: A high-order Laplace approximation of maximum likelihood... 109 5.7 Unit-specific and population-average models... 109 2
5.8 Over-dispersion and under-dispersion... 111 5.9 Restricted versus full PQL versus full ML... 112 5.10 Hypothesis testing... 112 6 Fitting HGLMs (Nonlinear Models)...113 6.1 Executing nonlinear analyses based on the MDM file... 113 6.2 Case 1: a Bernoulli model... 115 6.3 Case 2: a binomial model (number of trials, m i j 1)... 123 6.4 Case 3: Poisson model with equal exposure... 126 6.5 Case 4: Poisson model with variable exposure... 127 6.6 Case 5: Multinomial model... 129 6.7 Case 6: Ordinal model... 134 6.8 Additional features... 139 6.8.1 Over-dispersion... 139 6.8.2 Laplace approximation for binary outcome models... 139 6.8.3 Printing variance-covariance matrices for fixed effects... 140 6.9 Fitting HGLMs with three levels... 140 7 Conceptual and Statistical Background for Hierarchical Multivariate Linear Models (HMLM)...141 7.1 Unrestricted model... 142 7.1.1 Level-1 model... 142 7.1.2 Level-2 model... 143 7.1.3 Combined model... 144 7.2 HLM with homogenous level-1 variance... 144 7.2.1 Level-1 model... 145 7.2.2 Level-2 model... 145 7.2.3 Combined model... 145 7.3 HLM with varying level-1 variance... 146 7.4 HLM with a log-linear model for the level-1 variance... 146 7.5 First-order auto-regressive model for the level-1 residuals... 147 7.6 HMLM2: A multilevel, multivariate model... 147 7.6.1 Level-1 model... 147 7.6.2 Level-2 model... 148 7.6.3 Level-3 model... 148 7.6.4 The combined model... 149 8 Working with HMLM/HMLM2...150 8.1 An analysis using HMLM via Windows mode... 150 8.1.1 Constructing the MDM from raw data... 150 8.2 Executing analyses based on the MDM file... 153 8.3 An annotated example of HMLM... 154 8.4 An analysis using HMLM2 via Windows mode... 166 8.5 Executing analyses based on the MDM file... 166 3
9 Special Features...174 9.1 Latent variable analysis... 174 9.1.1 A latent variable analysis using HMLM: Example 1... 174 9.1.2 A latent variable analysis using HMLM: Example 2... 177 9.2 Applying HLM to multiply-imputed data... 180 9.2.1 Data with multiply-imputed values for the outcome or one covariate... 181 9.2.2 Calculations performed... 182 9.2.3 Working with plausible values in HLM... 183 9.2.4 Data with multiply-imputed values for the outcome and covariates... 184 9.3 "V-Known" models for HLM2... 185 9.3.1 Data input format... 186 9.3.2 Creating the MDM file... 187 9.3.3 Estimating a V-known model... 187 9.3.4 V-known analyses where Q = 1... 190 10 Conceptual and Statistical Background for Cross-classified Random Effect Models (HCM2)...191 10.1 The general cross-classified random effects models... 191 10.1.1 Level-1 or "within-cell" model... 192 10.1.2 Level-2 or "between-cell" model... 192 10.2 Parameter estimation... 193 10.3 Hypothesis testing... 193 11 Working with HCM2...194 11.1 An example using HCM2 in Windows mode... 194 11.1.1 Constructing the MDM file from raw data... 194 11.1.2 SPSS input... 194 11.1.3 Level-2 row-factor file... 195 11.1.4 Level-2 column-factor file... 196 11.2 Executing analyses based on the MDM file... 199 11.3 Specification of a conditional model with the effect associated with a row-specific predictor fixed... 202 11.4 Other program features... 207 12 Graphing Data and Models...209 12.1 Data based graphs two level analyses... 209 12.1.1 Box and whisker plots... 209 12.1.2 Scatter plots... 216 12.1.3 Line plots two-level analyses... 221 12.2 Model-based graphs two level... 225 12.2.1 Model graphs... 225 12.2.2 Level-1 equation modeling... 231 12.2.3 Level-1 residual box-and-whisker plots... 234 12.2.4 Level-1 residual vs predicted value... 237 12.2.5 Level-1 EB/OLS coefficient confidence intervals... 239 12.2.6 Graphing categorical predictors... 240 12.3 Three-level applications... 241 4
A Using HLM2 in interactive and batch mode...245 A.1 Using HLM2 in interactive mode... 245 A.1.1 Example: constructing an MDM file for the HS&B data using SPSS file input... 245 A.1.2 Example: constructing an MDM file for the HS&B data using ASCII file input... 246 A.2 Rules for format statements... 248 A.2.1 Example: Executing an analysis using HSB.MDM... 248 A.3 Using HLM in batch and/or interactive mode... 252 A.4 Using HLM2 in batch mode... 253 A.5 Printing of variance and covariance matrices for fixed effects and level-2 variances 257 A.6 Preliminary exploratory analysis with HLM2... 259 B Using HLM3 in Interactive and Batch Mode...262 B.1 Using HLM3 in interactive mode... 262 B.1.1 Example: constructing an MDM file for the public school data using SPSS file input... 262 B.1.2 Example: constructing an MDM file for the HS&B data using ASCII file input... 264 B.1.3 Example: Executing an analysis using EG.MDM... 265 B.2 Using HLM3 in batch mode... 268 B.2.1 Table of keywords and options... 268 B.3 Printing of variance and covariance matrices... 270 C Using HGLM in Interactive and Batch Mode...271 C.1 Example: Executing an analysis using THAIUGRP.MDM... 271 D Using HMLM in Interactive and Batch Mode...277 D.1 Constructing an MDM file... 277 D.2 Executing analyses based on MDM files... 277 D.2.1 Table of keywords and options... 279 D.2.2 Table of HMLM2 keywords and options... 279 E Using Special Features in Interactive and Batch Mode...281 E.1 Example: Latent variable analysis using the National Youth Study data sets... 281 E.2 A latent variable analysis to run regression with missing data... 283 E.3 Commands to apply HLM to multiply-imputed data... 284 F Using HCM2 in Interactive and Batch Mode...286 F.1 Using HCM2 in interactive mode... 286 F.1.1 Example: constructing an MDM file for the educational attainment data as described in Chapter 11 using SPSS file input... 286 F.1.2 Example: Executing an unconditional model analysis using ATTAIN.MDM... 288 F.1.3 Example: Executing a conditional model analysis using ATTAIN.MDM... 289 F.2 Using HCM2 in batch mode... 292 References...295 5