ggstatsplot (version 0.0.11)

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(0, 0.3),
  tau = "halfcauchy", tau.par = 0.5, sample = 10000,
  summarize = "integrate", caption = NULL, messages = TRUE, ...)

Arguments

data

A dataframe. It must contain columns named estimate (corresponding estimates of coefficients or other quantities of interest) and std.error (the standard error of the regression term).

k

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

d

type of prior for mean effect \(d\) (see prior)

d.par

prior parameters for \(d\)

tau

type of prior for standard deviation of study effects \(\tau\) in random-effects meta-analysis (i.e., the SD of d across studies; see prior)

tau.par

prior parameters for \(\tau\)

sample

number of samples in JAGS after burn-in and thinning (see run.jags). Samples are used to get posterior estimates for each study effect (which will show shrinkage). Only works for priors defined in prior.

summarize

whether and to compute parameter summaries (mean, median, SD, 95% quantile interval, HPD interval). If summarize = "integrate", numerical integration is used (which is precise but can require some seconds of computing time), summarize = "jags" summarizes the JAGS samples, and summarize = "none" suppresses parameter summaries.

caption

The text for the plot caption.

messages

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

...

arguments passed to run.jags (e.g., MCMC parameters such as sample, burnin, n.chains, thin or method="parallel")

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,
  sample = 50,
  messages = FALSE
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab