Cluster Bootstrap for DR DiD Estimators and the Stationarity Test
Source:R/stationarity-test.R
drdid_cluster_bootstrap.RdComputes Mammen cluster-bootstrap standard errors for the stationary and
non-stationary DR DiD estimators, and a cluster-bootstrap p-value for
drdid_stationarity_test(). The implementation works at the cluster-sum
level, so it avoids rebuilding observation-level multiplier vectors on every
bootstrap draw.
Usage
drdid_cluster_bootstrap(
nonstationary_fit,
stationary_fit,
group,
nboot = 9999,
seed = NULL,
alpha = c(0.1, 0.05, 0.01),
keep_boots = TRUE
)Arguments
- nonstationary_fit
Output from
drdid_nonstationary()withinffunc = TRUE.- stationary_fit
Output from
drdid_stationary()withinffunc = TRUE.- group
Cluster identifier vector. Its length must match the influence functions in the fitted objects.
- nboot
Number of cluster-bootstrap draws. Use
0to skip the bootstrap and returnNAclustered standard errors/p-values.- seed
Optional random seed. When supplied, the caller's RNG state is restored before returning.
- alpha
Significance levels passed to
drdid_stationarity_test().- keep_boots
Logical. If
TRUE, include bootstrap draws in the output.