Takes in a border in the form of a polyline (or borderpoints) and converts it into point data. These points are later used to run separate non-parametric RD estimations which eventually allows to visualise potential heterogeneous treatment effects alongside the cut-off.

discretise_border(
  cutoff,
  n = 10,
  random = FALSE,
  range = FALSE,
  ymax = NA,
  ymin = NA,
  xmax = NA,
  xmin = NA
)

Arguments

cutoff

sf object of the RD cut-off in the form of a line (not preferred, but also boundarypoints are possible)

n

the number of borderpoints to be created

random

whether they are randomly chosen (not desireable in most cases)

range

default = FALSE, if there is a specific range (N-S or E-W) for which the points are to be drawn (useful in order to exclude sparse borderpoints with little/no oberservations around because the non-parametric RD estimation will fail)

ymax

if range = TRUE: y coordinates

ymin

if range = TRUE: y coordinates

xmax

if range = TRUE: x coordinates

xmin

if range = TRUE: x coordinates

Value

an sf object with selected (and evenly spaced) borderpoints

Examples

borderpoints <- discretise_border(cutoff = cut_off, n = 10)