Regression Discontinuity Design (RD)#

Many decisions at a tech company are made with a rule: if the lead score is 60 or higher, the lead goes to a salesperson; otherwise it stays in self-serve. A rule like this looks like an obstacle to causal analysis, because the units that get treated differ from those that don’t. It is also an opportunity: two leads with scores of 59 and 61 are practically identical, yet one got the salesperson and the other did not.

The regression discontinuity (RD) design exploits exactly this situation. This section explains what an assignment rule identifies, how to estimate the effect with local regressions, how to do correct inference, how to check that the design is credible, and how the analysis changes when the rule is not followed to the letter (fuzzy RD), connecting with the instrumental variables sections.


1. Objectives#

By the end of this section, the reader will be able to:

  • Explain why an assignment rule based on a score creates a credible comparison only at the cutoff, and which effect is identified (a local effect at the cutoff, not a general average effect).

  • Estimate an RD effect with local linear regression, and explain why high-order global polynomials can produce spurious jumps.

  • Understand the bias–variance trade-off of the bandwidth, and why conventional confidence intervals undercover at the optimal bandwidth, which motivates robust bias-corrected inference.

  • Assess the validity of an RD design: density test, covariate balance, placebo cutoffs, and bandwidth sensitivity.

  • Interpret fuzzy RD as an instrumental-variables estimator and say whose effect it recovers (the compliers at the cutoff).

  • Know the main extensions: discrete scores, covariates, local randomization, and multiple cutoffs.


2. A Cutoff, a Rule: the Intuition#

Instacart and rounding. When a customer confirms an order, the platform pre-authorizes on their card an amount somewhat larger than the cart, to cover last-minute changes. That amount is rounded in $5 steps. Two orders with carts of $49.90 and $50.10 are nearly identical in everything else, but the second falls on a higher authorization step. That mechanical difference, which has nothing to do with customer characteristics, creates a quasi-random comparison around each step.

Our running example: leads at a B2B software company. A B2B software company gives each lead a score (lead score) from 0 to 100 based on its size, site activity and profile. The routing rule is simple: leads with score \(\geq 60\) go to a salesperson; the rest stay in self-serve. The outcome we care about is first-year revenue per lead (in thousands of dollars). How much does it add, in revenue, for a lead to be handled by a salesperson?

A naive comparison of revenue between handled and unhandled leads mixes two things: the effect of the salesperson and the fact that high-score leads were already better customers to begin with. RD solves the problem by comparing only leads very close to the cutoff, where the score is practically the same.

Basic vocabulary: the variable that determines assignment is the running variable or score (\(X\)); the value where the rule changes is the cutoff (\(\bar{x} = 60\)); and the rule itself is \(D = \mathbf{1}\{X \geq \bar{x}\}\).

Before exploring, predict:

  • Is the jump at the cutoff visible even with a lot of noise? What happens when the true effect is zero?

  • Can the dashed lines (the counterfactuals) be observed in the data? Which part of each do we see?

  • If the relationship between score and revenue is very curved, what happens to the estimate of the jump?

  • When you move the cutoff toward an extreme of the score, where there are few leads, what happens to precision?

The main panel shows the cloud of leads, their bin averages, and the local fit on each side of the cutoff. Turning on the counterfactuals reveals the two functions we do not observe: what the leads below the cutoff would have earned had they been handled, and what those above would have earned had they not been. The effect is the distance between the two fits exactly at the cutoff.

Two things should stand out. First, there is no overlap: no lead with score 45 was handled by a salesperson, so we cannot compare “45-point leads with and without a salesperson,” as we would with matching. The comparison happens at a point, which is why it relies on a continuity assumption. Second, the more curved the underlying relationship, the more it matters how the curve is fit near the cutoff.


3. Identification: Two Limits and a Continuity Assumption#

Let \(Y_i(1)\) be the revenue of lead \(i\) if handled by a salesperson and \(Y_i(0)\) the revenue if not handled. We observe only one of the two: \(Y_i = D_i\,Y_i(1) + (1-D_i)\,Y_i(0)\). In sharp RD, assignment is a deterministic function of the score: \(D_i = \mathbf{1}\{X_i \geq \bar{x}\}\).

