Uses \(Z \times \mathrm{Post}\) as an instrument for \(D \times \mathrm{Post}\) to recover a local average treatment effect under imperfect compliance.
Usage
morie_did_fuzzy(
data,
outcome,
assignment,
takeup,
post,
covariates = NULL,
cluster = NULL,
alpha = 0.05
)Arguments
- data
A data frame containing the outcome, treatment, post and any covariate columns.
- outcome
Name of the outcome column.
- assignment
Intent-to-treat assignment column.
- takeup
Actual treatment-takeup column.
- post
Name of the binary (0/1) post-period column.
- 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).
Value
A result list; see morie_did_2x2.
Details
For the de Chaisemartin-D'Haultfoeuille estimator on panel data
prefer morie_did_chaisemartin_dhaultfoeuille (rmorie
native).
Examples
set.seed(1)
n <- 400
z <- rbinom(n, 1, 0.5)
d <- as.integer(z & rbinom(n, 1, 0.8))
p <- rbinom(n, 1, 0.5)
y <- 0.5 * d * p + rnorm(n, sd = 0.5)
df <- data.frame(y = y, z = z, d = d, post = p)
res <- morie_did_fuzzy(df, "y", "z", "d", "post")
c(res$estimate, res$details$first_stage_f)
#> [1] 0.4645737 1021.0741570
