skillfed

rdrobust

Implements local polynomial Regression Discontinuity (RD) point estimators with robust bias-corrected confidence intervals and inference procedures.

rdrobust v2.0.0 89.8K downloads/30d#13,632 on PyPI97
Copyleft license GPL-3.0-only Active released

What it is and what it does

rdrobust is a Python implementation of regression discontinuity design methods for causal inference, translating the methodological framework from econometrics into a usable statistical package. It provides three main functions: rdrobust for point estimation and hypothesis testing with robust bias-corrected inference, rdbwselect for data-driven bandwidth selection, and rdplot for diagnostic visualization. The package depends on numpy, pandas, scipy for numerical computation, and plotnine and matplotlib for graphical output.

The package targets applied researchers and econometricians who work with quasi-experimental designs where a treatment assignment changes sharply at a threshold. It handles heteroskedasticity-robust and cluster-robust variance estimation, supports covariate adjustment, and implements the bias-correction and coverage-error optimization methods described in the underlying academic literature. Installation is straightforward, and the package includes a bundled Senate dataset for quick experimentation.

Use it for:

  • Estimate causal effects in policy evaluations where treatment is assigned based on a threshold (e.g., eligibility cutoffs)
  • Conduct robust inference on discontinuities in outcome variables at known policy discontinuities
  • Select optimal bandwidth for RD estimation automatically using data-driven procedures
  • Generate diagnostic plots of RD relationships with binned means and local polynomial fits
  • Perform cluster-robust inference when observations are grouped (e.g., by state or region)

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Implements regression discontinuity (RD) design estimation, inference, and plotting using local polynomial methods with robust bias-corrected confidence intervals.

Yes, if you work with regression discontinuity designs in econometrics or causal inference. The package is actively maintained, has no known vulnerabilities, installs with low friction, and implements state-of-the-art bias-corrected methods backed by peer-reviewed research. The GPL-3.0-only license is a constraint only if you need to incorporate it into proprietary software.

Install

rdrobust on PyPI

pip

pip install rdrobust

uv

uv add rdrobust

poetry

poetry add rdrobust

Installing rdrobust

Before you install

Low friction installation with five common scientific dependencies (numpy, pandas, scipy, plotnine, matplotlib). Actively maintained with recent releases; last commit 2026-08-14.

License in practice

GPL-3.0-only copyleft license requires any derivative work or distribution to also be GPL-3.0-only; acceptable for research and open-source projects but incompatible with proprietary software.

Quickstart

pip install rdrobust

from rdrobust import rdrobust, rdrobust_RDsenate

df = rdrobust_RDsenate()
r = rdrobust(y=df['vote'], x=df['margin'], vce='hc3')

Requires Python >= 3.9

Verify before relying

  • Whether cluster-robust variance (CRV3) implementation matches Pustejovsky-Tipton 2018 exactly as claimed
  • Performance characteristics with large datasets (memory footprint, computation time)
  • Compatibility with pandas/numpy versions beyond the minimum supported

Package facts

License GPL-3.0-only (copyleft)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 5 — numpy, pandas, scipy, plotnine, matplotlib
Maintenance actively maintained — 91 days since the last release
Last repo commit
First released
Downloads 89,822/month — #13,632 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rdrobust-2.0.0-py3-none-any.whl

Operating System :: OS IndependentProgramming Language :: Python :: 3

Tags

regression discontinuity estimationRD design inferencelocal polynomial regressioncausal inference discontinuitybias-corrected confidence intervalsbandwidth selection RDregression discontinuity plotseconometric discontinuity analysis
causal-inferenceeconometricsquasi-experimental-design

More Mathematics packages

Further reading