placebo_test {pensynth} | R Documentation |
Placebo permutation test for pensynth
Description
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.
Usage
placebo_test(object, Y1, Y0)
## S3 method for class 'pensynth'
placebo_test(object, Y1, Y0)
## S3 method for class 'cvpensynth'
placebo_test(object, Y1, Y0)
Arguments
object |
a fitted |
Y1 |
the post-intervention outcome of the treated unit |
Y0 |
the post-intervention outcome of the donor units (with N_donors columns) |
Details
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.
Value
A list with two elements
E1, the treated unit effect, 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
ATE0, the estimated ATE of the donor units
References
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.
See Also
pensynth()
, cv_pensynth()
, plot.pensynthtest()
, stats::update()
Examples
set.seed(45)
# simulate data with an effect of 0.8 SD
dat <- simulate_data(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)