You are on page 1of 2

189

British Journal of Mathematical and Statistical Psychology (2004), 57, 189–190


q 2004 The British Psychological Society
www.bps.org.uk

Statistical software review


Mixed models in SPSS

Multilevel models—also known as variance component models, hierarchical linear models,


random effects models, mixed models, and random coefficient models—have become part of the
quantitative social scientist’s standard toolkit. This is further evidenced by the introduction, in
SPSS version 11.0, of the Mixed models menu item on the Analyze menu. This menu item gives
access to a set of screens that set the syntax for the mixed command for fitting multilevel models
in SPSS.
The SPSS interface to multilevel models is based around the notion of repeated measurements
within subjects. Repeated measures on individuals is one of many areas where multilevel models
can be usefully applied. Basically, multilevel models deal not only with the fact that measurements
cluster within people but also that people cluster within a variety of social groupings
(e.g. households, schools, hospitals, geographical areas). One of the confusing things I found
when using SPSS to fit multilevel models is that the software can fit models to a wide range of
situations, well beyond repeated measures designs, but the software interface still uses the
vocabulary of repeated measures to address this wider range of models.
Let us see how multilevel models are set up and run in SPSS, taking the example of a random
slopes model, where we have data on pupils within schools and a pre-test and a post-test.
We regress the post-test on the pre-test and allow the relationship to vary across schools. The
syntax of the mixed command to do this is
mixed
post WITH pre
=fixed ¼ pre
=random intercept pre j subjectðschoolÞ covtypeðUNÞ:
which produces some clearly laid-out results in the output window. In the /fixed clause we can
easily include a list of main effects and interactions using standard syntax. The /random clause
states that we want the intercept and the slope of pre to vary randomly across schools. Here
subject(x) just means that the higher-level grouping factor is defined by the variable x. We estimate
the between-school covariance matrix of two school-level random effects. It is to this covariance
matrix that covtype(UN) refers. There are 16 different types of covariance matrix made available
via the covtype option, most of which only make any sense for modelling serial correlation in a
repeated measures design. For example, for the covariance structure of the school-level random
effects we can specify the ‘ar(1):heterogeneous’ format, which the SPSS help system defines as:
s 21 rs2 s1 r 2 s3 s1 r 3 s4 s1
rs2 s1 s22 rs3 s2 r 2 s4 s2
r 2 s3 s1 rs3 s2 s32 rs4 s3
r 3 s4 s1 r 2 s4 s2 rs4 s3 s42
190 Statistical software review

This makes complete sense in a repeated measures model as a way of modelling serial correlation.
However, for modelling what SPSS refers to as between subject (school, in our case) variation, it
makes no sense at all. The model runs and produces results, but what it is doing is beyond me. The
command syntax and the corresponding structures in the menu system seem fairly incoherent on
this point.
A good point about the /random clause is that it can have multiple instances in one call of the
mixed command. This allows models with an arbitrary number of random classifications and
multiple random effects (random slopes) at each classification. Furthermore, the classifications
need not be hierarchical. Thus the /random clause can easily specify some complicated population
structures. I tested this out on some more complex models: the system produced correct results and
the algorithm is clearly computationally efficient, in that the results were delivered quickly.
I do not have the space in this review to describe the graphical user interface provided for the
mixed command. However, I will say that I found it confusing, ambiguous and woefully described
in the help system. I have not used SPSS before so users familiar with SPSS conventions might not
find the GUI for the mixed command such a drag.
Users wanting to learn and apply these techniques need good documentation taking them
through a range of worked examples. They can then take an example similar to their own
problem, understand what is going on in the example and then have a go with their own data. The
SPSS Advanced Models Manual contains eleven pages that are not useful; the same text is
regurgitated in the online help system. Rather more useful is an HTML tutorial for the use of mixed
models in SPSS available from the support section of the SPSS website (you may need to register in
order to access this).
Another useful resource available from the UCLA multilevel modelling portal is
http:==www:ats:ucla:edu=stat=spss=paperexamples=singer=default:htm
which goes through the mixed command syntax for a range of models on several data sets; the
data sets are also provided.
Two other shortcomings should be mentioned. The mixed command only deals with
normally distributed responses. Given that much data in the social sciences is discrete (categorical
or count) this is a serious limitation. Secondly, I could not find an option to get access to the
multilevel shrunken residuals. These are essential for model diagnosis and exploration.
In the example above I have merely presented the bare bones syntax. Options exist for
choosing between maximum likelihood and restricted maximum likelihood estimators, setting
convergence criteria, incorporating residual (level 1 only) weights, producing descriptive
statistics, showing the covariance matrix of all fixed and random parameters and a limited
capability for specifying contrasts between the fixed parameters.
One other thing to beware of is that although the mixed model was introduced in version 11.0
of SPSS, I experienced a problem with this version. When trying to estimate the covariance
between the school-level random intercept and slope effects which requires the covtype(UN)
option, version 11.0 reset the covtype to diagonal, which removed the covariance. This rather
confused me at the time and SPSS technical support could not help. However, in version 11.5 the
problem is resolved.
In summary, if you are a user of SPSS and want to fit multilevel models you may well find the
mixed functionality useful. If you do not understand how these models work, you will probably
need to find someone who does to help you get up to speed. However, if you want to do an
in-depth multilevel analysis the lack of facilities for diagnostics, model exploration, hypothesis
testing and the restricted range of response types means one of the many alternative
software packages might be more appropriate. The website for the Centre for Multilevel Modelling
(http://multilevel.ioe.ac.uk/ ) has a series of reviews of software packages that can fit multilevel
models, which you may find helpful.
JON RASBASH (Centre for Multilevel Modelling, Institute of Education, University of London)

You might also like