Tutorials › Causal Inference › Kernel Weights and Local RD Samples

Regression Discontinuity Designs · Tutorial 638 of 972

Kernel Weights and Local RD Samples

Compare common kernel choices in local RD regression and calculate how their weights change the fitted discontinuity and the influence of observations near a bandwidth edge.

Advanced 9 min read

What You'll Learn

  • Define kernel weights using distance from the RD cutoff scaled by the bandwidth
  • Compare uniform, triangular, and Epanechnikov weights at specified distances
  • Calculate separate-side local linear intercepts and the resulting RD estimate
  • Explain why observations at the bandwidth edge can have different contributions
  • Distinguish a kernel’s weighting rule from the causal assumptions needed for RD interpretation

Why Kernel Weights Matter in RD

A local RD regression uses observations near a cutoff to estimate the outcome trend on each side and compare the two fitted values at the cutoff. The bandwidth determines which distances are considered local; the kernel determines how observations within that range are weighted. Thus, two analyses can use the same cutoff and bandwidth yet produce different fitted discontinuities because observations at different distances contribute differently.

A kernel is a weighting rule, not an identification assumption. For the discontinuity to have a causal interpretation in a sharp RD design, treatment must change at the cutoff and the relevant conditional mean outcomes in the absence of treatment must be continuous there. Kernel choice changes the estimation procedure; it cannot by itself establish those conditions.

Definition: Let \(R_i\) be unit \(i\)'s running variable, \(c\) the cutoff, and \(h>0\) a bandwidth. The centered running variable is \(X_i=R_i-c\), and the scaled distance is \(u_i=|X_i|/h\). A kernel \(K(u_i)\) assigns a nonnegative weight based on that scaled distance. With a compact-support kernel, observations with \(|X_i|>h\) receive weight zero. The local sample consists of observations with positive weight; a point exactly at the bandwidth edge may be in the kernel's support but still receive zero weight.

Common Kernel Choices

For a symmetric RD analysis, the weight depends on absolute distance from the cutoff. Three common choices are the uniform, triangular, and Epanechnikov kernels. The formulas below use the conventional normalizations; multiplying every weight in a fit by the same positive constant does not change its weighted least-squares coefficients.

$$ K_{\mathrm{uniform}}(u)=\frac{1}{2}\mathbf{1}(0\leq u\leq 1), \qquad K_{\mathrm{triangular}}(u)=(1-u)\mathbf{1}(0\leq u\leq 1) $$
$$ K_{\mathrm{Epanechnikov}}(u)=\frac{3}{4}(1-u^2)\mathbf{1}(0\leq u\leq 1) $$

Here \(\mathbf{1}(\cdot)\) equals 1 when its condition holds and 0 otherwise. Within the bandwidth, the uniform kernel gives every observation the same weight. The triangular kernel gives progressively less weight with distance and zero weight at the edge. The Epanechnikov kernel also downweights more distant observations, with a curved rather than linear decline, and gives zero weight at the edge. Other kernels exist; what matters for interpreting an analysis is the actual weighting rule and its support.

Worked Example: Comparing Weights by Distance

Suppose the bandwidth is \(h=8\) running-variable units. Consider observations at distances 0, 2, 4, 6, and 8 from the cutoff. Their scaled distances are \(u=0, 0.25, 0.5, 0.75,\) and 1. The kernel weights are:

Distance from cutoffScaled distance \(u\)UniformTriangularEpanechnikov
000.50001.0000.7500
20.250.50000.75000.7031
40.50.50000.50000.5625
60.750.50000.25000.3281
810.500000

For example, at distance 6, the triangular weight is \(1-6/8=0.25\). The Epanechnikov weight there is \(0.75[1-(6/8)^2]=0.328125\), or 0.3281 to four significant figures. The uniform weight is 0.5 throughout its support. At distance 8, the uniform kernel still assigns positive weight under the stated convention, whereas the other two assign zero. Since observations exactly at the edge are possible in finite data, this convention can matter in practice.

