Chapter 4 Kernel-weighted local polynomial regression

Kernel-weighted local polynomial regressions are a weighted regression restricted to a window-like (local) where the chosen kernel provides the weights. Observations closer to the cutoff have greater weight, and you need to select the bandwidth window. The method is sensitive to the size of the bandwidth window

We use a triangle kernel with the function lpoly. We need to specify the options kernel(triangle) and we need to specify the bandwidth size with (bwidth)

capture drop sdem* x1 x0
lpoly score demvoteshare if democrat == 0, nograph kernel(triangle) gen(x0 sdem0) bwidth(0.1)}
lpoly score demvoteshare if democrat == 1, nograph kernel(triangle) gen(x1 sdem1)  bwidth(0.1)}
scatter sdem1 x1, color(red) msize(small) || scatter sdem0 x0, msize(small) color(red) ///
xline(0.5,lstyle(dot)) legend(off) xtitle("Democratic vote share") ytitle("ADA score")
Kernel-weighted local polynomial regression
Kernel-weighted local polynomial regression

We estimate the local polynomial \(LATE\) using the following:

gen diff = sdem1 - sdem0
list sdem1 sdem0 diff in 1/1
(13,538 missing values generated)

     +---------------------------------+
     |    sdem1       sdem0       diff |
     |---------------------------------|
  1. | 64.39525   16.247676   48.14758 |
     +---------------------------------+

Stata code attributed to Marcelo Perraillon.