
Omitted-variable bias on a fitted model (native sensemakr)
Source:R/sensitivity.R
morie_sensitivity_omitted_var_bias.RdNative sensemakr::sensemakr for a fitted linear model:
robustness values, the partial R-squared of the treatment, and
benchmark bounds for confounders kd / ky times as
strong as each benchmark covariate (its partial R-squared with the
outcome from model, with the treatment from the regression of
the treatment on the other regressors). Pairs with
omitted_variable_bias, the closed form from
estimate, se and degrees of freedom.
Usage
morie_sensitivity_omitted_var_bias(
model,
treatment,
benchmark_covariates = NULL,
kd = c(1, 2, 3),
ky = NULL,
q = 1,
alpha = 0.05,
...
)Arguments
- model
A fitted
lm.- treatment
Name of the treatment coefficient.
- benchmark_covariates
Optional character vector of coefficient names whose strengths bound the unmeasured-confounder strength.
- kd
Multipliers on the benchmark covariate strength. Default
c(1, 2, 3).- ky
Multipliers on the benchmark covariate's outcome strength. Default equal to
kd.- q
Fraction of the estimate to be explained away. Default 1.
- alpha
Significance level. Default 0.05.
- ...
Unused.
Value
A list of class morie_sensitivity_omitted_var_bias
with rv_q, rv_qa, partial_r2_treatment and
benchmark_bounds (the columns of sensemakr's bounds table).