Introduction To Multilevel Modeling Using HLM 6
Introduction To Multilevel Modeling Using HLM 6
In the example of student nested within schools: Level-1 variables, such as students gender and age Level-2 variables, such as school type and size
Ecological Fallacy
See figure 3.1, on page 14 from Multilevel Analysis by Snijders and Bosker
Hierarchical linear model Random Intercept model Yij = 0j + rij 0j = 00 + u0j Written in mixed model format: Yij = 00 + u0j + rij
i is for individuals and j is for schools 0j is the mean of Yij for school j 00 is the average of all the 0js, therefore the grand rij and u0j are normally distributed rij and u0j are independent of each other Parameters to be estimated include regression coefficients and variance components: 00, var(rij) and var(u0j)
Hierarchical linear model Random Intercept and random slope model Yij = 0j + 1jX + rij 0j = 00 + u0j 1j = 10 + u1j Written in mixed model format: Yij = 00 + 10X + u0j + u1jX+ rij
0j is the mean of Yij for school j when X is zero 1j is the slope of X for school j (or the effect of X for school j) rij, u0j and u1j are normally distributed u0j and u1j are assumed to be correlated cross-level error terms are assumed to be independent parameters: 00, 10, var(u0j), var(u1j), cov(u0j, u1j) and var(rij)
Hierarchical linear model Random Intercept and random slope model Level-2 variable(s) to predict intercept and/or slope Yij = 0j + 1jX + rij 0j = 00 + 01W + u0j 1j = 10 + 11W + u1j Written in mixed model format: Yij = 00 + 01W + 10X + 11W*X + u0j + u1j*X + rij
0j is the mean of Yij for school j when X is zero 1j is the slope of X for school j (or the effect of X for school j) 00 is the average intercept 11 is the coefficient for the cross-level interaction term rij, u0j and u1j are normally distributed u0j and u1j are assumed to be correlated Cross-level error terms are assumed to be independent parameters to be estimated: 00, 01, 10, 11, var(u0j), var(u1j), cov(u0j, u1j) and var(rij)
Comparing the assumptions for hierarchical linear models with OLS models OLS Assumptions Linearity: function form is linear Normality: residuals are normally distributed Homoscedasticity: residual variance is constant Independence: observations are independent of each other HLM assumptions Linearity: function forms are linear at each level Normality: level-1 residuals are normally distributed and level-2 random effects us have a multivariate normal distribution Homoscedasticity: level-1 residual variance is constant Independence: level-1 residuals and level-2 residuals are uncorrelated Independence: observations at highest level are independent of each other
An Example
The dataset is a subsample from the 1982 High School and Beyond Survey and is used extensively in Hierarchical Linear Models by Raudenbush and Bryk. It consists of 7185 students nested in 160 schools. The outcome variable of interest is the student-level math achievement score, mathach. Predictor variables
Level-1 (student level) predictor variables:
ses: social-economic-status of a student female 0 = male and 1 = female
Model Building
Reading: Section 6.4 Model specification from Snijder and Bosker Unconditional model: mathachij = 0j + rij 0j = 00 + u0j Random intercept model with level-2 predictor(s): mathachij = 0j + rij 0j = 00 + 01(meanses) + u0j Random intercept and random slope model: mathachij = 0j + 1j(ses) + rij 0j = 00 + u0j 1j = 10 + u1j Full model: mathachij = 0j + 1j(group_mean_centered_ses) + rij 0j = 00 + 01(schtype) + 02(meanses) + u0j 1j = 10 + 11(schtype) + 12(meanses) + u1j
Final model
mathachij = 0j + 1j(group_mean_centered_ses) + rij 0j = 00 + 01(schtype) + 02(meanses) + u0j 1j = 10 + 11(schtype) + 12(meanses) + u1j
Tau INTRCPT1,B0 SES,B1 2.37996 0.19058 0.19058 0.14892
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 SCHTYPE, 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 SCHTYPE, G11 -1.640954 0.237401 -6.912 157 0.000 MEANSES, G12 1.034427 0.332785 3.108 157 0.003 ---------------------------------------------------------------------------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
---------------------------------------------------------------------------------------------------------
mathachij = 0j + 1j(group_mean_centered_ses) + rij 0j = 00 + 01(schtype) + 02(meanses) + u0j 1j = 10 + 11(schtype) + 12(meanses) + u1j 00 = 12.096: the intercept for public schools with meanses =0 (average ses) 01 = 1.226: the change in intercept from a public school to a private school
the intercept for private school with meanses = 0 is 12.096+1.226 = 13.322 the intercept for public school with meanses = 1 is 12.096 + 5.333 = 17.429 the effect of gcses for public schools with meanses = 0 is 2.94 the effect of gcses for private schools with meanses = 0 is 2.94 1.641 = 1.299 the effect of gcses for public schools with meanses = 0 is 2.94 the effect of gcses for public schools with meanses = 1 is 2.94 + 1.034 = 3.974
02 = 5.333: the change in intercept for a one-unit change in meanses 10 = 2.94: the slope of gcses for public schools with meanses = 0. 11 = -1.641: the change in slope from a public school to a private school 12 = 1.034: the change in slope for a one-unit change in meanses
For
For
INTRCPT1, B0 INTRCPT2, G00 SCHTYPE, G01 MEANSES, G02 SES slope, B1 INTRCPT2, G10 SCHTYPE, G11 MEANSES, G12
Getting ready for using HLM software for multilevel data analysis Creating MDM file
separate level-1 and level2 files for HLM2, or a single file original file can be in different format, such as SPSS, Stata and SAS linking variable can be either numeric or character variables in the analyses have to be numeric mdm file: binary file used for analyses and graphics mdmt file: template file in text format for creating mdm file hlm2mdm.sts: text file containing the summary statistics
Data management
HLM does not have data management capability One has to use other stat package(s) to clean the data and to create variables, such as dummy variables and within-level interaction terms HLM handles cross-level interactions nicely
data-based graphs
Model Building
Other Issues
References Multilevel Analysis: An Introduction to Basic and Advanced Multilevel Modeling by Tom Snijders and Roel Bosker Introduction to Multilevel Modeling by Ita Kreft and Jan de Leeuw Multilevel Analysis: Techniques and Applications by Joop Hox Hierarchical Linear Models, Second Edition by Stephen Raudenbush and Anthony Bryk HLM 6 - Hierarchical Linear and Nonlinear Modeling by Raudenbush et al.