plot.lmw_est | R Documentation |
lmw_est
objectProduces plots to diagnose the regression model fit to estimate the
treatment effect. These include an influence plot based on the sample
influence curve (SIC) and the regression diagnostics plots available for
lm
objects in plot.lm()
.
## S3 method for class 'lmw_est'
plot(x, type = "influence", ...)
x |
an |
type |
the type of plot to display. Allowable options include
|
... |
When
When |
When type = "influence"
, plot.lmw_est()
produces a plot of the
scaled sample influence curve (SIC) for each unit by index. It does so by
calling influence.lmw_est()
, which extract the model residuals
and computes the SIC as SIC = (N-1) * w * r / (1 - h)
, where N
is the sample size, w
are the units' implied regression weights,
r
are the residuals, and h
are the hat values. SIC values are
scaled to have a maximum of 1. Higher values indicate greater relative
influence.
When type = "lm"
, plot.lmw_est()
produces several plots
displayed sequentially according to the arguments supplied to plot()
.
These plots are produced by plot.lm()
to diagnose the
distribution of residuals and other measures of leverage and influence.
A plot is displayed, and x
is invisibly returned.
lmw_est()
, influence.lmw_est()
,
plot.lm()
data("lalonde")
# URI regression for ATT
lmw.out1 <- lmw(~ treat + age + education + race + married +
nodegree + re74 + re75, data = lalonde,
estimand = "ATT", method = "URI",
treat = "treat")
lmw.fit1 <- lmw_est(lmw.out1, outcome = "re78")
lmw.fit1
# Influence using SIC
plot(lmw.fit1, type = "influence")
# Usual regression diagnostics
plot(lmw.fit1, type = "lm", which = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.