Skip to contents

Assesses the sensitivity of 2SLS estimates to partial violations of the exclusion restriction. Computes the "breakdown point" – how strong the direct effect of the instrument on the outcome (plausibly through omitted channels) must be to explain away the IV estimate.

Usage

iv_sensitivity(
  data,
  outcome,
  treatment,
  instrument,
  covariates = NULL,
  delta_seq = seq(0, 1, by = 0.05),
  conf_level = 0.95,
  plot = TRUE
)

Arguments

data

A data frame.

outcome

Character. Outcome variable name.

treatment

Character. Endogenous treatment variable name.

instrument

Character or character vector. Instrument name(s).

covariates

Character vector. Exogenous covariates. Default NULL.

delta_seq

Numeric vector. Sequence of direct effect strengths (as fraction of the first-stage coefficient) to evaluate. Default seq(0, 1, by = 0.05).

conf_level

Numeric. Confidence level. Default 0.95.

plot

Logical. Whether to produce a sensitivity plot. Default TRUE.

Value

A list with:

iv_estimate

Numeric. Original 2SLS estimate.

first_stage_coef

Numeric. First-stage coefficient on instrument.

breakdown_delta

Numeric. Value of \(\delta\) at which the bias-adjusted 95% CI includes zero.

sensitivity_df

Data frame with delta, adjusted estimate, CI bounds.

plot

ggplot2 sensitivity plot.

Details

Following Conley et al. (2012), suppose the true model is \(Y = \tau D + \delta Z + X'\beta + \varepsilon\) where \(Z\) is the instrument. Under standard 2SLS (assuming \(\delta = 0\)), the estimate is consistent. For a given \(\delta\), the bias in the 2SLS estimator is \(-\delta / \pi\) where \(\pi\) is the first-stage coefficient. This function sweeps over \(\delta\) to show how the estimate changes.

References

Conley, T. G., Hansen, C. B., & Rossi, P. E. (2012). Plausibly exogenous. Review of Economics and Statistics, 94(1), 260–272.

Examples

if (FALSE) { # \dontrun{
library(ivreg)
# Card (1995) example
result <- iv_sensitivity(
  data       = card_data,
  outcome    = "log_wage",
  treatment  = "educ",
  instrument = "proximity_college",
  covariates = c("exper", "expersq", "black", "south")
)
result$plot
result$breakdown_delta
} # }