DiD with wild cluster bootstrap p-values (Cameron-Gelbach-Miller, 2008)
Source:R/did.R
morie_did_wild_cluster_bootstrap.RdRecommended when the number of clusters is small (< 50). Uses a
base-R Rademacher / Webb wild-cluster-bootstrap implementation.
Earlier rmorie versions also delegated to
fwildclusterboot::boottest when installed; that branch was
dropped in 0.9.5.12 because fwildclusterboot is GitHub-only and
transitively requires summclust, also GitHub-only, which made the
CI dependency resolver unreliable. Callers who want
fwildclusterboot should call it directly on a feols /
lm fit.
Usage
morie_did_wild_cluster_bootstrap(
data,
outcome,
treatment,
post,
cluster,
covariates = NULL,
n_bootstrap = 999L,
weight_type = "rademacher",
seed = 42L,
alpha = 0.05
)Arguments
- data
A data frame containing the outcome, treatment, post and any covariate columns.
- outcome
Name of the outcome column.
- treatment
Name of the binary (0/1) treatment-group column.
- post
Name of the binary (0/1) post-period column.
- cluster
Optional cluster ID column for CR1 standard errors.
- covariates
Optional character vector of covariate column names.
- n_bootstrap
Number of bootstrap replications.
- weight_type
"rademacher"(default) or"webb".- seed
RNG seed.
- alpha
Significance level for confidence intervals (default 0.05).
Value
A result list; see morie_did_2x2. p_value
is the bootstrap p-value.