| Title: | Sensitivity Analysis of Omitted Variable Bias |
|---|---|
| Description: | Conduct sensitivity analysis of omitted variable bias in linear econometric models using the methodology presented in Basu (2025) <doi:10.2139/ssrn.4704246>. |
| Authors: | Deepankar Basu [aut, cre, cph] |
| Maintainer: | Deepankar Basu <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 2.1.0 |
| Built: | 2026-09-22 22:38:30 UTC |
| Source: | https://github.com/dbasu-umass/ovbsa |
Compute bias adjusted confidence interval using truncated exponential prior distributions for kD, kY.
baci(fit, treatment, benchmark, N = 1000, alpha = 5/100, medkd = 1, medky = 1)baci(fit, treatment, benchmark, N = 1000, alpha = 5/100, medkd = 1, medky = 1)
fit |
An object of class |
treatment |
A character string naming the treatment variable. |
benchmark |
A character string naming the benchmark variable. |
N |
Numeric value for grid size. |
alpha |
Significance level. |
medkd |
Median of the distribution of kD (default=1). |
medky |
Median of the distribution of kY (default=1). |
A list containing the following two elements:
results |
A data frame with 2 rows ("Unadjusted" and "Bias-adjusted") and 2 columns ("Lower" and "Upper") containing the computed 100*(1-alpha)\ unadjusted and bias-adjusted confidence intervals. |
undstats |
A data frame of underlying statistics: the estimate, std error, max(kD) and max(k(Y). |
support_kdky_plot |
A |
# CRAN requires checking if the optional package is installed before running the example if (requireNamespace("sensemakr", quietly = TRUE)) { library(sensemakr) # Define example variables myN <- 500 # Fit the model using the darfur dataset provided by sensemakr fit <- lm(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar + pastvoted + hhsize_darfur + female + village, data = sensemakr::darfur) # Run baci function and see results res1 <- baci(fit = fit, treatment = "directlyharmed", benchmark = "female", N = myN, alpha = 1/100) }# CRAN requires checking if the optional package is installed before running the example if (requireNamespace("sensemakr", quietly = TRUE)) { library(sensemakr) # Define example variables myN <- 500 # Fit the model using the darfur dataset provided by sensemakr fit <- lm(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar + pastvoted + hhsize_darfur + female + village, data = sensemakr::darfur) # Run baci function and see results res1 <- baci(fit = fit, treatment = "directlyharmed", benchmark = "female", N = myN, alpha = 1/100) }
truncated exponential density
dtruncexp(x, rate = 1, a = 0, b = Inf)dtruncexp(x, rate = 1, a = 0, b = Inf)
x |
point between a and b at which density is computed |
rate |
rate parameter |
a |
lower bound |
b |
upper bound |
a real number
dtruncexp(x=1, rate=1, a=0, b=10)dtruncexp(x=1, rate=1, a=0, b=10)
truncated gamma density
dtruncgamma(x, shape, scale, a = 0, b = Inf)dtruncgamma(x, shape, scale, a = 0, b = Inf)
x |
point at which density is computed |
shape |
shape parameter |
scale |
scale parameter |
a |
lower limit (default is 0) |
b |
upper limit (default is Inf) |
a real number
dtruncgamma(x=1,shape=2, scale=3, a=0, b=20)dtruncgamma(x=1,shape=2, scale=3, a=0, b=20)