plot.strat | R Documentation |
Plots the standardized mean differences for strat
objects in the format of Love (2002).
## S3 method for class 'strat'
plot(
x,
incl_none = TRUE,
incl_base = TRUE,
by_strata = FALSE,
weighted_avg = FALSE,
legend = c("No strata", "Base strata", "Refined strata"),
...
)
x |
object of S3 class 'strat' |
incl_none |
whether to plot imbalances before any stratification |
incl_base |
whether to plot imbalances for the base stratification (if one exists) |
by_strata |
whether to generate a list of plots, one for each base stratum if
|
weighted_avg |
whether to take the weighted average instead of the straight average
when collapsing standardized mean differences across strata. Default is |
legend |
a vector of labels to use for the three stratifications on the plot.
The corresponding label for any stratification that is not to be plotted must
still be provided but will be ignored and
can be set to |
... |
further arguments passed to or from other methods |
Either a ggplot object for the Love plot of standardized mean differences or
a list of such ggplot objects if by_strata
is TRUE
Love, T. E. (2002), "Displaying covariate balance after adjustment for selection bias", Joint Statistical Meetings, yumpu.com/en/document/read/41664623.
# Choose 800 patients and 5 covariates to work with for the example
set.seed(28)
samp <- sample(1:nrow(rhc_X), 800)
cov_samp <- sample(1:26, 5)
ref <- refine(X = rhc_X[samp, cov_samp], z = rhc_X[samp, "z"])
plot(ref)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.