
Exposure-response double machine learning with bootstrap sensitivity
Source:R/envhealth.R
morie_envhealth_sensitivity.RdFits the partially linear model of Chernozhukov et al. (2018, section
4.2) with morie_estimate_double_ml (continuous exposure as
the treatment), then re-fits it on n_bootstrap non-parametric
resamples for a percentile interval (Efron and Tibshirani 1993).
Usage
morie_envhealth_sensitivity(
data,
outcome,
exposure,
confounders,
n_bootstrap = 100L,
random_state = 42L
)Examples
# \donttest{
set.seed(1)
d <- data.frame(x1 = rnorm(200), x2 = rnorm(200))
d$exposure <- 20 + 2 * d$x1 + rnorm(200)
d$asthma <- 5 + 0.3 * d$exposure + d$x2 + rnorm(200)
morie_envhealth_sensitivity(d, outcome = "asthma", exposure = "exposure",
confounders = c("x1", "x2"), n_bootstrap = 20)$ate
#> [1] 0.2593973
# }