Skip to contents

Computes 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() with inffunc = TRUE.

stationary_fit

Output from drdid_stationary() with inffunc = TRUE.

group

Cluster identifier vector. Its length must match the influence functions in the fitted objects.

nboot

Number of cluster-bootstrap draws. Use 0 to skip the bootstrap and return NA clustered 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.

Value

A list with clustered standard errors for both estimators, stationarity-test p-values, and optionally bootstrap draws.