Package 'ovbsa'

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

Help Index


Compute bias adjusted confidence interval using truncated exponential prior distributions for kD, kY.

Description

Compute bias adjusted confidence interval using truncated exponential prior distributions for kD, kY.

Usage

baci(fit, treatment, benchmark, N = 1000, alpha = 5/100, medkd = 1, medky = 1)

Arguments

fit

An object of class lm.

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).

Value

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 ggplot2 plot object visualizing the support of the joint distribution of (kD,kY).

Examples

# 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

Description

truncated exponential density

Usage

dtruncexp(x, rate = 1, a = 0, b = Inf)

Arguments

x

point between a and b at which density is computed

rate

rate parameter

a

lower bound

b

upper bound

Value

a real number

Examples

dtruncexp(x=1, rate=1, a=0, b=10)

truncated gamma density

Description

truncated gamma density

Usage

dtruncgamma(x, shape, scale, a = 0, b = Inf)

Arguments

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)

Value

a real number

Examples

dtruncgamma(x=1,shape=2, scale=3, a=0, b=20)