Description Usage Arguments Details Value Examples
Run the same brms model on multiple datasets and then combine the results into one fitted model object. This is useful in particular for multiple missing value imputation, where the same model is fitted on multiple imputed data sets. Models can be run in parallel using the future package.
1 2 3 4 5 
formula 
An object of class 
data 
A list of data.frames each of which will be used to fit a
separate model. Alternatively, a 
family 
A description of the response distribution and link function to
be used in the model. This can be a family function, a call to a family
function or a character string naming the family. Every family function has
a 
prior 
One or more 
autocor 
An optional 
cov_ranef 
A list of matrices that are proportional to the (within)
covariance structure of the grouplevel effects. The names of the matrices
should correspond to columns in 
sample_prior 
Indicate if samples from all specified proper priors
should be drawn additionally to the posterior samples (defaults to

sparse 
(Deprecated) Logical; indicates whether the populationlevel
design matrices should be treated as sparse (defaults to 
knots 
Optional list containing user specified knot values to be used
for basis construction of smoothing terms. See

stanvars 
An optional 
stan_funs 
(Deprecated) An optional character string containing
selfdefined Stan functions, which will be included in the functions
block of the generated Stan code. It is now recommended to use the

combine 
Logical; Indicates if the fitted models should be combined
into a single fitted model object via 
fit 
An instance of S3 class 
seed 
The seed for random number generation to make results
reproducible. If 
file 
Either 
... 
Further arguments passed to 
The combined model may issue false positive convergence warnings, as
the MCMC chains corresponding to different datasets may not necessarily
overlap, even if each of the original models did converge. To find out
whether each of the original models converged, investigate
fit$rhats
, where fit
denotes the output of
brm_multiple
.
If combine = TRUE
a brmsfit_multiple
object, which
inherits from class brmsfit
and behaves essentially the same. If
combine = FALSE
a list of brmsfit
objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  ## Not run:
library(mice)
imp < mice(nhanes2)
# fit the model using mice and lm
fit_imp1 < with(lm(bmi ~ age + hyp + chl), data = imp)
summary(pool(fit_imp1))
# fit the model using brms
fit_imp2 < brm_multiple(bmi ~ age + hyp + chl, data = imp, chains = 1)
summary(fit_imp2)
plot(fit_imp2, pars = "^b_")
# investigate convergence of the original models
fit_imp2$rhats
# use the future package for parallelization
library(future)
plan(multiprocess)
fit_imp3 < brm_multiple(bmi~age+hyp+chl, data = imp, chains = 1)
summary(fit_imp3)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.