love_plot {FSM} | R Documentation |
Love plot
Description
Generates a Love plot of Absolute Standardized Mean Differences (ASMD) or Target Absolute Standardized Differences (TASMD) between two groups under one or two designs.
Usage
love_plot(
data_frame,
index_col = TRUE,
alloc1,
alloc2 = NULL,
imbalance = "TASMD",
treat_lab = 1,
vline = "",
xupper = 1,
mean_tar = NULL,
sd_tar = NULL,
denom = "target",
legend_text = "FSM",
legend_position = "topright"
)
Arguments
data_frame |
Data frame containing a column of unit indices (optional) and covariates (or transformations thereof). |
index_col |
if |
alloc1 |
A vector of treatment assignment. |
alloc2 |
A (optional) vector of treatment assignment. |
imbalance |
Measure of imbalance used. If |
treat_lab |
Label of the treatment group in which the TASMD is computed. Applicable only when |
vline |
A (optional) x-coordinate at which a vertical line is drawn. |
xupper |
Upper limit of the x-axis. |
mean_tar |
A (optional) vector of target profile of the covariates under consideration,
e.g., mean of the covariates in the target population. Applicable only when |
sd_tar |
A optional vector of the standard deviation of the covariates in the target population.
Applicable only when |
denom |
Specifies the denominator for the computation of TASMD. If |
legend_text |
Legend of the two designs under consideration. |
legend_position |
= Position of the legend in the plot. The default is |
Value
Love plot of the ASMD/TASMD of the covariates.
Author(s)
Ambarish Chattopadhyay, Carl N. Morris and Jose R. Zubizarreta.
References
Chattopadhyay, A., Morris, C. N., and Zubizarreta, J. R. (2020), “Randomized and Balanced Allocation
of Units into Treatment Groups Using the Finite Selection Model for R
".
Love, T. (2004), “Graphical display of covariate balance”, Presentation, See http://chrp.org/love/JSM2004RoundTableHandout.pdf, 1364.
Examples
# Consider the Lalonde dataset.
# Get the full sample size.
N = nrow(Lalonde)
# Get the treatment group sizes.
n1 = floor(N/2)
n2 = N-n1
# Generate an SOM.
som_obs = som(n_treat = 2, treat_sizes = c(n1,n2),include_discard = FALSE,
method = 'SCOMARS', marginal_treat = rep((n2/N),N), control = FALSE)
# Generate a treatment assignment given som_obs.
f = fsm(data_frame = Lalonde, SOM = som_obs, s_function = 'Dopt', eps = 0.0001,
ties = 'random', intercept = TRUE, standardize = TRUE, units_print = FALSE)
# Get assignment vector under the FSM.
Z_fsm_obs = f$data_frame_allocated$Treat
# Draw a random CRD.
Z_crd_obs = crd(data_frame = Lalonde, n_treat = 2, treat_sizes = c(n1, n2),
control = FALSE)$Treat
# Draw Love plot.
love_plot(data_frame = Lalonde, index_col = TRUE, alloc1 = Z_fsm_obs, alloc2 = Z_crd_obs,
imbalance = 'TASMD', treat_lab = 1, mean_tar = NULL, sd_tar = NULL, denom = 'target',
vline = "", legend_text = c("FSM","CRD"), xupper = 0.15, legend_position = 'topright')