Field Guide to the R Mixed Model Wilderness
Preface
Running mixed models in R is no easy task. There are dozens of packages supporting these aims, each with varying functionality, syntax, and conventions. The linear mixed model ecosystem in R consists of over 80 libraries that either construct and solve mixed model equations or helper packages the process the results from mixed model analysis. These libraries provide a patchwork of overlapping and unique functionality regarding the fundamental structure of mixed models: allowable distributions, nested and crossed random effects, heterogeneous error structures and other facets. No single R library has all possible functionality enabled for fitting mixed models.
This patchwork of packages makes it very challenging for statisticians to conduct mixed model analysis and to teach others how to run mixed models in R. We have written this guide to provide recipes for handling common analytical scenarios encountered in agricultural and life sciences that require mixed models. As a field guide, it is intended to be succinct, and to help researchers meet their analytic goals.
Book Organization
Chapter | Topics |
---|---|
1 | required data and software |
2 | brief introduction to mixed models |
3 | warnings and guidance when beginning an analysis |
4 | outline of an analysis |
5-11 | examples of how to analyze specific experimental designs |
12 | examples analyses for repeated measures |
13 | estimating marginal means and conducting contrasts |
14 | special issues related to variance estimation |
15 | troubleshooting errors |
16 | resources for further study |
What This Does Not Cover
Generalized linear models (where the dependent variable follows a non-Gaussian distribution, and a link function is used to model how the expected value of dependent variable responds to a linear predictor). We do address cases of unequal variance in Chapter 14, but if another distribution and/or a link function is required for the model, that is not addressed in this guide.
Basic principles of experimental design. We assume you know this, but if you do not, please check out the Grammar of Experimental Design for guidance on these topics.
Instructions in using R. We assume familiarity with R. If you need help in learning R, there are numerous guides, including our introductory R course.
Non-linear models. As a reminder, the “linear” in linear models refer to the parameters being estimated, not the structure of the independent variables.
This is a work-in-progress and will be updated over time.
In general, the content from this website may not be copied or reproduced without attribution. However, the example code and required data sets to run the code are MIT licensed. These can be accessed on GitHub.