% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Balance.R
\name{plotCovariatePrevalence}
\alias{plotCovariatePrevalence}
\title{Plot covariate prevalence}
\usage{
plotCovariatePrevalence(
  balance,
  threshold = 0,
  title = "Covariate prevalence",
  fileName = NULL,
  beforeLabel = "Before matching",
  afterLabel = "After matching",
  targetLabel = "Target",
  comparatorLabel = "Comparator"
)
}
\arguments{
\item{balance}{A data frame created by the \code{computeCovariateBalance} function.}

\item{threshold}{A threshold value for standardized difference. When exceeding the threshold, covariates will be
marked in a different color. If \code{threshold = 0}, no color coding will be used.}

\item{title}{The main title for the plot.}

\item{fileName}{Name of the file where the plot should be saved, for example 'plot.png'. See the
function \code{ggsave} in the ggplot2 package for supported file formats.}

\item{beforeLabel}{Label for the before matching / stratification panel.}

\item{afterLabel}{Label for the after matching / stratification panel.}

\item{targetLabel}{Label for the x-axis.}

\item{comparatorLabel}{Label for the y-axis.}
}
\value{
A ggplot object. Use the \link[ggplot2:ggsave]{ggplot2::ggsave} function to save to file in a different
format.
}
\description{
Plot prevalence of binary covariates in the target and comparator cohorts, before and after matching.
Requires running \code{computeCovariateBalance} first.
}
