Skip to contents

Per-unit difference between the ignorability-mode and do-mode effects, \(\Delta(x) = \tau_{\mathrm{obs}}(x) - \tau_{\mathrm{do}}(x)\). Under ignorability the two coincide and \(\Delta \equiv 0\); a non-zero gap is a sensitivity signal – how much the estimated effect would move if a fitted regime confounded treatment and outcome beyond X – not a correction the data licenses.

Usage

proxy_confounding_gap(model, newdata, t1 = 1, t0 = 0)

Arguments

model

An uplift_model.

newdata

A data frame carrying the covariate columns.

t1, t0

The treated and control treatment values. Default 1 and 0.

Value

A data.table::data.table with columns id, tau_obs, tau_do, gap, overlap_flag.

Examples

set.seed(1)
n <- 600L
x <- stats::rnorm(n)
t <- stats::rbinom(n, 1L, 0.5)
y <- 0.5 * t + x + stats::rnorm(n, sd = 0.5)
dat <- data.frame(y = y, t = t, x = x)
m <- fit_uplift(dat, "y", "t", "x", N = 2L, regime = "sample",
                max_iter = 80L, seed = 1L)
proxy_confounding_gap(m, data.frame(x = c(-1, 0, 1)))
#>       id   tau_obs tau_do       gap overlap_flag
#>    <int>     <num>  <num>     <num>       <lgcl>
#> 1:     1 0.4438819      0 0.4438819        FALSE
#> 2:     2 0.4850305      0 0.4850305        FALSE
#> 3:     3 0.5261790      0 0.5261790        FALSE