Kernel Weights in Local Linear RD

For a sharp RD, fit a local linear regression separately on each side of the cutoff. Using \(X_i=R_i-c\), a weighted fit on side \(s\), where \(s\) is left or right, minimizes the weighted sum of squared residuals:

$$ \sum_{i:\,i\text{ on side }s} K\!\left(\frac{|X_i|}{h}\right) \left(Y_i-a_s-b_sX_i\right)^2 $$

The fitted intercept \(a_s\) is the estimated outcome at the cutoff from that side. The local linear RD estimate is the right-side intercept minus the left-side intercept, \(\hat{\tau}=a_{\mathrm{right}}-a_{\mathrm{left}}\). The weights affect which observations most influence the fitted lines, but the intercept remains an extrapolation to \(X_i=0\) from observations on each side. In the causal RD interpretation, the estimate is a local treatment effect only under the design's identification conditions.

Result: For a weighted linear fit on one side, let \(w_i=K(|X_i|/h)\), and define \(S_0=\sum_i w_i\), \(S_1=\sum_i w_iX_i\), \(S_2=\sum_i w_iX_i^2\), \(T_0=\sum_i w_iY_i\), and \(T_1=\sum_i w_iX_iY_i\). When \(S_0S_2-S_1^2>0\), the fitted intercept is $$ \hat{a}=\frac{S_2T_0-S_1T_1}{S_0S_2-S_1^2}. $$ The sums are over observations on that side. This expression makes clear that changing the kernel can change the intercept, even when the bandwidth and observations are held fixed.

To justify the expression, the weighted least-squares normal equations for the intercept and slope are \(S_0\hat{a}+S_1\hat{b}=T_0\) and \(S_1\hat{a}+S_2\hat{b}=T_1\). Multiply the first equation by \(S_2\), the second by \(S_1\), and subtract the second from the first. The slope terms cancel, giving \((S_0S_2-S_1^2)\hat{a}=S_2T_0-S_1T_1\). Dividing by the positive determinant gives the stated intercept. A positive determinant requires enough variation in the running variable among positively weighted observations to identify the local line.

Worked Example: Kernel Choice Changes the Fitted RD Estimate

Consider hypothetical data with bandwidth \(h=4\). On each side, there are observations at distances \(t=1,2,3\) from the cutoff. For calculating each side's intercept, use \(t=|X_i|\); the intercept at \(t=0\) is the fitted value at the cutoff. The outcomes are:

Distance \(t\)Left-side outcomeRight-side outcome
11015
21218
31625

All six observations are within the bandwidth. Fit a separate weighted line on each side. With uniform weights, the intercepts from ordinary least squares are \(6.667\) on the left and \(9.333\) on the right, so the estimated discontinuity is \(9.333-6.667=2.667\) outcome units.

For the triangular kernel, the weights at \(t=1,2,3\) are \(0.75,0.5,0.25\), respectively. For the left side, the weighted sums are \(S_0=1.5\), \(S_1=2.5\), \(S_2=5\), \(T_0=17.5\), and \(T_1=31.5\). Therefore,

$$ \hat{a}_{\mathrm{left}} =\frac{5(17.5)-2.5(31.5)}{1.5(5)-(2.5)^2} =\frac{8.75}{1.25}=7 $$

On the right, \(T_0=26.5\) and \(T_1=48\), with the same \(S_0,S_1,S_2\). Thus \(\hat{a}_{\mathrm{right}}=[5(26.5)-2.5(48)]/1.25=10\), and the estimated discontinuity is \(10-7=3\) outcome units.

For the Epanechnikov kernel, the weights at \(t=1,2,3\) are \(45/64,36/64,21/64\). The common factor \(1/64\) can be dropped without changing either fitted line, so use weights \(45,36,21\). The left-side sums are \(S_0=102\), \(S_1=180\), \(S_2=378\), \(T_0=1218\), and \(T_1=2322\). Hence,

