HLM
HLM
HLM
52
53
Example of
Hierarchical
Level
School
Level
Example Variables
Schools geographic
location
Annual budget
Level-2
Classroom
Class size
Level
Homework assignment
load
Teaching experience
Teaching style
Level-1
Student
Gender
Level
Intelligence Quotient (IQ)
Socioeconomic status
Self-esteem rating
Behavioural conduct rating
Breakfast consumption
GPA
The outcome variable is always a level-1 variable.
Hofmann, 1997). HLM is prevalent across many domains,
and is frequently used in the education, health, social work,
and business sectors. Because development of this statistical
method occurred simultaneously across many fields, it has
come to be known by several names, including multilevel-,
mixed level-, mixed linear-, mixed effects-, random effects-,
random coefficient (regression)-, and (complex) covariance
components-modeling (Raudenbush & Bryk, 2002). These
labels all describe the same advanced regression technique
that is HLM. HLM simultaneously investigates relationships
within and between hierarchical levels of grouped data,
thereby making it more efficient at accounting for variance
among variables at different levels than other existing
analyses.
Example
Throughout this tutorial we will make use of an example
to illustrate our explanation of HLM. Imagine a researcher
asks the following question: What school-, classroom-, and
student-related factors influence students Grade Point Average?
This research question involves a hierarchy with three
levels. At the highest level of the hierarchy (level-3) are
school-related variables, such as a schools geographic
location and annual budget. Situated at the middle level of
the hierarchy (level-2) are classroom variables, such as a
teachers homework assignment load, years of teaching
experience, and teaching style. Level-2 variables are nested
within level-3 groups and are impacted by level-3 variables.
54
Table 2. Sample dataset using the disaggregation method, with level-2 and level-3 variables excluded from the data
(dataset is adapted from an example by Snijders & Bosker, 1999)
Student ID
(Level-1)
1
2
3
4
5
6
7
8
9
10
Classroom ID
(Level-2)
1
1
2
2
3
3
4
4
5
5
School ID
(Level-3)
1
1
1
1
1
1
1
1
1
1
GPA Score
(Level-1)
5
7
4
6
3
5
2
4
1
3
Aggregation
Aggregation of data deals with the issues of hierarchical
data analysis differently than disaggregation: Instead of
ignoring higher level group differences, aggregation ignores
lower level individual differences. Level-1 variables are
raised to higher hierarchical levels (e.g., level-2 or level-3)
and information about individual variability is lost. In
aggregated statistical models, within-group variation is
ignored and individuals are treated as homogenous entities
(Beaubien et al., 2001; Gill, 2003; Osborne, 2000). To the
researcher investigating the impact of breakfast
consumption on student GPA, this approach changes the
research question (Osborne, 2000). Mean classroom GPA
becomes the new outcome variable of interest, rather than
55
Table 3. Sample dataset using the aggregation method, with level-1 variables excluded from the data
(dataset is adapted from an example by Snijders & Bosker, 1999)
Teacher ID
(Level-2)
1
2
3
4
5
Classroom GPA
(Level-2)
6
5
4
3
2
HLM
Figure 3 depicts the relationship between breakfast
consumption and student GPA using HLM. Each level-1
(X,Y) unit (i.e., each students GPA and breakfast
consumption) is identified by its level-2 cluster (i.e., that
students classroom). Each level-2 clusters slope (i.e., each
classrooms slope) is also identified and analyzed separately.
Using HLM, both the within- and between-group
regressions are taken into account to depict the relationship
between breakfast consumption and GPA. The resulting
analysis indicates that breakfast consumption is positively
related to GPA at level-1 (i.e., at the student level) but that
the intercepts for these slope effects are influenced by level-2
factors [i.e., students breakfast consumption and GPA (X, Y)
units are also affected by classroom level factors]. Although
disaggregation and aggregation methods indicated a
negative relationship between breakfast consumption and
GPA, HLM indicates that unit increases in breakfast
consumption actually positively impact GPA. As
demonstrated, HLM takes into consideration the impact of
56
57
(5)
58
Table 4. Hypothesis and necessary conditions: Does student breakfast consumption and
teaching style influence student GPA?
Hypotheses
1
Breakfast consumption is related to GPA.
2
Teaching style is related to GPA, after controlling for breakfast consumption.
3
Teaching style moderates the breakfast consumption-GPA relationship.
Conditions
1
There is systematic within- & between-group variance in GPA.
2
There is significant variance at the level-1 intercept.
3
There is significant variance in the level-1 slope.
4
The variance in the level-1 intercept is predicted by teaching style.
5
The variance in the level-1 slope is predicted by teaching style.
important implications for parameter estimation, which will
be discussed in the next section.
Estimation of Effects
Two-level hierarchical models involve the estimation of
three types of parameters. The first type of parameter is
fixed effects, and these do not vary across groups (Hofmann,
1997). The fixed effects are represented by
,
,
and
in Equations 3 and 4. While the level-2 fixed effects
could be estimated via the Ordinary Least Squares (OLS)
approach, it is not an appropriate estimation strategy as it
requires the assumption of homoscedasticity to be met. This
assumption is violated in hierarchical models as the
accuracy of level-1 parameters are likely to vary across
groups (e.g., classrooms; Hofmann, 1997). The technique
used to estimate fixed effects is called a Generalized Least
Squared (GLS) estimate. A GLS yields a weighted level-2
regression which ensures that groups (e.g., classrooms) with
more accurate estimates of the outcome variable (i.e., the
intercepts and slopes) are allocated more weight in the level2 regression equation (Hofmann, 1997). Readers seeking
further information on the estimation of fixed effects are
directed to Raudenbush & Bryk (2002).
The second type of parameter is the random level-1
coefficients ( and
) which are permitted to vary across
groups (e.g., classrooms; Hofmann, 1997). Hierarchical
models provide two estimates for random coefficients of a
given group (e.g., classroom): (1) computing an OLS
regression for the level-1 equation representing that group
(e.g., classroom); and (2) the predicted values of
and
in the level-2 model [see Equations 3 and 4]. Of importance
is which estimation strategy provides the most precise
values of the population slope and intercept for the given
group (e.g., classroom; Hofmann, 1997). HLM software
programs use an empirical Bayes estimation strategy, which
takes into consideration both estimation strategies by
computing an optimally weighted combination of the two
(Raudenbush & Bryk, 2002; Raudenbush, Bryk, Cheong,
59
(9)
Our three hypotheses are a) breakfast consumption is
related to GPA; b) teaching style is related to GPA, after
controlling for breakfast consumption; and c) teaching style
moderates the breakfast consumption-GPA relationship. In
order to support these hypotheses, HLM models require five
conditions to be satisfied. Our hypotheses and necessary
conditions to be satisfied are summarized in Table 4.
(12)
Once this condition is satisfied, HLM can examine the next
two conditions to determine whether there are significant
differences in intercepts and slopes across classrooms.
where:
60
where:
(13)
(14)
(15)
where:
= mean of the intercepts across classrooms;
= mean of the slopes across classrooms (Hypothesis
1);
= Level-1 residual variance;
= variance in intercepts;
= variance in slopes.
The
and
parameters are the level-1 coefficients of the
intercepts and the slopes, respectively, averaged across
classrooms. HLM runs a t-test on these parameters to assess
whether they differ significantly from zero, which is a direct
test of hypothesis 1 in the case of
. This t-test reveals
whether the pooled slope between GPA and breakfast
consumption differs from zero.
A test is used to assess whether the variance in the
intercept and slopes differs significantly from zero (
and
, respectively). At this stage, HLM also estimates the
residual level-1 variance and compares it to the estimate
from the test of Condition 1. Using both estimates, HLM
calculates the percent of variance in GPA that is accounted
for by breakfast consumption (see Equation 16).
(16)
Of note is that in order for the fourth and fifth conditions to
be tested, the second and third conditions must first be met.
= Level-2 intercept;
= Level-2 slope (Hypothesis 2);
= mean (pooled) slopes;
= Level-1 residual variance;
= residual intercept variance;
= variance in slopes.
The intercepts-as-outcomes model is similar to the
random coefficient regression used for the second and third
conditions except that it includes teaching style as a
predictor of the intercepts at level-2. This is a direct test of
the second hypothesis, that teaching style is related to GPA
after controlling for breakfast consumption. The residual
variance ( ) is assessed for significance using another
test. If this test indicates a significant value, other level-2
predictors can be added to account for this variance. To
assess how much variance in GPA is accounted for by
teaching style, the variance attributable to teaching style is
compared to the total intercept variance (see Equation 20).
(20)
Condition 5: The Variance in the Level-1 Slope is Predicted
by Teaching Style
The fifth condition assesses whether the difference in
slopes is related to teaching style. It is known as the slopesas-outcomes model. The following sub-models (see
Equations 21-23) formed with select variables from Equation
9 are used to determine if condition five is satisfied.
(21)
(22)
(23)
where:
= Level-2 intercept;
= Level-2 slope (Hypothesis 2);
= Level-2 intercept;
= Level-2 slope (Hypothesis 3);
= Level-1 residual variance;
= residual intercept variance;
= residual slope variance.
With teaching style as a predictor of the level-1 slope,
becomes a measure of the residual variance in the averaged
level-1 slopes across groups. If a test on
is significant,
it indicates that there is systematic variance in the level-1
slopes that is as-of-yet unaccounted for, therefore other
level-2 predictors can be added to the model. The slopes-as-
61
Preparation
It is essential to prepare the data files using a statistical
software package before importing the data structure into
the HLM software. The present example uses PASW
(Predictive Analytics SoftWare) version 18 (Statistical
Package for the Social Sciences; SPSS). A separate file is
created for each level of the data in PASW. Each file should
contain the participants scores on the variables for that
level, plus an identification code to link the scores between
levels. It is important to note that the identification code
variable must be in string format, must contain the same
number of digits for all levels, and must be given the exact
same variable name at all levels. The data file must also be
sorted, from lowest value to highest value, by the
identification code variable (see Figure 4).
In this example, the level-1 file contains 300 scores for the
measures of Shots_on_5 and Life_Satisfaction, where
participants were assigned identification codes (range: 01 to
30) based on their team membership. The level-2 file
contains 30 scores for the measure of Coach_Experience and
identification codes (range: 01 to 30), which were associated
with the appropriate players from the level-1 data. Once a
data file has been created in this manner for each level, it is
possible to import the data files into the HLM software.
HLM Set-Up
The following procedures were conducted according to
those outlined by Raudenbush and Bryk (2002). After
launching the HLM program, the analysis can begin by
clicking File Make New MDM File Stat Package Input. In
the dialogue box that appears, select the MDM (Multivariate
Data Matrix). We will select HLM2 to continue because our
example has two levels. A new dialogue box will open, in
which we will specify the file details, as well as load the
level-1 and level-2 variables.
First, specify the variables for the analysis by linking the
file to the level-1 and level-2 SPSS data sets that were
created. Once both have been selected, click Choose Variable
to select the desired variables from the data set (check the
box next to In MDM) and specify the identification code
variables (check the box next to ID). Please note that you are
not required to select all of the variables from the list to be in
the MDM, but you must specify an ID variable. You must
also specify whether there are any missing data and how
missing data should be handled during the analyses. If you
select Running Analyses for the missing data, HLM will
perform a pairwise deletion; if you select Making MDM,
HLM will perform a listwise deletion. In the next step,
62
Figure 4. Example of SPSS data file as required by HLM. The image on the left represents the data for level-1. The
image on the right represents the data for level-2.
ensure that under the Structure of Data section, Cross sectional
is selected. Under MDM File Name, provide a name for the
current file, add the extension .mdm, and ensure that the
input file type is set to SPSS/Windows. Finally, in the MDM
Template File section, choose a name and location for the
template files.
To run the analyses, click Make MDM, and then click
Check Stats. Checking the statistics is an invaluable step that
should be performed carefully. At this point, the program
will indicate any specific missing data. After this process is
complete, click Done and a new window will open where it
is possible to build the various models and run the required
analyses. Before continuing, ensure that the optimal output
file type is selected by clicking File Preferences. In this
window, it is possible to make a number of adjustments to
the output; however, the most important is to the Type of
Output. For the clearest and easiest to interpret output file, it
is strongly recommended that HTML output is selected as
well as view HTML in default browser.
Unconstrained (null) Model
As a first step, a one-way analysis of variance is performed
to confirm that the variability in the outcome variable, by
level-2 group, is significantly different than zero. This tests
whether there are any differences at the group level on the
63
(25)
64
group. Click Run Analysis to run this model and view the
output screen. The generated output screen should be
identical to Figure 8.
A regression coefficient is estimated and its significance
confirms the relationship between the level-1 predictor
variable and the outcome variable. To view results of this
analysis, consult the significance values for the INTRCPT2,
in the Final estimation of fixed effect output table (refer to
Figure 8), which is non-standardized. The non-standardized
final estimation of fixed effects tables will be similar to the
standardized table (i.e. with robust standard errors) unless
an assumption has been violated (e.g. normality), in which
case, use the standardized final estimation. The results of the
present analysis support the relationship between
Shots_on_5 and Life_Satisfaction, b = 2.89, p < .001. Please
note that the direction (positive or negative) of this statistic
is interpreted like a regular regression.
To calculate a measure of effect size, calculate the
variance (r2) explained by the level-1 predictor variable in
the outcome variable using Equation 26.
(26)
65
66
(27)
where 2null is the value obtained in the first step (nullmodel testing) under the Summary of the model specified table
in Figure 6 (2null = 14.96). Next 2means is the value obtained
under the Summary of the model specified table in the present
analysis (2means = 1.68; Figure 10). The results confirm that
Coach_Experience explains 88.8% of the between measures
variance in Life_Satisfaction.
Random Intercepts and Slopes Model
The final step is to test for interactions between the two
predictor variables (level-1 and level-2). Please note that if
only interested in the main effects of both predictor
variables (level-1 and level-2), this final step is not necessary.
Alternatively, this final model could be used to test the two
previous models instead of running them separately. If you
67
68
69