Linear Mixed Models: A Practical Guide Using Statistical Software
Brady T. West, MA
Kathleen B. Welch, MS, MPH
Andrzej T. Galecki, M.D., Ph.D.
Note: A second edition is in progress in 2013!
Published by Chapman Hall / CRC Press (Click here to purchase online, and receive a 20% discount! The 20% Online Promotion Code is 585HHXXXX, which can be inserted in the promotion code field at checkout.)
This book provides readers with a practical introduction to the theory and applications of linear mixed models, and introduces the fitting and interpretation of several types of linear mixed models
using the statistical software packages SAS (PROC MIXED), SPSS (Linear Mixed Models), Stata (xtmixed), R (the lme() and lmer() functions), and HLM (Hierarchical Linear Models).
The book focuses on the statistical meaning behind linear mixed models. Why fit them? Why are they important? When are they applicable? What do they mean for research conclusions? The book also presents and compares practical, step-by-step analyses of real-world data sets in all of the aforementioned software packages, allowing readers to compare and contrast the packages in terms of their syntax/code, ease of use, available methods and options, and relative advantages.
Click on any of the following chapters for links to the data sets, updates to the software code in the book, and miscellaneous additional information:
Chapter 3 -> Two-level Models for Clustered Data: The Rat Pup Example
Chapter 4 -> Three-level Models for Clustered Data: The Classroom Example
Chapter 5 -> Models for Repeated Measures Data: The Rat Brain Example
Chapter 6 -> Random Coefficient Models for Longitudinal Data: The Autism Example
Chapter 7 -> Models for Clustered Longitudinal Data: The Dental Veneer Example
You can also view a brief promotional video from the three authors here.
Notes on Shrinkage Estimators
SPSS White Paper on the MIXED Procedure, with instructions on data preparation and use of the MIXED Procedure via the SPSS menus
1. Journal of Statistical Theory and Practice
2. Journal of the American Statistical Association
4. Technometrics (Nominated for the 2009 Ziegel Prize)
6. Statistics in Medicine
7. Journal of Quality Technology
8. Journal of the Royal Statistical Society-Series A
9. Biometrical Journal
1. HLM 7 is now available, offering HLM users the ability to fit four-level models and enhanced statistical output. Click here for more details!
2. Linear models with general error covariance structures and no random effects can now be fitted in Stata using the xtmixed command. Courtesy of Nicholas J. Horton (Stata Tip 95 in the Stata Journal, 11(1), 145-148), here is an example for a longitudinal data set with four time points on each subject:
xtmixed y ib14.time female, || id:, nocons residuals(un, t(time)) var
Note the use of *|| id:, nocons* as the key part of this syntax, omitting random intercepts.
3. The languageR package in R contains the pvals.func() function, which uses MCMC sampling to facilitate making inferences for parameters when using lmer() in R. Click here for an example using the Rat Pup data in Chapter 3. Unfortunately, this function cannot currently handle models with correlated random effects. Updates will be provided as they become available!
4. The book was nominated for the 2009 Ziegel Prize, sponsored by the Journal Technometrics and honoring a first edition with clearly discussed statistical methodology that "brings together in one volume a body of material previously only available in scattered research articles and having the potential to significantly improve practice in engineering and science."
5. The new version of the xtmixed command in Stata 11 has many new features and capabilities, including estimation of error covariance structures and estimation of marginal means; click here for more details! Updates to the Stata code demonstrating these analyses are available on the respective pages for each chapter.
6. Stata 11 also makes it easier to work with categorical (factor) variables that are predictors in linear mixed models. For example, assuming that treatment and sex have been coded as numeric variables:
xi: xtmixed weight i.treatment i.sex
is now submitted as
xtmixed weight i.treatment i.sex
and reference categories can be specified as
xtmixed weight ib2.treatment i.sex
Further, full factorial interaction terms are specified as
xtmixed weight i.treatment##i.sex
The xi: modifier will still work for all of our code. Updates to the examples using factor variable coding are available on the respective chapter web pages.
7. Testing the significance of parameters when using lmer() in R: see the lmer() examples for the analysis chapters for a program based on MCMC sampling written by Doug Bates to assess the importance of parameters in lmer() models.
8. POWER ANALYSIS: Those interested in power analysis and sample size calculations for study designs that are multilevel and/or longitudinal in nature can check out this site for some very helpful free software and documentation (the Optimal Design software package) developed at the University of Michigan. Additional free simulation-based software and documentation for power analysis in multilevel designs can be found here.
9. An R package containing the data sets for the book, WWGbook, has been posted on CRAN. Please visit the R Project site for links to CRAN mirrors.
10. Users of web-aware Stata can import the data sets from this web page directly when working through the examples. For example, the Chapter 3 data can be imported as follows:
. insheet using http://www-personal.umich.edu/~bwest/rat_pup.dat
The more critical errata in the second printing are listed below. Readers can click here for a full list of all the errata in the first and second printings.
1. Table 7.2, showing a sample of the Dental Veneer data set, was omitted from Chapter 7 in printing. Interested readers can either download the electronic version of the data set, or email the authors to see Table 7.2 in print. The current version of Table 7.2 in the text (summarizing the models considered in Chapter 7) should actually be Table 7.3.
2. On page 282, in the first paragraph of Section 7.3.2, the reference to Figure 7.3 should actually be Table 7.3.
3. In Appendix A, the listed web sites for additional software options and a review of matrix algebra are no longer operational. The new web sites are as follows:
Multilevel software reviews: http://www.cmm.bristol.ac.uk/learning-training/multilevel-m-software/index.shtml
Matrix algebra tutorial: http://www.sosmath.com/matrix/matrix.html
Please direct any questions and/or comments to Brady West (firstname.lastname@example.org).
Last modified 4/16/13 by Brady T. West