% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bridgesampling.R
\name{bf.brma}
\alias{bf.brma}
\alias{bayes_factor.brma}
\title{Bayes Factor for brma Objects}
\usage{
\method{bf}{brma}(x1, x2, log = FALSE, ...)

\method{bayes_factor}{brma}(x1, x2, log = FALSE, ...)
}
\arguments{
\item{x1}{a brma model object (numerator).}

\item{x2}{a brma model object (denominator).}

\item{log}{logical; if \code{TRUE}, the log Bayes factor is returned.
Default is \code{FALSE}.}

\item{...}{additional arguments (currently not used).}
}
\value{
A list of class \code{"bf_default"} with components:
\itemize{
\item \code{bf}: (scalar) value of the Bayes factor in favor of
\code{x1} over \code{x2}.
\item \code{log}: Boolean indicating whether \code{bf} corresponds
to the log Bayes factor.
}
}
\description{
Compute the Bayes factor comparing two brma models.
}
\details{
Computes the Bayes factor in favor of the model \code{x1} over the
model \code{x2}. The marginal likelihoods must first be computed using
\code{\link{add_marglik}}. Both models must be fitted to the same
outcome target/data, including outcome type and, when present, weights and
cluster identifiers.
}
\examples{
\dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")
  fit1 <- brma(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")
  fit2 <- brma(
    yi           = yi,
    vi           = vi,
    data         = dat.lehmann2018,
    measure      = "SMD",
    prior_effect = FALSE
  )

  fit1 <- add_marglik(fit1)
  fit2 <- add_marglik(fit2)

  bf(fit1, fit2)
}
}

}
\seealso{
\code{\link{add_marglik}}, \code{\link{bridge_sampler.brma}},
\code{\link{post_prob.brma}}, \code{\link{logml.brma}}
}
