% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot_prior}
\alias{plot_prior}
\alias{plot_prior.prior}
\alias{plot_prior.brma}
\title{Plot Prior Distributions}
\usage{
plot_prior(x, ...)

\method{plot_prior}{prior}(x, plot_type = "base", ...)

\method{plot_prior}{brma}(
  x,
  parameter = "mu",
  parameter_mods,
  parameter_scale,
  standardized_coefficients = TRUE,
  output_measure = NULL,
  transform = NULL,
  plot_type = "base",
  ...
)
}
\arguments{
\item{x}{a \code{brma}, \code{BMA}, or \code{RoBMA} object, or a prior
distribution object.}

\item{...}{additional arguments passed to the prior plotting method.}

\item{plot_type}{whether to use a base plot \code{"base"} or ggplot2
\code{"ggplot"} for plotting. Defaults to \code{"base"}.}

\item{parameter}{character. Base parameter to plot. Defaults to \code{"mu"}.
Common options are \code{"mu"}, \code{"tau"}, \code{"rho"}, \code{"PET"},
\code{"PEESE"}, \code{"omega"}, and \code{"bias"}, with aliases
\code{"effect"} = \code{"mu"}, \code{"heterogeneity"} = \code{"tau"},
and \code{"weightfunction"} = \code{"omega"}. \code{"bias"} plots only
non-mixed or homogeneous bias priors; for mixed weightfunction and PET/PEESE
mixtures use \code{"omega"}, \code{"PET"}, or \code{"PEESE"}. Moderator and
scale terms can also be selected by name when unambiguous. A character vector
requests multiple base parameters.}

\item{parameter_mods}{character. Moderator term to plot.
Use \code{"intercept"} for the adjusted effect in meta-regression models.}

\item{parameter_scale}{character. Scale-regression term to plot.
Use \code{"intercept"} for the heterogeneity intercept in location-scale models.}

\item{standardized_coefficients}{whether to plot moderator and scale-regression
priors on the standardized predictor scale. Defaults to \code{TRUE}, which
shows the priors as specified. Set to \code{FALSE} to transform them to the
original predictor scale when continuous predictors were standardized.}

\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"}.}
}
\value{
\code{plot_prior} returns either \code{NULL} invisibly if
\code{plot_type = "base"} or a \code{ggplot2} object if
\code{plot_type = "ggplot"}. If multiple parameters are requested, a named
list is returned, invisibly for base plots.
}
\description{
\code{plot_prior} visualizes prior distributions stored in
\code{brma}, \code{BMA}, and \code{RoBMA} objects.
This is especially useful for objects created with \code{only_priors = TRUE}.
}
\details{
\code{output_measure} and \code{transform} transform the prior
plotting scale only for effect-size location priors (\code{"mu"} or the
meta-regression intercept).
}
\examples{
\dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")

  priors <- BMA(
    yi           = yi,
    vi           = vi,
    mods         = ~ Preregistered,
    data         = dat.lehmann2018,
    measure      = "SMD",
    only_priors  = TRUE
  )

  plot_prior(priors, parameter = "mu")
  plot_prior(priors, parameter = "tau")
  plot_prior(priors, parameter_mods = "Preregistered")
}
}

}
\seealso{
\code{\link[=BMA]{BMA()}} \code{\link[=RoBMA]{RoBMA()}} \code{\link[=brma]{brma()}} \code{\link[=prior]{prior()}}
}
