Weighted Mixed-Effects Models Using Multilevel Pseudo Maximum Likelihood Estimation
Overview
Run mixed-effects models that include weights at every level. The WeMix package fits a weighted mixed model, also known as a multilevel, mixed, or hierarchical linear model (HLM). The weights could be inverse selection probabilities, such as those developed for an education survey where schools are sampled probabilistically, and then students inside of those schools are sampled probabilistically. Although mixed-effects models are already available in R, WeMix is unique in implementing methods for mixed models using weights at multiple levels. Both linear and logit models are supported. Models may have up to three levels. Random effects are estimated using the PIRLS algorithm from 'lme4pureR' (Walker and Bates (2013) https://github.com/lme4/lme4pureR).
improvements
- there is now a
predictfunction.
BUG FIXES
- the latest Matrix package (unclear what version caused the issue, maybe 1.6) caused a bug that is fixed by this version of WeMix.
- the
havenpackage doesn't always import data in formats theMatrixpackage recognizes. Columns that should be numeric are now cast as numeric before they are used, which may prevent this issue. Thanks to Emilie Franck for pointing this out. - the
mixfunction documentation now notes that the coefficient standard errors are always cluster robust (CR-0) estimates. Thanks to Francis Huang for pointing out that it previously mentioned a non-existent argument. - the
mixfunction nolonger fails if thelme4::lmerfit had a variable of exactly zero becausebobyqathrew an error. Thanks fo Charles Blankenship for identifying this bug.
FUNCTION RETIREMENT
- the functions
getHessian2andgetJacobianare removed from the package because they are not used.
From inst/NEWS.Rd in the release
Install
Health
NOTER code for possible problemsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64
Found calls to structure() using deprecated special names: WeMix/tests/testthat/test-1-main.R (.Dim: 1, .Dimnames: 1) WeMix/tests/testthat/test-4-ECLS.R (.Dim: 1, .Dimnames: 1) WeMix/tests/testthat/test-5-TIMSS.R (.Dim: 1, .Dimnames: 1) '.Dim' should be changed to 'dim'. '.Dimnames' should be changed to 'dimnames'.
- NOTE8 OK, 5 NOTE2026-09-08
- ERROR8 OK, 4 NOTE, 1 ERROR2026-09-07
- NOTE8 OK, 5 NOTE2026-07-23
- ERROR12 OK, 1 ERROR2026-07-07
- OK12 OK2026-04-25
Show 1 earlier changeHide 1 earlier change
- NOTE13 OK, 1 NOTE2026-03-10
Documentation
- Help pages
- 3includes a package overview page
- Examples that run
- 0%2 never run
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 33%
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 26
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Forks over time
Issues over time
2 development-tooling and community-health practices detected across 1 family in the upstream repository
Checks run against github.com/american-institutes-for-research/wemix on 2026-10-18.
Dependencies
Installing WeMix adds 10 packages (7 with compiled code, 12 MB of source tarballs). Heaviest: lme4 4.1 MB, nloptr 2.1 MB, Rcpp 1.8 MB.
Code & Tests
People & History
Previously maintained by Claire Kelley (1.0.2 to 3.0.0).
Show 4 peopleHide 4 people
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 4.0.3Latest
- RR 4.3.0 released · 2023-04-21
- 4.0.02023-03-21 · diff ↗
- 3.3.02022-12-21 · diff ↗
- 3.2.42022-10-05 · diff ↗
- 3.2.22022-09-23 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 3.2.12021-12-07 · diff ↗
- 3.2.02021-11-16 · diff ↗
- 3.1.92021-10-20 · diff ↗
- 3.1.82021-06-06 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 3.1.72021-05-11 · diff ↗
Show 17 earlier eventsHide 17 earlier events
- 3.1.62020-12-08 · diff ↗
- 3.1.52020-09-09 · diff ↗
- 3.1.42020-05-21 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 3.1.32020-01-09 · diff ↗
- 3.1.12019-06-27 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 3.0.0
- 2.2.1
- unarchivedReturned to CRAN2019-03-13
- 2.2.0
- archivedRemoved from CRAN2019-03-05check problems were not corrected despite reminders
- 2.1.02018-09-24 · diff ↗
- 2.0.02018-08-14 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 1.0.22018-04-10
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2018-04-10
- Total releases
- 21 / 8 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 620 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("WeMix")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-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.