% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-clinical.R
\name{geom_forest}
\alias{geom_forest}
\title{Forest plot}
\usage{
geom_forest(
  mapping = NULL,
  data = NULL,
  ref = 1,
  color = NULL,
  linewidth = NULL
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Map the estimate to \code{x},
the study/subgroup to \code{y}, and the interval to \code{xmin}/\code{xmax}
(via \code{ymin}/\code{ymax}, which are swapped for you). Map \code{size} to weight.}

\item{ref}{Reference line position: \code{1} for ratios (default), \code{0} for
mean differences, \code{NA} to omit.}

\item{color}{Marker and whisker color.}

\item{linewidth}{Whisker width.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Point estimates with confidence intervals down a category axis, with a
dashed no-effect reference line — the standard display for hazard/odds
ratios, subgroup analyses, and meta-analyses. Marker area encodes study
weight when \code{size} is mapped.
}
\examples{
d <- data.frame(
  study = c("Trial A", "Trial B", "Trial C", "Pooled"),
  hr = c(0.82, 0.71, 0.95, 0.83),
  lo = c(0.65, 0.52, 0.78, 0.74),
  hi = c(1.03, 0.97, 1.16, 0.93),
  weight = c(30, 22, 28, 100)
)
ggnext(d, aes(hr, study, ymin = lo, ymax = hi, size = weight)) +
  geom_forest() +
  labs(title = "Hazard ratio by trial", x = "Hazard ratio (95\% CI)", y = NULL)
}