The parameter of interest is the average causal effect at the cutoff:

\[ \tau_{SRD} = E\big[Y_i(1) - Y_i(0) \mid X_i = \bar{x}\big]. \]

Continuity assumption. The functions \(E[Y_i(0)\mid X_i = x]\) and \(E[Y_i(1)\mid X_i = x]\) are continuous at \(x = \bar{x}\). In words: if nobody were treated, expected revenue would not jump at the cutoff; the same holds if everybody were treated.

Formal result: under continuity, the effect at the cutoff is identified as the difference of two one-sided limits,

\[ \tau_{SRD} = \lim_{x \downarrow \bar{x}} E[Y_i \mid X_i = x] \;-\; \lim_{x \uparrow \bar{x}} E[Y_i \mid X_i = x]. \]

(Throughout the section we use the convention “right minus left.”) The proof is in the appendix. This matches what we saw in the dashboard: the effect is the distance between the two fits at the cutoff.

Two important caveats about what this result does not say:

  • It is a local effect. \(\tau_{SRD}\) is the effect for leads whose score is at the cutoff. It is not an average effect over the whole population, and extrapolating it to leads with score 90 requires additional assumptions. That is the price of such a credible comparison.

  • Continuity is an assumption, not a test. It fails if, at the cutoff, something else happens besides the rule, or if units can manipulate their score to land on one side or the other. Section 6 shows how to look for evidence for or against it.


4. Estimation: Global vs. Local#

4.1 The global approach (and its problems)#

The first idea is to fit a single regression model to all the data, with a polynomial in the score centered at the cutoff and a treatment dummy:

\[ Y_i = \alpha + \tau D_i + \beta_1 (X_i - \bar{x}) + \beta_2 D_i (X_i - \bar{x}) + \varepsilon_i. \]

The case \(\beta_2 = 0\) imposes the same slope on both sides (the “common trend” model); allowing \(\beta_2 \neq 0\) is more flexible. When the relationship is curved, the temptation is to add quadratic, cubic, fourth-order terms…

The problem is that a global polynomial uses all the data, even far from the cutoff, to determine the value of the fit at the cutoff. With high orders, the fit becomes very sensitive to what happens in the tails and can produce a jump where there is none (a result Gelman and Imbens (2019) document as a reason to avoid high-order polynomials in RD).

4.2 The local approach#

The alternative is to fit a simple, linear, regression, but only with the observations within a window \([\bar{x}-h,\ \bar{x}+h]\) around the cutoff, separately on each side. Observations are weighted with a kernel that gives more weight to those closer to the cutoff. The triangular kernel is the standard because it has optimal properties at a boundary, which is what the cutoff is for each side; the uniform kernel (all observations with equal weight) is a simple alternative. The estimated effect \(\hat{\tau}\) is the difference between the two local intercepts at \(\bar{x}\).

The key parameter is the bandwidth \(h\):

  • A small \(h\) uses only observations very close to the cutoff: less bias (the relationship looks more like a line over a short stretch), but more variance (few data points).

  • A large \(h\) uses more data: less variance, but more bias if the relationship is curved.

There are bandwidth selectors that minimize mean squared error (MSE-optimal), proposed by Imbens and Kalyanaraman (2012) and refined by Calonico, Cattaneo and Titiunik (2014). A local polynomial of order 1 is used by default for the point estimate.

Before exploring, predict:

  • In the Global vs. local tab, the true effect is zero. As you raise the order of the global polynomial, what happens to the estimated jump?

  • Does the local fit change as much as the global one when curvature changes?

  • In the Bandwidth and coverage tab, what happens to the bias and to the spread of the estimator as you increase \(h\)?

  • With the MSE-optimal \(h\), does the conventional confidence interval cover the true value 95% of the time?

