Title: | Robust Bayesian Meta-Analyses |
---|---|
Description: | A framework for estimating ensembles of meta-analytic models (assuming either presence or absence of the effect, heterogeneity, and publication bias). The RoBMA framework uses Bayesian model-averaging to combine the competing meta-analytic models into a model ensemble, weights the posterior parameter distributions based on posterior model probabilities and uses Bayes factors to test for the presence or absence of the individual components (e.g., effect vs. no effect; Bartoš et al., 2022, <doi:10.1002/jrsm.1594>; Maier, Bartoš & Wagenmakers, 2022, <doi:10.1037/met0000405>). Users can define a wide range of non-informative or informative prior distributions for the effect size, heterogeneity, and publication bias components (including selection models and PET-PEESE). The package provides convenient functions for summary, visualizations, and fit diagnostics. |
Authors: | František Bartoš [aut, cre] , Maximilian Maier [aut] , Eric-Jan Wagenmakers [ths] , Joris Goosen [ctb], Matthew Denwood [cph] (Original copyright holder of some modified code where indicated.), Martyn Plummer [cph] (Original copyright holder of some modified code where indicated.) |
Maintainer: | František Bartoš <[email protected]> |
License: | GPL-3 |
Version: | 3.1.0 |
Built: | 2024-11-13 05:02:04 UTC |
Source: | https://github.com/fbartos/robma |
RoBMA: Bayesian model-averaged meta-analysis with adjustments for publication bias and ability to specify informed prior distributions and draw inference with inclusion Bayes factors.
See Bartoš et al. (2022), Maier et al. (2022), and Bartoš et al. (2022) for details regarding the RoBMA methodology.
More details regarding customization of the model ensembles are provided in the Reproducing BMA, BMA in Medicine, and Fitting Custom Meta-Analytic Ensembles vignettes. Please, use the "Issues" section in the GitHub repository to ask any further questions.
František Bartoš [email protected]
Bartoš F, Maier M, Quintana DS, Wagenmakers E (2022).
“Adjusting for publication bias in JASP and R — Selection models, PET-PEESE, and robust Bayesian meta-analysis.”
Advances in Methods and Practices in Psychological Science, 5(3), 1–19.
doi:10.1177/25152459221109259.
Bartoš F, Maier M, Wagenmakers E, Doucouliagos H, Stanley TD (2022).
“Robust Bayesian meta-analysis: Model-averaging across complementary publication bias adjustment methods.”
Research Synthesis Methods.
doi:10.1002/jrsm.1594.
Maier M, Bartoš F, Wagenmakers E (2022).
“Robust Bayesian Meta-Analysis: Addressing Publication Bias with Model-Averaging.”
Psychological Methods.
doi:10.1037/met0000405.
Useful links:
The data set contains correlation coefficients, sample sizes, and labels for 27 experimental studies focusing on the effect of violent video games on aggressive behavior. The full original data can found at https://github.com/Joe-Hilgard/Anderson-meta.
Anderson2010
Anderson2010
A data.frame with 3 columns and 23 observations.
a data.frame.
Anderson CA, Shibuya A, Ihori N, Swing EL, Bushman BJ, Sakamoto A, Rothstein HR, Saleem M (2010). “Violent video game effects on aggression, empathy, and prosocial behavior in Eastern and Western countries: A meta-analytic review.” Psychological Bulletin, 136(2), 151. doi:10.1037/a0018251.
The data set contains Cohen's d effect sizes, standard errors, and labels for 9 experimental studies of precognition from the infamous Bem (2011) as analyzed in his later meta-analysis (Bem et al. 2011).
Bem2011
Bem2011
A data.frame with 3 columns and 9 observations.
a data.frame.
Bem DJ (2011).
“Feeling the future: experimental evidence for anomalous retroactive influences on cognition and affect.”
Journal of Personality and Social Psychology, 100(3), 407.
doi:10.1037/a0021524.
Bem DJ, Utts J, Johnson WO (2011).
“Must psychologists change the way they analyze their data?”
Journal of Personality and Social Psychology, 101(4), 716.
doi:10.1037/a0024777.
BiBMA
estimate a Binomial Bayesian
model-averaged meta-analysis. The interface allows a complete customization of
the ensemble with different prior (or list of prior) distributions
for each component.
BiBMA( x1, x2, n1, n2, study_names = NULL, study_ids = NULL, priors_effect = prior(distribution = "student", parameters = list(location = 0, scale = 0.58, df = 4)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1.77, scale = 0.55)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_baseline = NULL, priors_baseline_null = prior_factor("beta", parameters = list(alpha = 1, beta = 1), contrast = "independent"), 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, ... )
BiBMA( x1, x2, n1, n2, study_names = NULL, study_ids = NULL, priors_effect = prior(distribution = "student", parameters = list(location = 0, scale = 0.58, df = 4)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1.77, scale = 0.55)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_baseline = NULL, priors_baseline_null = prior_factor("beta", parameters = list(alpha = 1, beta = 1), contrast = "independent"), 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, ... )
x1 |
a vector with the number of successes in the first group |
x2 |
a vector with the number of successes in the second group |
n1 |
a vector with the number of observations in the first group |
n2 |
a vector with the number of observations in the second group |
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 |
priors_effect |
list of prior distributions for the effect size ( |
priors_heterogeneity |
list of prior distributions for the heterogeneity |
priors_effect_null |
list of prior distributions for the effect size ( |
priors_heterogeneity_null |
list of prior distributions for the heterogeneity |
priors_baseline |
prior distributions for the alternative hypothesis about
intercepts ( |
priors_baseline_null |
prior distributions for the null hypothesis about
intercepts ( |
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. |
See RoBMA()
for more details.
NoBMA
returns an object of class 'RoBMA'.
RoBMA()
, summary.RoBMA()
, update.RoBMA()
, check_setup()
Checks fitted RoBMA object for warnings and errors and prints them to the console.
check_RoBMA(fit)
check_RoBMA(fit)
fit |
a fitted RoBMA object. |
check_RoBMA
returns a vector of error and
warning messages.
"RoBMA"
ensemble implied by the specified priorscheck_setup
prints summary of "RoBMA"
ensemble
implied by the specified prior distributions. It is useful for checking
the ensemble configuration prior to fitting all of the models.
check_setup( model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, models = FALSE, silent = FALSE ) check_setup.RoBMA( model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, models = FALSE, silent = FALSE )
check_setup( model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, models = FALSE, silent = FALSE ) check_setup.RoBMA( model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, models = FALSE, silent = FALSE )
model_type |
string specifying the RoBMA ensemble. 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
( |
models |
should the models' details be printed. |
silent |
do not print the results. |
check_setup
invisibly returns list of summary tables.
"BiBMA.reg"
ensemble implied by the specified priors
and formulacheck_setup
prints summary of "RoBMA.reg"
ensemble
implied by the specified prior distributions. It is useful for checking
the ensemble configuration prior to fitting all of the models.
check_setup.BiBMA( priors_effect = prior(distribution = "student", parameters = list(location = 0, scale = 0.58, df = 4)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1.77, scale = 0.55)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_baseline = NULL, priors_baseline_null = prior_factor("beta", parameters = list(alpha = 1, beta = 1), contrast = "independent"), models = FALSE, silent = FALSE, ... )
check_setup.BiBMA( priors_effect = prior(distribution = "student", parameters = list(location = 0, scale = 0.58, df = 4)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1.77, scale = 0.55)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_baseline = NULL, priors_baseline_null = prior_factor("beta", parameters = list(alpha = 1, beta = 1), contrast = "independent"), models = FALSE, silent = FALSE, ... )
priors_effect |
list of prior distributions for the effect size ( |
priors_heterogeneity |
list of prior distributions for the heterogeneity |
priors_effect_null |
list of prior distributions for the effect size ( |
priors_heterogeneity_null |
list of prior distributions for the heterogeneity |
priors_baseline |
prior distributions for the alternative hypothesis about
intercepts ( |
priors_baseline_null |
prior distributions for the null hypothesis about
intercepts ( |
models |
should the models' details be printed. |
silent |
whether all print messages regarding the fitting process
should be suppressed. Defaults to |
... |
additional arguments. |
check_setup.reg
invisibly returns list of summary tables.
"RoBMA.reg"
ensemble implied by the specified priors
and formulacheck_setup
prints summary of "RoBMA.reg"
ensemble
implied by the specified prior distributions. It is useful for checking
the ensemble configuration prior to fitting all of the models.
check_setup
prints summary of "RoBMA.reg"
ensemble
implied by the specified prior distributions. It is useful for checking
the ensemble configuration prior to fitting all of the models.
check_setup.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior("spike", parameters = list(location = 0)), models = FALSE, silent = FALSE, ... ) check_setup.RoBMA.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior("spike", parameters = list(location = 0)), models = FALSE, silent = FALSE, ... ) check_setup.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior("spike", parameters = list(location = 0)), models = FALSE, silent = FALSE, ... )
check_setup.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior("spike", parameters = list(location = 0)), models = FALSE, silent = FALSE, ... ) check_setup.RoBMA.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior("spike", parameters = list(location = 0)), models = FALSE, silent = FALSE, ... ) check_setup.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior("spike", parameters = list(location = 0)), models = FALSE, silent = FALSE, ... )
formula |
a formula for the meta-regression model |
data |
a data object created by the |
test_predictors |
vector of predictor names that will be test
(i.e., assigned both the null and alternative prior distributions).
Defaults to |
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 |
transformation |
transformation to be applied to the supplied
effect sizes before fitting the individual models. Defaults to
|
prior_scale |
a scale used to define priors. Defaults to |
standardize_predictors |
whether continuous predictors should be standardized prior to
estimating the model. Defaults to |
effect_direction |
the expected direction of the effect. The one-sided
selection sets the weights omega to 1 to significant results in the expected
direction. Defaults to |
priors |
named list of prior distributions for each predictor
(with names corresponding to the predictors). It allows users to
specify both the null and alternative hypothesis prior distributions
for each predictor by assigning the corresponding element of the named
list with another named list (with |
model_type |
string specifying the RoBMA ensemble. 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
( |
prior_covariates |
a prior distributions for the regression parameter
of continuous covariates on the effect size under the alternative hypothesis
(unless set explicitly in |
prior_covariates_null |
a prior distributions for the regression parameter
of continuous covariates on the effect size under the null hypothesis
(unless set explicitly in |
prior_factors |
a prior distributions for the regression parameter
of categorical covariates on the effect size under the alternative hypothesis
(unless set explicitly in |
prior_factors_null |
a prior distributions for the regression parameter
of categorical covariates on the effect size under the null hypothesis
(unless set explicitly in |
models |
should the models' details be printed. |
silent |
do not print the results. |
... |
additional arguments. |
check_setup.reg
invisibly returns list of summary tables.
check_setup.reg
invisibly returns list of summary tables.
combine_data
combines different effect sizes
into a common measure specified in transformation
. Either
a data.frame data
with columns named corresponding to the
arguments or vectors with individual values can be passed.
combine_data( d = NULL, r = NULL, z = NULL, logOR = NULL, OR = NULL, t = NULL, y = NULL, se = NULL, v = NULL, n = NULL, lCI = NULL, uCI = NULL, study_names = NULL, study_ids = NULL, weight = NULL, data = NULL, transformation = "fishers_z", return_all = FALSE, ... )
combine_data( d = NULL, r = NULL, z = NULL, logOR = NULL, OR = NULL, t = NULL, y = NULL, se = NULL, v = NULL, n = NULL, lCI = NULL, uCI = NULL, study_names = NULL, study_ids = NULL, weight = NULL, data = NULL, transformation = "fishers_z", return_all = FALSE, ... )
d |
a vector of effect sizes measured as Cohen's d |
r |
a vector of effect sizes measured as correlations |
z |
a vector of effect sizes measured as Fisher's z |
logOR |
a vector of effect sizes measured as log odds ratios |
OR |
a vector of effect sizes measured as odds ratios |
t |
a vector of t/z-statistics |
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 |
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 |
weight |
specifies likelihood weights of the individual estimates. Notes that this is an untested experimental feature. |
data |
a data frame with column names corresponding to the variable names used to supply data individually |
transformation |
transformation to be applied to the supplied
effect sizes before fitting the individual models. Defaults to
|
return_all |
whether data frame containing all filled values should be
returned. Defaults to |
... |
additional arguments. |
The aim of the function is to combine different, already calculated, effect size measures. In order to obtain effect size measures from raw values, e.g, mean differences, standard deviations, and sample sizes, use escalc function.
The function checks the input values and in transforming the input into a common effect size measure in the following fashion:
obtains missing standard errors by squaring variances
obtains missing standard errors from confidence intervals (after transformation to
Fisher's z scale for d
and r
).
obtains missing sample sizes (or standard errors for logOR) from t-statistics and effect sizes
obtains missing standard errors from sample sizes and effect sizes
obtains missing sample sizes from standard errors and effect sizes
obtains missing t-statistics from sample sizes and effect sizes (or standard errors and effect sizes for logOR)
changes the effect sizes direction to be positive
transforms effect sizes into the common effect size
transforms standard errors into the common metric
If the transforms
is NULL
or an unstandardized effect size y
is
supplied, steps 4-9 are skipped.
combine_data
returns a data.frame.
RoBMA()
, check_setup()
, effect_sizes()
, standard_errors()
, and sample_sizes()
Return a matrix of independent contrasts – a level for each term.
contr.independent(n, contrasts = TRUE)
contr.independent(n, contrasts = TRUE)
n |
a vector of levels for a factor, or the number of levels |
contrasts |
logical indicating whether contrasts should be computed |
A matrix with n rows and k columns, with k = n if contrasts = TRUE
and k = n
if contrasts = FALSE
.
There are no references for Rd macro \insertAllCites
on this help page.
contr.independent(c(1, 2)) contr.independent(c(1, 2, 3))
contr.independent(c(1, 2)) contr.independent(c(1, 2, 3))
Return a matrix of mean difference contrasts.
This is an adjustment to the contr.orthonormal
that ascertains that the prior
distributions on difference between the gran mean and factor level are identical independent
of the number of factor levels (which does not hold for the orthonormal contrast). Furthermore,
the contrast is re-scaled so the specified prior distribution exactly corresponds to the prior
distribution on difference between each factor level and the grand mean – this is approximately
twice the scale of contr.orthonormal
.
contr.meandif(n, contrasts = TRUE)
contr.meandif(n, contrasts = TRUE)
n |
a vector of levels for a factor, or the number of levels |
contrasts |
logical indicating whether contrasts should be computed |
A matrix with n rows and k columns, with k = n - 1 if contrasts = TRUE
and k = n
if contrasts = FALSE
.
There are no references for Rd macro \insertAllCites
on this help page.
contr.meandif(c(1, 2)) contr.meandif(c(1, 2, 3))
contr.meandif(c(1, 2)) contr.meandif(c(1, 2, 3))
diagnostics
creates visual
checks of individual models convergence. Numerical
overview of individual models can be obtained by
summary(object, type = "models", diagnostics = TRUE)
,
or even more detailed information by
summary(object, type = "individual")
.
diagnostics( fit, parameter, type, plot_type = "base", show_models = NULL, lags = 30, title = is.null(show_models) | length(show_models) > 1, ... ) diagnostics_autocorrelation( fit, parameter = NULL, plot_type = "base", show_models = NULL, lags = 30, title = is.null(show_models) | length(show_models) > 1, ... ) diagnostics_trace( fit, parameter = NULL, plot_type = "base", show_models = NULL, title = is.null(show_models) | length(show_models) > 1, ... ) diagnostics_density( fit, parameter = NULL, plot_type = "base", show_models = NULL, title = is.null(show_models) | length(show_models) > 1, ... )
diagnostics( fit, parameter, type, plot_type = "base", show_models = NULL, lags = 30, title = is.null(show_models) | length(show_models) > 1, ... ) diagnostics_autocorrelation( fit, parameter = NULL, plot_type = "base", show_models = NULL, lags = 30, title = is.null(show_models) | length(show_models) > 1, ... ) diagnostics_trace( fit, parameter = NULL, plot_type = "base", show_models = NULL, title = is.null(show_models) | length(show_models) > 1, ... ) diagnostics_density( fit, parameter = NULL, plot_type = "base", show_models = NULL, title = is.null(show_models) | length(show_models) > 1, ... )
fit |
a fitted RoBMA object |
parameter |
a parameter to be plotted. Either
|
type |
type of MCMC diagnostic to be plotted.
Options are |
plot_type |
whether to use a base plot |
show_models |
MCMC diagnostics of which models should be
plotted. Defaults to |
lags |
number of lags to be shown for
|
title |
whether the model number should be displayed in title.
Defaults to |
... |
additional arguments to be passed to
par if |
The visualization functions are based on stan_plot function and its color schemes.
diagnostics
returns either NULL
if plot_type = "base"
or an object/list of objects (depending on the number of parameters to be plotted)
of class 'ggplot2' if plot_type = "ggplot2"
.
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # diagnostics function allows to visualize diagnostics of a fitted RoBMA object, for example, # the trace plot for the mean parameter in each model model diagnostics(fit, parameter = "mu", type = "chain") # in order to show the trace plot only for the 11th model, add show_models parameter diagnostics(fit, parameter = "mu", type = "chain", show_models = 11) # furthermore, the autocorrelations diagnostics(fit, parameter = "mu", type = "autocorrelation") # and overlying densities for each plot can also be visualize diagnostics(fit, parameter = "mu", type = "densities") ## End(Not run)
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # diagnostics function allows to visualize diagnostics of a fitted RoBMA object, for example, # the trace plot for the mean parameter in each model model diagnostics(fit, parameter = "mu", type = "chain") # in order to show the trace plot only for the 11th model, add show_models parameter diagnostics(fit, parameter = "mu", type = "chain", show_models = 11) # furthermore, the autocorrelations diagnostics(fit, parameter = "mu", type = "autocorrelation") # and overlying densities for each plot can also be visualize diagnostics(fit, parameter = "mu", type = "densities") ## End(Not run)
Functions for transforming between different effect size measures.
d2r(d) d2z(d) d2logOR(d) d2OR(d) r2d(r) r2z(r) r2logOR(r) r2OR(r) z2r(z) z2d(z) z2logOR(z) z2OR(z) logOR2r(logOR) logOR2z(logOR) logOR2d(logOR) logOR2OR(logOR) OR2r(OR) OR2z(OR) OR2logOR(OR) OR2d(OR)
d2r(d) d2z(d) d2logOR(d) d2OR(d) r2d(r) r2z(r) r2logOR(r) r2OR(r) z2r(z) z2d(z) z2logOR(z) z2OR(z) logOR2r(logOR) logOR2z(logOR) logOR2d(logOR) logOR2OR(logOR) OR2r(OR) OR2z(OR) OR2logOR(OR) OR2d(OR)
d |
Cohen's d. |
r |
correlation coefficient. |
z |
Fisher's z. |
logOR |
log(odds ratios). |
OR |
offs ratios. |
All transformations are based on (Borenstein et al. 2011). In case that a direct transformation is not available, the transformations are chained to provide the effect size of interest.
Borenstein M, Hedges LV, Higgins JP, Rothstein HR (2011). Introduction to meta-analysis. John Wiley & Sons.
standard_errors()
, sample_sizes()
forest
creates a forest plot for
a "RoBMA"
object.
forest( x, conditional = FALSE, plot_type = "base", output_scale = NULL, order = NULL, ... )
forest( x, conditional = FALSE, plot_type = "base", output_scale = NULL, order = NULL, ... )
x |
a fitted RoBMA object |
conditional |
whether conditional estimates should be
plotted. Defaults to |
plot_type |
whether to use a base plot |
output_scale |
transform the effect sizes and the meta-analytic
effect size estimate to a different scale. Defaults to |
order |
order of the studies. Defaults to |
... |
list of additional graphical arguments
to be passed to the plotting function. Supported arguments
are |
forest
returns either NULL
if plot_type = "base"
or an object object of class 'ggplot2' if plot_type = "ggplot2"
.
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # the forest function creates a forest plot for a fitted RoBMA object, for example, # the forest plot for the individual studies and the model-averaged effect size estimate forest(fit) # the conditional effect size estimate forest(fit, conditional = TRUE) # or transforming the effect size estimates to Fisher's z forest(fit, output_scale = "fishers_z") ## End(Not run)
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # the forest function creates a forest plot for a fitted RoBMA object, for example, # the forest plot for the individual studies and the model-averaged effect size estimate forest(fit) # the conditional effect size estimate forest(fit, conditional = TRUE) # or transforming the effect size estimates to Fisher's z forest(fit, output_scale = "fishers_z") ## End(Not run)
interpret
creates a brief textual summary
of a fitted RoBMA object.
interpret(object, output_scale = NULL)
interpret(object, output_scale = NULL)
object |
a fitted RoBMA object |
output_scale |
transform the meta-analytic estimates to a different
scale. Defaults to |
interpret
returns a character.
Reports whether x is a RoBMA object
is.RoBMA(x) is.RoBMA.reg(x) is.NoBMA(x) is.NoBMA.reg(x) is.BiBMA(x)
is.RoBMA(x) is.RoBMA.reg(x) is.NoBMA(x) is.NoBMA.reg(x) is.BiBMA(x)
x |
an object to test |
returns a boolean.
The data set contains partial correlation coefficients, standard errors, study labels, samples sizes, type of the educational outcome, intensity of the employment, gender of the student population, study location, study design, whether the study controlled for endogenity, and whether the study controlled for motivation. The original data set including additional variables and the publication can be found at http://meta-analysis.cz/students. (Note that some standard errors and employment intensities are missing.)
Kroupova2021
Kroupova2021
A data.frame with 11 columns and 881 observations.
a data.frame.
Kroupova K, Havranek T, Irsova Z (2021). “Student employment and education: A meta-analysis.” CEPR Discussion Paper. https://www.ssrn.com/abstract=3928863.
The data set contains correlation coefficients r, sample sizes n, and labels for each study assessing the relationship between acculturation mismatch (that is the result of the contrast between the collectivist cultures of Asian and Latin immigrant groups and the individualist culture in the United States) and intergenerational cultural conflict (Lui 2015) which was used as an example in Bartoš et al. (2022).
Lui2015
Lui2015
A data.frame with 3 columns and 18 observations.
a data.frame.
Bartoš F, Maier M, Quintana DS, Wagenmakers E (2022).
“Adjusting for publication bias in JASP and R — Selection models, PET-PEESE, and robust Bayesian meta-analysis.”
Advances in Methods and Practices in Psychological Science, 5(3), 1–19.
doi:10.1177/25152459221109259.
Lui PP (2015).
“Intergenerational cultural conflict, mental health, and educational outcomes among Asian and Latino/a Americans: Qualitative and meta-analytic review.”
Psychological Bulletin, 141(2), 404–446.
doi:10.1037/a0038449.
marginal_plot
allows to visualize prior and
posterior distributions of marginal estimates of a RoBMA regression model.
marginal_plot( x, parameter, conditional = FALSE, plot_type = "base", prior = FALSE, output_scale = NULL, dots_prior = NULL, ... )
marginal_plot( x, parameter, conditional = FALSE, plot_type = "base", prior = FALSE, output_scale = NULL, dots_prior = NULL, ... )
x |
a fitted RoBMA regression object |
parameter |
regression parameter to be plotted |
conditional |
whether conditional marginal estimates should be
plotted. Defaults to |
plot_type |
whether to use a base plot |
prior |
whether prior distribution should be added to
figure. Defaults to |
output_scale |
transform the effect sizes and the meta-analytic
effect size estimate to a different scale. Defaults to |
dots_prior |
list of additional graphical arguments
to be passed to the plotting function of the prior
distribution. Supported arguments are |
... |
list of additional graphical arguments
to be passed to the plotting function. Supported arguments
are |
plot.RoBMA
returns either NULL
if plot_type = "base"
or an object object of class 'ggplot2' if plot_type = "ggplot2"
.
marginal_summary
creates summary tables for
marginal estimates of a RoBMA regression model.
marginal_summary( object, conditional = FALSE, output_scale = NULL, probs = c(0.025, 0.975), logBF = FALSE, BF01 = FALSE )
marginal_summary( object, conditional = FALSE, output_scale = NULL, probs = c(0.025, 0.975), logBF = FALSE, BF01 = FALSE )
object |
a fitted RoBMA regression object |
conditional |
show the conditional estimates (assuming that the alternative is true). |
output_scale |
transform the meta-analytic estimates to a different
scale. Defaults to |
probs |
quantiles of the posterior samples to be displayed.
Defaults to |
logBF |
show log of Bayes factors. Defaults to |
BF01 |
show Bayes factors in support of the null hypotheses. Defaults to
|
marginal_summary
returns a list of tables of class 'BayesTools_table'.
RoBMA()
, summary.RoBMA()
, diagnostics()
, check_RoBMA()
NoBMA
is a wrapper around RoBMA()
that can
be used to estimate a (Normal - publication bias unadjusted) Bayesian
model-averaged meta-analysis. The interface allows a complete customization of
the ensemble with different prior (or list of prior) distributions
for each component.
NoBMA( 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", model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, 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, ... )
NoBMA( 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", model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, 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 |
a scale used to define priors. Defaults to |
model_type |
string specifying the RoBMA ensemble. Defaults to |
priors_effect |
list of prior distributions for the effect size ( |
priors_heterogeneity |
list of prior distributions for the heterogeneity |
priors_effect_null |
list of prior distributions for the effect size ( |
priors_heterogeneity_null |
list of prior distributions for the heterogeneity |
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
( |
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. |
See RoBMA()
for more details.
NoBMA
returns an object of class 'RoBMA'.
RoBMA()
, summary.RoBMA()
, update.RoBMA()
, check_setup()
NoBMA.reg
is a wrapper around RoBMA.reg()
that can
be used to estimate a (Normal - publication bias unadjusted) Bayesian
model-averaged meta-regression. The interface allows a complete customization of
the ensemble with different prior (or list of prior) distributions
for each component.
NoBMA.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior_factor("spike", parameters = list(location = 0), contrast = "meandif"), 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, ... )
NoBMA.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior_factor("spike", parameters = list(location = 0), contrast = "meandif"), 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, ... )
formula |
a formula for the meta-regression model |
data |
a data object created by the |
test_predictors |
vector of predictor names that will be test
(i.e., assigned both the null and alternative prior distributions).
Defaults to |
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 |
transformation |
transformation to be applied to the supplied
effect sizes before fitting the individual models. Defaults to
|
prior_scale |
a scale used to define priors. Defaults to |
standardize_predictors |
whether continuous predictors should be standardized prior to
estimating the model. Defaults to |
priors |
named list of prior distributions for each predictor
(with names corresponding to the predictors). It allows users to
specify both the null and alternative hypothesis prior distributions
for each predictor by assigning the corresponding element of the named
list with another named list (with |
model_type |
string specifying the RoBMA ensemble. Defaults to |
priors_effect |
list of prior distributions for the effect size ( |
priors_heterogeneity |
list of prior distributions for the heterogeneity |
priors_effect_null |
list of prior distributions for the effect size ( |
priors_heterogeneity_null |
list of prior distributions for the heterogeneity |
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
( |
prior_covariates |
a prior distributions for the regression parameter
of continuous covariates on the effect size under the alternative hypothesis
(unless set explicitly in |
prior_covariates_null |
a prior distributions for the regression parameter
of continuous covariates on the effect size under the null hypothesis
(unless set explicitly in |
prior_factors |
a prior distributions for the regression parameter
of categorical covariates on the effect size under the alternative hypothesis
(unless set explicitly in |
prior_factors_null |
a prior distributions for the regression parameter
of categorical covariates on the effect size under the null hypothesis
(unless set explicitly in |
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. |
See RoBMA()
for more details.
Note that these default prior distributions are relatively wide and more informed prior distributions for testing for the presence of moderation should be considered.
See RoBMA.reg()
for more details.
NoBMA.reg
returns an object of class 'RoBMA'.
RoBMA()
, RoBMA.reg()
, summary.RoBMA()
, update.RoBMA()
, check_setup()
plot_models
plots individual models'
estimates for a "RoBMA"
object.
plot_models( x, parameter = "mu", conditional = FALSE, output_scale = NULL, plot_type = "base", order = "decreasing", order_by = "model", ... )
plot_models( x, parameter = "mu", conditional = FALSE, output_scale = NULL, plot_type = "base", order = "decreasing", order_by = "model", ... )
x |
a fitted RoBMA object |
parameter |
a parameter to be plotted. Defaults to
|
conditional |
whether conditional estimates should be
plotted. Defaults to |
output_scale |
transform the effect sizes and the meta-analytic
effect size estimate to a different scale. Defaults to |
plot_type |
whether to use a base plot |
order |
how the models should be ordered.
Defaults to |
order_by |
what feature should be use to order the models.
Defaults to |
... |
list of additional graphical arguments
to be passed to the plotting function. Supported arguments
are |
plot_models
returns either NULL
if plot_type = "base"
or an object object of class 'ggplot2' if plot_type = "ggplot2"
.
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # the plot_models function creates a plot for of the individual models' estimates, for example, # the effect size estimates from the individual models can be obtained with plot_models(fit) # and effect size estimates from only the conditional models plot_models(fit, conditional = TRUE) ## End(Not run)
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # the plot_models function creates a plot for of the individual models' estimates, for example, # the effect size estimates from the individual models can be obtained with plot_models(fit) # and effect size estimates from only the conditional models plot_models(fit, conditional = TRUE) ## End(Not run)
plot.RoBMA
allows to visualize
different "RoBMA"
object parameters in various
ways. See type
for the different model types.
## S3 method for class 'RoBMA' plot( x, parameter = "mu", conditional = FALSE, plot_type = "base", prior = FALSE, output_scale = NULL, rescale_x = FALSE, show_data = TRUE, dots_prior = NULL, ... )
## S3 method for class 'RoBMA' plot( x, parameter = "mu", conditional = FALSE, plot_type = "base", prior = FALSE, output_scale = NULL, rescale_x = FALSE, show_data = TRUE, dots_prior = NULL, ... )
x |
a fitted RoBMA object |
parameter |
a parameter to be plotted. Defaults to
|
conditional |
whether conditional estimates should be
plotted. Defaults to |
plot_type |
whether to use a base plot |
prior |
whether prior distribution should be added to
figure. Defaults to |
output_scale |
transform the effect sizes and the meta-analytic
effect size estimate to a different scale. Defaults to |
rescale_x |
whether the x-axis of the |
show_data |
whether the study estimates and standard
errors should be show in the |
dots_prior |
list of additional graphical arguments
to be passed to the plotting function of the prior
distribution. Supported arguments are |
... |
list of additional graphical arguments
to be passed to the plotting function. Supported arguments
are |
plot.RoBMA
returns either NULL
if plot_type = "base"
or an object object of class 'ggplot2' if plot_type = "ggplot2"
.
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # the 'plot' function allows to visualize the results of a fitted RoBMA object, for example; # the model-averaged effect size estimate plot(fit, parameter = "mu") # and show both the prior and posterior distribution plot(fit, parameter = "mu", prior = TRUE) # conditional plots can by obtained by specifying plot(fit, parameter = "mu", conditional = TRUE) # plotting function also allows to visualize the weight function plot(fit, parameter = "weightfunction") # re-scale the x-axis plot(fit, parameter = "weightfunction", rescale_x = TRUE) # or visualize the PET-PEESE regression line plot(fit, parameter = "PET-PEESE") ## End(Not run)
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) ### ggplot2 version of all of the plots can be obtained by adding 'model_type = "ggplot" # the 'plot' function allows to visualize the results of a fitted RoBMA object, for example; # the model-averaged effect size estimate plot(fit, parameter = "mu") # and show both the prior and posterior distribution plot(fit, parameter = "mu", prior = TRUE) # conditional plots can by obtained by specifying plot(fit, parameter = "mu", conditional = TRUE) # plotting function also allows to visualize the weight function plot(fit, parameter = "weightfunction") # re-scale the x-axis plot(fit, parameter = "weightfunction", rescale_x = TRUE) # or visualize the PET-PEESE regression line plot(fit, parameter = "PET-PEESE") ## End(Not run)
The data set contains Cohen's d effect sizes, standard errors, and labels for 5 studies assessing the tactile outcome from a meta-analysis of the effect of potassium-containing toothpaste on dentine hypersensitivity (Poulsen et al. 2006) which was used as an example in Bartoš et al. (2021).
Poulsen2006
Poulsen2006
A data.frame with 3 columns and 5 observations.
a data.frame.
Bartoš F, Gronau QF, Timmers B, Otte WM, Ly A, Wagenmakers E (2021).
“Bayesian model-averaged meta-analysis in medicine.”
Statistics in Medicine.
doi:10.1002/sim.9170.
Poulsen S, Errboe M, Mevil YL, Glenny A (2006).
“Potassium containing toothpastes for dentine hypersensitivity.”
Cochrane Database of Systematic Reviews.
doi:10.1002/14651858.cd001476.pub2.
Prints marginal_summary object for RoBMA method
## S3 method for class 'marginal_summary.RoBMA' print(x, ...)
## S3 method for class 'marginal_summary.RoBMA' print(x, ...)
x |
a summary of a RoBMA object |
... |
additional arguments |
print.marginal_summary.RoBMA
invisibly returns the print statement.
Prints a fitted RoBMA object
## S3 method for class 'RoBMA' print(x, ...)
## S3 method for class 'RoBMA' print(x, ...)
x |
a fitted RoBMA object. |
... |
additional arguments. |
print.RoBMA
invisibly returns the print statement.
Prints summary object for RoBMA method
## S3 method for class 'summary.RoBMA' print(x, ...)
## S3 method for class 'summary.RoBMA' print(x, ...)
x |
a summary of a RoBMA object |
... |
additional arguments |
print.summary.RoBMA
invisibly returns the print statement.
prior
creates a prior distribution.
The prior can be visualized by the plot
function.
prior( distribution, parameters, truncation = list(lower = -Inf, upper = Inf), prior_weights = 1 )
prior( distribution, parameters, truncation = list(lower = -Inf, upper = Inf), prior_weights = 1 )
distribution |
name of the prior distribution. The possible options are
|
parameters |
list of appropriate parameters for a given
|
truncation |
list with two elements, |
prior_weights |
prior odds associated with a given distribution. The value is passed into the model fitting function, which creates models corresponding to all combinations of prior distributions for each of the model parameters and sets the model priors odds to the product of its prior distributions. |
prior
and prior_none
return an object of class 'prior'.
A named list containing the distribution name, parameters, and prior weights.
plot.prior()
, Normal, Lognormal, Cauchy,
Beta, Exponential,
LocationScaleT, InvGamma.
# create a standard normal prior distribution p1 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1)) # create a half-normal standard normal prior distribution p2 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1), truncation = list(lower = 0, upper = Inf)) # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1)
# create a standard normal prior distribution p1 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1)) # create a half-normal standard normal prior distribution p2 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1), truncation = list(lower = 0, upper = Inf)) # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1)
prior_factor
creates a prior distribution for fitting
models with factor predictors. (Note that results across different operating
systems might vary due to differences in JAGS numerical precision.)
prior_factor( distribution, parameters, truncation = list(lower = -Inf, upper = Inf), prior_weights = 1, contrast = "meandif" )
prior_factor( distribution, parameters, truncation = list(lower = -Inf, upper = Inf), prior_weights = 1, contrast = "meandif" )
distribution |
name of the prior distribution. The possible options are
|
parameters |
list of appropriate parameters for a given
|
truncation |
list with two elements, |
prior_weights |
prior odds associated with a given distribution. The value is passed into the model fitting function, which creates models corresponding to all combinations of prior distributions for each of the model parameters and sets the model priors odds to the product of its prior distributions. |
contrast |
type of contrast for the prior distribution. The possible options are
|
return an object of class 'prior'.
# create an orthonormal prior distribution p1 <- prior_factor(distribution = "mnormal", contrast = "orthonormal", parameters = list(mean = 0, sd = 1))
# create an orthonormal prior distribution p1 <- prior_factor(distribution = "mnormal", contrast = "orthonormal", parameters = list(mean = 0, sd = 1))
prior_informed
creates an informed prior distribution based on past
research. The prior can be visualized by the plot
function.
prior_informed(name, parameter = NULL, type = "smd")
prior_informed(name, parameter = NULL, type = "smd")
name |
name of the prior distribution. There are many options based on prior psychological or medical research. For psychology, the possible options are
For medicine, the possible options are based on Bartoš et al. (2021)
and Bartoš et al. (2023)
who developed empirical prior distributions for the effect size and heterogeneity parameters of the
continuous outcomes (standardized mean differences), dichotomous outcomes (logOR, logRR, and risk differences),
and time to event outcomes (logHR) based on the Cochrane database of systematic reviews.
Use |
parameter |
parameter name describing what prior distribution is supposed to be produced in cases
where the |
type |
prior type describing what prior distribution is supposed to be produced in cases
where the
|
Further details can be found in van Erp et al. (2017), Gronau et al. (2017), and Bartoš et al. (2021).
prior_informed
returns an object of class 'prior'.
Bartoš F, Gronau QF, Timmers B, Otte WM, Ly A, Wagenmakers E (2021).
“Bayesian model-averaged meta-analysis in medicine.”
Statistics in Medicine.
doi:10.1002/sim.9170.
Gronau QF, Van Erp S, Heck DW, Cesario J, Jonas KJ, Wagenmakers E (2017).
“A Bayesian model-averaged meta-analysis of the power pose effect with informed and default priors: The case of felt power.”
Comprehensive Results in Social Psychology, 2(1), 123–138.
doi:10.1080/23743603.2017.1326760.
van Erp S, Verhagen J, Grasman RP, Wagenmakers E (2017).
“Estimates of between-study heterogeneity for 705 meta-analyses reported in Psychological Bulletin from 1990–2013.”
Journal of Open Psychology Data, 5(1).
doi:10.5334/jopd.33.
prior()
, prior_informed_medicine_names
# prior distribution representing expected effect sizes in social psychology # based on prior elicitation with dr. Oosterwijk p1 <- prior_informed("Oosterwijk") # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1) # empirical prior distribution for the standardized mean differences from the oral health # medical subfield based on meta-analytic effect size estimates from the # Cochrane database of systematic reviews p2 <- prior_informed("Oral Health", parameter ="effect", type ="smd") print(p2)
# prior distribution representing expected effect sizes in social psychology # based on prior elicitation with dr. Oosterwijk p1 <- prior_informed("Oosterwijk") # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1) # empirical prior distribution for the standardized mean differences from the oral health # medical subfield based on meta-analytic effect size estimates from the # Cochrane database of systematic reviews p2 <- prior_informed("Oral Health", parameter ="effect", type ="smd") print(p2)
prior
creates a prior distribution.
The prior can be visualized by the plot
function.
prior_none(prior_weights = 1)
prior_none(prior_weights = 1)
prior_weights |
prior odds associated with a given distribution. The value is passed into the model fitting function, which creates models corresponding to all combinations of prior distributions for each of the model parameters and sets the model priors odds to the product of its prior distributions. |
prior
and prior_none
return an object of class 'prior'.
A named list containing the distribution name, parameters, and prior weights.
plot.prior()
, Normal, Lognormal, Cauchy,
Beta, Exponential,
LocationScaleT, InvGamma.
# create a standard normal prior distribution p1 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1)) # create a half-normal standard normal prior distribution p2 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1), truncation = list(lower = 0, upper = Inf)) # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1)
# create a standard normal prior distribution p1 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1)) # create a half-normal standard normal prior distribution p2 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1), truncation = list(lower = 0, upper = Inf)) # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1)
prior
creates a prior distribution for fitting a PET or
PEESE style models in RoBMA. The prior distribution can be visualized
by the plot
function.
prior_PEESE( distribution, parameters, truncation = list(lower = 0, upper = Inf), prior_weights = 1 )
prior_PEESE( distribution, parameters, truncation = list(lower = 0, upper = Inf), prior_weights = 1 )
distribution |
name of the prior distribution. The possible options are
|
parameters |
list of appropriate parameters for a given
|
truncation |
list with two elements, |
prior_weights |
prior odds associated with a given distribution. The value is passed into the model fitting function, which creates models corresponding to all combinations of prior distributions for each of the model parameters and sets the model priors odds to the product of its prior distributions. |
prior_PET
and prior_PEESE
return an object of class 'prior'.
# create a half-Cauchy prior distribution # (PET and PEESE specific functions automatically set lower truncation at 0) p1 <- prior_PET(distribution = "Cauchy", parameters = list(location = 0, scale = 1)) plot(p1)
# create a half-Cauchy prior distribution # (PET and PEESE specific functions automatically set lower truncation at 0) p1 <- prior_PET(distribution = "Cauchy", parameters = list(location = 0, scale = 1)) plot(p1)
prior
creates a prior distribution for fitting a PET or
PEESE style models in RoBMA. The prior distribution can be visualized
by the plot
function.
prior_PET( distribution, parameters, truncation = list(lower = 0, upper = Inf), prior_weights = 1 )
prior_PET( distribution, parameters, truncation = list(lower = 0, upper = Inf), prior_weights = 1 )
distribution |
name of the prior distribution. The possible options are
|
parameters |
list of appropriate parameters for a given
|
truncation |
list with two elements, |
prior_weights |
prior odds associated with a given distribution. The value is passed into the model fitting function, which creates models corresponding to all combinations of prior distributions for each of the model parameters and sets the model priors odds to the product of its prior distributions. |
prior_PET
and prior_PEESE
return an object of class 'prior'.
# create a half-Cauchy prior distribution # (PET and PEESE specific functions automatically set lower truncation at 0) p1 <- prior_PET(distribution = "Cauchy", parameters = list(location = 0, scale = 1)) plot(p1)
# create a half-Cauchy prior distribution # (PET and PEESE specific functions automatically set lower truncation at 0) p1 <- prior_PET(distribution = "Cauchy", parameters = list(location = 0, scale = 1)) plot(p1)
prior_weightfunction
creates a prior distribution for fitting
a RoBMA selection model. The prior can be visualized by the plot
function.
prior_weightfunction(distribution, parameters, prior_weights = 1)
prior_weightfunction(distribution, parameters, prior_weights = 1)
distribution |
name of the prior distribution. The possible options are
|
parameters |
list of appropriate parameters for a given
|
prior_weights |
prior odds associated with a given distribution. The model fitting function usually creates models corresponding to all combinations of prior distributions for each of the model parameters, and sets the model priors odds to the product of its prior distributions. |
prior_weightfunction
returns an object of class 'prior'.
p1 <- prior_weightfunction("one-sided", parameters = list(steps = c(.05, .10), alpha = c(1, 1, 1))) # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1)
p1 <- prior_weightfunction("one-sided", parameters = list(steps = c(.05, .10), alpha = c(1, 1, 1))) # the prior distribution can be visualized using the plot function # (see ?plot.prior for all options) plot(p1)
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, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, 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, ... )
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, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, 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 |
a scale used to define priors. Defaults to |
effect_direction |
the expected direction of the effect. The one-sided
selection sets the weights omega to 1 to significant results in the expected
direction. Defaults to |
model_type |
string specifying the RoBMA ensemble. 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
( |
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 Bartoš et al. (2022). The previous versions
of the package (i.e., RoBMA < 2.0) used specifications proposed by
Maier et al. (2022) (this specification can be easily
obtained by setting model_type = "2w"
. The RoBMA-PP specification from
Bartoš et al. (2022) can be obtained by setting
model_type = "PP"
.
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'.
Bartoš F, Maier M, Wagenmakers E, Doucouliagos H, Stanley TD (2022).
“Robust Bayesian meta-analysis: Model-averaging across complementary publication bias adjustment methods.”
Research Synthesis Methods.
doi:10.1002/jrsm.1594.
Maier M, Bartoš F, Wagenmakers E (2022).
“Robust Bayesian Meta-Analysis: Addressing Publication Bias with Model-Averaging.”
Psychological Methods.
doi:10.1037/met0000405.
van Erp S, Verhagen J, Grasman RP, Wagenmakers E (2017).
“Estimates of between-study heterogeneity for 705 meta-analyses reported in Psychological Bulletin from 1990–2013.”
Journal of Open Psychology Data, 5(1).
doi:10.5334/jopd.33.
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)
## 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)
Controls settings for the autofit process of the MCMC JAGS sampler (specifies termination criteria), and values for the convergence checks.
set_autofit_control( max_Rhat = 1.05, min_ESS = 500, max_error = NULL, max_SD_error = NULL, max_time = list(time = 60, unit = "mins"), sample_extend = 1000, restarts = 10 ) set_convergence_checks( max_Rhat = 1.05, min_ESS = 500, max_error = NULL, max_SD_error = NULL, remove_failed = FALSE, balance_probability = TRUE )
set_autofit_control( max_Rhat = 1.05, min_ESS = 500, max_error = NULL, max_SD_error = NULL, max_time = list(time = 60, unit = "mins"), sample_extend = 1000, restarts = 10 ) set_convergence_checks( max_Rhat = 1.05, min_ESS = 500, max_error = NULL, max_SD_error = NULL, remove_failed = FALSE, balance_probability = TRUE )
max_Rhat |
maximum value of the R-hat diagnostic.
Defaults to |
min_ESS |
minimum estimated sample size.
Defaults to |
max_error |
maximum value of the MCMC error.
Defaults to |
max_SD_error |
maximum value of the proportion of MCMC error
of the estimated SD of the parameter.
Defaults to |
max_time |
list with the time and unit specifying the maximum
autofitting process per model. Passed to difftime function
(possible units are |
sample_extend |
number of samples to extend the fitting process if
the criteria are not satisfied.
Defaults to |
restarts |
number of times new initial values should be generated in case a
model fails to initialize. Defaults to |
remove_failed |
whether models not satisfying the convergence checks should
be removed from the inference. Defaults to |
balance_probability |
whether prior model probability should be balanced
across the combinations of models with the same H0/H1 for effect / heterogeneity / bias
in the case of non-convergence. Defaults to |
set_autofit_control
returns a list of autofit control settings
and set_convergence_checks
returns a list of convergence checks settings.
A placeholder object and functions for the RoBMA package. (adapted from the runjags R package).
RoBMA.options(...) RoBMA.get_option(name)
RoBMA.options(...) RoBMA.get_option(name)
... |
named option(s) to change - for a list of available options, see details below. |
name |
the name of the option to get the current value of - for a list of available options, see details below. |
The current value of all available RoBMA options (after applying any changes specified) is returned invisibly as a named list.
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.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior_factor("spike", parameters = list(location = 0), contrast = "meandif"), 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, ... )
RoBMA.reg( formula, data, test_predictors = TRUE, study_names = NULL, study_ids = NULL, transformation = if (any(colnames(data) != "y")) "fishers_z" else "none", prior_scale = if (any(colnames(data) != "y")) "cohens_d" else "none", standardize_predictors = TRUE, effect_direction = "positive", priors = NULL, model_type = NULL, priors_effect = prior(distribution = "normal", parameters = list(mean = 0, sd = 1)), priors_heterogeneity = prior(distribution = "invgamma", parameters = list(shape = 1, scale = 0.15)), priors_bias = list(prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "two.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.1)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1), steps = c(0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.025, 0.05)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1), steps = c(0.05, 0.5)), prior_weights = 1/12), prior_weightfunction(distribution = "one.sided", parameters = list(alpha = c(1, 1, 1, 1), steps = c(0.025, 0.05, 0.5)), prior_weights = 1/12), prior_PET(distribution = "Cauchy", parameters = list(0, 1), truncation = list(0, Inf), prior_weights = 1/4), prior_PEESE(distribution = "Cauchy", parameters = list(0, 5), truncation = list(0, Inf), prior_weights = 1/4)), priors_effect_null = prior(distribution = "point", parameters = list(location = 0)), priors_heterogeneity_null = prior(distribution = "point", parameters = list(location = 0)), priors_bias_null = prior_none(), priors_hierarchical = prior("beta", parameters = list(alpha = 1, beta = 1)), priors_hierarchical_null = NULL, prior_covariates = prior("normal", parameters = list(mean = 0, sd = 0.25)), prior_covariates_null = prior("spike", parameters = list(location = 0)), prior_factors = prior_factor("mnormal", parameters = list(mean = 0, sd = 0.25), contrast = "meandif"), prior_factors_null = prior_factor("spike", parameters = list(location = 0), contrast = "meandif"), 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, ... )
formula |
a formula for the meta-regression model |
data |
a data object created by the |
test_predictors |
vector of predictor names that will be test
(i.e., assigned both the null and alternative prior distributions).
Defaults to |
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 |
transformation |
transformation to be applied to the supplied
effect sizes before fitting the individual models. Defaults to
|
prior_scale |
a scale used to define priors. Defaults to |
standardize_predictors |
whether continuous predictors should be standardized prior to
estimating the model. Defaults to |
effect_direction |
the expected direction of the effect. The one-sided
selection sets the weights omega to 1 to significant results in the expected
direction. Defaults to |
priors |
named list of prior distributions for each predictor
(with names corresponding to the predictors). It allows users to
specify both the null and alternative hypothesis prior distributions
for each predictor by assigning the corresponding element of the named
list with another named list (with |
model_type |
string specifying the RoBMA ensemble. 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
( |
prior_covariates |
a prior distributions for the regression parameter
of continuous covariates on the effect size under the alternative hypothesis
(unless set explicitly in |
prior_covariates_null |
a prior distributions for the regression parameter
of continuous covariates on the effect size under the null hypothesis
(unless set explicitly in |
prior_factors |
a prior distributions for the regression parameter
of categorical covariates on the effect size under the alternative hypothesis
(unless set explicitly in |
prior_factors_null |
a prior distributions for the regression parameter
of categorical covariates on the effect size under the null hypothesis
(unless set explicitly in |
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. |
See RoBMA()
for more details.
Note that these default prior distributions are relatively wide and more informed prior distributions for testing for the presence of moderation should be considered.
RoBMA.reg
returns an object of class 'RoBMA.reg'.
Bartoš F, Maier M, Wagenmakers E, Doucouliagos H, Stanley TD (2022).
“Robust Bayesian meta-analysis: Model-averaging across complementary publication bias adjustment methods.”
Research Synthesis Methods.
doi:10.1002/jrsm.1594.
van Erp S, Verhagen J, Grasman RP, Wagenmakers E (2017).
“Estimates of between-study heterogeneity for 705 meta-analyses reported in Psychological Bulletin from 1990–2013.”
Journal of Open Psychology Data, 5(1).
doi:10.5334/jopd.33.
RoBMA()
summary.RoBMA()
, update.RoBMA()
, check_setup.reg()
Functions for transforming between standard errors and sample sizes (assuming equal sample sizes per group).
se_d(d, n) n_d(d, se) se_r(r, n) n_r(r, se) se_z(n) n_z(se)
se_d(d, n) n_d(d, se) se_r(r, n) n_r(r, se) se_z(n) n_z(se)
d |
Cohen's d |
n |
sample size of the corresponding effect size |
se |
standard error of the corresponding effect size |
r |
correlation coefficient |
Calculations for Cohen's d, Fisher's z, and log(OR) are based on (Borenstein et al. 2011). Calculations for correlation coefficient were modified to make the standard error corresponding to the computed on Fisher's z scale under the same sample size (in order to make all other transformations consistent). In case that a direct transformation is not available, the transformations are chained to provide the effect size of interest.
Note that sample size and standard error calculation for log(OR) is not available. The standard error is highly dependent on the odds within the groups and sample sizes for individual events are required. Theoretically, the sample size could be obtained by transforming the effect size and standard error to a different measure and obtaining the sample size using corresponding function, however, it leads to a very poor approximation and it is not recommended.
Borenstein M, Hedges LV, Higgins JP, Rothstein HR (2011). Introduction to meta-analysis. John Wiley & Sons.
effect_sizes()
, standard_errors()
Functions for transforming between standard errors of different effect size measures.
se_d2se_logOR(se_d, logOR) se_d2se_r(se_d, d) se_r2se_d(se_r, r) se_logOR2se_d(se_logOR, logOR) se_d2se_z(se_d, d) se_r2se_z(se_r, r) se_r2se_logOR(se_r, r) se_logOR2se_r(se_logOR, logOR) se_logOR2se_z(se_logOR, logOR) se_z2se_d(se_z, z) se_z2se_r(se_z, z) se_z2se_logOR(se_z, z)
se_d2se_logOR(se_d, logOR) se_d2se_r(se_d, d) se_r2se_d(se_r, r) se_logOR2se_d(se_logOR, logOR) se_d2se_z(se_d, d) se_r2se_z(se_r, r) se_r2se_logOR(se_r, r) se_logOR2se_r(se_logOR, logOR) se_logOR2se_z(se_logOR, logOR) se_z2se_d(se_z, z) se_z2se_r(se_z, z) se_z2se_logOR(se_z, z)
se_d |
standard error of Cohen's d |
logOR |
log(odds ratios) |
d |
Cohen's d |
se_r |
standard error of correlation coefficient |
r |
correlation coefficient |
se_logOR |
standard error of log(odds ratios) |
se_z |
standard error of Fisher's z |
z |
Fisher's z |
Transformations for Cohen's d, Fisher's z, and log(OR) are based on (Borenstein et al. 2011). Calculations for correlation coefficient were modified to make the standard error corresponding to the computed on Fisher's z scale under the same sample size (in order to make all other transformations consistent). In case that a direct transformation is not available, the transformations are chained to provide the effect size of interest.
It is important to keep in mind that the transformations are only
approximations to the true values. From our experience,
se_d2se_z
works well for values of se(Cohen's d) < 0.5. Do
not forget that the effect sizes are standardized and variance of
Cohen's d = 1. Therefore, a standard error of study cannot be larger
unless the participants provided negative information (of course, the
variance is dependent on the effect size as well, and, can therefore be
larger).
When setting prior distributions, do NOT attempt to transform a standard
normal distribution on Cohen's d (mean = 0, sd = 1) to a normal
distribution on Fisher's z with mean 0 and sd = se_d2se_z(0, 1)
.
The approximation does NOT work well in this range of values. Instead,
approximate the sd of distribution on Fisher's z using samples in this way:
sd(d2z(rnorm(10000, 0, 1)))
or, specify the distribution on Cohen's d
directly.
Borenstein M, Hedges LV, Higgins JP, Rothstein HR (2011). Introduction to meta-analysis. John Wiley & Sons.
effect_sizes()
, sample_sizes()
summary.RoBMA
creates summary tables for a
RoBMA object.
## S3 method for class 'RoBMA' summary( object, type = "ensemble", conditional = FALSE, output_scale = NULL, probs = c(0.025, 0.975), logBF = FALSE, BF01 = FALSE, short_name = FALSE, remove_spike_0 = FALSE, ... )
## S3 method for class 'RoBMA' summary( object, type = "ensemble", conditional = FALSE, output_scale = NULL, probs = c(0.025, 0.975), logBF = FALSE, BF01 = FALSE, short_name = FALSE, remove_spike_0 = FALSE, ... )
object |
a fitted RoBMA object |
type |
whether to show the overall RoBMA results ( |
conditional |
show the conditional estimates (assuming that the
alternative is true). Defaults to |
output_scale |
transform the meta-analytic estimates to a different
scale. Defaults to |
probs |
quantiles of the posterior samples to be displayed.
Defaults to |
logBF |
show log of Bayes factors. Defaults to |
BF01 |
show Bayes factors in support of the null hypotheses. Defaults to
|
short_name |
whether priors names should be shortened to the first
(couple) of letters. Defaults to |
remove_spike_0 |
whether spike prior distributions with location at zero should
be omitted from the summary. Defaults to |
... |
additional arguments |
summary.RoBMA
returns a list of tables of class 'BayesTools_table'.
See diagnostics()
for visual convergence checks of the individual models.
RoBMA()
, diagnostics()
, check_RoBMA()
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) # summary can provide many details about the model summary(fit) # estimates from the conditional models can be obtained with summary(fit, conditional = TRUE) # overview of the models and their prior and posterior probability, marginal likelihood, # and inclusion Bayes factor can be obtained with summary(fit, type = "models") # diagnostics overview, containing the maximum R-hat, minimum ESS, maximum MCMC error, and # maximum MCMC error / sd across parameters for each individual model can be obtained with summary(fit, type = "diagnostics") # summary of individual models and their parameters can be further obtained by summary(fit, type = "individual") ## End(Not run)
## Not run: # using the example data from Anderson et al. 2010 and fitting the default model # (note that the model can take a while to fit) fit <- RoBMA(r = Anderson2010$r, n = Anderson2010$n, study_names = Anderson2010$labels) # summary can provide many details about the model summary(fit) # estimates from the conditional models can be obtained with summary(fit, conditional = TRUE) # overview of the models and their prior and posterior probability, marginal likelihood, # and inclusion Bayes factor can be obtained with summary(fit, type = "models") # diagnostics overview, containing the maximum R-hat, minimum ESS, maximum MCMC error, and # maximum MCMC error / sd across parameters for each individual model can be obtained with summary(fit, type = "diagnostics") # summary of individual models and their parameters can be further obtained by summary(fit, type = "individual") ## End(Not run)
update.BiBMA
can be used to
add an additional model to an existing "BiBMA"
object by
specifying either a null or alternative prior for each parameter
and the prior odds of the model (prior_weights
), see the
vignette("CustomEnsembles")
vignette,
change the prior odds of fitted models by specifying a vector
prior_weights
of the same length as the fitted models,
refitting models that failed to converge with updated settings of control parameters,
or changing the convergence criteria and recalculating the ensemble
results by specifying new control
argument and setting
refit_failed == FALSE
.
## S3 method for class 'BiBMA' update( object, refit_failed = TRUE, extend_all = FALSE, prior_effect = NULL, prior_heterogeneity = NULL, prior_baseline = NULL, prior_weights = NULL, prior_effect_null = NULL, prior_heterogeneity_null = NULL, prior_baseline_null = NULL, study_names = NULL, chains = NULL, adapt = NULL, burnin = NULL, sample = NULL, thin = NULL, autofit = NULL, parallel = NULL, autofit_control = NULL, convergence_checks = NULL, save = "all", seed = NULL, silent = TRUE, ... )
## S3 method for class 'BiBMA' update( object, refit_failed = TRUE, extend_all = FALSE, prior_effect = NULL, prior_heterogeneity = NULL, prior_baseline = NULL, prior_weights = NULL, prior_effect_null = NULL, prior_heterogeneity_null = NULL, prior_baseline_null = NULL, study_names = NULL, chains = NULL, adapt = NULL, burnin = NULL, sample = NULL, thin = NULL, autofit = NULL, parallel = NULL, autofit_control = NULL, convergence_checks = NULL, save = "all", seed = NULL, silent = TRUE, ... )
object |
a fitted BiBMA object |
refit_failed |
whether failed models should be refitted. Relevant only
if new priors or |
extend_all |
extend sampling in all fitted models based on |
prior_effect |
prior distribution for the effect size ( |
prior_heterogeneity |
prior distribution for the heterogeneity |
prior_baseline |
prior distribution for the intercepts ( |
prior_weights |
either a single value specifying prior model weight of a newly specified model using priors argument, or a vector of the same length as already fitted models to update their prior weights. |
prior_effect_null |
prior distribution for the effect size ( |
prior_heterogeneity_null |
prior distribution for the heterogeneity |
prior_baseline_null |
prior distribution for the intercepts ( |
study_names |
an optional argument with the names of the studies |
chains |
a number of chains of the MCMC algorithm. |
adapt |
a number of adaptation iterations of the MCMC algorithm.
Defaults to |
burnin |
a number of burnin iterations of the MCMC algorithm.
Defaults to |
sample |
a number of sampling iterations of the MCMC algorithm.
Defaults to |
thin |
a thinning of the chains of the MCMC algorithm. Defaults to
|
autofit |
whether the model should be fitted until the convergence
criteria (specified in |
parallel |
whether the individual models should be fitted in parallel.
Defaults to |
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. |
See BiBMA()
for more details.
BiBMA
returns an object of class 'BiBMA'.
BiBMA()
, summary.RoBMA()
, prior()
, check_setup()
update.RoBMA
can be used to
add an additional model to an existing "RoBMA"
object by
specifying either a null or alternative prior for each parameter
and the prior odds of the model (prior_weights
), see the
vignette("CustomEnsembles")
vignette,
change the prior odds of fitted models by specifying a vector
prior_weights
of the same length as the fitted models,
refitting models that failed to converge with updated settings of control parameters,
or changing the convergence criteria and recalculating the ensemble
results by specifying new control
argument and setting
refit_failed == FALSE
.
## S3 method for class 'RoBMA' update( object, refit_failed = TRUE, extend_all = FALSE, prior_effect = NULL, prior_heterogeneity = NULL, prior_bias = NULL, prior_hierarchical = NULL, prior_weights = NULL, prior_effect_null = NULL, prior_heterogeneity_null = NULL, prior_bias_null = NULL, prior_hierarchical_null = NULL, study_names = NULL, chains = NULL, adapt = NULL, burnin = NULL, sample = NULL, thin = NULL, autofit = NULL, parallel = NULL, autofit_control = NULL, convergence_checks = NULL, save = "all", seed = NULL, silent = TRUE, ... )
## S3 method for class 'RoBMA' update( object, refit_failed = TRUE, extend_all = FALSE, prior_effect = NULL, prior_heterogeneity = NULL, prior_bias = NULL, prior_hierarchical = NULL, prior_weights = NULL, prior_effect_null = NULL, prior_heterogeneity_null = NULL, prior_bias_null = NULL, prior_hierarchical_null = NULL, study_names = NULL, chains = NULL, adapt = NULL, burnin = NULL, sample = NULL, thin = NULL, autofit = NULL, parallel = NULL, autofit_control = NULL, convergence_checks = NULL, save = "all", seed = NULL, silent = TRUE, ... )
object |
a fitted RoBMA object |
refit_failed |
whether failed models should be refitted. Relevant only
if new priors or |
extend_all |
extend sampling in all fitted models based on |
prior_effect |
prior distribution for the effect size ( |
prior_heterogeneity |
prior distribution for the heterogeneity |
prior_bias |
prior distribution for the publication bias adjustment
component that will be treated as belonging to the alternative hypothesis.
Defaults to |
prior_hierarchical |
prior distribution for the correlation of random effects
( |
prior_weights |
either a single value specifying prior model weight of a newly specified model using priors argument, or a vector of the same length as already fitted models to update their prior weights. |
prior_effect_null |
prior distribution for the effect size ( |
prior_heterogeneity_null |
prior distribution for the heterogeneity |
prior_bias_null |
prior distribution for the publication bias adjustment
component that will be treated as belonging to the null hypothesis.
Defaults to |
prior_hierarchical_null |
prior distribution for the correlation of random effects
( |
study_names |
an optional argument with the names of the studies |
chains |
a number of chains of the MCMC algorithm. |
adapt |
a number of adaptation iterations of the MCMC algorithm.
Defaults to |
burnin |
a number of burnin iterations of the MCMC algorithm.
Defaults to |
sample |
a number of sampling iterations of the MCMC algorithm.
Defaults to |
thin |
a thinning of the chains of the MCMC algorithm. Defaults to
|
autofit |
whether the model should be fitted until the convergence
criteria (specified in |
parallel |
whether the individual models should be fitted in parallel.
Defaults to |
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. |
See RoBMA()
for more details.
RoBMA
returns an object of class 'RoBMA'.
RoBMA()
, summary.RoBMA()
, prior()
, 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) # the update function allows us to change the prior model weights of each model fit1 <- update(fit, prior_weights = c(0, rep(1, 35))) # add an additional model with different priors specification # (see '?prior' for more information) fit2 <- update(fit, priors_effect_null = prior("point", parameters = list(location = 0)), priors_heterogeneity = prior("normal", parameters = list(mean = 0, sd = 1), truncation = list(lower = 0, upper = Inf)), priors_bias = prior_weightfunction("one-sided", parameters = list(cuts = c(.05, .10, .20), alpha = c(1, 1, 1, 1)))) # update the models with an increased number of sample iterations fit3 <- update(fit, autofit_control = set_autofit_control(sample_extend = 1000), extend_all = TRUE) ## End(Not run)
## 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) # the update function allows us to change the prior model weights of each model fit1 <- update(fit, prior_weights = c(0, rep(1, 35))) # add an additional model with different priors specification # (see '?prior' for more information) fit2 <- update(fit, priors_effect_null = prior("point", parameters = list(location = 0)), priors_heterogeneity = prior("normal", parameters = list(mean = 0, sd = 1), truncation = list(lower = 0, upper = Inf)), priors_bias = prior_weightfunction("one-sided", parameters = list(cuts = c(.05, .10, .20), alpha = c(1, 1, 1, 1)))) # update the models with an increased number of sample iterations fit3 <- update(fit, autofit_control = set_autofit_control(sample_extend = 1000), extend_all = TRUE) ## End(Not run)
Density function for the weighted multivariate normal
distribution with mean
, covariance matrix sigma
,
critical values crit_x
, and weights omega
.
x |
quantiles. |
p |
vector of probabilities. |
mean |
mean |
sigma |
covariance matrix. |
crit_x |
vector of critical values defining steps. |
omega |
vector of weights defining the probability of observing a t-statistics between each of the two steps. |
type |
type of weight function (defaults to |
log , log.p
|
logical; if |
.dwmnorm_fast
returns a density of the multivariate
weighted normal distribution.
Density, distribution function, quantile function
and random generation for the weighted normal distribution with
mean
, standard deviation sd
, steps steps
(or critical values) crit_x
), and weights omega
.
dwnorm( x, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided", log = FALSE ) pwnorm( q, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided", lower.tail = TRUE, log.p = FALSE ) qwnorm( p, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided", lower.tail = TRUE, log.p = FALSE ) rwnorm( n, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided" )
dwnorm( x, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided", log = FALSE ) pwnorm( q, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided", lower.tail = TRUE, log.p = FALSE ) qwnorm( p, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided", lower.tail = TRUE, log.p = FALSE ) rwnorm( n, mean, sd, steps = if (!is.null(crit_x)) NULL, omega, crit_x = if (!is.null(steps)) NULL, type = "two.sided" )
x , q
|
vector of quantiles. |
mean |
mean |
sd |
standard deviation. |
steps |
vector of steps for the weight function. |
omega |
vector of weights defining the probability of observing a t-statistics between each of the two steps. |
crit_x |
vector of critical values defining steps
(if |
type |
type of weight function (defaults to |
log , log.p
|
logical; if |
lower.tail |
logical; if |
p |
vector of probabilities. |
n |
number of observations. If length(n) > 1, the length is taken to be the number required. |
The mean
, sd
, steps
, omega
can be
supplied as a vectors (mean
, sd
) or matrices (steps
,
omega
) with length / number of rows equal to x
/q
/
p
. Otherwise, they are recycled to the length of the result.
dwnorm
gives the density, dwnorm
gives the
distribution function, qwnorm
gives the quantile function,
and rwnorm
generates random deviates.