CRAN Task View: Mixed Models

Maintainer:Ben Bolker
Contact:bolker at

Mixed models are a broad class of statistical models used to analyze data where observations can be assigned to discrete groups, and where the parameters describing the differences are treated as random variables . They are also variously described as multilevel , hierarchical , or repeated measures . They can be fitted in either frequentist or Bayesian frameworks.

The R-SIG-mixed-models mailing list (also available via the Gmane web aggregator ) is an active forum for discussion of mixed-model-related questions, course announcements, etc.. Stack Overflow and Stack Exchange also host relevant discussions.

Fitting linear mixed models

The most commonly used packages/functions for fitting linear mixed models (i.e., models with Normal residuals, predictors that are linear functions of the input variables, and Normal distributions of the random effects within grouping variables) are nlme:: lme and lme4:: lmer. MCMCglmm fits linear mixed models in a Bayesian MCMC framework.

Fitting generalized linear mixed models

The most commonly used packages/functions for fitting generalized linear mixed models (i.e., models with conditional distributions in the exponential family, e.g. Bernoulli/binomial/Poisson/Gamma and distributions of the conditional modes that are Normal on the scale of the linear predictor) are MASS:: glmmPQL and lme4:: glmer. MCMCglmm fits generalized linear mixed models in a Bayesian MCMC framework.

Other, less commonly used, packages for fitting GLMMs include glmmML; glmmADMB (not on CRAN, and possibly out of date on R-forge); repeated; glmm; hglm.

Fitting nonlinear mixed models

nlme ::nlme, lme4 ::nlmer.

Generalized estimating equations

geesmv; geepack

Model diagnostics and summaries

(See also "Inference")

Model diagnostics and summary statistics

influence.ME, aods3, cAIC4, HLMdiag, lmmfit, iccbeta

Model presentation and prediction

effects, rockchalk, arm (coefficient plots),

Convenience wrappers

These functions don't necessarily add new functionality, but provide convenient frameworks for (typically) less experienced users to fit and interpret mixed models. ez, mixlm afex, RVAideMemoire, ZeligMultilevel


Spatial/temporal models

Geostatistical models (i.e. explicitly incorporating a model for continuous decay of correlation with distance, either in residuals or on random effects/latent variables); models based on a priori weights (e.g. simultaneous, conditional autoregression models) geoRglm; GLMMarp; INLA ; nlme with corStruct; spaMM; sphet; spacom georob; geoBayes

Differential equation models

nlmeODE; insideRODE

Phylogenetic/pedigree-based models

(See also "Phylogenetics task view"; genetics task view?) pedigreemm; correlation structures from ape; MCMCglmm

Generalized additive models, splines, and quantile regression

gamm 4, mgcv ::gamm, lqmm, lmms, lmeSplines; assist

Multinomial and ordinal models

polytomous, ordinal

Bioinformatic applications

(Bioconductor links?) MCMC.qpcr, JAGUAR; GxM; GWAF; dlmap; CpGassoc

Ecological and environmental applications

(See also "Environmental task view") IPMpack; HydroME; dsm; climwin; cati; carcass; blmeco; BBRecapture; secr




afex, ez, RLRsim, lmerTest, pbkrtest, cAIC4

Power analysis

longpower, clusterPower

CRAN packages:

Related links: