This function computes the robustness value of a regression coefficient.
The robustness value describes the minimum strength of association (parameterized in terms of partial R2) that omitted variables would need to have both with the treatment and with the outcome to change the estimated coefficient by a certain amount (for instance, to bring it down to zero).
For instance, a robustness value of 1% means that an unobserved confounder that explain 1% of the residual variance of the outcome and 1% of the residual variance of the treatment is strong enough to explain away the estimated effect. Whereas a robustness value of 90% means that any unobserved confounder that explain less than 90% of the residual variance of both the outcome and the treatment assignment cannot fully account for the observed effect. You may also compute robustness value taking into account sampling uncertainty. See details in Cinelli and Hazlett (2020).
The function robustness_value can take as input an lm
object or you may directly pass the t-value and degrees of freedom.
robustness_value(model, ...)
# S3 method for lm
robustness_value(model, covariates = NULL, q = 1, alpha = 1, ...)
# S3 method for fixest
robustness_value(
model,
covariates = NULL,
q = 1,
alpha = 1,
message = TRUE,
...
)
# S3 method for numeric
robustness_value(t_statistic, dof, q = 1, alpha = 1, ...)
an fixest
object with the regression model.
arguments passed to other methods. First argument should either be an lm
model or a fixest
model with the
regression model or a numeric vector with the t-value of the coefficient estimate
model covariates for which the robustness value will be computed. Default is to compute the robustness value of all covariates.
percent change of the effect estimate that would be deemed problematic. Default is 1
,
which means a reduction of 100% of the current effect estimate (bring estimate to zero). It has to be greater than zero.
significance level.
should messages be printed? Default = TRUE.
numeric
vector with the t-value of the coefficient estimates
residual degrees of freedom of the regression
The function returns a numerical vector with the robustness value. The arguments q and alpha are saved as attributes of the vector for reference.
Cinelli, C. and Hazlett, C. (2020), "Making Sense of Sensitivity: Extending Omitted Variable Bias." Journal of the Royal Statistical Society, Series B (Statistical Methodology).
# using an lm object
## loads data
data("darfur")
## fits model
model <- lm(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar +
pastvoted + hhsize_darfur + female + village, data = darfur)
## robustness value of directly harmed q =1 (reduce estimate to zero)
robustness_value(model, covariates = "directlyharmed")
#> directlyharmed
#> 0.1387764
#> Parameters: q = 1, alpha = 1
## robustness value of directly harmed q = 1/2 (reduce estimate in half)
robustness_value(model, covariates = "directlyharmed", q = 1/2)
#> directlyharmed
#> 0.07202698
#> Parameters: q = 0.5, alpha = 1
## robustness value of directly harmed q = 1/2, alpha = 0.05
## (reduce estimate in half, with 95% confidence)
robustness_value(model, covariates = "directlyharmed", q = 1/2, alpha = 0.05)
#> directlyharmed
#> 0.004562761
#> Parameters: q = 0.5, alpha = 0.05
# you can also provide the statistics directly
robustness_value(t_statistic = 4.18445, dof = 783)
#> [1] 0.1387764
#> Parameters: q = 1, alpha = 1