hist.ipw is a function that takes as an argument a list of ipw objects, or the objects provided as independent arguments. The function returns a ggplot2 object containing propensity score histograms for each of the supplied models.

# S3 method for ipw
hist(
  ...,
  cat = 2,
  ncol = 2,
  xlab = NULL,
  ylab = "Density",
  panel_dim = 1,
  binwidth = 0.02,
  weight = FALSE,
  by_treat = TRUE,
  legend_title = "Treatment \nGroup",
  colors = "Dark2"
)

Arguments

...

ipw objects supplied as a list or as seperate arguments

cat

For multinomial propensity score, the arguments specifies which category probabilities are plotted.

ncol

The number of columns for the paneling

xlab

The x-axis label

ylab

The y-axis label

panel_dim

The number of dimensions for the paneling (either 1 or 2).

binwidth

The width of the histogram bins (default is 0.05).

weight

If true, the histogram will be weighted with the treatment weights (default = FALSE)

by_treat

If TRUE, the histogram will be stratified by treatment group, otherwise it will depict the overall distribution of the PS in the sample. (default = TRUE)

legend_title

A string used to title the legend, default is "Treatment Groups"

colors

Set colors for resulting ggplot object. Either a vector of strings which are interpreted as RGB codes or a sinlge string that identifies as color brewer palette. If set to NULL, hist.ipw will use grey shades. As a default, hist.ipw uses the color brewer palette 'Dark2'.

Value

A ggplot2 object that can be further modified by the user before plotting.

Author

M. Alan Brookhart