ggstatsplot (version 0.1.1)

bf_meta_message: Bayes factor message for random-effects meta-analysis

Description

Bayes factor message for random-effects meta-analysis

Usage

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, ...)

Arguments

data

data frame containing the variables for effect size y, standard error SE, labels, and moderators per study.

k

Number of digits after decimal point (should be an integer) (Default: k = 2).

d

the prior distribution of the average effect size \(d\) specified either as the type of family (e.g., "norm") or via prior.

d.par

prior parameters for \(d\) (only used if d specifies the type of family).

tau

the prior distribution of the between-study heterogeneity \(\tau\) specified either as a character value (e.g., "halfcauchy") or via prior.

tau.par

prior parameters for \(\tau\) (only used if tau specifies the type of family).

iter

number of MCMC iterations using Stan.

summarize

how to estimate parameter summaries (mean, median, SD, etc.): Either by numerical integration (summarize = "integrate") or based on MCMC/Stan samples (summarize = "stan").

caption

The text for the plot caption.

messages

Decides whether messages references, notes, and warnings are to be displayed (Default: TRUE).

...

further arguments passed to rstan::sampling (see stanmodel-method-sampling). For instance: warmup=500, chains=4, control=list(adapt_delta=.95)).

Examples

Run this code
# 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