Plot prevalence of binary covariates in the target and comparator cohorts, before and after matching.
Requires running computeCovariateBalance
first.
plotCovariatePrevalence(
balance,
threshold = 0,
title = "Covariate prevalence",
fileName = NULL,
beforeLabel = "Before matching",
afterLabel = "After matching",
targetLabel = "Target",
comparatorLabel = "Comparator"
)
A data frame created by the computeCovariateBalance
function.
A threshold value for standardized difference. When exceeding the threshold, covariates will be
marked in a different color. If threshold = 0
, no color coding will be used.
The main title for the plot.
Name of the file where the plot should be saved, for example 'plot.png'. See the
function ggsave
in the ggplot2 package for supported file formats.
Label for the before matching / stratification panel.
Label for the after matching / stratification panel.
Label for the x-axis.
Label for the y-axis.
A ggplot object. Use the ggplot2::ggsave function to save to file in a different format.