Assesses whether a fitted trop() ATT is distinguishable from zero by
comparing it to a placebo null distribution. Control units are repeatedly
relabelled as pseudo-treated — using the same number of treated units and
the same treatment timing as the real design, so block, staggered and
non-absorbing patterns are all reproduced faithfully — and the estimator is
refit at the fit's cross-validated penalties (the true effect is zero by
construction). The observed ATT is then placed against that null.
Arguments
- object
A
tropfit fromtrop().- B
Number of placebo assignments to draw.
- alternative
Direction of the test:
"two.sided"(default),"greater"or"less".- control
A
trop_control()list for the placebo refits (penalties are held fixed at the fit's values; this mainly setsseedandworkers). Defaults totrop_control(); setseedhere for reproducible draws.- x
A
trop_placebo_testobject.- digits
Number of significant digits to print.
- ...
Unused.
Value
An object of class trop_placebo_test (a list) with the observed
ATT, the vector of placebo ATTs, the p.value, the placebo-null mean
and sd, a central null interval null.low/null.high, alternative,
B, and n_treated_units. It has print() and autoplot() methods.
Details
This is a randomisation/permutation test, not a standard error: it answers
"could a TROP design like mine produce an effect this large when there is none?"
For interval estimates use the bootstrap or jackknife (see trop() and
compare_se_modes()).
Examples
# \donttest{
df <- sim_panel(N = 16, T = 9, n_treated = 3, t0 = 6, att = 3, seed = 1)
# fixed penalties keep the example fast; omit `lambda` to cross-validate
fit <- trop(df, "y", "w", "id", "t", se = "none",
lambda = list(time = 0.1, unit = 0.5, nn = 2))
pt <- trop_placebo_test(fit, B = 30)
pt
#> TROP placebo test
#> observed ATT : 3.464
#> placebo null : mean -0.07527, sd 0.3276 (30 draws, 3 pseudo-treated units)
#> null 95% range: [-0.6849, 0.5333]
#> two.sided p-value : 0.0000
# }