Skip to content

Linear Mixed-Effects Models using 'Eigen' and S4

348packages dependsuggested by 261
7.9Mdownloads / year
71.8%test coverage
13/13flavors OK

Overview

About

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".

Changes in 2.0-6

BUG FIXES

  • fixed compDev=FALSE (R-level PIRLS, used for debugging): the uOnly flag was inverted relative to the C++ implementation. getME(*, "devfun") for GLMMs now correctly propagates compDev (and tolPwrss) from the fitted model to the reconstructed deviance function environment.
  • profile() no longer emits spurious "unused control arguments ignored" warnings when profiling with an optimizer different from the one used for the original fit (GH #913)
  • lmList would 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 glmer with 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.merMod function, results exposed in logLik, anova, df.residual ...) (GH #943, Henrik Singmann)
  • fixed ordering bug for models with multiple structured covariances of different types (mkReTrms sorts 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::lmList prints grouping variable as NULL (GH #958)
  • fixed some edge cases where splom would 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() with re.form=NULL now works when a predictor is a one-column matrix (e.g. from scale()) used inside poly(); poly() with pre-specified coefficients (stored in predvars) 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 original control argument specified a non-default optimizer or optCtrl (GH #985)
  • fixed a heap-use-after-free bug in merPredD construction. This caused intermittent (GC-timing-dependent) "Downdated VtV is not positive definite" errors and other spurious failures in glmer() fits, most visible under memory pressure (e.g. during R 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 of glmer implementation
  • parallelization via the future framework is available by setting argument parallel to "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 name data resolving to utils::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 > 1 are 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 any glmer() fit with nAGQ > 1.
  • exported covariance methods documented in help("Covariance-class") (getPar, getTheta, etc.)
  • the dependency on rlang has been removed; the once-per-session deprecation warnings for formula-processing functions that moved to reformulas are 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 specifying family or newparams now gives a more informative error. This only affects the one-sided-formula dispatch path that is internal to lme4; the two-sided simulate.formula/simulate.formula_lhs dispatch mechanism shared with ergm (see GH #566) is unchanged, so ergm'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 sigma as part of newparams now gives an error (it previously gave a bogus result based on the residual dispersion from a merMod object with default beta and theta values)

From inst/NEWS.Rd in the release

Install

Health

CRAN checks
13OK
Slowest check: 15.1 min · r-oldrel-windows-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 2.0-6
README· In the repository, left out of the releaseVignettesYes · 7 · dynamicNEWSYes · mentions 2.0-6Citation fileYes · cites a publication
Cites a JSS article
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

7.9M
CRAN downloads in the past year
Rank #82 · ~21.7K/day · ~661.3K/mo
Daily download trend is not available in this view yet.
938.2K30 days
2.3M90 days
7.9M1 year
Compare downloads with other packages →
Also on89.5K r2u109 autocran241.5K conda_forge3.4K c2d4u

Repository

lme4/lme4 ↗Organization: lme4
699Stars
165Forks
189Open issues
6Open PRs
2Releases
3,973Commits
57Commit identities
3,973 commits · Last activity 2026-10-21 · +0.6% stars, 30d · Default branch at 2.1-0, ahead of CRAN 2.0-6 (checked 2026-10-18)
Responsiveness
How these are sampled
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

2025-10-13 · 6562026-10-19 · 699
PracticesBeta

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.

Continuous integration (3)
GitHub ActionsR CMD check workflowTravis CI (config file)

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (2)
pkgdown

GitHub Pages site last deployed 2025-05-06

Reproducibility and dev environment (1)
Makefile
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen 2026-01-03
    Pull request: opened by its own account
    Commits: 18 by its own account
  • Claude Codefirst seen 2026-05-23
    Named in .Rbuildignore: CLAUDE.md
    Commits: at least 125 crediting it in the message
From outside contributors
  • Claude Code
    Pull requests: 1 from outside contributors, first on 2026-10-07, 1 from forks
Models named in its commits
  • 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.

Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
30 external dependencies (excludes base and recommended)

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.

Depends (4)
R >= 3.6Matrixmethodsstats
Imports (13)
MASSRdpackbootgraphicsgridlatticeminqa (>= 1.1.15)nlmenloptrparallelreformulassplinesutils
LinkingTo (3)
Enhances (0)
none

Datasets

People & History

People (18)
Maintainer since 0.999999-2 (2013), Author · added in 0.999375-38
Author · added in 1.1-35.3
Author · added in 1.1-38
Author · added in 0.999375-16
Author · added in 1.0-4
Contributor · added in 1.1-25
Contributor · added in 2.0-6
Contributor · added in 1.1-37
Contributor · added in 1.1-5
Contributor · added in 0.999375-16
Contributor · added in 1.1-19
Contributor · added in 1.1-11
Contributor · added in 1.1-8
Show 4 more contributorsHide 4 contributors
Contributor, Copyright holder · added in 1.1-25
shared copyright on simulate.formula
Contributor · added in 1.1-15
Contributor · added in 1.1-5
Contributor · added in 1.1-35

Previously maintained by Doug and Martin (0.999375-36 to 0.999375-37) and Douglas Bates (0.2-1 to 0.999375-35).

Listed in earlier versions (2)
no longer listed · 0.2-1 to 0.5-2
no longer listed · 0.4-7 to 0.99875-2
Releases (137)

Pick two releases to compare their code metrics.

Show 154 earlier eventsHide 154 earlier events
  • R
    R 4.3.0 released · 2023-04-21
  • 1.1-32
    record
    2023-03-14 · diff ↗
  • 1.1-31
    record
    2022-11-01 · diff ↗
  • 1.1-30
    record
    2022-07-08 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 1.1-29
    record
    2022-04-07 · diff ↗
  • 1.1-28
    record
    2022-02-05 · diff ↗ ·
    added 1 export
    mkNewReTrms
  • 1.1-27.1
    record
    2021-06-22 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 1.1-27
    record
    2021-05-15 · diff ↗
  • 1.1-26
    record
    2020-12-01 · diff ↗
  • 1.1-25
    record
    2020-10-23 · diff ↗ ·
    added 2 exports
    lme4_testlevel, simulate.formula
  • R
    R 4.0.0 released · 2020-04-24
  • 1.1-23
    record
    2020-04-07 · diff ↗ ·
    added 2 exports
    nlminbwrap, getData
  • R
    R 3.6.0 released · 2019-04-26
  • 1.1-21
    record
    2019-03-05 · diff ↗
  • 1.1-20
    record
    2019-02-04 · diff ↗
  • 1.1-19
    record
    2018-11-10 · diff ↗ ·
    added 3 exports
    allFit, isSingular, rePCA
  • 1.1-18-1
    record
    2018-08-18 · diff ↗ ·
    added 1 export
    devfun2
  • R
    R 3.5.0 released · 2018-04-23
  • 1.1-17
    record
    2018-04-03 · diff ↗
  • 1.1-16
    record
    2018-03-28 · diff ↗
  • 1.1-15
    record
    2017-12-21 · diff ↗ ·
    added 1 export
    dotplot.ranef.mer
  • 1.1-14
    record
    2017-09-27 · diff ↗
  • R
    R 3.4.0 released · 2017-04-21
  • 1.1-13
    record
    2017-04-19 · diff ↗ ·
    added 1 export
    checkConv
  • R
    R 3.3.0 released · 2016-05-03
  • 1.1-12
    record
    2016-04-16 · diff ↗
  • 1.1-11
    record
    2016-02-12 · diff ↗
  • 1.1-10
    record
    2015-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
    record
    2015-08-20 · diff ↗ ·
    added 1 export
    negative.binomial
  • 1.1-8
    record
    2015-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
  • R
    R 3.2.0 released · 2015-04-16
  • 1.1-7
    record
    2014-07-19 · diff ↗ ·
    added 3 exports
    logProf, nloptwrap, REMLcrit
  • 1.1-6
    record
    2014-04-13 · diff ↗
  • R
    R 3.1.0 released · 2014-04-10
  • 1.1-5
    record
    2014-03-14 · diff ↗ ·
    removed 2 exports
    fortify, fortify.lmerMod
    added 6 exports
    dummy, expandDoubleVerts, .makeCC, ngrps, .simulateFun, fortify.merMod
  • 1.0-6
    record
    2014-02-02 · diff ↗
  • 1.0-5
    record
    2013-10-25 · diff ↗ ·
    added 2 exports
    confint.merMod, vcov.merMod
  • 1.0-4
    record
    2013-09-21 · diff ↗ ·
    removed 6 exports
    AIC, BIC, logLik, HPDinterval, lmer2, mcmcsamp
    added 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-2
    record
    2013-04-15 · diff ↗
  • R
    R 3.0.0 released · 2013-04-03
  • 0.999999-0
    record
    2012-06-23 · diff ↗ ·
    added 5 exports
    isLMM, isGLMM, isNLMM, isREML, sigma
  • R
    R 2.15.0 released · 2012-03-30
  • R
    R 2.14.0 released · 2011-10-31
  • 0.999375-42
    record
    2011-10-04 · diff ↗ ·
    added 1 export
    getME
  • 0.999375-41
    record
    2011-08-09 · diff ↗
  • 0.999375-40
    record
    2011-07-23 · diff ↗
  • R
    R 2.13.0 released · 2011-04-13
  • 0.999375-39
    record
    2011-03-08 · diff ↗
  • 0.999375-38
    record
    2011-02-17 · diff ↗
  • 0.999375-37
    record
    2010-11-10 · diff ↗
  • 0.999375-36
    record
    2010-10-23 · diff ↗
  • R
    R 2.12.0 released · 2010-10-15
  • 0.999375-35
    record
    2010-08-19 · diff ↗
  • 0.999375-34
    record
    2010-06-29 · diff ↗ ·
    added 3 exports
    AIC, BIC, logLik
  • R
    R 2.11.0 released · 2010-04-22
  • 0.999375-33
    record
    2010-04-02 · diff ↗
  • R
    R 2.10.0 released · 2009-10-26
  • 0.999375-32
    record
    2009-10-20 · diff ↗
  • 0.999375-31
    record
    2009-05-24 · diff ↗
  • 0.999375-30
    record
    2009-05-12 · diff ↗
  • R
    R 2.9.0 released · 2009-04-17
  • 0.999375-28
    record
    2008-12-14 · diff ↗
  • R
    R 2.8.0 released · 2008-10-20
  • 0.999375-27
    record
    2008-09-28 · diff ↗
  • 0.999375-26
    record
    2008-08-26 · diff ↗
  • 0.999375-25
    record
    2008-08-14 · diff ↗
  • 0.999375-24
    record
    2008-08-06 · diff ↗
  • 0.999375-23
    record
    2008-07-29 · diff ↗
  • 0.999375-22
    record
    2008-07-12 · diff ↗
  • 0.999375-21
    record
    2008-07-11 · diff ↗
  • 0.999375-20
    record
    2008-06-26 · diff ↗
  • 0.999375-19
    record
    2008-06-26 · diff ↗
  • 0.999375-18
    record
    2008-06-25 · diff ↗
  • 0.999375-17
    record
    2008-06-23 · diff ↗
  • 0.999375-16
    record
    2008-06-23 · diff ↗ ·
    removed 4 exports
    gsummary, hatTrace, pedigree, pooledSD
    added 4 exports
    glmer, HPDinterval, refit, VarCorr
  • R
    R 2.7.0 released · 2008-04-22
  • 0.99875-9
    record
    2007-10-14 · diff ↗
  • R
    R 2.6.0 released · 2007-10-03
  • 0.99875-8
    record
    2007-09-26 · diff ↗
  • 0.99875-7
    record
    2007-08-04 · diff ↗
  • 0.99875-6
    record
    2007-07-10 · diff ↗
  • 0.99875-5
    record
    2007-07-10 · diff ↗
  • 0.99875-4
    record
    2007-07-07 · diff ↗
  • 0.99875-2
    record
    2007-06-21 · diff ↗
  • 0.99875-1
    record
    2007-06-11 · diff ↗ ·
    added 1 export
    nlmer
  • 0.99875-0
    record
    2007-05-15 · diff ↗
  • R
    R 2.5.0 released · 2007-04-24
  • 0.9975-13
    record
    2007-02-11 · diff ↗
  • 0.9975-12
    record
    2007-01-31 · diff ↗
  • 0.9975-11
    record
    2007-01-26 · diff ↗ ·
    added 1 export
    lmer2
  • 0.9975-10
    record
    2006-12-02 · diff ↗
  • 0.9975-9
    record
    2006-11-15 · diff ↗
  • 0.9975-8
    record
    2006-10-25 · diff ↗
  • 0.9975-7
    record
    2006-10-19 · diff ↗
  • 0.9975-6
    record
    2006-10-17 · diff ↗
  • 0.9975-5
    record
    2006-10-16 · diff ↗
  • 0.9975-4
    record
    2006-10-15 · diff ↗
  • 0.9975-3
    record
    2006-10-11 · diff ↗
  • 0.9975-1
    record
    2006-10-06 · diff ↗
  • 0.9975-0
    record
    2006-10-03 · diff ↗ ·
    added 4 exports
    hatTrace, lmer, mcmcsamp, pedigree
  • R
    R 2.4.0 released · 2006-10-03
  • R
    R 2.3.0 released · 2006-04-24
  • 0.995-2
    record
    2006-01-20 · diff ↗
  • 0.995-1
    record
    2006-01-17 · diff ↗
  • R
    R 2.2.0 released · 2005-10-06
  • 0.98-1
    record
    2005-07-28 · diff ↗ ·
    removed 7 exports
    convertFromS3groupedData, getCovariateFormula, getGroups, getGroupsFormula, getResponse, getResponseFormula, groupedData
  • 0.96-1
    record
    2005-06-13 · diff ↗ ·
    removed 6 exports
    BIC, VarCorr, fixef, lmer, lmerControl, ranef
  • 0.95-10
    record
    2005-05-31 · diff ↗
  • 0.95-9
    record
    2005-05-30 · diff ↗
  • 0.95-8
    record
    2005-05-20 · diff ↗
  • 0.95-7
    record
    2005-05-18 · diff ↗
  • 0.95-6
    record
    2005-04-19 · diff ↗ ·
    removed 1 export
    contr.SAS
  • R
    R 2.1.0 released · 2005-04-18
  • 0.95-5
    record
    2005-04-12 · diff ↗
  • 0.95-4
    record
    2005-04-07 · diff ↗
  • 0.95-3
    record
    2005-04-06 · diff ↗
  • 0.95-1
    record
    2005-04-02 · diff ↗ ·
    removed 3 exports
    GLMM, lme, lmeControl
    added 1 export
    lmerControl
  • 0.9-2
    record
    2005-02-28 · diff ↗
  • 0.9-1
    record
    2005-02-25 · diff ↗ ·
    removed 2 exports
    Names, Names<-
  • 0.8-3
    record
    2005-02-21 · diff ↗
  • 0.8-2
    record
    2005-01-25 · diff ↗
  • 0.8-1
    record
    2005-01-24 · diff ↗
  • 0.6-12
    record
    2005-01-24 · diff ↗ ·
    removed 1 export
    lme1
    added 1 export
    lmer
  • 0.6-11
    record
    2004-12-17 · diff ↗ ·
    added 1 export
    contr.SAS
  • 0.6-10
    record
    2004-12-14 · diff ↗ ·
    added 2 exports
    groupedData, convertFromS3groupedData
  • 0.6-9
    record
    2004-10-06 · diff ↗ ·
    added 1 export
    lme1
  • R
    R 2.0.0 released · 2004-10-04
  • 0.6-7
    record
    2004-09-15 · diff ↗
  • 0.6-6
    record
    2004-09-14 · diff ↗
  • 0.6-5
    record
    2004-09-06 · diff ↗
  • 0.6-4
    record
    2004-07-10 · diff ↗
  • 0.6-3
    record
    2004-07-07 · diff ↗ ·
    added 2 exports
    BIC, gsummary
  • 0.6-2
    record
    2004-06-08 · diff ↗
  • 0.6-1
    record
    2004-06-02 · diff ↗ ·
    removed 14 exports
    EMupdate<-, LMEgradient, coef<-, corMatrix, glmmLa2LogLikComp, glmmLa2RespWt, isInitialized, pdDiag, pdFactor, pdIdent, pdLogChol, pdMatrix, pdNatural, pdgradient
  • 0.5-2
    record
    2004-04-12 · diff ↗ ·
    added 2 exports
    fixef, ranef
  • R
    R 1.9.0 released · 2004-04-12
  • 0.4-7
    record
    2004-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-4
    record
    2003-10-15 · diff ↗
  • R
    R 1.8.0 released · 2003-10-08
  • 0.4-3
    record
    2003-10-01 · diff ↗
  • 0.3-7
    record
    2003-09-02 · diff ↗
  • 0.3-6
    record
    2003-08-28 · diff ↗
  • 0.3-5
    record
    2003-08-12 · diff ↗
  • 0.3-4
    record
    2003-08-12 · diff ↗
  • 0.3-3
    record
    2003-07-23 · diff ↗
  • 0.3-2
    record
    2003-07-21 · diff ↗
  • 0.3-1
    record
    2003-07-18 · diff ↗
  • 0.2-4
    record
    2003-07-15 · diff ↗
  • 0.2-3
    record
    2003-07-04 · diff ↗
  • 0.2-2
    record
    2003-07-01 · diff ↗
  • 0.2-1
    record
    2003-06-25
  • R
    R 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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for lme4 version 2.0-6 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy