
Omitted-variable bias analysis (sensemakr framework)
Source:R/sensitivity.R
omitted_variable_bias.RdClosed-form Cinelli-Hazlett robustness-value implementation in
base R. For the full sensemakr treatment (benchmark plots,
adjusted t-statistics, contour plots) on a fitted lm
object, use morie_sensitivity_omitted_var_bias.
Usage
omitted_variable_bias(
estimate,
se,
dof,
r2_yd_x,
partial_r2_treatment,
q = 1,
alpha = 0.05,
benchmark_covariates = NULL
)Arguments
- estimate
Treatment coefficient.
- se
SE of the estimate.
- dof
Residual degrees of freedom.
- r2_yd_x
Partial R^2 of treatment with outcome.
- partial_r2_treatment
Same as
r2_yd_x(for clarity).- q
Fraction of the estimate to be explained away. Default 1.
- alpha
Significance level. Default 0.05.
- benchmark_covariates
Named list mapping covariate name -> partial R^2.
Examples
str(omitted_variable_bias(0.5, 0.15, dof = 150, r2_yd_x = 0.1,
partial_r2_treatment = 0.05), max.level = 1)
#> List of 7
#> $ estimate : num 0.5
#> $ se : num 0.15
#> $ rv_q : num 0.244
#> $ rv_qa : num 0.871
#> $ partial_r2_treatment: num 0.05
#> $ benchmark_bounds : list()
#> $ interpretation : chr "To explain away 100% of the estimate (0.5000), an unobserved confounder would need partial R^2 >= 0.2441 with b"| __truncated__
#> - attr(*, "class")= chr [1:2] "morie_ovb" "list"