
Last chance! 50% off unlimited learning
Sale ends in
Bayes factor message for random-effects meta-analysis
bf_meta_message(
data,
k = 2,
d = "norm",
d.par = c(mean = 0, sd = 0.3),
tau = "halfcauchy",
tau.par = c(scale = 0.5),
iter = 10000,
summarize = "stan",
caption = NULL,
messages = TRUE,
...
)
data frame containing the variables for effect size y
,
standard error SE
, labels
, and moderators per study.
Number of digits after decimal point (should be an integer)
(Default: k = 2
).
the prior distribution of the average effect size "norm"
) or via
prior
.
prior parameters for d
specifies
the type of family).
the prior distribution of the between-study heterogeneity
"halfcauchy"
) or via prior
.
prior parameters for tau
specifies the type of family).
number of MCMC iterations using Stan.
how to estimate parameter summaries (mean, median, SD,
etc.): Either by numerical integration (summarize = "integrate"
) or
based on MCMC/Stan samples (summarize = "stan"
).
The text for the plot caption.
Decides whether messages references, notes, and warnings are
to be displayed (Default: TRUE
).
further arguments passed to rstan::sampling
(see
stanmodel-method-sampling
). Relevant MCMC settings
concern the number of warmup samples that are discarded
(warmup=500
), the total number of iterations per chain
(iter=2000
), the number of MCMC chains (chains=4
), whether
multiple cores should be used (cores=4
), and control arguments that
make the sampling in Stan more robust, for instance:
control=list(adapt_delta=.97)
.
# NOT RUN {
# }
# NOT RUN {
# setup
set.seed(123)
library(metaBMA)
# creating a dataframe
(df <-
structure(
.Data = list(
study = c("1", "2", "3", "4", "5"),
estimate = c(
0.382047603321706,
0.780783111514665,
0.425607573765058,
0.558365541235078,
0.956473848429961
),
std.error = c(
0.0465576338644502,
0.0330218199731529,
0.0362834986178494,
0.0480571500648261,
0.062215818388157
)
),
row.names = c(NA, -5L),
class = c("tbl_df", "tbl", "data.frame")
))
# getting Bayes factor in favor of null hypothesis
ggstatsplot::bf_meta_message(
data = df,
k = 3,
iter = 1500,
messages = TRUE
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab