Skip to contents

pkgdown

didint implements difference-in-differences estimators with spatial interference, following Xu (2023, 2026).

What this package does

Standard DiD assumes one unit’s outcome does not depend on another unit’s treatment. That is often too strong for spatial policies. A treated municipality can affect nearby municipalities, so the estimand has to say what exposure level is being compared.

didint implements the doubly robust estimators of Ruonan Xu:

  • did_int_2x2() — two-period, common-adoption-timing case from Xu (2023). Estimates the direct ATT at a chosen exposure level g.
  • did_int_dynamic() — event study with common adoption timing (Xu 2026, Section I).
  • did_int_staggered() — staggered adoption with not-yet-treated comparison groups (Xu 2026, Section II), with joint-IF aggregation across cohort-time cells.

Standard errors come from the empirical influence function. With coords and a cutoff, they are Conley spatial-HAC. An optional trim argument drops units with extreme propensities (Xu 2026 uses 0.01 in the Brazil application).

Installation

# install.packages("remotes")
remotes::install_github("xiangao/didint")

Documentation & vignettes

Full documentation: https://xiangao.github.io/didint/

Page Description
Brazil Amazon Priority List End-to-end replication of Xu (2026) Section III on the public Assunção-McMillan-Murphy-Souza-Rodrigues archive
did_int_2x2() 2x2 base case (Xu 2023)
did_int_dynamic() Dynamic event study (Xu 2026 §I)
did_int_staggered() Staggered adoption with joint-IF aggregation (Xu 2026 §II)
Reference index All functions on one page

A Julia port with identical estimators is at DidInterference.jl (docs: https://xiangao.github.io/DidInterference.jl/).

References

  • Xu, Ruonan (2023). “Difference-in-Differences with Interference.” arXiv:2306.12003.
  • Xu, Ruonan (2026). “Dynamic Difference-in-Differences with Interference.” AEA Papers and Proceedings 116: 58–63.

License

MIT