Skip to contents

McCrary (2008) density manipulation test

Usage

morie_rdd_mccrary(x, cutoff = 0, n_bins = 50, bandwidth = NULL)

Arguments

x

Numeric vector of running-variable values (used by bandwidth selectors + density tests that don't take a data.frame).

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.

bandwidth

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

Value

A named list (see Details).

Examples

set.seed(35)
x <- runif(2000, -1, 1)
out <- morie_rdd_mccrary(x, cutoff = 0)
out$p_value
#> [1] 0.2875372