Package: badcontrols 1.0.0

Hugo SantAnna

badcontrols: Difference-in-Differences with Bad Controls

Implements methods for difference-in-differences with bad controls, i.e., time-varying covariates that are affected by the treatment. Provides imputation, doubly robust, and machine learning estimators that are based on Caetano, Callaway, Payne, and Sant'Anna (2026) <doi:10.48550/arXiv.2608.03881>.

Authors:Carolina Caetano [aut], Brantly Callaway [aut], Stroud Payne [aut], Hugo Sant'Anna [aut, cre]

badcontrols_1.0.0.tar.gz
badcontrols_1.0.0.zip(r-4.7-any)badcontrols_1.0.0.zip(r-4.6-any)badcontrols_1.0.0.zip(r-4.5-any)
badcontrols_1.0.0.tgz(r-4.6-any)badcontrols_1.0.0.tgz(r-4.5-any)
badcontrols_1.0.0.tar.gz(r-4.7-any)badcontrols_1.0.0.tar.gz(r-4.6-any)
badcontrols_1.0.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
badcontrols/json (API)

# Install 'badcontrols' in R:
install.packages('badcontrols', repos = c('https://hugosantanna.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/hugosantanna/badcontrols/issues

Datasets:

On CRAN:

Conda:

quarto

5.45 score 4 stars 10 scripts 527 downloads 3 exports 43 dependencies

Last updated from:651ccc9257. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK195
source / vignettesOK167
linux-releaseOK173
macos-releaseOK259
macos-oldrelOK275
windows-develOK181
windows-releaseOK182
windows-oldrelOK150
wasm-releaseOK125

Exports:didbcdr_ml_attgtsimulate_bad_controls

Dependencies:BHbigmemorybigmemory.sriBMiscclicpp11data.tabledplyrDRDIDfarverfastglmFormulagenericsggplot2gluegtableisobandlabelinglatticelifecyclemagrittrMatrixpbapplypillarpkgconfigptetoolsR6RColorBrewerRcppRcppArmadilloRcppEigenrlangS7scalessplines2tibbletidyselecttrustutf8uuidvctrsviridisLitewithr

Difference-in-Differences with Bad Controls: A Coding Example
NLSY data | Question 1: Is occupation score a bad control? | Estimating the effect of displacement on earnings | Other estimators

Last update: 2026-08-30
Started: 2026-08-07

Difference-in-Differences with Bad Controls: A Conceptual Overview
Motivation | Alternative approaches | New Approach 1: Condition on the pre-treatment bad control | New Approach 2: Covariate unconfoundedness for the bad control | Conceptual side-discussion: | Conclusion | References

Last update: 2026-08-24
Started: 2026-08-07