In the Global vs. local tab, the true effect is zero: any estimated jump is spurious. With high-order polynomials and a curved function, the global fit tends to invent a jump at the cutoff, while the local fit is much less sensitive to the shape of the curve (with the “Wiggly” setting it stays close to zero). The Bandwidth and coverage tab repeats the experiment 500 times: the histogram shows how \(\hat{\tau}\) is distributed for each \(h\), and the table compares the coverage (fraction of times the interval contains the true value) of the conventional intervals and of the robust ones we present next.


5. Inference: Smoothing Bias and Robust Correction#

The previous simulation should have shown something uncomfortable: with the MSE-optimal bandwidth, the conventional confidence interval covers the true value less than 95% of the time. The reason is that the MSE-optimal bandwidth balances bias and variance, but leaves a smoothing bias (from approximating a curve with a line) that is not negligible relative to the standard deviation. The conventional interval is built as if that bias did not exist, so it ends up off-center.

The solution of Calonico, Cattaneo and Titiunik (2014) is robust bias-corrected inference (RBC):

  1. Estimate the smoothing bias using a local polynomial of one order higher (typically, order 2).

  2. Subtract it from the point estimate (bias correction).

  3. Compute the standard error accounting for the fact that the bias was estimated, which makes it somewhat larger.

The resulting interval is re-centered and somewhat wider, and recovers coverage close to the nominal 95%. In practice three things are reported: the conventional estimator, the bias-corrected estimator, and the robust interval. This is the procedure the rdrobust package implements by default.

Two brief notes. First, using the MSE-optimal \(h\) to estimate and correct the bias with RBC is the usual practice; the alternative of choosing a bandwidth smaller than optimal (undersmoothing) reduces the bias but wastes data. Second, the precision of RD depends heavily on the sample size near the cutoff, not the total; this connects with the logic of the power section.

The notebook (Part 1) implements the local linear estimator from scratch and then with rdrobust: RD plot, MSE-optimal bandwidth, robust bias-corrected interval and bandwidth sensitivity.


6. Validity: Can the Score Be Manipulated?#

The continuity assumption cannot be tested directly, but its observable consequences can be examined. The most important threat in tech settings is score manipulation: if salespeople can “nudge” the score of a lead they care about so it passes the cutoff, or if users can adjust their behavior to land just above it, the comparison at the cutoff stops being quasi-random.

Manipulation biases RD only when those who manipulate are systematically different from those who don’t (for example, leads of higher latent quality). If manipulation is random, the cutoff remains credible even though it was manipulated. That is why the standard set of checks combines several tools:

  • Density test (McCrary, 2008; modern version by Cattaneo, Jansson and Ma, 2020): compares the density of the score just left and right of the cutoff. A jump in the density suggests sorting.

  • Covariate balance: variables determined before assignment (for example, company size) should not jump at the cutoff. An RD is estimated with that covariate as the “outcome.”

  • Placebo cutoffs: the analysis is repeated at scores where there is no rule (for example, 40 or 80, using only the data from one side of \(\bar{x}\)); no jump should be found.

  • Bandwidth sensitivity: \(\hat{\tau}\) and its interval are plotted for a range of values of \(h\); the result should not depend on the chosen width.

  • Donut RD: observations in a very small radius around the cutoff, where manipulation tends to concentrate, are dropped; this costs extra variance.

Before exploring, predict:

  • With random manipulation, does the density test reject? Is the estimate of \(\hat{\tau}\) biased?

  • With selective manipulation (the higher-quality leads are the ones that jump the cutoff), what does the balance plot show?

  • What effect does the donut have on bias and on precision?

  • With integer scores heaped at multiples of 5, does the density test detect manipulation better or worse?

With 0% manipulation, the checks come out clean (apart from an occasional false positive, which shows up when you change sample with the Draw control): this is the baseline. With scores heaped at multiples of 5, the rounding blurs part of the density jump: the test loses power. When manipulation appears, the score histogram shows the density jump and the test’s p-value drops. But what is decisive is the type of manipulation: if it is random, \(\hat{\tau}\) barely moves; if it is selective, RD estimates something other than the causal effect and the balance plot gives it away, because the covariate correlated with latent quality also jumps.

