The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

regsensitivity regsensitivity logo: a point estimate opening into an identified set

Build R-CMD-check test-coverage lint pkgdown Codecov test coverage

Install CRAN status GitHub tag R >= 4.1

Project Lifecycle: stable License: MIT Docs Last commit Issues Code of Conduct

Regression sensitivity analysis for omitted-variable bias in R.

Implements the identified-set and breakdown-point analyses described in:

Both arXiv working papers above are still revised periodically; citations in this package track the year of the latest arXiv revision.

The package provides a formula + data.frame API, ggplot2-based plotting, and percentile and bias-corrected-and-accelerated bootstrap intervals — i.i.d. or clustered — on the breakdown point.

Beyond the Stata original it computes the identified set at every triple of sensitivity parameters, including the region rxbar > rmax(cbar) > rybar; traces the breakdown frontier in either direction (direction = "rybar"); and takes Assumption A6 in its two-sided form (clow).

Installation

# Released version (once accepted on CRAN):
install.packages("regsensitivity")

# Development version from GitHub:
# install.packages("remotes")
remotes::install_github("mikenguyen13/regsensitivity")

Quickstart

library(regsensitivity)
data(bfg2020)
bfg2020$statea <- factor(bfg2020$statea)

compare <- c("log_area_2010", "lat", "lon", "temp_mean", "rain_mean",
             "elev_mean", "d_coa", "d_riv", "d_lak", "ave_gyi")
form <- avgrep2000to2016 ~ tye_tfe890_500kNI_100_l6 +
    log_area_2010 + lat + lon + temp_mean + rain_mean + elev_mean +
    d_coa + d_riv + d_lak + ave_gyi + statea

# Default DMP analysis, cbar = 0.1
bnds <- regsen_bounds(form, bfg2020, compare = compare, cbar = 0.1)
print(bnds)
plot(bnds)

# Breakdown across cbar grid
bd <- regsen_breakdown(form, bfg2020, compare = compare,
                        cbar = seq(0, 1, 0.05))
plot(bd)

# Cluster bootstrap CI on the breakdown point
boot <- regsen_boot(form, bfg2020, compare = compare,
                     cbar = 1, cluster = "km_grid_cel_code",
                     R = 199)
print(boot)

See vignette("regsensitivity") for a full tour, vignette("interpreting-results") for what the numbers mean and what to write in a paper, and vignette("dmp2022-replication") for the paper-exact replication.

Crosswalk: Stata → R

Stata syntax R equivalent
regsensitivity bounds y x w, compare(w1) cbar(.1) regsen_bounds(y ~ x + w, data, compare = w1, cbar = 0.1)
regsensitivity bounds ... cbar(0(.2)1) regsen_bounds(..., cbar = seq(0, 1, 0.2))
regsensitivity bounds ... rybar(=rxbar) regsen_bounds(..., rybar_expr = function(rx) rx)
regsensitivity bounds ... oster regsen_bounds(..., analysis = "oster")
regsensitivity bounds ... oster delta(-3 3 eq) regsen_bounds(..., analysis = "oster", delta = seq(-3, 3, 0.05))
regsensitivity bounds ... oster delta(0(.001).999 bound) regsen_bounds(..., analysis = "oster", delta = seq(0, .999, .001), delta_type = "bound")
regsensitivity breakdown ... cbar(0(.1)1) regsen_breakdown(..., cbar = seq(0, 1, 0.1))
regsensitivity breakdown ... beta(-1(.2)1 lb) regsen_breakdown(..., beta = bnd_lb(seq(-1, 1, 0.2)))
regsensitivity breakdown ... beta(4 ub) regsen_breakdown(..., beta = bnd_ub(4))
(no equivalent) regsen_breakdown(..., direction = "rybar", rxbar = ...)
(no equivalent) regsen_bounds(..., clow = 0.5)
regsensitivity breakdown ... oster rmax(0(.1)1) beta(0 eq) regsen_breakdown(..., analysis = "oster", r2long = seq(0, 1, 0.1), beta = bnd_eq(0))
regsensitivity plot plot(result)
regsensitivity (no subcommand) regsen_summary(...)

Citation

Inside R, every format is one call away:

citation("regsensitivity")                       # rendered text
print(citation("regsensitivity"), bibtex = TRUE) # with BibTeX
toBibtex(citation("regsensitivity"))             # BibTeX only

Copy-pasteable forms below.

BibTeX

@Manual{regsensitivity,
    title  = {regsensitivity: Regression Sensitivity Analysis for Omitted Variable Bias},
    author = {Mike Nguyen},
    year   = {2026},
    note   = {R package version 0.2.0},
    url    = {https://github.com/mikenguyen13/regsensitivity}
}

RIS (Zotero, EndNote, Mendeley)

TY  - COMP
TI  - regsensitivity: Regression Sensitivity Analysis for Omitted Variable Bias
AU  - Nguyen, Mike
PY  - 2026
PB  - GitHub
ET  - 0.2.0
UR  - https://github.com/mikenguyen13/regsensitivity
ER  -

APA 7

Nguyen, M. (2026). regsensitivity: Regression sensitivity analysis for omitted variable bias (Version 0.2.0) [R package]. https://github.com/mikenguyen13/regsensitivity

MLA 9

Nguyen, Mike. regsensitivity: Regression Sensitivity Analysis for Omitted Variable Bias. Version 0.2.0, 2026. https://github.com/mikenguyen13/regsensitivity.

Chicago (author-date)

Nguyen, Mike. 2026. “regsensitivity: Regression Sensitivity Analysis for Omitted Variable Bias.” R package version 0.2.0. https://github.com/mikenguyen13/regsensitivity.

Machine-readable

Methodology citations (the underlying papers, which are separate works) live below in References.

References

Code of conduct

Please note that the regsensitivity project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

MIT. See LICENSE.md. The bundled bfg2020 data set is a subset of the replication data from Bazzi, Fiszbein and Gebresilasse (2020), Frontier Culture, Econometrica.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.