|
1 | 1 | #' Conduct a sensitivity analysis for estimated ecological quantities |
2 | 2 | #' |
| 3 | +#' Relates confounding of an omitted variable with predictor or outcome to |
| 4 | +#' bias in ecological estimates, using the nonparametric sensitivity analysis |
| 5 | +#' of Chernozhukov et al. (2022). |
| 6 | +#' |
| 7 | +#' The parameter `c_predictor` equals \eqn{1 - R^2_{\alpha\sim\alpha_s}}, where |
| 8 | +#' \eqn{\alpha} is the true Riesz representer and \eqn{\alpha_s} is the Riesz |
| 9 | +#' representer with the observed covariates. The RR can be equivalently |
| 10 | +#' expressed as \deqn{ |
| 11 | +#' \alpha = \partial_x \log f(X\mid Z, U), |
| 12 | +#' } where \eqn{U} is the unobserved confounder and \eqn{f} is the conditional |
| 13 | +#' density. The corresponding `c_predictor` is then \deqn{ |
| 14 | +#' 1 - R^2_{\alpha\sim\alpha_s} = 1 - \ |
| 15 | +#' \frac{\mathbb{E}[(\partial_x \log f(X\mid Z))^2]}{ |
| 16 | +#' \mathbb{E}[(\partial_x \log f(X\mid Z, U))^2]}. |
| 17 | +#' } When \eqn{X\mid Z,U} and \eqn{X\mid Z} are homoscedastic Gaussian, this |
| 18 | +#' simplifies to \deqn{ |
| 19 | +#' 1 - R^2_{\alpha\sim\alpha_s} = |
| 20 | +#' 1 - \frac{\mathbb{E}[X - \mathbb{E}[X\mid Z, U]]^2}{ |
| 21 | +#' \mathbb{E}[X - \mathbb{E}[X\mid Z]]^2} |
| 22 | +#' = R^2_{X\sim U\mid Z}. |
| 23 | +#' } |
| 24 | +#' |
3 | 25 | #' The bounds here are plug-in estimates and do not incorporate sampling |
4 | 26 | #' uncertainty. As such, they may fail to cover the true value in finite |
5 | 27 | #' samples, even under large enough sensitivity parameters; see Section 5 of |
6 | | -#' Chernozhukov et al (2022). |
| 28 | +#' Chernozhukov et al. (2022). |
7 | 29 | #' |
8 | 30 | #' @param est A set of estimates from [ei_est()] using both regression and Riesz |
9 | 31 | #' representer. |
|
19 | 41 | #' @param bias_bound If provided, overrides `c_predictor` and finds values of |
20 | 42 | #' `c_predictor` that correspond to (the absolute value of) the provided |
21 | 43 | #' amount of bias. |
22 | | -#' @param confounding The confounding parameter (\eqn{rho}), which must be |
| 44 | +#' @param confounding The confounding parameter (\eqn{\rho}), which must be |
23 | 45 | #' between 0 and 1 (the adversarial worst-case). |
24 | 46 | #' @param expand_ci If `TRUE` and confidence intervals are present in `est`, |
25 | 47 | #' expand the width of the intervals in each direction by the calculated bias |
@@ -116,6 +138,11 @@ ei_sens <- function(est, c_outcome=seq(0, 1, 0.01)^2, c_predictor=seq(0, 1, 0.01 |
116 | 138 | #' @returns A data frame of the same format as `est`, but with a new `rv` column |
117 | 139 | #' containing the robustness values. |
118 | 140 | #' |
| 141 | +#' @references |
| 142 | +#' Chernozhukov, V., Cinelli, C., Newey, W., Sharma, A., & Syrgkanis, V. (2022). |
| 143 | +#' *Long story short: Omitted variable bias in causal machine learning* |
| 144 | +#' (No. w30302). National Bureau of Economic Research. |
| 145 | +#' |
119 | 146 | #' @examples |
120 | 147 | #' data(elec_1968) |
121 | 148 | #' |
|
0 commit comments