Generalized linear mixed model explained
In statistics, a generalized linear mixed model (GLMM) is an extension to the generalized linear model (GLM) in which the linear predictor contains random effects in addition to the usual fixed effects. They also inherit from generalized linear models the idea of extending linear mixed models to non-normal data.
Generalized linear mixed models provide a broad range of models for the analysis of grouped data, since the differences between groups can be modelled as a random effect. These models are useful in the analysis of many kinds of data, including longitudinal data.
Model
Generalized linear mixed models are generally defined such that, conditioned on the random effects
, the dependent variable
is distributed according to the
exponential familywith its expectationrelated to the linear predictor
via a link function
:
.Here
and
are the fixed effects design matrix, and fixed effects respectively;
and
are the random effects design matrix and random effects respectively. To understand this very brief definition you will first need to understand the definition of a
generalized linear model and of a
mixed model.
Generalized linear mixed models are a special cases of hierarchical generalized linear models in which the random effects are normally distributed.
The complete likelihood[1]
p(y)=\intp(y\vertu)p(u)du
has no general closed form, and integrating over the random effects is usually extremely computationally intensive. In addition to numerically approximating this integral(e.g. via
Gauss–Hermite quadrature), methods motivated by Laplace approximation have been proposed.
[2] For example, the penalized quasi-likelihood method, which essentially involves repeatedly fitting (i.e. doubly iterative) a weighted normal mixed model with a working variate,
[3] is implemented by various commercial and open source statistical programs.
Fitting a model
Fitting generalized linear mixed models via maximum likelihood (as via the Akaike information criterion (AIC)) involves integrating over the random effects. In general, those integrals cannot be expressed in analytical form. Various approximate methods have been developed, but none has good properties for all possible models and data sets (e.g. ungrouped binary data are particularly problematic). For this reason, methods involving numerical quadrature or Markov chain Monte Carlo have increased in use, as increasing computing power and advances in methods have made them more practical.
The Akaike information criterion is a common criterion for model selection. Estimates of the Akaike information criterion for generalized linear mixed models based on certain exponential family distributions have recently been obtained.
Software
- Several contributed packages in R provide functionality for generalized linear mixed models, including
lme4
[4] and glmm
.[5]
- Generalized linear mixed models can be fitted using SAS and SPSS[6]
- MATLAB also provides a
fitglme
function to fit generalized linear mixed model models.
- The Python
Statsmodels
package supports binomial and poisson implementations.[7]
- The Julia package
MixedModels.jl
provides a function called GeneralizedLinearMixedModel
that fits a generalized linear mixed model to provided data.[8]
- DHARMa: residual diagnostics for hierarchical (multi-level/mixed) regression models (utk.edu)
See also
Notes and References
- Book: Pawitan . Yudi . In All Likelihood: Statistical Modelling and Inference Using Likelihood . OUP Oxford . 978-0199671229 . 459 . Paperbackition.
- Breslow . N. E. . Clayton . D. G. . Approximate Inference in Generalized Linear Mixed Models . Journal of the American Statistical Association . 20 December 2012 . 88 . 421 . 9–25 . 10.1080/01621459.1993.10594284.
- Wolfinger . Russ . O'connell . Michael . Generalized linear mixed models a pseudo-likelihood approach . Journal of Statistical Computation and Simulation . December 1993 . 48 . 3-4 . 233–243 . 10.1080/00949659308811554.
- Web site: lme4 package - RDocumentation . www.rdocumentation.org . 15 September 2022.
- Web site: glmm package - RDocumentation . www.rdocumentation.org . 15 September 2022.
- Web site: IBM Knowledge Center. www.ibm.com. 6 December 2017.
- Web site: Statsmodels Documentation. www.statsmodels.org. 17 March 2021.
- Web site: Details of the parameter estimation · MixedModels . juliastats.org . 16 June 2021.