| RoBMA_prior_specification | R Documentation |
The RoBMA function extends the prior specification described in
prior_specification by allowing mixture priors that define competing
hypotheses for Bayesian model-averaging. This enables multimodel inference via the
product space method \insertCitecarlin1995bayesian,lodewyckx2011tutorialRoBMA,
where a single MCMC chain explores a joint model space containing all competing models.
prior_effect |
prior distribution(s) for the alternative effect component(s). |
prior_heterogeneity |
prior distribution(s) for the alternative heterogeneity component(s). |
prior_mods |
prior distribution(s) for alternative moderator components. A single prior applies to all terms; a named list can specify term-specific components. |
prior_scale |
prior distribution(s) for alternative scale-regression components. A single prior applies to all terms; a named list can specify term-specific components. |
prior_heterogeneity_allocation |
prior distribution(s) for the alternative cluster-level heterogeneity allocation component(s). |
prior_bias |
prior distribution(s) for alternative publication-bias component(s), such as weight functions, PET, or PEESE. Alternative prior arguments can be:
See |
prior_effect_null |
prior distribution(s) for the null effect component(s). |
prior_heterogeneity_null |
prior distribution(s) for the null heterogeneity component(s). |
prior_mods_null |
prior distribution(s) for null moderator components. A single prior applies to all terms; a named list can specify term-specific components. |
prior_scale_null |
prior distribution(s) for null scale-regression components. A single prior applies to all terms; a named list can specify term-specific components. |
prior_heterogeneity_allocation_null |
prior distribution(s) for the null cluster-level heterogeneity allocation component(s). |
prior_bias_null |
prior distribution(s) for null publication-bias
component(s), usually Null prior arguments can be:
Defaults to a point mass (spike) at zero for effect and heterogeneity parameters. |
model_type |
character string specifying predefined publication-bias model ensembles. One of:
Custom |
RoBMA implements Bayesian model-averaging using the product space method \insertCitecarlin1995bayesian,lodewyckx2011tutorialRoBMA. Rather than fitting each model separately and combining results after the fitting is complete, this approach embeds all competing models within a single joint model space. A discrete model indicator variable selects which model component is "active" at each MCMC iteration, and the posterior probability of each model is estimated from the proportion of iterations spent in that model's subspace.
This is achieved by specifying mixture priors that combine:
Null hypothesis component(s): Typically point masses (spikes) representing the absence of an effect, heterogeneity, or publication bias
Alternative hypothesis component(s): Continuous distributions representing the presence of the parameter
The mixture structure enables direct computation of:
Inclusion Bayes factors: Evidence for the presence vs. absence of each parameter (e.g., effect, heterogeneity, bias)
Model-averaged estimates: Posterior estimates that account for model uncertainty by weighting across all models
Conditional estimates: Posterior estimates given that a particular hypothesis is true
By default, RoBMA creates the following mixture priors:
| Parameter | Null component | Alternative component |
Effect (\mu) | Spike(0) | Normal(0, UISD-scaled) |
Heterogeneity (\tau) | Spike(0) | Normal+(0, UISD-scaled) |
| Publication bias | No bias (prior_none) | Weight functions + PET + PEESE |
Allocation (\rho) | (none by default) | Beta(1, 1) |
See prior_specification for details on how the UISD scaling is determined.
Each prior_* and prior_*_null argument accepts either a single prior or a list:
Single prior: Creates one component in the mixture
List of priors: Creates multiple components, enabling model-averaging across different prior specifications (e.g., different effect size scales)
When multiple priors are specified in a list, they are all treated as alternative (or null) hypothesis components for the main inclusion Bayes factor. The inclusion Bayes factor tests the combined evidence for all alternative components against all null components. The detailed summary output shows posterior probabilities and inclusion Bayes factors for each individual component separately, allowing finer-grained inference about which specific prior specification is most supported by the data.
For top-level mixture components, setting a prior argument to NULL or FALSE
removes that hypothesis component:
prior_effect_null = NULL: No null hypothesis for effect (assumes effect exists)
prior_effect = NULL: No alternative hypothesis (assumes no effect)
prior_bias_null = NULL or FALSE: No "no bias" model (assumes some bias mechanism)
prior_bias = NULL or FALSE: No bias model (assumes no bias mechanism)
For moderator and scale regression terms, an omitted or whole-argument NULL
prior_mods / prior_scale means "use defaults". To omit a component for a
specific term, use a named list entry such as prior_mods_null = list(x1 = NULL).
For moderator priors (prior_mods, prior_mods_null), you can specify different
priors for different predictors using named lists. A single prior object applies
to all moderator terms:
RoBMA(..., mods = ~ x1 + x2, prior_mods_null = list(x1 = NULL) # No null for x1, default null for x2 )
This allows testing whether specific moderators have effects while assuming others are always included or excluded.
\mu) and heterogeneity (\tau)Effect and heterogeneity priors combine spike-and-slab components:
# Default: spike(0) null + normal alternative
# Custom: multiple alternatives with different scales
RoBMA(...,
prior_effect = list(
prior("normal", list(mean = 0, sd = 0.5)),
prior("normal", list(mean = 0, sd = 1.0))
)
)
Bias priors combine different publication bias adjustment mechanisms:
No publication bias (null hypothesis)
Weight functions: Selection models with different step functions
PET/PEESE: Regression-based bias adjustment
The model_type argument provides convenient presets:
RoBMA(..., model_type = "PSMA") # Full ensemble (default) RoBMA(..., model_type = "PP") # Only PET-PEESE models
See publication_bias_prior_specification for the bias-prior
constructors and preset model spaces.
\rho) for multilevel modelsWhen cluster is specified, \rho controls the cluster-level variance
allocation. The decomposition is
\tau_{between} = \tau\sqrt{\rho} and
\tau_{within} = \tau\sqrt{1 - \rho}. By default, only an alternative
(Beta(1,1)) is specified, but null hypotheses can be added:
RoBMA(...,
cluster = study,
prior_heterogeneity_allocation_null = prior("spike", list(location = 0.5))
)
When mods is specified, the effect prior becomes the intercept prior, and each
moderator receives a mixture prior. The intercept inherits the effect mixture
structure, while regression coefficients get separate spike-and-slab mixtures.
Similarly, when scale = ~ ... is specified for location-scale models, the
heterogeneity prior becomes the scale intercept prior, and each scale predictor
receives a mixture prior following the same pattern as moderator terms.
Note that the scale intercept (i.e., baseline heterogeneity) is always positive and
the multiplicative scale coefficients require non-zero prior distribution on the
intercept.
Each component in a mixture prior has an associated prior weight (prior model
probability). User-specified components receive equal weights unless their
prior objects set prior_weights. Publication-bias presets use fixed weights:
"2w" and "6w" split the alternative bias mass equally across their
weight functions, "PP" splits it equally across PET and PEESE, and "PSMA"
assigns half of the alternative bias mass to the six weight functions
combined and one quarter each to PET and PEESE. Custom weights can be
specified via the prior_weights argument in individual prior objects.
The prior odds between null and alternative hypotheses affect the Bayes factor interpretation. With equal prior weights on null and alternative, the posterior odds equal the Bayes factor.
prior_specification for base prior specification options,
publication_bias_prior_specification for publication-bias priors,
RoBMA for the main model-averaging function,
prior for creating prior distribution objects
## Not run:
if (requireNamespace("metadat", quietly = TRUE)) {
data(dat.lehmann2018, package = "metadat")
# Default mixture priors (spike-and-slab for effect and heterogeneity)
fit1 <- RoBMA(
yi = yi,
vi = vi,
data = dat.lehmann2018,
measure = "SMD",
seed = 1,
silent = TRUE
)
# Custom alternative priors (two effect size scales)
fit2 <- RoBMA(
yi = yi,
vi = vi,
data = dat.lehmann2018,
measure = "SMD",
prior_effect = list(
prior("normal", list(mean = 0, sd = 0.35)),
prior("normal", list(mean = 0, sd = 0.70))
),
seed = 1,
silent = TRUE
)
# No null hypothesis for effect (assume effect exists)
fit3 <- RoBMA(
yi = yi,
vi = vi,
data = dat.lehmann2018,
measure = "SMD",
prior_effect_null = NULL,
seed = 1,
silent = TRUE
)
# Only selection model bias adjustment (no PET-PEESE)
fit4 <- RoBMA(
yi = yi,
vi = vi,
data = dat.lehmann2018,
measure = "SMD",
model_type = "6w",
seed = 1,
silent = TRUE
)
# Meta-regression with different null specifications per moderator
fit5 <- RoBMA(
yi = yi,
vi = vi,
mods = ~ Preregistered,
data = dat.lehmann2018,
measure = "SMD",
prior_mods_null = list(Preregistered = NULL),
seed = 1,
silent = TRUE
)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.