Learn R Programming

twang (version 1.0-3)

diag.plot: Create diagnostic plots

Description

Creates diagnostic plots of propensity scores including, a side-by-side boxplot of propensity scores, a histogram of propensity score weights, QQ plots of KS and t-statistic p-values, and a plot of absolute effect sizes

Usage

diag.plot(title=NULL,
          treat=NULL,
          p.s=NULL,
          w.ctrl=NULL,
          desc.unw=NULL,
          desc.w=NULL,
          plots="all")

## S3 method for class 'ps':
plot(x, label = "", ask=FALSE, plots="all", ...)
                  
## S3 method for class 'dxwts':
plot(x, label = "", ask=FALSE, plots="all", ...)

Arguments

title
a title for the plots
treat
a vector of 0/1 treatment indicators
p.s
a vector of propensity scores (optional)
w.ctrl
weights for the control subjects
desc.unw
a list object containing the balance assessment without weights, usually the result of a call to desc.wts or the desc component of a
desc.w
a list object containing the weighted balance assessment
plots
a character vector listing the plots to be created. The options are all (the default), optimize, ps boxplot, weight histogram, t pvalues, ks pvalues, es. Any other options (such as "none") will produce no plots
x
a ps object, usually one returned from ps
label
a character string for titling the plots
ask
logical. If TRUE then the graphics window waits for a response from the user before showing the next graph
...
other arguments passed to the plot function

Value

  • No returned objects

Details

plot.ps and plot.dxwts are wrappers for diag.plot The plots include: Boxplot of propensity scores for cases in the treatment and comparison conditions. Histogram of comparison condition case weights. P-value plots for unweighted and weighted t statistics, and KS statistics. Change in standardized effect size plot. For each model covariate, standardized effect sizes before and after comparison group case weighting are linked by blue lines if weighting reduces the effect size, and by red lines if weights increase the effect size. Significant effect sizes are indicated with a closed red circle. Standardized effect sizes are defined as the difference between the treatment and comparison group means, divided by the treatment group standard deviation. Very large effect sizes are omitted from these plots. When this occurs, a warning is placed at the top of the figure.

See Also

ps