plot.manual_strata: Plot method for 'manual_strata' object

Description Usage Arguments Examples

View source: R/S3_methods.R

Description

Generates diagnostic plots for the product of a stratification by manual_stratify. There are two plot types:

  1. "SR" (default) - produces a scatter plot of strata by size and treat:control ratio

  2. "hist" - produces a histogram of propensity scores within a stratum.

Note that residual plots and AC plots are not supported for manual_strata objects because no prognostic model is fit.

Usage

1
2
## S3 method for class 'manual_strata'
plot(x, type = "SR", label = FALSE, stratum = "all", propensity, ...)

Arguments

x

a manual_strata object returned by manual_stratify

type

string giving the plot type (default = "SR"). Other option is "hist"

label

ignored unless type = "SR". If TRUE, a clickable plot is produced. The user may click on any number of strata and press finish to have those strata labeled. Note: uses identify, which may not be supported on some devices

stratum

ignored unless type = "hist". A number specifying which stratum to plot.

propensity

ignored unless type = "hist". Specifies propensity score information for plots where this is required. Accepts either a vector of propensity scores, a glm model for propensity scores, or a formula for fitting a propensity score model.

...

other arguments

Examples

1
2
3
4
dat <- make_sample_data()
m.strat <- manual_stratify(dat, treat ~ C1)
plot(m.strat) # makes size-ratio scatter plot
plot(m.strat, type = "hist", propensity = treat ~ X1, stratum = 1)

raikens1/stratamatch documentation built on May 27, 2021, 10:13 p.m.