| Balance Statistics {cobalt} | R Documentation |
bal.tab and love.plotbal.tab and love.plot display balance statistics for the included covariates. Which balance statistics are displayed is controlled by the stats argument in each of these functions. The argument to stats should be a character vector with the names of the balance statistics to be displayed. This page describes all of the available balance statistics and how to request them. Abbreviations are allowed, so you can use the first few letters of each balance statistics to request it instead of typing out its whole name. That convention is used throughout the documentation. For example, to request mean differences and variance ratios in bal.tab or love.plot, you could include stats = c("m", "v"). In addition, the thresholds argument uses the same naming conventions and can be used to request balance thresholds on each statistic. For example, to request a balance threshold of .1 for mean differences, you could include thresholds = c(m = .1).
Below, each allowable entry to stats and thresholds are described, along with other details or option that accompany them.
"mean.diffs"Mean differences as computed by col_w_smd. Can be abbreviated as "m". Setting the arguments continuous and binary to either "std" or "raw" will determine whether standardized mean differences or raw mean differences are calculated for continuous and categorical variables, respectively. When standardized mean differences are requested, the s.d.denom argument controls how the standardization occurs. When abs = TRUE, negative values become positive. Mean differences are requested by default when no entry to stats is provided. Can also be requested using the disp.diff argument. Thresholds can also be requested using m.threshold.
"variance.ratios"Variance ratios as computed by col_w_vr. Can be abbreviated as "v". Will not be computed for binary variables. When abs = TRUE, values less than 1 will have their inverse taken. Can also be requested using the disp.v.ratio argument. Thresholds can also be requested using v.threshold. When used with love.plot, the x-axis scaled will be logged so that, e.g., .5 is as far away from 1 as 2 is.
"ks.statistics"Kolmogrov-Smirnov (KS) statistics as computed by col_w_ks. Can be abbreviated as "ks". Can also be requested using the disp.ks argument. Thresholds can also be requested using ks.threshold.
"ovl.coefficients"Overlapping (OVL) statistics as computed by col_w_ovl. Can be abbreviated as "ovl". Additional arguments passed to col_w_ovl, such as integrate or bw, can be supplied to bal.tab or love.plot. Can also be requested using the disp.ovl argument. Thresholds can also be requested using ovl.threshold.
"correlations"Pearson correlations as computed by col_w_cov. Can be abbreviated as "cor". Setting the arguments continuous and binary to either "std" or "raw" will determine whether correlations or covariances are calculated for continuous and categorical variables, respectively (they are both "std" by default). When correlations are requested, the s.d.denom argument controls how the standardization occurs. When abs = TRUE, negative values become positive. Pearson correlations are requested by default when no entry to stats is provided. Can also be requested using the disp.corr argument. Thresholds can also be requested using r.threshold.
"spearman.correlations"Spearman correlations as computed by col_w_cov. Can be abbreviated as "sp". All arguments are the same as those for "correlations". When abs = TRUE, negative values become positive. Can also be requested using the disp.spear argument. Thresholds can also be requested using s.threshold.
If a statistic is requested in thresholds, it will automatically be placed in stats. For example, bal.tab(..., stats = "m", thresholds = c(v = 2)) will display both mean differences and variance ratios, and the variance ratios will have a balance threshold set to 2.
data(lalonde)
#Binary treatments
bal.tab(treat ~ age + educ + married + re74, data = lalonde,
stats = c("m", "v", "ks"))
love.plot(treat ~ age + educ + married + re74, data = lalonde,
stats = c("m", "v", "ks"), binary = "std",
thresholds = c(m = .1, v = 2))
#Continuous treatments
bal.tab(re75 ~ age + educ + married + re74, data = lalonde,
stats = c("cor", "sp"))
love.plot(re75 ~ age + educ + married + re74, data = lalonde,
stats = c("cor", "sp"), continuous = "std",
thresholds = c(cor = .1, sp = .1))