% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/zplot.R
\name{lines.zplot_brma}
\alias{lines.zplot_brma}
\title{Add Zplot Density Lines}
\usage{
\method{lines}{zplot_brma}(
  x,
  plot_type = "base",
  probs = c(0.025, 0.975),
  max_samples = 10000,
  plot_ci = TRUE,
  extrapolate = FALSE,
  from = -6,
  to = 6,
  by = 0.05,
  length.out = NULL,
  col = "black",
  as_data = FALSE,
  ...
)
}
\arguments{
\item{x}{a zplot_brma object.}

\item{plot_type}{graphics system: \code{"base"} or \code{"ggplot"}.
Defaults to \code{"base"}.}

\item{probs}{quantiles for credible intervals. Defaults to \code{c(.025, .975)}.}

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

\item{plot_ci}{whether to show credible interval bands. Defaults to \code{TRUE}.}

\item{extrapolate}{whether to remove bias adjustments. Defaults to \code{FALSE}.}

\item{from, to}{z-value range for density. Defaults to \code{-6} and \code{6}.}

\item{by}{step size for density points. Defaults to 0.05.}

\item{length.out}{number of density points (alternative to \code{by}).}

\item{col}{line color. Defaults to \code{"black"}.}

\item{as_data}{whether to return data instead of plotting. Defaults to \code{FALSE}.}

\item{...}{additional graphical parameters.}
}
\value{
\code{NULL} invisibly for base graphics, ggplot2 layers for ggplot,
or a data frame with columns \code{x}, \code{y}, \code{y_lCI}, \code{y_uCI}
if \code{as_data = TRUE}.
}
\description{
Adds model-implied density lines to an existing zplot.
}
\details{
When \code{extrapolate = FALSE}, the density includes all bias adjustments
(PET/PEESE regression, selection weights) representing the fitted model.
When \code{extrapolate = TRUE}, bias adjustments are removed to show the
hypothetical distribution without publication bias. Under selection models,
the curve is scaled by inverse selection probability and need not integrate
to one.
}
\seealso{
\code{\link[=plot.zplot_brma]{plot.zplot_brma()}}, \code{\link[=hist.zplot_brma]{hist.zplot_brma()}}
}
