Runs an rmsb
package Bayesian fitting function such as blrm
separately for each completed dataset given a multiple imputation result such as one produced by Hmisc::aregImpute
. Stacks the posterior draws and diagnostics across all imputations, and computes parameter summaries on the stacked posterior draws.
stackMI(
formula,
fitter,
xtrans,
data = NULL,
n.impute = xtrans$n.impute,
dtrans = NULL,
derived = NULL,
subset = NULL,
refresh = 0,
progress = if (refresh > 0) "stan-progress.txt" else "",
file = NULL,
...
)
an rmsb
fit object with expanded posterior draws and diagnostics
a model formula
a Bayesian fitter
an object created by transcan
, aregImpute
, or mice
data frame
number of imputations to run, default is the number saved in xtrans
an integer or logical vector specifying the subset of observations to fit
see rstan::sampling. The default is 0, indicating that no progress notes are output. If refresh > 0
and progress
is not ''
, progress output will be appended to file progress
. The default file name is 'stan-progress.txt'
.
see refresh
. Defaults to ''
if refresh = 0
. Note: If running interactively but not under RStudio, rstan
will open a browser window for monitoring progress.
optional file name in which to store results in RDS format. If file
is given and it already exists, and none of the arguments to stackMI
have changed since that fit, the fit object from file
is immediately returned. So if the model, data, and imputations have not changed nothing needs to be computed.
arguments passed to fitter
Frank Harrell