Skip to contents

Thin extender over rdlocrand::rdrandinf for finite-sample randomisation-inference around the cutoff window (Cattaneo, Frandsen & Titiunik, 2015; Cattaneo, Titiunik & Vazquez-Bare, 2016).

Usage

morie_rdd_local_randinf(Y, R, wl, wr, ...)

Arguments

Y

Numeric outcome vector.

R

Numeric running / forcing variable.

wl

Numeric scalar; left edge of the randomisation window.

wr

Numeric scalar; right edge of the randomisation window.

...

Further arguments forwarded to rdlocrand::rdrandinf (e.g. statistic, p, nulltau, reps, seed).

Value

A list with $method = "rdlocrand::rdrandinf" and $raw (an rdrandinf object with the randomisation-inference p-values and the observed statistic).

Examples

if (FALSE) { # \dontrun{
  if (requireNamespace("rdlocrand", quietly = TRUE)) {
    set.seed(1)
    R <- runif(200, -1, 1)
    Y <- 0.5 * R + (R >= 0) * 0.3 + rnorm(200, sd = 0.5)
    morie_rdd_local_randinf(Y, R, wl = -0.1, wr = 0.1)
  }
} # }