% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/marginal_means.R
\name{marginal_means.brma}
\alias{marginal_means.brma}
\title{Estimated Marginal Means for brma Objects}
\usage{
\method{marginal_means}{brma}(
  object,
  null_hypothesis = 0,
  normal_approximation = FALSE,
  n_samples = 10000,
  output_measure = NULL,
  transform = NULL,
  bf = NULL,
  ...
)
}
\arguments{
\item{object}{a fitted \code{brma} object with moderators.}

\item{null_hypothesis}{point null hypothesis used for inclusion Bayes
factors. Defaults to \code{0}.}

\item{normal_approximation}{whether prior and posterior density at the null
should be approximated with a normal distribution. Defaults to \code{FALSE}.}

\item{n_samples}{number of samples/grid points used by BayesTools for
marginal prior densities. Defaults to \code{10000}.}

\item{output_measure}{effect-size measure for location/effect predictions.
Defaults to the fitted measure. Supported conversions are among \code{"SMD"},
\code{"COR"}, \code{"ZCOR"}, and \code{"OR"}; \code{"RR"}, \code{"HR"},
\code{"IRR"}, \code{"RD"}, and \code{"GEN"} can only be returned on their
fitted measure. Use \code{transform = "EXP"} for ratio-scale output from
log-scale measures.}

\item{transform}{optional display transformation. Currently \code{"EXP"}
exponentiates log-scale measures \code{"OR"}, \code{"RR"}, \code{"HR"},
and \code{"IRR"}.}

\item{bf}{whether inclusion Bayes factors should be shown by default in
summaries. Defaults to \code{TRUE} for RoBMA/BMA objects and \code{FALSE}
for single-model \code{brma} objects.}

\item{...}{additional arguments (currently ignored).}
}
\value{
A list of class \code{marginal_means.brma} containing the
BayesTools \code{marginal_inference} object and parameter metadata.
}
\description{
Computes estimated marginal means for a fitted \code{brma}
object with moderators using \code{BayesTools::as_marginal_inference()}.
}
\examples{
\dontrun{
if (requireNamespace("metadat", quietly = TRUE) &&
    requireNamespace("metafor", quietly = TRUE)) {
  data(dat.bcg, package = "metadat")
  dat <- metafor::escalc(
    measure = "RR",
    ai      = tpos,
    bi      = tneg,
    ci      = cpos,
    di      = cneg,
    data    = dat.bcg
  )

  fit <- brma(yi = yi, vi = vi, mods = ~ alloc, data = dat, measure = "RR")
  mm  <- marginal_means(fit)
  summary(mm)
  plot(mm, parameter = "alloc")
}
}

}
\seealso{
\code{\link[=summary]{summary()}}, \code{\link[=plot]{plot()}}, \code{\link[=summary.brma]{summary.brma()}}, \code{\link[=regplot]{regplot()}}
}
