For each candidate fake time in placebo_times, redefines the
post indicator and estimates a 2x2 DiD on pre-true-treatment data.
Usage
morie_did_placebo_test_time(
data,
outcome,
treatment,
time,
true_treatment_time,
placebo_times,
covariates = NULL,
cluster = NULL,
alpha = 0.05
)Arguments
- data
Data frame.
- outcome, treatment, time
Column names.
- true_treatment_time
The actual treatment-onset time (data are restricted to pre-period observations).
- placebo_times
Vector of candidate fake treatment times.
- covariates
Optional character vector of covariate column names.
- cluster
Optional cluster ID column for CR1 standard errors.
- alpha
Significance level for confidence intervals (default 0.05).
Examples
set.seed(1)
df <- data.frame(
y = rnorm(500), d = rbinom(500, 1, 0.5),
time = sample(1:8, 500, replace = TRUE)
)
out <- morie_did_placebo_test_time(df, "y", "d", "time",
true_treatment_time = 7,
placebo_times = c(3, 4, 5))
out
#> placebo_time estimate std_error p_value significant
#> interaction 3 0.010094814 0.2271821 0.9645577 FALSE
#> interaction1 4 -0.002246453 0.2199366 0.9918505 FALSE
#> interaction2 5 0.025201883 0.2297443 0.9126510 FALSE
