The brms.mmrm
R package implements a mixed model of
repeated measures (MMRM), a popular and flexible model to analyze
continuous longitudinal outcomes (Mallinckrodt et
al. (2008), Mallinckrodt and Lipkovich
(2017), Holzhauer and Weber
(2024)). brms.mmrm
focuses on marginal MMRMs for
randomized controlled parallel studies with discrete time points, where
each patient shares the same set of time points. Whereas the mmrm
package
is frequentist, brms.mmrm
fits models in Bayesian fashion
using brms
(Bürkner 2017).
Model
Let be independent data points observed for individual patients in a clinical trial. Each is a numeric vector of length , where is the number of discrete time points in the dataset (e.g. patient visits in the study protocol). We model as follows:
Above,
is the fixed effect model matrix of patient
,
and its specific makeup is determined by arguments such as
intercept
and group
in
brm_formula()
.
is a constant-length vector of fixed effect parameters.
The MMRM in brms.mmrm
is a distributional
model, which means it uses a linear regression structure for both
the mean and the variance of the multivariate normal likelihood. In
particular, the
symmetric positive-definite residual covariance matrix
of patient
decomposes as follows:
Above,
is a vector of
time-specific scalar standard deviations, and
is a diagonal
matrix.
is a patient-specific matrix which controls how the distributional
parameters
map to the more intuitive standard deviation vector
.
The specific makeup of
is determined by the sigma
argument of
brm_formula()
, which in turn is produced by
brm_formula_sigma()
.
is a symmetric positive-definite correlation matrix with diagonal
elements equal to 1 and off-diagonal elements between -1 and 1. The
structure of
depends on the correlation
argument of
brm_formula()
, which could describe an unstructured
parameterization, ARMA, compound symmetry, etc. These alternative
structures and priors are available directly through brms
.
For specific details, please consult https://paulbuerkner.com/brms/reference/autocor-terms.html
and ?brms.mmrm::brm_formula
.
Priors
The scalar components of
are modeled as independent with user-defined priors specified through
the prior
argument of brm_model()
. The
hyperparameters of these priors are constant. The default priors are
improper uniform for non-intercept terms and a data-dependent Student-t
distribution for the intercept. The variance-related distributional
parameters
are given similar priors
For the correlation matrix
,
the default prior in brms.mmrm
is the LKJ
correlation distribution with shape parameter equal to 1. This
choice of prior is only valid for unstructured correlation matrices.
Other correlation structures, such ARMA, will parameterize
and allow users to set priors on those new specialized parameters.
Sampling
brms.mmrm
, through brms
, fits the
model to the data using the Markov chain Monte Carlo (MCMC) capabilities
of Stan (Stan
Development Team 2023). Please read https://mc-stan.org/users/documentation/ for more
details on the methodology of Stan.
The result of MCMC is a collection of draws from the full joint
posterior distribution of the parameters given the data. Individual
draws of scalar parameters such as
are considered draws from the marginal posterior distribution of
e.g.
given the data.
Imputation of missing outcomes
Under the missing at random (MAR) assumptions, MMRMs do not require
imputation (Holzhauer and Weber (2024)).
However, if the outcomes in your data are not missing at random, or if
you are targeting an alternative estimand, then you may need to impute
missing outcomes. brms.mmrm
can leverage either of the two
alternative solutions described at https://paulbuerkner.com/brms/articles/brms_missings.html.
Please see the usage
vignette for details on the implementation and interface.