| placebo_test | R Documentation |
Perform a permutation test on a pensynth object, in the sense of Abadie, Diamond, and Hainmueller (2010). The pensynth method is performed multiple times, treating each donor as the treated unit and the treated unit with the remaining donors as the donor units.
placebo_test(object, Y1, Y0, verbose = TRUE)
## S3 method for class 'pensynth'
placebo_test(object, Y1, Y0, verbose = TRUE)
## S3 method for class 'cvpensynth'
placebo_test(object, Y1, Y0, verbose = TRUE)
object |
a fitted |
Y1 |
the post-intervention outcome of the treated unit |
Y0 |
the post-intervention outcome of the donor units |
verbose |
|
Note that this function updates the original call in order to
re-estimate the synthetic control on the permuted data.
Ensure that the data is available to the placebo test function
(i.e., avoid complex environment functions such as with()),
and ensure that the data does not change between estimating the
original object and calling this function.
A list with two elements
E1, the treated unit effect(s), computed as Y1 - Y0 %*% w
E0, the donor unit effects, computed in the same way but using the permutation test's weights.
ATE1, the estimated ATE of the treated unit(s)
ATE0, the estimated ATE of the donor units
Abadie, A., Diamond, A., & Hainmueller, J. (2010). Synthetic control methods for comparative case studies: Estimating the effect of California’s tobacco control program. Journal of the American statistical Association, 105(490), 493-505.
pensynth(), cv_pensynth(), plot.pensynthtest(), stats::update()
set.seed(45)
# simulate data with an effect of 0.8 SD
dat <- simulate_data_synth(treatment_effect = .8)
# fit a model
fit <- pensynth(dat$X1, dat$X0, lambda = 1e-5)
# Perform placebo test
test <- placebo_test(fit, dat$Y1, dat$Y0)
plot(test)
abline(h = .8, lty = 2)
legend("bottomright", lty = 2, legend = "true effect")
# compute a pseudo p-value based on ATE in
# the post-intervention time period
ref_dist <- stats::ecdf(test$ATE0)
1 - ref_dist(test$ATE1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.