plot.matched.set: Plot the distribution of the sizes of matched sets.

View source: R/matched_set_obj.R

plot.matched.setR Documentation

Plot the distribution of the sizes of matched sets.

Description

A plot method for creating a histogram of the distribution of the sizes of matched sets. This method accepts all standard optional hist arguments via the ... argument. By default, empty matched sets (treated units that could not be matched with any control units) are noted as a vertical bar at x = 0 and not included in the regular histogram. See the include.empty.sets argument for more information about this.

Usage

## S3 method for class 'matched.set'
plot(
  x,
  ...,
  border = NA,
  col = "grey",
  ylab = "Frequency of Size",
  xlab = "Matched Set Size",
  lwd = NULL,
  main = "Distribution of Matched Set Sizes",
  freq = TRUE,
  include.empty.sets = FALSE
)

Arguments

x

a matched.set object

...

optional arguments to be passed to hist

border

default is NA. This is the same argument as the standard argument for hist

col

default is "grey". This is the same argument as the standard argument for hist

ylab

default is "Frequency of Size". This is the same argument as the standard argument for hist

xlab

default is "Matched Set Size". This is the same argument as the standard argument for hist

lwd

default is NULL. This is the same argument as the standard argument for hist

main

default is "Distribution of Matched Set Sizes". This is the same argument as the standard argument for hist

freq

default is TRUE. See freq argument in hist function for more.

include.empty.sets

logical value indicating whether or not empty sets should be included in the histogram. default is FALSE. If FALSE, then empty sets will be noted as a separate vertical bar at x = 0. If TRUE, empty sets will be included as normal sets.

Examples

PM.results <- PanelMatch(lag = 4, time.id = "year", unit.id = "wbcode2", 
                         treatment = "dem", refinement.method = "mahalanobis", 
                         data = dem, match.missing = TRUE, 
                         covs.formula = ~ I(lag(tradewb, 1:4)) + I(lag(y, 1:4)),
                         size.match = 5, qoi = "att",
                         outcome.var = "y", lead = 0:4, forbid.treatment.reversal = FALSE)
plot(PM.results$att)
plot(PM.results$att, include.empty.sets = TRUE)


insongkim/PanelMatch documentation built on June 10, 2022, 8 p.m.