Skip to contents

Binned scatter + global-polynomial data for an RD plot

Usage

morie_rdd_plot_data(
  data,
  outcome,
  running,
  cutoff = 0,
  n_bins = 20,
  p_global = 4,
  p_local = 1,
  bandwidth = NULL,
  kernel = "triangular"
)

Arguments

data

A data.frame holding the outcome, running variable, treatment, and any covariates referenced by name.

outcome

Character; column name of the response variable in data.

running

Character; column name of the running (forcing) variable in data.

cutoff

Numeric scalar; the threshold on running. Default 0 (the canonical normalisation).

n_bins

Integer; bin count for histogram-based density tests and binned-plot reductions.

p_global

Integer; polynomial order for the global component of morie_rdd_plot_data.

p_local

Integer; polynomial order for the local component of morie_rdd_plot_data.

bandwidth

Numeric; the local-polynomial bandwidth on each side of the cutoff. NULL invokes the data-driven CCT selector.

kernel

One of "triangular" (default), "epanechnikov", "uniform", or "gaussian".