$$ \hat{a}_{\mathrm{left}} =\frac{378(1218)-180(2322)}{102(378)-180^2} =\frac{42444}{6156}=6.895 $$

For the right side, \(T_0=1848\) and \(T_1=3546\), giving \(\hat{a}_{\mathrm{right}}=[378(1848)-180(3546)]/6156=9.789\). The Epanechnikov estimate of the discontinuity is therefore \(9.789-6.895=2.895\) outcome units. These differences show that the point estimate can change with the kernel. The arithmetic alone does not establish that any estimate is causal; that interpretation still depends on the RD identification assumptions.

How Edge Observations Contribute

A positive weight means an observation enters the weighted objective, but it does not mean that its effect on the fitted intercept is exactly equal to that weight. In local linear regression, the intercept is determined jointly by the weighted outcomes and running-variable values. A point's contribution also depends on the other observations and on the fitted slope. Consequently, kernel weights describe the criterion being minimized, not a simple averaging rule for the final RD estimate.

Worked Example: A Descriptive Effective Sample Size

Suppose a one-sided local sample has five observations at distances \(0,2,5,9,10\) units, with \(h=10\). Under the uniform kernel, all five receive equal positive weights (using weights of 1, which are proportional to the conventional 0.5). A descriptive measure of weight concentration is \(n_{\mathrm{eff}}=(\sum_iw_i)^2/\sum_iw_i^2\). Here \(n_{\mathrm{eff}}=5^2/5=5\).

Under the triangular kernel, the weights are \(1,0.8,0.5,0.1,0\). Thus \(\sum_iw_i=2.4\) and \(\sum_iw_i^2=1+0.64+0.25+0.01=1.90\), so \(n_{\mathrm{eff}}=2.4^2/1.90=3.032\). The edge observation at distance 10 has zero weight and contributes nothing to the fit. This effective sample size is only a descriptive summary of weight concentration; it is not the number of independent observations for inference and does not replace an appropriate RD standard error.

Practical Interpretation and Common Pitfalls

Kernel choice is worth reporting because it specifies how the local sample is weighted. For example, “triangular kernel with bandwidth 10 running-variable units” communicates both the support and the declining weights within it. If the bandwidth is the same, the uniform kernel gives relatively more weight to distant observations than the triangular kernel, while a triangular or Epanechnikov kernel places relatively more emphasis on observations closer to the cutoff. This description concerns the weighting rule, not a guarantee that closer observations always determine the fitted intercept more strongly in isolation.

A common mistake is to say that a triangular kernel excludes observations near the bandwidth edge. It does not exclude all such observations: at any distance strictly less than \(h\), its weight is positive, though it declines toward zero. Another mistake is to treat the weight itself as the observation's exact influence on the estimated jump. The correction is to distinguish the kernel weight in the weighted least-squares objective from the observation's resulting effect on the fitted coefficients, which depends on the full weighted regression.

Finally, changing the kernel is not the same as changing the bandwidth. The kernel changes relative weights within its support; the bandwidth sets the scale of that support for compact kernels. Neither a kernel nor a bandwidth, by itself, makes a local comparison causally valid. Keep the running variable, cutoff, outcome, and design assumptions explicit when interpreting a fitted discontinuity.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. With \(h=12\), what are the uniform and triangular weights for an observation 9 units from the cutoff?
  2. Why can two local linear RD estimates differ when they use the same observations and bandwidth but different kernels?
  3. Under a triangular kernel, does an observation exactly at the bandwidth edge contribute to the weighted regression? What about one just inside the edge?
  4. What does the weighted least-squares kernel weight specify, and why is it not generally the observation's exact influence on the fitted discontinuity?
  5. Why does using a local kernel not, by itself, justify a causal interpretation of an RD estimate?
Clinical Biostats