Implements local polynomial Regression Discontinuity (RD) point estimators with robust bias-corrected confidence intervals and inference procedures.
Actively maintained. Last release 8 weeks ago, commits in 10 of the last 26 weeks. A safe choice.
pip install rdrobustRDROBUST
The package rdrobust implements estimation, inference, and graphical procedures for Regression Discontinuity (RD) designs using local polynomial methods.
rdrobust: point estimation and robust bias-corrected inference.rdbwselect: data-driven bandwidth selection for RD estimation and inference.rdplot: data-driven RD plots based on binned means and local polynomial fits.
See references for methodological and practical details.
Website: https://rdpackages.github.io/.
Source code: https://github.com/rdpackages/rdrobust.
Authors
Sebastian Calonico (scalonico@ucdavis.edu)
Matias D. Cattaneo (matias.d.cattaneo@gmail.com)
Max H. Farrell (mhfarrell@gmail.com)
Ricardo Masini (ricardo.masini@gmail.com)
Rocio Titiunik (rocio.titiunik@gmail.com)
Installation
To install/update use pip:
pip install rdrobust
Usage
from rdrobust import rdrobust, rdbwselect, rdplot, plot_rdrobust, rdrobust_RDsenate
# Load bundled Senate dataset (1390 x 14)
df = rdrobust_RDsenate()
# Sharp RD with HC3 heteroskedasticity-robust variance
r = rdrobust(y=df['vote'], x=df['margin'], vce='hc3')
# Cluster-robust variance (CRV3, Pustejovsky-Tipton 2018)
r = rdrobust(y=df['vote'], x=df['margin'], cluster=df['state'], vce='cr3')
# Bandwidth selection
bw = rdbwselect(y=df['vote'], x=df['margin'], all=True)
# Diagnostic plot of an rdrobust object, with effect panel
fig = plot_rdrobust(r, y=df['vote'], x=df['margin'], show_effect=True)
- Replication: rdrobust illustration, rdplot illustration, senate data.