Learn R Programming

rdmulti (version 0.2)

rdmcplot: RD plots with multiple cutoffs.

Description

rdmc() RD plots with multiple cutoffs.

Usage

rdmcplot(Y, X, C, hvec = NULL, pvec = NULL, noscatter = FALSE,
  nodraw = FALSE)

Arguments

Y

outcome variable.

X

running variable.

C

cutoff variable.

hvec

bandwidths to be passed to rdrobust() to calculate cutoff-specific estimates. Should be a vector of length equal to the number of different cutoffs.

pvec

order of the polynomials to be passed to rdrobust() to calculate cutoff-specific estimates. Should be a vector of length equal to the number of different cutoffs.

noscatter

omits scatter plot.

nodraw

omits plot.

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

References

M.D. Cattaneo, R. Titiunik and G. Vazquez-Bare. (2018). Analysis of Regression Discontinuity Designs with Multiple Cutoffs or Multiple Scores. Working paper, University of Michigan.

Examples

Run this code
# NOT RUN {
# 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)


# }

Run the code above in your browser using DataLab