mmrm
0.3.19Mixed Models for Repeated Measures
Overview
Mixed models for repeated measures (MMRM) are a popular choice for analyzing longitudinal continuous outcomes in randomized clinical trials and beyond; see Cnaan, Laird and Slasor (1997) doi:10.1002/(SICI)1097-0258(19971030)16:20%3C2349::AID-SIM667%3E3.0.CO;2-E for a tutorial and Mallinckrodt, Lane, Schnell, Peng and Mancuso (2008) doi:10.1177/009286150804200402 for a review. This package implements MMRM based on the marginal linear model without random effects using Template Model Builder ('TMB') which enables fast and robust model fitting. Users can specify a variety of covariance matrices, weight observations, fit models with restricted or standard maximum likelihood inference, perform hypothesis testing with Satterthwaite or Kenward-Roger adjustment, and extract least square means estimates by using 'emmeans'.
Bug Fixes
emmeans()now uses the fitted fixed-effect terms to construct its coefficient basis. This fixes incorrect marginal means and uncertainty estimates for models where the visit variable appears only in interactions, such as treatment-by-visit models without a visit main effect.
Miscellaneous
- Satterthwaite, empirical and linear Kenward-Roger covariance preparation now skip unused second derivatives. Linear Kenward-Roger also omits the
Rcomponent and its allocation. - Linear Kenward-Roger (
vcov = "Kenward-Roger-Linear") now calculates the adjusted coefficient covariance from contracted sums instead of looping over all pairs of covariance parameters. This is substantially faster for models with many covariance parameters, e.g. unstructured covariance with many visits, and gives the same results up to floating-point error. Consequently, thekr_compelement of such fits now containsPand the contracted matrixS_Q, whileQandRareNULL. Full Kenward-Roger fits are unchanged. - Kenward-Roger degrees of freedom now use contrast-space matrix contractions and a direct scalar shortcut, preserving the existing formulas while reducing contrast inference time.
- For one-dimensional Kenward-Roger contrasts whose variance does not depend on the covariance parameters (zero moment), the degrees of freedom are now
Infwith F scaling1, which is the limit of the formulas, instead ofNaN.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-18
- WARNING12 OK, 1 WARNING2026-07-16
- OK13 OK2026-06-23
Show 8 earlier changesHide 8 earlier changes
- ERROR12 OK, 1 ERROR2026-06-20
- OK13 OK2026-06-12
- ERROR12 OK, 1 ERROR2026-06-05
- OK13 OK2026-05-07
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-23
- NOTE11 OK, 3 NOTE2026-04-22
- ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 130 (108 internal)includes a package overview page
- Examples that run
- 100%15 run in a plain check
- Exported functions with examples
- 73%
- Documented parameters
- 89%
- Return-value docs
- 93%
- Help pages citing references
- 1% with a bibliography file
- Between-Within
- Coefficients Covariance Matrix Adjustment
- Comparison with other software
- Covariance Structures
- Details of Hypothesis Testing
- Details of Weighted Least Square Empirical Covariance
- Kenward-Roger
- Mixed Models for Repeated Measures
- Model Fitting Algorithm
- Model-Robust Variance Estimator for G-Computation
Show 4 moreHide 4 vignettes
Downloads
Repository
- PRs merged (all time)
- 94%
- Median days to close, 50 most recently updated closed issues
- 19
- 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
15 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/openpharma/mmrm on 2026-10-11.
Funding links: GitHub Sponsors
GitHub Pages site last deployed 2026-10-07
pkgdown site last built 2026-10-07
Show all practicesHide 3 practices
This repository has an AI review tool set up.
- Copilot code reviewCommits: some accepting its review suggestions, count not recorded
Dependencies
Installing mmrm adds 39 packages (21 with compiled code, 26 MB of source tarballs). Heaviest: stringi 11 MB, Rcpp 1.8 MB, RcppEigen 1.7 MB.
Show all 13 packagesHide all 13 packages
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.3.19Latest2026-10-06 · current release · diff ↗ ·
listed once in CRAN's queue
Seen in one reading of CRAN's incoming queue, at 2026-10-06 15:36 UTC, so it stayed less than the time between readings. - 0.3.182026-06-19 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 0.3.172026-01-08 · diff ↗
- 0.3.162025-12-09 · diff ↗
- 0.3.152025-06-10 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.3.142024-09-28 · diff ↗
- 0.3.132024-09-23 · diff ↗
- 0.3.122024-06-26 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.3.112024-03-05 · diff ↗
- 0.3.102024-01-26 · diff ↗
- 0.3.92024-01-25 · diff ↗
- 0.3.8
- 0.3.72023-12-09 · diff ↗
Show 6 earlier eventsHide 6 earlier events
Package metadata
- First published
- 2022-10-18
- Total releases
- 17 / 4 yrs
- License
- Apache License 2.0 OSI
- Minimum R
- ≥ 4.1
- Bundled data
- 126 KB / 3 files
- Download size
- 1.2 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("mmrm")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.