View source: R/sensitivity_stats.R
| sensitivity_stats | R Documentation | 
Convenience function that computes the robustness_value,
partial_r2 and partial_f2 of the coefficient of interest.
sensitivity_stats(...)
## S3 method for class 'lm'
sensitivity_stats(
  model,
  treatment,
  q = 1,
  alpha = 0.05,
  reduce = TRUE,
  invert = FALSE,
  ...
)
## S3 method for class 'fixest'
sensitivity_stats(
  model,
  treatment,
  q = 1,
  alpha = 0.05,
  reduce = TRUE,
  invert = FALSE,
  message = T,
  ...
)
## S3 method for class 'numeric'
sensitivity_stats(
  estimate,
  se,
  dof,
  treatment = "treatment",
  q = 1,
  alpha = 0.05,
  reduce = TRUE,
  invert = FALSE,
  ...
)
| ... | arguments passed to other methods. | 
| model | An  | 
| treatment | A character vector with the name of the treatment variable of the model. | 
| q | percent change of the effect estimate that would be deemed problematic.  Default is  | 
| alpha | significance level. | 
| reduce | should the bias adjustment reduce or increase the
absolute value of the estimated coefficient? Default is  | 
| invert | should IRV be computed instead of RV? (i.e. is the estimate insignificant?). Default is  | 
| message | should messages be printed? Default = TRUE. | 
| estimate | Coefficient estimate. | 
| se | standard error of the coefficient estimate. | 
| dof | residual degrees of freedom of the regression. | 
A data.frame containing the following quantities:
a character with the name of the treatment variable
a numeric vector with the estimated effect of the treatment
a numeric vector with the estimated standard error of the treatment effect
a numeric vector with the t-value of the treatment
a numeric vector with  the partial R2 of the treatment and the outcome, see details in partial_r2
a numeric vector with  the robustness value of the treatment, see details  in robustness_value
a numeric vector with the robustness value of the treatment considering statistical significance, see details  in robustness_value
a numeric vector with the partial (Cohen's) f2 of the treatment with the outcome, see details in partial_f2
a numeric vector with the degrees of freedom of the model
Cinelli, C. and Hazlett, C. (2020), "Making Sense of Sensitivity: Extending Omitted Variable Bias." Journal of the Royal Statistical Society, Series B (Statistical Methodology).
## loads data
data("darfur")
## fits model
model <- lm(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar +
             pastvoted + hhsize_darfur + female + village, data = darfur)
## sensitivity stats for directly harmed
sensitivity_stats(model, treatment = "directlyharmed")
## you can  also pass the numeric values directly
sensitivity_stats(estimate = 0.09731582, se = 0.02325654, dof = 783)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.