plot.summary.lmw {lmw}R Documentation

Produce a Love plot of balance statistics

Description

Produces Love plots (also known as dot plots) of balance statistics to summarize balance visually. The plots are generated using dotchart() and points().

Usage

## S3 method for class 'summary.lmw'
plot(
  x,
  stats,
  abs = TRUE,
  var.order = "data",
  threshold = NULL,
  layout = "vertical",
  ...
)

Arguments

x

a summary.lmw object; the output of a call to summary.lmw() with standardize = TRUE.

stats

a vector of the names of the columns in the summary.lmw output to plot; more than one is allowed. Abbreviations allowed. When unspecified, the TSMD statistics for each treatment group will be plotted.

abs

logical; whether the statistics should be plotted in absolute value (TRUE) or not (FALSE). Default is TRUE. This does not affect the display of KS statistics (which are always non-negative). When TRUE and standardized mean differences are displayed, the x-axis title will be "TASMD", i.e., target absolute standardized mean difference.

var.order

how the variables should be ordered. Allowable options include "data", ordering the variables as they appear in the summary output, "alphabetical", ordering the variables alphabetically, and, when un = TRUE in the call to summary.lmw(), "unadjusted", ordering the variables by the first statistic in stats in the unadjusted sample. Default is "data". Abbreviations allowed.

threshold

numeric values at which to place vertical lines indicating a balance threshold. These can make it easier to see for which variables balance has been achieved given a threshold. Multiple values can be supplied to add multiple lines. When abs = FALSE, the lines will be displayed on both sides of zero. The lines are drawn with abline with the linetype (lty) argument corresponding to the order of the entered variables (see options at par()). Enter a value as NA to skip that value of lty (e.g., c(NA, .05) to have only a dashed vertical line at .05).

layout

how the multiple plots should be laid out. Allowable options include "vertical" (the default) and "horizontal". Abbreviations allowed.

...

further arguments passed to dotplot().

Details

Love plots will be produced for the requested statistics in the summary.lmw output. How these plots are arranged depends on the value supplied to layout, which uses layout() to arrange the plots.

Value

A plot is displayed, and x is invisibly returned.

See Also

summary.lmw()

Examples

data("lalonde")

# URI regression for ATT
lmw.out1 <- lmw(~ treat + age + education + race + married +
                  nodegree + re74 + re75, data = lalonde,
                estimand = "ATT", method = "URI",
                treat = "treat")
lmw.out1
(s <- summary(lmw.out1))

plot(s)
plot(s, stats = "SMD", abs = FALSE)

[Package lmw version 0.0.2 Index]