A general lesson: no single check proves the design is valid. The density test detects sorting, but sorting only matters if it is selective; balance detects selection, but only in the covariates we observe. It is best to report the whole set.


7. Fuzzy RD: From the Rule to Adoption#

In fuzzy RD, crossing the cutoff changes the probability of receiving treatment but does not determine it. Example: Uber offers a bonus to drivers who exceed a weekly-trips threshold (50). The rule defines who is eligible, but not every eligible driver enrolls in the bonus, and some drivers below the threshold get it another way. The variable \(Y\) is hours online the following month and \(D\) is actual enrollment.

Eligibility \(Z = \mathbf{1}\{X \geq \bar{x}\}\) plays the role of instrument. There are two jumps at the cutoff: the first stage, \(\rho_D\) (jump in the probability of enrolling), and the reduced form, \(\rho_Y\) (jump in hours online):

\[ \rho_D = \lim_{x\downarrow \bar{x}} E[D_i\mid X_i=x] - \lim_{x\uparrow \bar{x}} E[D_i\mid X_i=x], \qquad \rho_Y = \lim_{x\downarrow \bar{x}} E[Y_i\mid X_i=x] - \lim_{x\uparrow \bar{x}} E[Y_i\mid X_i=x]. \]

Formal result: under continuity of the outcome and adoption functions at the cutoff, monotonicity and exclusion (the rule affects \(Y\) only through \(D\)),

\[ \tau_{FRD} = \frac{\rho_Y}{\rho_D} \]

is the average causal effect for compliers at the cutoff: the drivers who enroll if and only if they exceed the cutoff. The derivation is in the appendix. It is exactly the Wald estimator from the LATE section, applied locally: the ratio of reduced form to first stage.

Three consequences. First, the effect is that of a subgroup: not of the always-takers (who enroll regardless), nor the never-takers, nor all drivers. Second, exclusion must be defended: if crossing the cutoff changes hours through a path other than enrollment, the ratio is contaminated. Third, if the first-stage jump is small, we face a weak instrument (see 2SLS and weak instruments): the denominator is noisy, the standard error blows up and conventional intervals are unreliable. In practice it is estimated with 2SLS, using local linear regressions in both stages, and the first stage and reduced form are reported separately.

Before exploring, predict:

  • As you lower the first-stage jump from 0.9 to 0.1, what happens to the sampling distribution of \(\hat{\tau}_{FRD}\)?

  • With positive selection, in which direction is the naive comparison between enrolled and non-enrolled biased? And the fuzzy RD estimate?

  • If the effects for compliers differ from those for always-takers, which one does fuzzy RD recover?

  • With a jump of 0.9 and no always-takers, which estimator does fuzzy RD resemble?

The first two panels show the first stage and the reduced form; the third shows the distribution of the ratio over many samples. As the adoption jump shrinks, that histogram widens a lot: it is the local version of the weak-instrument problem. With a jump close to 1 and no always-takers, the panel looks like sharp RD.


8. Notes and Extensions#

Some issues that come up often in practice and are worth knowing, even if they go beyond this section:

  • Discrete or heaped scores. Integer scores (like the lead score) or rounded ones (Instacart’s $5 steps) violate the idea of a continuous variable: there are few distinct values near the cutoff. Kolesár and Rothe (2018) show that conventional RD can be miscalibrated; donut RD and local randomization alternatives are common remedies.

  • Covariates. Including pre-treatment covariates (Calonico et al., 2019) can improve precision of RD, but is not needed for identification, and the result should not depend on them.

  • Continuity vs. local randomization. There are two frameworks to justify RD. The continuity framework (the one in this section) uses local fits and extrapolates to the cutoff. The local randomization framework (Cattaneo, Frandsen and Titiunik, 2015) assumes that, in a narrow window around the cutoff, assignment is as in an experiment and uses permutation tests. The former is more natural with continuous scores and many observations; the latter, with discrete scores or few observations near the cutoff.

  • Multiple cutoffs. When different groups face different cutoffs, an RD can be estimated at each and combined (rdmulti package).

  • Geographic RD. When the running variable is distance to a border (for example, between two jurisdictions with different regulation), RD is applied along the border. If the border already differed across jurisdictions before the policy, the prior discontinuity can be subtracted, giving a “difference-in-discontinuities” (Pasquini, 2021), a combination of RD and difference-in-differences. A classic RD application in public policy is the effect of the minimum legal drinking age on mortality (Carpenter and Dobkin, 2009).


