plot.auto_strata {stratamatch} | R Documentation |
Plot method for auto_strata
object
Description
Generates diagnostic plots for the product of a stratification by
auto_stratify
. There are four plot types:
-
"SR"
(default) - produces a scatter plot of strata by size and treat:control ratio -
"hist"
- produces a histogram of propensity scores within a stratum -
"AC"
- produces a Assignment-Control plot of individuals within a stratum -
"residual"
- produces a residual plot for the prognostic model
Usage
## S3 method for class 'auto_strata'
plot(
x,
type = "SR",
label = FALSE,
stratum = "all",
strata_lines = TRUE,
jitter_prognosis,
jitter_propensity,
propensity,
...
)
Arguments
x |
an |
type |
string giving the plot type (default = |
label |
ignored unless |
stratum |
ignored unless |
strata_lines |
default = |
jitter_prognosis |
ignored unless |
jitter_propensity |
ignored unless |
propensity |
ignored unless |
... |
other arguments |
See Also
Aikens, Greaves, and Baiocchi (2020) in Statistics in Medicine, Section 3.2 for an explaination of Assignment-Control plots (formerly "Fisher-Mill" plots).
Examples
dat <- make_sample_data()
a.strat <- auto_stratify(dat, "treat", outcome ~ X1 + X2)
plot(a.strat) # makes size-ratio scatter plot
plot(a.strat, type = "hist", propensity = treat ~ X1, stratum = 1)
plot(a.strat, type = "AC", propensity = treat ~ X1, stratum = 1)
plot(a.strat, type = "residual")