Package comparison


For now, this page is only covering "basic" mixed modeling packages (although the line is admittedly somewhat blurry): see the list of packages on the main page for packages covering additive mixed models, Cox regression, etc.

In a nutshell

R packages

  • MCMCglmm. Uses MCMC instead of ML to fit the model. Bayesian priors can be included. Some complex variance structures (heterogeneous yes, AR1 no).
  • nlme One of the first widely-used mixed-models software for S-Plus. Ported from S-plus to R. Nested random effects easily modeled. Crossed random effects difficult. Stable (maintenance-mode). Multiple functions (lme for linear, nlme for nonlinear, gls for no random terms). Complex (and custom) variance structures possible. No GLMMs.
  • lme4. Under active development, especially for GLMMs. No complex variance structures. Uses sparse matrix algebra, handles crossed random effects well. Much faster than nlme.
  • glmmADMB interface to ADMB (see below); flexible, but slower than other R packages.


  • ADMB. Automatic Differentiation Model Builder. Mostly used in Forestry/Fish/Wildlife. Started out as a commercial product, but now open-source. Non-linear models handled. ADMB-RE, implements random effects in non-linear models via Laplace, importance sampling, GHQ in some cases.
  • SAS Commercial. Full-featured.
    • PROC MIXED implements modern LMMs; it is very widely used with lots of examples, but can be very slow.
    • PROC GLIMMIX added generalized models; it now incorporates Laplace approximation and adaptive Gaussian quadrature, but falls back to PQL for models with complex correlation structures. It also has other features such as simpler syntax to request predictable functions of random effects.
    • HPMIXED is "High Performance" to address the slow speed of MIXED, but low-featured.
    • PROC NLMIXED is for non-linear and linear models (i.e. models that cannot be fitted in PROC MIXED/GLIMMIX, such as those with unusual variance-covariance structures or variances that are functions of fixed or random predictors). It also fits GLMMs via Laplace/GHQ (but ''not'' crossed effects). Multiple denominator degrees of freedom methods (Kenward Roger, Satterthwaite, Containment).
  • ASREML Commercial: free licenses available for academic and developing-country use. Available as a standalone, R package (ASREML-R, or in Genstat. Uses sparse matrices and Average Information for speed. Widely used in plant and animal breeding. Numerous error structures supported. Splines well-integrated. Generalized models: PQL only, warnings in documentation. Wald-type tests. Constraints on parameters allowed.

(To add: npmlreg, regress (from Gabor Grothendieck))

Linear mixed models

package function estimation inference (tests) inference (confidence intervals) random effects (G structure) residuals (R structure) ~other
nlme lme ML, REML Wald (summary), likelihood ratio test (anova), sequential and marginal conditional F tests (anova) Wald intervals on fixed and RE parameters (intervals) multiple (nested) random effects;
diagonal, blocked structures (pdClasses);
crossed possible, but slow
spatial and temporal correlations (corStruct),
continuous and discrete heteroscedasticity (varStruct)
lme4 lmer1 ML, REML ML, REML F statistics (sans denominator df: summary), likelihood ratio test (anova),
post-hoc MCMC (mcmcsamp)2
post-hoc MCMC mcmcsamp nested and crossed RE, $$\Sigma$$ diagonal or block diagonal3 none
lme4a lmer4 as above as above as above + likelihood profiles, fast parametric bootstrapping bootMer as above none
lmm ecmeml.lmm ML(ECME algorithm)
lmm fastml.lmm ML(rapidly Converging algorithm)
asreml asreml Sparse matrix, Average Information REML Wald anova Standard errors Multiple crossed/nested/blocked/splines (Blocked) AR1xAR1, Matern, Factor Analytic, Heteroskedastic
statmod mixedModel25 REML
SAS PROC MIXED REML,ML, MIVQUE0, or Type1–Type3(method= option) wald t and F test multiple,complex (you can define the co-variance structure by type option in random statement)
Wald, LRT(COVTEST Statement) ,Type III test for fixed effects Wald (default),LRT Multiple,nested or crossed
SAS HPMIXED REML wald t, F test, type III test and chisq test wald intervals on fixed effect and random effect (CL option) multiple,complex
HLM HLM REML,FML Multilevel,nested and or crossed random effects
MLWiN ML,MCMC Multilevel,nested/crossed random effects
Stata? xtmixed//xtreg(random-intercept model) REML,ML Wald,LR test (with ML) Wald multilevel,nested/crossed,4 types of covariance structure
diagonal-blocked structures,Heteroskedastic random effects
Heteroskedastic (residuals()), _ independent/exchangeable/unstructured/banded/exponential


package function estimation inference (tests) inference (confidence intervals) families random effects other
lme4 glmer Laplace, AGHQ Wald (summary), LRT (anova),
simulation tests of simple random effects (RLRsim package)
Wald (by hand) Poisson, binomial multiple: nested, crossed
lme4a glmer Laplace, AGHQ Wald (summary), LRT (anova) Wald (by hand): eventually, likelihood profiles Poisson, binomial multiple: nested, crossed
glmmML glmmML Laplace, AGHQ Wald Poisson, binomial [logit, cloglog] single
glmmAK logpoissonRE MCMC Wald Poisson single (normal or G-spline)
MCMCglmm MCMCglmm MCMC 'Bayesian p-value' credible intervals (coda::HPDinterval) Gaussian, Poisson, categorical,
multinomial, exponential, geometric,
categorical, various zero-inflated/altered
multiple, complex
MASS glmmPQL PQL Wald (summary) Wald binomial, Poisson, Gamma, …
(see ?family)
correlation structures
(?nlme::corClasses) glmmNP GHQ/Expectation-maximization many (see in the gamlss.dist package) single ("two-level")
glmmBUGS glmmBUGS MCMC Poisson, Binomial spatial effects
hglm hglm or hglm2 hierarchical likelihood Wald (summary) see ?family
HGLMMM HGLMfit hierarchical likelihood
first order Laplace ?
Wald (summary)
Gamma(log, inverse)
complex,multiple profile(LapFix=TRUE)
bernor bnlogl Monte Carlo sampling Bernoulli (logit link)
glmmADMB glmm.admb Laplace Wald (summary), LRT (anova), MCMC Poisson, negative binomial, Bernoulli (+ zero-inflation) single (multiple under development) profiles
repeated glmm GHQ Wald (summary) Wald (by hand) see ?family single
R-INLA inla nested Laplace Poisson,Binomial [logit,probit,cloglog]
Negative Binomial …
Spatial and temporal correlation models
Wald, LRT(COVTEST Statement)
Type III test for fixed effects
Wald (default),LRT Binomial,Poisson,Gamma(check the Dist option) multiple,nested and crossed profile or non-profile
SAS PROC NLMIXED PROC NLMIXED GHQ, First-order method…(Check "method=" option)
Laplace (QPOINTS=1 option)
Wald, LRT Wald Normal,Binomial,Poisson,Binary,Gamma
Negative Binomial, General (custom defined), zero-inflated
number of random effects < 5
limited to only 2 levels

NLMMs and other extensions

package function estimation inference (tests) inference (confidence intervals) families random effects other
nlme nlme ML OR REML Wald t (summary)
Wald F (anova)
use intervals() no specific family required ? nested
lme4 nlmer Laplace or PQL
(method option)
wald (summary) wald (hand?) no family required nested or crossed


lme (nlme) glmmPQL (MASS) [g]lmer (lme4) [g]lmer (lme4a) MCMCglmm glmm.admb
summary estimate, std err, t, df, p estimate, std err, t, df, p lmer: estimate, std err, t
glmer: est, std err, Z, p (Wald/asymptotic)
like lme4 post.mean, CI, eff.sample estimate,std.error,z values, p
coef all coefficients
(predicted values for each group)
fixef fixed effect parameters ($\beta$)
ranef random effect estimates ($u$)
logLik (marginal) log-likelihood
AIC marginal AIC
confint confidence intervals
intervals confidence intervals
plot diagnostic plots (not diagnostic plots)
predict predicted values,
allowing new data
simulate simulated values
from fitted model
(for lmer)
fitted fitted values
update update model
VarCorr variance-covariance matrices
of random effects
coefplot plot of coefficients
and confidence/credible intervals
anova (no p-values) (compare two models)
drop1 (no LRT) (no p-values)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License