Skip to contents

Fits 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
)

Arguments

data

A data frame.

outcome, exposure, confounders

Column names.

n_bootstrap

Number of resamples (default 100).

random_state

Seed for the resampling.

Value

A list with ate, se_analytic, se_bootstrap, ci_lower_bs, ci_upper_bs, n_bootstrap and method.

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
# }