% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-clinical.R
\name{geom_smd}
\alias{geom_smd}
\title{Baseline covariate balance (standardized mean difference) plot}
\usage{
geom_smd(data, group, vars = NULL, threshold = 0.1, color = NULL)
}
\arguments{
\item{data}{A data frame with one row per subject: a two-level \code{group}
column and one or more numeric covariate columns.}

\item{group}{Name of the two-level grouping column (treatment arm).}

\item{vars}{Character vector of covariate columns; default all numeric
columns other than \code{group}.}

\item{threshold}{Dashed-line threshold in SMD units; \code{NULL} or \code{0}
omits it.}

\item{color}{Marker and whisker color.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
The standardized mean difference (Cohen's d) between two groups for
each covariate, down a category axis with a reference line at
SMD = 0 and a dashed line at the conventional 0.1 "acceptable
imbalance" threshold — the standard baseline balance check for a
randomized or propensity-matched comparison.
}
\examples{
set.seed(1)
d <- data.frame(
  arm = rep(c("treatment", "control"), each = 50),
  age = c(rnorm(50, 55, 8), rnorm(50, 58, 9)),
  bmi = c(rnorm(50, 27, 4), rnorm(50, 27.5, 4)),
  sbp = c(rnorm(50, 130, 12), rnorm(50, 129, 11))
)
ggnext() +
  geom_smd(d, group = "arm") +
  labs(title = "Baseline balance", x = "Standardized mean difference", y = NULL)
}
