rdstagger

Staggered Regression Discontinuity with Network Interference

R-CMD-check CRAN status License: MIT


The Problem

Three identification challenges frequently arise together in applied work — yet no unified method handles all three:

Challenge Example
RD assignment Schools treated when test score falls below a cutoff
Staggered timing Districts adopt the policy in different years
Network spillovers Treated districts affect neighboring districts

rdstagger solves all three simultaneously.


Installation

# CRAN (forthcoming)
install.packages("rdstagger")

# GitHub (development)
remotes::install_github("causalfragility-lab/rdstagger")

Quick Start

library(rdstagger)

# 1. Simulate data
sim <- sim_rdstagger(n = 400, nperiods = 8, n_cohorts = 3,
                     true_direct = 0.30, true_spill = 0.10, seed = 42)

# 2. Estimate ATT(g,t)
res <- rdstagger_attgt(
  data    = sim$data,
  yname   = "y",
  xname   = "x",
  cutoff  = 0,
  gname   = "g",
  tname   = "period",
  idname  = "id",
  network = sim$network,
  bw      = 1.5
)

# 3. Pre-treatment test
rdstagger_pretest(res)

# 4. Event study
agg <- rdstagger_agg(res, type = "dynamic")
plot(agg)

Key Functions

Function Description
sim_rdstagger() Simulate staggered RD panel data with network interference
rdstagger_bw() Optimal bandwidth selection per cohort-time cell
rdstagger_attgt() Estimate ATT(g,t) — direct and spillover effects
rdstagger_spillover() Estimate spillover effects on network neighbors
rdstagger_agg() Aggregate into event-study, group, calendar, or overall ATT
rdstagger_pretest() Pre-treatment parallel trends falsification tests

References


License

MIT © 2026 Subir Hait