rdmcplot: Data-driven RD plots for multi-cutoff designs

View source: R/rdmcplot.R

rdmcplotR Documentation

Data-driven RD plots for multi-cutoff designs

Description

rdmcplot() implements data-driven Regression Discontinuity (RD) plots for designs with multiple cutoffs.

Usage

rdmcplot(
  Y,
  X,
  C,
  nbinsmat = NULL,
  binselectvec = NULL,
  scalevec = NULL,
  supportmat = NULL,
  pvec = NULL,
  hmat = NULL,
  kernelvec = NULL,
  weightsvec = NULL,
  covs_mat = NULL,
  covs_list = NULL,
  covs_evalvec = NULL,
  covs_dropvec = NULL,
  ginv.tolvec = NULL,
  masspointsvec = NULL,
  ci = NULL,
  shade = FALSE,
  col_bins = NULL,
  pch_bins = NULL,
  col_poly = NULL,
  lty_poly = NULL,
  col_xline = NULL,
  lty_xline = NULL,
  nobins = FALSE,
  nopoly = FALSE,
  noxline = FALSE,
  nodraw = FALSE,
  subset = NULL,
  data = NULL
)

Arguments

Y

outcome variable.

X

running variable.

C

cutoff variable.

nbinsmat

matrix of cutoff-specific number of bins. See rdplot() for details.

binselectvec

vector of cutoff-specific bins selection method. See rdplot() for details.

scalevec

vector of cutoff-specific scale factors. See rdplot() for details.

supportmat

matrix of cutoff-specific support conditions. See rdplot() for details..

pvec

vector of cutoff-specific polynomial orders. See rdplot() for details.

hmat

matrix of cutoff-specific bandwidths. See rdplot() for details.

kernelvec

vector of cutoff-specific kernels. See rdplot() for details.

weightsvec

vector of cutoff-specific weights. See rdplot() for details.

covs_mat

matrix of covariates. See rdplot() for details.

covs_list

list of of covariates to be used in each cutoff.

covs_evalvec

vector indicating the evaluation point for additional covariates. See rdrobust() for details.

covs_dropvec

vector indicating whether collinear covariates should be dropped at each cutoff. See rdrobust() for details.

ginv.tolvec

vector of cutoff-specific tolerances for generalized inverse calculations. See rdplot() for details.

masspointsvec

vector indicating how to handle repeated values at each cutoff. See rdplot() for details.

ci

adds confidence intervals of the specified level to the plot. See rdrobust() for details.

shade

passes the shaded confidence interval option to rdplot().

col_bins

vector of colors for bins.

pch_bins

vector of characters (pch) type for bins.

col_poly

vector of colors for polynomial curves.

lty_poly

vector of lty for polynomial curves.

col_xline

vector of colors for vertical lines.

lty_xline

vector of lty for vertical lines.

nobins

omits bins plot.

nopoly

omits polynomial curve plot.

noxline

omits vertical lines indicating the cutoffs.

nodraw

omits plot.

subset

optional subset of observations to use.

data

optional data frame for resolving string variable names.

Value

clist

list of cutoffs

cnum

number of cutoffs

X0

matrix of X values for control units

X1

matrix of X values for treated units

Yhat0

estimated polynomial for control units

Yhat1

estimated polynomial for treated units

Xmean

bin average of X values

Ymean

bin average for Y values

CI_l

lower end of confidence intervals

CI_r

upper end of confidence intervals

cfail

Cutoffs where rdrobust() encountered problems

Author(s)

Matias D. Cattaneo, Princeton University. matias.d.cattaneo@gmail.com

Rocio Titiunik, Princeton University. rocio.titiunik@gmail.com

Gonzalo Vazquez-Bare, UC Santa Barbara. gvazquezbare@gmail.com

References

Cattaneo, M.D., R. Titiunik and G. Vazquez-Bare. (2020). Analysis of Regression Discontinuity Designs with Multiple Cutoffs or Multiple Scores. Stata Journal, forthcoming.

Examples

# Toy dataset
X <- runif(1000,0,100)
C <- c(rep(33,500),rep(66,500))
Y <- (1 + X + (X>=C))*(C==33)+(.5 + .5*X + .8*(X>=C))*(C==66) + rnorm(1000)
# rdmcplot with standard syntax
tmp <- rdmcplot(Y,X,C)



rdmulti documentation built on May 18, 2026, 1:07 a.m.