How this calculation works
A sharp regression discontinuity calculation compares the two limiting outcome curves at an assignment cutoff. It is designed for treatment rules that change deterministically when the running variable crosses that boundary.
Choose cutoff c and fixed bandwidth h before fitting; retain |x-c|<h with weights1-|x-c|/h (triangular kernel). Fit separate weighted least squares y=alpha_side+beta_side*(x-c) on each side, with x=c assigned to right. Jump=alpha_right-alpha_left. Report counts, effective weights, local slopes and rank. Conventional model-based SE can be offered with explicit assumptions; do not claim rdrobust bias-corrected inference without actually implementing local-quadratic bias correction and robust variance.A worked example
With the prefilled inputs, jump = 5.000000000000011. Rows [runningVariable,outcome]. Triangular local-linear sharp RD; conventional HC1 interval only.
Good to know
Triangular local-linear sharp RD with HC1 conventional uncertainty only. Bias-corrected intervals are not implemented; bandwidth bias and manipulation require external investigation.
Reference: Primary method reference or author-maintained documentation (opens in a new tab) ↗
Focus on the discontinuity
A sharp regression discontinuity calculation compares the two limiting outcome curves at an assignment cutoff. It is designed for treatment rules that change deterministically when the running variable crosses that boundary.
The causal interpretation requires appropriate continuity assumptions for the potential outcomes. A visible jump alone does not establish those assumptions or rule out sorting, another simultaneous rule change or data manipulation.
Compare with the Simple linear regression calculator. Estimate a discontinuity at a predetermined treatment cutoff using separate local fits and a declared bandwidth, rather than a global regression slope.
Set the cutoff and local window
Rows [runningVariable,outcome]. Triangular local-linear sharp RD; conventional HC1 interval only.The bandwidth determines which observations contribute to the local fits. With triangular weights, observations closer to the cutoff have greater influence and observations at the outer window edge receive zero weight.
The cutoff is not estimated from the largest observed gap. Choose it from the assignment rule, and document the bandwidth so a different analyst can reproduce the same local comparison. The runnable example has eighty observations following two exact lines, with running values distributed on either side of zero. The right-hand line is shifted upward by five, so the two separately fitted intercepts differ by five. Because the observations lie exactly on their respective lines, residual-based standard errors are essentially zero. That arithmetic property is useful for checking the estimator; it is not a realistic claim of certainty for an observational treatment effect. For ordinary data, retain the side-specific observation counts and inspect how much positive triangular weight remains near the boundary.
Fit each side separately
Both local lines use x minus the cutoff as their running-variable coordinate. Their intercepts therefore represent the predicted values immediately on the left and right at the same boundary.
Allowing separate slopes avoids forcing a common trend through both sides. The reported jump is the right intercept minus the left intercept, with the cutoff observation assigned to the right-hand side by convention.
Check local information
A large overall dataset may contain little information near the cutoff. Review retained counts, distinct running-variable values and weighted spread separately on each side before interpreting the coefficient.
A local line cannot be identified when its side has no usable variation in the running variable. Such a case needs an explicit rank error, rather than a numerical intercept produced by a generalized inverse.
A jump of five in constructed data
At cutoff zero, let the left outcomes follow y=1+2x at x=-3,-2,-1. Let the right outcomes follow y=6+2x at x=0,1,2, and use bandwidth four.
The fitted intercepts are one and six, so the discontinuity is five. Both local slopes are two; changing positive weights does not change these exact lines because this example has no residual error.
Distinguish a fit from robustRD inference
The local-linear point estimate is only one part of anRD analysis. Conventional uncertainty can be sensitive to smoothing bias and should not be labeled robust bias-corrected unless that procedure is implemented.
Trying several bandwidths can expose sensitivity, but selecting only the one with the strongest result invalidates a simple interpretation of its uncertainty. Report justified sensitivity choices rather than a hidden search over windows.
Use design evidence alongside the number
Inspect outcome trends, covariate continuity and the assignment process. Repeated or coarsely rounded running-variable values can affect what the local comparison can actually learn.
This page handles a sharp assignment rule and a specified local-linear estimator. Imperfect treatment take-up, multiple cutoffs, clustered assignment or discrete support can require a different design and dedicated inference. The working coordinate is the running variable minus the cutoff, divided by bandwidth, which improves the scale of the local matrix calculation. Returned slopes are converted back to the original running-variable units. Observations exactly at the cutoff belong to the right side; observations exactly one bandwidth away have zero weight and are excluded. The conventional standard error combines the two independent-side HC1 intercept variances. It does not include a local-quadratic bias correction, clustering correction or automatic bandwidth search. Comparing several justified windows is informative, but reporting only a favorable result from many windows hides a separate selection problem. Triangular local-linear sharp RD with HC1 conventional uncertainty only. Bias-corrected intervals are not implemented; bandwidth bias and manipulation require external investigation.
A few questions, answered
Is the cutoff estimated from the data?
No. It should come from the assignment rule defining the design.
Which side includes x equal to the cutoff?
The stated convention assigns it to the right-hand side.
Does this implement robust bias-corrected confidence intervals?
Only if that extra procedure is explicitly provided; a pair of local-linear fits alone does not do so.
Can I use it when some people do not follow assignment?
That is a fuzzy design and needs an instrumental-variable discontinuity analysis rather than the sharp estimator.