% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/zplot.R
\name{as_zplot.brma}
\alias{as_zplot.brma}
\alias{as_zplot}
\title{Transform brma Object to Zplot}
\usage{
\method{as_zplot}{brma}(
  object,
  significance_level = stats::qnorm(0.975),
  max_samples = 10000,
  ...
)
}
\arguments{
\item{object}{a normal-outcome \code{brma} object.}

\item{significance_level}{z-value threshold for significance. Defaults
to \code{qnorm(0.975)} (two-sided alpha = 0.05).}

\item{max_samples}{maximum number of posterior samples for estimation.
Defaults to 10000. Use \code{Inf} to use all posterior samples.}

\item{...}{additional arguments (currently unused).}
}
\value{
The input object with added class \code{"zplot_brma"} and a new
\code{zplot} list component containing:
\describe{
\item{estimates}{a list with posterior samples for \code{EDR} and
missing-study \code{weights}}
\item{data}{a list with \code{significance_level}, observed
\code{z}-statistics, \code{N_significant}, and \code{N_observed}}
}
}
\description{
Transforms an estimated brma model into a zplot object
that can be summarized and plotted to assess replicability.
}
\details{
Zplot analysis estimates the Expected Discovery Rate (EDR), the posterior
mean probability that an exact replication would be statistically significant
at the supplied threshold. This provides insight into the replicability of
findings in a literature.

The implementation uses extrapolation mode by default, which removes
selection-model weights when evaluating the model-implied z-value density.
PET/PEESE regression terms remain part of the fitted location model.
Zplot diagnostics are available only for normal outcome models. GLMM
objects are rejected because their raw likelihood is on a count scale while
zplot diagnostics require observed effect-size z-statistics with standard
errors.

The resulting object retains all original brma properties while adding
zplot results, enabling both standard meta-analytic summaries and
zplot diagnostics on the same object.
}
\examples{
\dontrun{
if (requireNamespace("metadat", quietly = TRUE)) {
  data(dat.lehmann2018, package = "metadat")
  fit <- bPET(yi = yi, vi = vi, data = dat.lehmann2018, measure = "SMD")

  zfit <- as_zplot(fit)
  summary(zfit)
  plot(zfit)
}
}

}
\seealso{
\code{\link[=summary.zplot_brma]{summary.zplot_brma()}}, \code{\link[=plot.zplot_brma]{plot.zplot_brma()}}, \code{\link[=hist.zplot_brma]{hist.zplot_brma()}}
}
