The goal of this exercise is to find out what happens if I intentionally use a level2 variable at level 1 in HLM. I found that the coefficients and standard errors remain about the same. The parameter that differed was just the degree of freedom, which was consistent with my expectation.
Using my old NELS dataset, I ran two different HLM models using Bryk and Raudenbush’s software (See model 1 and model 2 equations in the table below).
 The URBAN as level 1 covariate model (I entered the level2 variable URBAN wrongly at level 1)
 The URBAN as level 2 covariate model (I entered the level2 variable URBAN correctly at level 2)
The outcome variable is the achievement composite (POSTTEST), students are level 1 and schools are level 2. When expressed as mixed models, the two models are identical, which is why I expected most parameters to come out the same.
POSTTEST_{ij} = γ_{00}
+ γ_{10}*URBAN_{ij} + u_{0j}+ r_{ij}
The first model (MODEL 1; see below) included URBAN (students are in urban school) as a level 1 predictor. Of course this is a wrong specification because urban is a school characteristic. In the second model (MODEL 2), I used it at the expected level, which is at level 2 (school level).
These models look different, but AGAIN when expressed as mixed models, they are identical. As the third model (MODEL 3), I replicated the same HLM model using SAS PROC GLIMMIX. SAS requires that the equation be expressed as a mixed model.
Results showed that coefficients and standard errors are more or less the same across three models. The only one thing that was different was degree of freedom.
Conclusion: As long as variables enter the model as fixed effects as done here, there is nothing magical about the HLM model. HLM software or SAS PROC GLIMMIX (option ddfm=kr) adjust degree of freedom values, accounting for the fact that URBAN is a schoollevel variable and thus should not be awarded a value that is too large. Notice that under the correct specification (MODEL 2 and MODEL 3), the degree of freedom for URBAN is close to the number of schools, not to the number of students.
Thanks for any comments you may have.
MODEL 1  MODEL 2  MODEL 3  
URBAN as LEVEL 1 covariate  URBAN as level 2 covariate  SAS PROC GLIMMIX  
Level1 Model
POSTTEST_{ij} = β_{0j} + β_{1j}*(URBAN_{ij}) + r_{ij} Level2 Model β_{0j} = γ_{00} + u_{0j} Mixed Model POSTTEST_{ij} = γ_{00} 
Level1 Model
POSTTEST_{ij} = β_{0j} + r_{ij} Level2 Model β_{0j} = γ_{00} + γ_{01}*(URBAN_LE_{j}) + u_{0j} Mixed Model POSTTEST_{ij} = γ_{00} + γ_{01}*URBAN_LE_{j} + u_{0j}+ r_{ij} 
proc glimmix data=kaz.level1;
class schoolID; model posttest = urban /solution ddfm=kr dist=normal link=identity s ; random schoolID; run;


Final estimation of fixed effects (with robust standard errors)
Final estimation of variance components
Statistics for current covariance components model

Final estimation of fixed effects (with robust standard errors)
Final estimation of variance components
Statistics for current covariance components model


Datasets:
www.nippondream.com/file/datafiles_HLM.zip
Leave a Reply