Bayesian Marginal Effects for 'brms' Models
Overview
Calculate Bayesian marginal effects, average marginal effects, and marginal coefficients (also called population averaged coefficients) for models fit using the 'brms' package including fixed effects, mixed effects, and location scale models. These are based on marginal predictions that integrate out random effects if necessary (see for example doi:10.1186/s12874-015-0046-6 and doi:10.1111/biom.12707).
- Now supports response variables with a binomial distribution. Predictions that marginalise over random effects will use the number of trials. For contrasts, such as using
brmsmargins()you can use theat =argument to force trials to 1 to get marginal probabilities rather than counts of successful trials. - Experimental support for integrating out random effects from a student t distribution. Currently only supports this for location parameters. When
dparis not empty inbrmsonly Gaussian distributions are supported. Some caution is needed here asbrmsuses the same degree of freedom parameter for all random effects of the same grouping variable, so for complex random effect structures, there may be errors in how they are integrated out.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-04
- WARNING12 OK, 1 WARNING2026-07-03
- OK13 OK2026-06-09
Show 5 earlier changesHide 5 earlier changes
- ERROR12 OK, 1 ERROR2026-06-08
- OK12 OK2026-04-25
- WARNING12 OK, 1 NOTE, 1 WARNING2026-04-22
- ERROR11 OK, 1 NOTE, 1 WARNING, 1 ERROR2026-04-18
- WARNING10 OK, 4 WARNING2026-03-10
Documentation
- Help pages
- 18 (8 internal)
- Examples that run
- 88%7 run in a plain check · 1 never run
- Exported functions with examples
- 80%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 22%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 42
- 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
6 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/jwiley/brmsmargins on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-06-18 · The repository has a site deploy workflow
pkgdown site last built 2026-06-18
Dependencies
Installing brmsmargins adds 78 packages (37 with compiled code, 84 MB of source tarballs). Heaviest: BH 14 MB, stringi 11 MB, ggplot2 6.0 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.3.0Latest
- 0.2.12025-09-26 · diff ↗
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.2.0
- RR 4.2.0 released · 2022-04-22
- 0.1.12021-12-16
- RR 4.1.0 released · 2021-05-18
Package metadata
- First published
- 2021-12-16
- Total releases
- 4 / 5 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 4.0.0
- Download size
- 960 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("brmsmargins")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-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.