Linear Mixed-Effects Models using 'Eigen' and S4
Overview
Fit linear and generalized linear mixed-effects models. The models and their components are represented using S4 classes and methods. The core computational algorithms are implemented using the 'Eigen' C++ library for numerical linear algebra and 'RcppEigen' "glue".
BUG FIXES
- fixed
compDev=FALSE(R-level PIRLS, used for debugging): theuOnlyflag was inverted relative to the C++ implementation.getME(*, "devfun")for GLMMs now correctly propagatescompDev(andtolPwrss) from the fitted model to the reconstructed deviance function environment. profile()no longer emits spurious "unused control arguments ignored" warnings when profiling with anoptimizerdifferent from the one used for the original fit (GH #913)lmListwould fail when some groups have rank-deficient model matrices; in particular, it used to report the incorrect degrees of freedom (GH #377)- likelihood profiling no longer gets stuck when a deviance value less than the original fitted deviance (but greater than
mindev-devtol) is encountered - fixed bug where
glmerwith structured covariance models would return incorrect fixed effect coefficients (zero values, or wrong number of values) (GH #962). refit()on a GLMM with multiple random effects no longer gives a spurious "longer object length is not a multiple of shorter object length" warning (GH #975)- fixed the case where a Gamma GLMM performs poorly for data with small shape parameters by changing the starting parameter values for Gamma families (GH #290)
- fixed parameter-counting bug for structured covariance matrices (internal
npar.merModfunction, results exposed inlogLik,anova,df.residual...) (GH #943, Henrik Singmann) - fixed ordering bug for models with multiple structured covariances of different types (
mkReTrmssorts random effects in decreasing order of number of grouping variable levels, this ordering was not applied consistently) (GH #945, Henrik Singmann) - fixed the case where
lme4::lmListprints grouping variable asNULL(GH #958) - fixed some edge cases where
splomwould fail due to bad spline fits in profiles: these cases are now dropped, with a warning (Michael Chirico, GH #979)
Show all changes in 2.0-6Hide the rest of the changes in 2.0-6
simulate()withre.form=NULLnow works when a predictor is a one-column matrix (e.g. fromscale()) used insidepoly();poly()with pre-specified coefficients (stored inpredvars) rejected matrix input even though it accepted it during initial model fitting (GH #948)allFit()could fail or emit spurious warnings when refitting a model whose originalcontrolargument specified a non-defaultoptimizeroroptCtrl(GH #985)- fixed a heap-use-after-free bug in
merPredDconstruction. This caused intermittent (GC-timing-dependent) "Downdated VtV is not positive definite" errors and other spurious failures inglmer()fits, most visible under memory pressure (e.g. duringR CMD check) or under AddressSanitizer. - fixed a second, unrelated heap-use-after-free with the same symptoms, triggered by an interaction between R's ALTREP-wrapped vectors and Rcpp's data-pointer accessors (exposed by the Rcpp 1.1.2 upgrade; invaluable help from Ivan Krylov).
NEW FEATURES
- a new vignette (
vignette("glmer", package = "lme4")) describes the details ofglmerimplementation - parallelization via the
futureframework is available by setting argumentparallelto"future".
USER-VISIBLE CHANGES
getData()now gives more informative error messages when the original data cannot be retrieved: if the object is not found, the message names the object and suggests re-loading it; if an object of the wrong type is found (e.g. the namedataresolving toutils::data), the message reports the type and location of what was found and notes the likely masking (GH #808)- the Gauss-Hermite quadrature (GH) nodes and weights used when
nAGQ > 1are now symmetrized (nodes averaged with their negatives in reverse order; weights averaged in forward and reverse order), matching the convention in MixedModels.jl (GH #968). This will produce small changes to numerical results for anyglmer()fit withnAGQ > 1. - exported covariance methods documented in
help("Covariance-class")(getPar,getTheta, etc.) - the dependency on
rlanghas been removed; the once-per-session deprecation warnings for formula-processing functions that moved toreformulasare now implemented internally. - performing *de novo* simulation (i.e., calling
simulate()with a one-sided formula rather than a fitted model or a two-sided formula) without specifyingfamilyornewparamsnow gives a more informative error. This only affects the one-sided-formula dispatch path that is internal tolme4; the two-sidedsimulate.formula/simulate.formula_lhsdispatch mechanism shared withergm(see GH #566) is unchanged, soergm's behavior should not be affected. - *de novo* simulation (see previous item) for a family with an estimated scale parameter (e.g. Gaussian, Gamma) without specifying
sigmaas part ofnewparamsnow gives an error (it previously gave a bogus result based on the residual dispersion from amerModobject with defaultbetaandthetavalues)
From inst/NEWS.Rd in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-23
- ERROR10 OK, 3 NOTE, 1 ERROR2026-03-12
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 92 (1 internal)includes a package overview page
- Examples that run
- 99%67 run in a plain check (6 of them under a condition) · 1 hold no code
- Exported functions with examples
- 67%
- Documented parameters
- 86%
- Return-value docs
- 75%
- Help pages citing references
- 23% with a bibliography file
Downloads
Repository
- PRs merged (all time)
- 84%
- Median days to close, 50 most recently updated closed issues
- 46
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
6 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/lme4/lme4 on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2025-05-06
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2026-01-03Pull request: opened by its own accountCommits: 18 by its own account
- Claude Codefirst seen 2026-05-23Named in .Rbuildignore: CLAUDE.mdCommits: at least 125 crediting it in the message
- Claude CodePull requests: 1 from outside contributors, first on 2026-10-07, 1 from forks
- Claude Sonnet 558 commits · Jul to Aug 2026
- Claude Sonnet 4.637 commits · May to Jun 2026
- Claude Opus 5.55 commits · Sep 2026
Some of these counts are a minimum, because the search stopped before the oldest commits.
Dependencies
Installing lme4 adds 7 packages (5 with compiled code, 7.2 MB of source tarballs). Heaviest: nloptr 2.1 MB, Rcpp 1.8 MB, RcppEigen 1.7 MB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 300 more dependents and 261 packages that suggest it on CRAN ↗
Code & Tests
Datasets
People & History
Show 4 more contributorsHide 4 contributors
Previously maintained by Doug and Martin (0.999375-36 to 0.999375-37) and Douglas Bates (0.2-1 to 0.999375-35).
Pick two releases to compare their code metrics.
- 2.0-6Latest
- RR 4.6.0 released · 2026-04-24
- 2.0-12026-03-05 · diff ↗ ·
removed 1 export
isSingularadded 6 exports
reOnly, getDoublevertDefault, isNewMerMod, forceNewMerMod, anyStructured, getReCovs - 1.1-38
- RR 4.5.0 released · 2025-04-11
- 1.1-372025-03-26 · diff ↗
- 1.1-362025-01-11 · diff ↗
- 1.1-35.52024-07-03 · diff ↗
- 1.1-35.42024-06-19 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.1-35.32024-04-16 · diff ↗
- 1.1-35.22024-03-28 · diff ↗
- 1.1-35.12023-11-05 · diff ↗
- 1.1-35
- 1.1-342023-07-05 · diff ↗
- 1.1-332023-04-25 · diff ↗
Show 154 earlier eventsHide 154 earlier events
- RR 4.3.0 released · 2023-04-21
- 1.1-322023-03-14 · diff ↗
- 1.1-312022-11-01 · diff ↗
- 1.1-302022-07-08 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 1.1-292022-04-07 · diff ↗
- 1.1-28
- 1.1-27.12021-06-22 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 1.1-272021-05-15 · diff ↗
- 1.1-262020-12-01 · diff ↗
- 1.1-25
- RR 4.0.0 released · 2020-04-24
- 1.1-23
- RR 3.6.0 released · 2019-04-26
- 1.1-212019-03-05 · diff ↗
- 1.1-202019-02-04 · diff ↗
- 1.1-19
- 1.1-18-1
- RR 3.5.0 released · 2018-04-23
- 1.1-172018-04-03 · diff ↗
- 1.1-162018-03-28 · diff ↗
- 1.1-15
- 1.1-142017-09-27 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 1.1-13
- RR 3.3.0 released · 2016-05-03
- 1.1-122016-04-16 · diff ↗
- 1.1-112016-02-12 · diff ↗
- 1.1-102015-10-06 · diff ↗ ·
added 11 exports
.prt.VC, .prt.aictab, .prt.call, .prt.family, .prt.grps, .prt.methTit, .prt.resids, .prt.warn, formatVC, llikAIC, methTitle - 1.1-9
- 1.1-82015-06-22 · diff ↗ ·
added 14 exports
factorize, glmerLaplaceHandle, GQN, mlist2vec, vec2mlist, vec2STlist, sdcor2cov, cov2sdcor, Vv_to_Cv, Sv_to_Cv, Cv_to_Vv, Cv_to_Sv, mkParsTemplate, mkDataTemplate - RR 3.2.0 released · 2015-04-16
- 1.1-7
- 1.1-62014-04-13 · diff ↗
- RR 3.1.0 released · 2014-04-10
- 1.1-52014-03-14 · diff ↗ ·
removed 2 exports
fortify, fortify.lmerModadded 6 exports
dummy, expandDoubleVerts, .makeCC, ngrps, .simulateFun, fortify.merMod - 1.0-62014-02-02 · diff ↗
- 1.0-5
- 1.0-42013-09-21 · diff ↗ ·
removed 6 exports
AIC, BIC, logLik, HPDinterval, lmer2, mcmcsampadded 41 exports
bootMer, devcomp, findbars, fixef, fortify, getL, GHrule, glFormula, glmer.nb, glmerControl, glmFamily, glmResp, golden, GQdk, isNested, lFormula, lmerControl, lmerResp, lmResp, merPredD, mkGlmerDevfun, mkLmerDevfun, mkMerMod, mkRespMod, mkReTrms, mkVarCorr, Nelder_Mead, NelderMead, nlformula, nlmerControl and 11 more - 0.999999-22013-04-15 · diff ↗
- RR 3.0.0 released · 2013-04-03
- 0.999999-0
- RR 2.15.0 released · 2012-03-30
- RR 2.14.0 released · 2011-10-31
- 0.999375-42
- 0.999375-412011-08-09 · diff ↗
- 0.999375-402011-07-23 · diff ↗
- RR 2.13.0 released · 2011-04-13
- 0.999375-392011-03-08 · diff ↗
- 0.999375-382011-02-17 · diff ↗
- 0.999375-372010-11-10 · diff ↗
- 0.999375-362010-10-23 · diff ↗
- RR 2.12.0 released · 2010-10-15
- 0.999375-352010-08-19 · diff ↗
- 0.999375-34
- RR 2.11.0 released · 2010-04-22
- 0.999375-332010-04-02 · diff ↗
- RR 2.10.0 released · 2009-10-26
- 0.999375-322009-10-20 · diff ↗
- 0.999375-312009-05-24 · diff ↗
- 0.999375-302009-05-12 · diff ↗
- RR 2.9.0 released · 2009-04-17
- 0.999375-282008-12-14 · diff ↗
- RR 2.8.0 released · 2008-10-20
- 0.999375-272008-09-28 · diff ↗
- 0.999375-262008-08-26 · diff ↗
- 0.999375-252008-08-14 · diff ↗
- 0.999375-242008-08-06 · diff ↗
- 0.999375-232008-07-29 · diff ↗
- 0.999375-222008-07-12 · diff ↗
- 0.999375-212008-07-11 · diff ↗
- 0.999375-202008-06-26 · diff ↗
- 0.999375-192008-06-26 · diff ↗
- 0.999375-182008-06-25 · diff ↗
- 0.999375-172008-06-23 · diff ↗
- 0.999375-162008-06-23 · diff ↗ ·
removed 4 exports
gsummary, hatTrace, pedigree, pooledSDadded 4 exports
glmer, HPDinterval, refit, VarCorr - RR 2.7.0 released · 2008-04-22
- 0.99875-92007-10-14 · diff ↗
- RR 2.6.0 released · 2007-10-03
- 0.99875-82007-09-26 · diff ↗
- 0.99875-72007-08-04 · diff ↗
- 0.99875-62007-07-10 · diff ↗
- 0.99875-52007-07-10 · diff ↗
- 0.99875-42007-07-07 · diff ↗
- 0.99875-22007-06-21 · diff ↗
- 0.99875-1
- 0.99875-02007-05-15 · diff ↗
- RR 2.5.0 released · 2007-04-24
- 0.9975-132007-02-11 · diff ↗
- 0.9975-122007-01-31 · diff ↗
- 0.9975-11
- 0.9975-102006-12-02 · diff ↗
- 0.9975-92006-11-15 · diff ↗
- 0.9975-82006-10-25 · diff ↗
- 0.9975-72006-10-19 · diff ↗
- 0.9975-62006-10-17 · diff ↗
- 0.9975-52006-10-16 · diff ↗
- 0.9975-42006-10-15 · diff ↗
- 0.9975-32006-10-11 · diff ↗
- 0.9975-12006-10-06 · diff ↗
- 0.9975-0
- RR 2.4.0 released · 2006-10-03
- RR 2.3.0 released · 2006-04-24
- 0.995-22006-01-20 · diff ↗
- 0.995-12006-01-17 · diff ↗
- RR 2.2.0 released · 2005-10-06
- 0.98-12005-07-28 · diff ↗ ·
removed 7 exports
convertFromS3groupedData, getCovariateFormula, getGroups, getGroupsFormula, getResponse, getResponseFormula, groupedData - 0.96-1
- 0.95-102005-05-31 · diff ↗
- 0.95-92005-05-30 · diff ↗
- 0.95-82005-05-20 · diff ↗
- 0.95-72005-05-18 · diff ↗
- 0.95-6
- RR 2.1.0 released · 2005-04-18
- 0.95-52005-04-12 · diff ↗
- 0.95-42005-04-07 · diff ↗
- 0.95-32005-04-06 · diff ↗
- 0.95-1
- 0.9-22005-02-28 · diff ↗
- 0.9-1
- 0.8-32005-02-21 · diff ↗
- 0.8-22005-01-25 · diff ↗
- 0.8-12005-01-24 · diff ↗
- 0.6-12
- 0.6-11
- 0.6-10
- 0.6-9
- RR 2.0.0 released · 2004-10-04
- 0.6-72004-09-15 · diff ↗
- 0.6-62004-09-14 · diff ↗
- 0.6-52004-09-06 · diff ↗
- 0.6-42004-07-10 · diff ↗
- 0.6-3
- 0.6-22004-06-08 · diff ↗
- 0.6-12004-06-02 · diff ↗ ·
removed 14 exports
EMupdate<-, LMEgradient, coef<-, corMatrix, glmmLa2LogLikComp, glmmLa2RespWt, isInitialized, pdDiag, pdFactor, pdIdent, pdLogChol, pdMatrix, pdNatural, pdgradient - 0.5-2
- RR 1.9.0 released · 2004-04-12
- 0.4-72004-01-28 · diff ↗ ·
added 27 exports
EMupdate<-, GLMM, LMEgradient, Names, Names<-, VarCorr, coef<-, corMatrix, getCovariateFormula, getGroups, getGroupsFormula, getResponse, getResponseFormula, glmmLa2LogLikComp, glmmLa2RespWt, isInitialized, lmList, lme, lmeControl, pdDiag, pdFactor, pdIdent, pdLogChol, pdMatrix, pdNatural, pdgradient, pooledSD - 0.4-42003-10-15 · diff ↗
- RR 1.8.0 released · 2003-10-08
- 0.4-32003-10-01 · diff ↗
- 0.3-72003-09-02 · diff ↗
- 0.3-62003-08-28 · diff ↗
- 0.3-52003-08-12 · diff ↗
- 0.3-42003-08-12 · diff ↗
- 0.3-32003-07-23 · diff ↗
- 0.3-22003-07-21 · diff ↗
- 0.3-12003-07-18 · diff ↗
- 0.2-42003-07-15 · diff ↗
- 0.2-32003-07-04 · diff ↗
- 0.2-22003-07-01 · diff ↗
- 0.2-12003-06-25
- RR 1.7.0 released · 2003-04-16
Package metadata
- First published
- 2003-06-25
- Total releases
- 137 / 23 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 3.6
- Bundled data
- 163 KB / 18 files
- Download size
- 4.1 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("lme4")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.18637/jss.v067.i01.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.