RoBMA | R Documentation |
RoBMA
is used to estimate a robust Bayesian
meta-analysis. The interface allows a complete customization of
the ensemble with different prior (or list of prior) distributions
for each component.
RoBMA(
d = NULL,
r = NULL,
logOR = NULL,
OR = NULL,
z = NULL,
y = NULL,
se = NULL,
v = NULL,
n = NULL,
lCI = NULL,
uCI = NULL,
t = NULL,
study_names = NULL,
study_ids = NULL,
data = NULL,
weight = NULL,
transformation = if (is.null(y)) "fishers_z" else "none",
prior_scale = if (is.null(y)) "cohens_d" else "none",
effect_direction = "positive",
model_type = NULL,
rescale_priors = 1,
priors_effect = set_default_priors("effect", rescale = rescale_priors),
priors_heterogeneity = set_default_priors("heterogeneity", rescale = rescale_priors),
priors_bias = set_default_priors("bias", rescale = rescale_priors),
priors_effect_null = set_default_priors("effect", null = TRUE),
priors_heterogeneity_null = set_default_priors("heterogeneity", null = TRUE),
priors_bias_null = set_default_priors("bias", null = TRUE),
priors_hierarchical = set_default_priors("hierarchical"),
priors_hierarchical_null = set_default_priors("hierarchical", null = TRUE),
algorithm = "bridge",
chains = 3,
sample = 5000,
burnin = 2000,
adapt = 500,
thin = 1,
parallel = FALSE,
autofit = TRUE,
autofit_control = set_autofit_control(),
convergence_checks = set_convergence_checks(),
save = "all",
seed = NULL,
silent = TRUE,
...
)
d |
a vector of effect sizes measured as Cohen's d |
r |
a vector of effect sizes measured as correlations |
logOR |
a vector of effect sizes measured as log odds ratios |
OR |
a vector of effect sizes measured as odds ratios |
z |
a vector of effect sizes measured as Fisher's z |
y |
a vector of unspecified effect sizes (note that effect size transformations are unavailable with this type of input) |
se |
a vector of standard errors of the effect sizes |
v |
a vector of variances of the effect sizes |
n |
a vector of overall sample sizes |
lCI |
a vector of lower bounds of confidence intervals |
uCI |
a vector of upper bounds of confidence intervals |
t |
a vector of t/z-statistics |
study_names |
an optional argument with the names of the studies |
study_ids |
an optional argument specifying dependency between the
studies (for using a multilevel model). Defaults to |
data |
a data object created by the |
weight |
specifies likelihood weights of the individual estimates. Notes that this is an untested experimental feature. |
transformation |
transformation to be applied to the supplied
effect sizes before fitting the individual models. Defaults to
|
prior_scale |
an effect size scale used to define priors. Defaults to |
effect_direction |
the expected direction of the effect. Correctly specifying
the expected direction of the effect is crucial for one-sided selection models,
as they specify cut-offs using one-sided p-values. Defaults to |
model_type |
string specifying the RoBMA ensemble. Defaults to |
rescale_priors |
a re-scaling factor for the prior distributions. The re-scaling
factor allows to adjust the width of all default priors simultaneously. Defaults to |
priors_effect |
list of prior distributions for the effect size ( |
priors_heterogeneity |
list of prior distributions for the heterogeneity |
priors_bias |
list of prior distributions for the publication bias adjustment
component that will be treated as belonging to the alternative hypothesis.
Defaults to |
priors_effect_null |
list of prior distributions for the effect size ( |
priors_heterogeneity_null |
list of prior distributions for the heterogeneity |
priors_bias_null |
list of prior weight functions for the |
priors_hierarchical |
list of prior distributions for the correlation of random effects
( |
priors_hierarchical_null |
list of prior distributions for the correlation of random effects
( |
algorithm |
a string specifying the algorithm used for the model averaging. Defaults to |
chains |
a number of chains of the MCMC algorithm. |
sample |
a number of sampling iterations of the MCMC algorithm.
Defaults to |
burnin |
a number of burnin iterations of the MCMC algorithm.
Defaults to |
adapt |
a number of adaptation iterations of the MCMC algorithm.
Defaults to |
thin |
a thinning of the chains of the MCMC algorithm. Defaults to
|
parallel |
whether the individual models should be fitted in parallel.
Defaults to |
autofit |
whether the model should be fitted until the convergence
criteria (specified in |
autofit_control |
allows to pass autofit control settings with the
|
convergence_checks |
automatic convergence checks to assess the fitted
models, passed with |
save |
whether all models posterior distributions should be kept
after obtaining a model-averaged result. Defaults to |
seed |
a seed to be set before model fitting, marginal likelihood
computation, and posterior mixing for reproducibility of results. Defaults
to |
silent |
whether all print messages regarding the fitting process
should be suppressed. Defaults to |
... |
additional arguments. |
The default settings of the RoBMA 2.0 package corresponds to the RoBMA-PSMA
ensemble proposed by \insertCitebartos2021no;textualRoBMA. The previous versions
of the package (i.e., RoBMA < 2.0) used specifications proposed by
\insertCitemaier2020robust;textualRoBMA (this specification can be easily
obtained by setting model_type = "2w"
. The RoBMA-PP specification from
\insertCitebartos2021no;textualRoBMA can be obtained by setting
model_type = "PP"
. The complete list of default prior distributions is described at
set_default_priors()
. Note that inclusion of the PET and PEESE style publication bias adjustments
models might pick up on small-study effects. To remove true heterogeneity due to study design,
sub-populations, treatments etc. potentially causing small-study effects, use meta-regression
via the RoBMA.reg()
function, or remove the PET and PEESE style models from the publication bias
adjustment component of the ensemble.
The vignette("CustomEnsembles", package = "RoBMA")
and vignette("ReproducingBMA", package = "RoBMA")
vignettes describe how to use RoBMA()
to fit custom meta-analytic ensembles (see prior()
,
prior_weightfunction()
, prior_PET()
, and prior_PEESE()
for more information about prior
distributions).
The RoBMA function first generates models from a combination of the provided priors for each of the model parameters. Then, the individual models are fitted using autorun.jags function. A marginal likelihood is computed using bridge_sampler function. The individual models are then combined into an ensemble using the posterior model probabilities using BayesTools package.
Generic summary.RoBMA()
, print.RoBMA()
, and plot.RoBMA()
functions are
provided to facilitate manipulation with the ensemble. A visual check of the
individual model diagnostics can be obtained using the diagnostics()
function.
The fitted model can be further updated or modified by update.RoBMA()
function.
RoBMA
returns an object of class 'RoBMA'.
summary.RoBMA()
, update.RoBMA()
, check_setup()
## Not run:
# using the example data from Bem 2011 and fitting the default (RoBMA-PSMA) model
fit <- RoBMA(d = Bem2011$d, se = Bem2011$se, study_names = Bem2011$study)
# in order to speed up the process, we can turn the parallelization on
fit <- RoBMA(d = Bem2011$d, se = Bem2011$se, study_names = Bem2011$study, parallel = TRUE)
# we can get a quick overview of the model coefficients just by printing the model
fit
# a more detailed overview using the summary function (see '?summary.RoBMA' for all options)
summary(fit)
# the model-averaged effect size estimate can be visualized using the plot function
# (see ?plot.RoBMA for all options)
plot(fit, parameter = "mu")
# forest plot can be obtained with the forest function (see ?forest for all options)
forest(fit)
# plot of the individual model estimates can be obtained with the plot_models function
# (see ?plot_models for all options)
plot_models(fit)
# diagnostics for the individual parameters in individual models can be obtained using diagnostics
# function (see 'diagnostics' for all options)
diagnostics(fit, parameter = "mu", type = "chains")
# the RoBMA-PP can be fitted with addition of the 'model_type' argument
fit_PP <- RoBMA(d = Bem2011$d, se = Bem2011$se, study_names = Bem2011$study, model_type = "PP")
# as well as the original version of RoBMA (with two weightfunctions)
fit_original <- RoBMA(d = Bem2011$d, se = Bem2011$se, study_names = Bem2011$study,
model_type = "2w")
# or different prior distribution for the effect size (e.g., a half-normal distribution)
# (see 'vignette("CustomEnsembles")' for a detailed guide on specifying a custom model ensemble)
fit <- RoBMA(d = Bem2011$d, se = Bem2011$se, study_names = Bem2011$study,
priors_effect = prior("normal", parameters = list(0, 1),
truncation = list(0, Inf)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.