9. Consolidation: Checklist for an RD Analysis#

A credible RD analysis follows an almost standard sequence:

  1. Plot first. An RD plot of bin averages of the outcome against the score, with the cutoff marked. If nothing shows up, a sophisticated estimate is unlikely to find it.

  2. Estimate with local linear regression, triangular kernel and MSE-optimal bandwidth.

  3. Report the conventional estimator, the bias-corrected one, and the robust interval.

  4. Check validity: density test, covariate balance, placebo cutoffs.

  5. Show robustness: bandwidth sensitivity and, with discrete scores, donut RD.

  6. If fuzzy: report the first stage and reduced form separately, the ratio, and the first-stage F.

  7. Interpret with care: it is an effect local to the cutoff (and, if fuzzy, for compliers).


Appendix: Formal Derivations#

A.1 Identification of sharp RD#

Assumptions: \(D_i = \mathbf{1}\{X_i \geq \bar{x}\}\) and the functions \(E[Y_i(d)\mid X_i=x]\), \(d \in \{0,1\}\), are continuous at \(\bar{x}\).

Step 1 — Since \(Y_i = D_i Y_i(1) + (1-D_i) Y_i(0)\), for \(x \geq \bar{x}\) we have \(D_i = 1\) and so \(E[Y_i\mid X_i=x] = E[Y_i(1)\mid X_i=x]\). For \(x < \bar{x}\), \(E[Y_i\mid X_i=x] = E[Y_i(0)\mid X_i=x]\).

Step 2 — Taking limits on each side,

\[ \lim_{x\downarrow\bar{x}} E[Y_i\mid X_i=x] = \lim_{x\downarrow\bar{x}} E[Y_i(1)\mid X_i=x] = E[Y_i(1)\mid X_i=\bar{x}], \]
\[ \lim_{x\uparrow\bar{x}} E[Y_i\mid X_i=x] = \lim_{x\uparrow\bar{x}} E[Y_i(0)\mid X_i=x] = E[Y_i(0)\mid X_i=\bar{x}], \]

where the second equality in each line uses continuity.

Step 3 — Subtracting, the left-hand side is the difference of one-sided limits and the right-hand side is \(E[Y_i(1) - Y_i(0)\mid X_i=\bar{x}] = \tau_{SRD}\). \(\blacksquare\)

A.2 Fuzzy RD as a local Wald ratio#

Assumptions: continuity of \(E[Y_i(d)\mid X_i=x]\) and of the distribution of adoption types at \(\bar{x}\); monotonicity (crossing the cutoff never discourages adoption); exclusion (the rule affects \(Y\) only through \(D\)); \(\rho_D \neq 0\).

Step 1 — Let \(D_i(1)\) and \(D_i(0)\) be \(i\)’s adoption with and without eligibility. With monotonicity, \(D_i(1)\geq D_i(0)\), and the compliers are those with \(D_i(1)=1,\ D_i(0)=0\).

Step 2 — By continuity, the jump in adoption at the cutoff is \(\rho_D = E[D_i(1) - D_i(0)\mid X_i=\bar{x}] = P(\text{complier}\mid X_i=\bar{x})\).

Step 3 — By exclusion, only compliers change outcome when crossing the cutoff, so the jump in the outcome is \(\rho_Y = E[Y_i(1)-Y_i(0)\mid \text{complier},\ X_i=\bar{x}]\cdot P(\text{complier}\mid X_i=\bar{x})\).

Step 4 — Dividing, \(\rho_Y/\rho_D = E[Y_i(1)-Y_i(0)\mid \text{complier},\ X_i=\bar{x}]\). \(\blacksquare\)


Test what you learned#

References#