Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 065
Research workflow/5 steps

Regression discontinuity, done right (rdrobust)

01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 5 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 5
01
Data prep

Load senate data and inspect the running variable

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Load the Cattaneo-Frandsen-Titiunik U.S. Senate data and look at the Democratic margin of victory that determines incumbency.

Reads fromNot specified Feeds into#2
Key code
# Install:  install.packages("rdrobust")   # R  ·  pip install rdrobust  (Python)
library(rdrobust)
data(rdrobust_RDsenate)
vote   <- rdrobust_RDsenate$vote     # Dem vote share next election (outcome)
margin <- rdrobust_RDsenate$margin   # Dem margin this election (running var)
summary(margin)

Reference / docs ↗

Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

An outcome vector y and a running/forcing variable x (and a cutoff c, default 0).

Show data format & exampleHide example
y (outcome) x (running var)
4.2 -0.8
5.1 -0.1
6.9 0.2
7.3 0.9
03
Read the evidence

Results & interpretation

1 figure Workflow discussion 0
01FigureThe jump in the outcome at the cutoff — the local RD treatment effect (τ ≈ 7.4).

Result figure rendered by StatsOtter from the package's documented example — unofficial community showcase; all credit to the original authors.

The estimate

\tau_{\mathrm{RD}}=\lim_{x\downarrow c}\mathbb E[Y\mid X=x]-\lim_{x\uparrow c}\mathbb E[Y\mid X=x]

Context & interpretation

⚠️ Unofficial community showcase of rdrobust (docs). Not affiliated with the authors — all credit to Guido Imbens & coauthors; this summarizes public documentation.

What it does. In a regression discontinuity (RD) design, units just above and just below a cutoff on a running variable are treated as if randomized; rdrobust estimates the jump in the outcome at the cutoff. How it works. It fits local-linear (or local-quadratic) regressions on each side of the threshold, selects a data-driven bandwidth, and—critically—reports bias-corrected point estimates with robust confidence intervals that account for the bias introduced by the smoothing. Assumptions. Continuity of potential outcomes at the cutoff and no precise manipulation of the running variable; the estimate is a local effect at the threshold. Imbens's contribution. The mean-squared-error-optimal bandwidth selector originates with Imbens & Kalyanaraman (2012, Review of Economic Studies); rdrobust (Calonico, Cattaneo, Farrell, Titiunik) builds robust inference on top of that bandwidth lineage.

What you get — RD point estimate at the cutoff with conventional, bias-corrected, and robust standard errors / CIs.

Example output

Sharp RD estimates using local polynomial regression.

Number of Obs.                 1297
BW type                        mserd
Kernel                         Triangular
VCE method                     NN

Number of Obs.                  595          702
Eff. Number of Obs.             360          323
Order est. (p)                    1            1
BW est. (h)                  17.754       17.754

=============================================================================
        Method     Coef. Std. Err.    z     P>|z|      [ 95% C.I. ]
=============================================================================
  Conventional     7.414     1.459  5.083   0.000    [ 4.555 , 10.273 ]
Bias-Corrected     7.507     1.459  5.146   0.000    [ 4.647 , 10.366 ]
        Robust     7.507     1.741  4.311   0.000    [ 4.094 , 10.919 ]
=============================================================================

Links: package · paper

Peer notes

Discuss the workflow (0)

  • No comments yet — start the conversation.
IN THE MARGINS

Peer discussion