Image credit: xinhua

R Code to Replicate Two Tables in a Paper on Regression Discontinuity

In the online supplement of Huang and Zhan (2021), we provide two simulation tables to demonstrate that local composite quanitle regression can be used to estimate sharp kink regression discontinuity (RD) and sharp RD with covariates. Links to the R code to replicate these tables are provided in this post for the intereted reader to download.

The R code to replicate the simulation table for sharp kink RD can be downloaded here. Change line 8 to try five types of error distributions and line 11 for models with and without heteroskedasticity.

The R code to replicate the simulation table for sharp RD with covariates can be downloaded here. Run this code will reproduce the entire table. To use this code in your research with covariates, simply use the exported function cqrMMxcv and replace the variable z in line 133 with a vector or matrix of covariates.

Additional examples for sharp kink RD and sharp RD with covariates using the R package rdcqr can be found at the software’s github page https://github.com/xhuang20/rdcqr.