View source: R/robustness_bound.R
robustness_bound | R Documentation |
robustness_bound()
computes the value of the sensitivity parameter M at which the robustness bounds change from excluding to including an ATT of 0.
robustness_bound(object, level = 0.95)
object |
an |
level |
the desired confidence level. Set to 0 to ignore sampling variation in computing the interval bounds. Default is .95. |
A single number corresponding to the changepoint value of M. If there is no positive value of M for which the interval bounds cross 0, NA
will be returned.
summary.apm_est()
for examining the ATT and bounds for a given value of M
; uniroot()
for the function that finds the changepoint value of M
.
data("ptpdata")
# Combination of 4 models: 2 time trends, 2 lags
models <- apm_mod(list(crude_rate ~ 1),
lag = 0:1,
time_trend = 0:1)
models
# Fit the models to data; unit_var must be supplied for
# fixed effects
fits <- apm_pre(models,
data = ptpdata,
group_var = "group",
time_var = "year",
val_times = 2004:2007,
unit_var = "state",
nsim = 100,
verbose = FALSE)
est <- apm_est(fits,
post_time = 2008,
M = 1,
R = 20,
verbose = FALSE)
est
# ATT estimate and bounds for M = 1
summary(est)
#Changepoint value of M ignoring estimation uncertainty
(M <- robustness_bound(est, level = 0))
summary(est, level = 0, M = M)
#Changepoint value of M accounting for estimation uncertainty
(M <- robustness_bound(est, level = .95))
summary(est, level = .95, M = M)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.