rddtools v0.4.0


Monthly downloads



Toolbox for Regression Discontinuity Design ('RDD')

Set of functions for Regression Discontinuity Design ('RDD'), for data visualisation, estimation and testing.



Travis-CI Build Status Coverage Status

rddtools is a new R package under development, designed to offer a set of tools to run all the steps required for a Regression Discontinuity Design (RDD) Analysis, from primary data visualisation to discontinuity estimation, sensitivity and placebo testing.

Installing rddtools

This github website hosts the source code. One of the easiest ways to install the package from github is by using the R package devtools:

if (!require('devtools')) install.packages('devtools')
devtools::install_github( "bquast/rddtools" )

Note however the latest version of rddtools only works with R 3.0, and that you might need to install Rtools if on Windows.


The (preliminary) documentation is available in the help files directly, as well as in the vignettes. The vignettes can be accessed from R.


rddtools: main features

  • Simple visualisation of the data using binned-plot: plot()

  • Bandwidth selection:

  • Estimation:
    • RDD parametric estimation: rdd_reg_lm() This includes specifying the polynomial order, including covariates with various specifications as advocated in Imbens and Lemieux 2008.
    • RDD local non-parametric estimation: rdd_reg_np(). Can also include covariates, and allows different types of inference (fully non-parametric, or parametric approximation).
    • RDD generalised estimation: allows to use custom estimating functions to get the RDD coefficient. Could allow for example a probit RDD, or quantile regression.
  • Post-Estimation tools:
    • Various tools, to obtain predictions at given covariate values ( rdd_pred() ), or to convert to other classes, to lm ( as.lm() ), or to the package np ( as.npreg() ).
    • Function to do inference with clustered data: clusterInf() either using a cluster covariance matrix ( vcovCluster() ) or by a degrees of freedom correction (as in Cameron et al. 2008).
  • Regression sensitivity analysis:
    • Plot the sensitivity of the coefficient with respect to the bandwith: plotSensi()
    • Placebo plot using different cutpoints: plotPlacebo()
  • Design sensitivity analysis:
    • McCrary test of manipulation of the forcing variable: wrapper dens_test() to the function DCdensity() from package rdd.
    • Test of equal means of covariates: covarTest_mean()
    • Test of equal density of covariates: covarTest_dens()
  • Datasets


Functions in rddtools

Name Description
clusterInf Post-inference for clustered data
covarTest_dis Testing for balanced covariates: equality of distribution
rdd_bw_rsw Global bandwidth selector of Ruppert, Sheather and Wand (1995) from package KernSmooth
rdd_gen_reg General polynomial estimator of the regression discontinuity
dens_test Run the McCracy test for manipulation of the forcing variable
indh INDH data set
plot.rdd_data Plot rdd_data
plotPlacebo Draw a (density) plot of placebo tests
covarTest_mean Testing for balanced covariates: equality of means with t-test
rdd_coef RDD coefficient
rdd_reg_lm Parametric polynomial estimator of the regression discontinuity
house Dataset used in Lee (2008)
waldci Confint allowing vcov
as.lm Convert a rdd object to lm
vcovCluster Cluster Heteroskedasticity-consistent estimation of the covariance matrix.
rdd_bw_ik Imbens-Kalyanaraman Optimal Bandwidth Calculation
plotSensi Plot the sensitivity to the bandwidth
rdd_reg_np Parametric polynomial estimator of the regression discontinuity
rdd_data Construct rdd_data
rdd_pred RDD coefficient prediction
STAR_MHE Transformation of the STAR dataset as used in Angrist and Pischke (2008)
plotBin Bin plotting
rot_bw Bandwidth selector
rddtools Regression Discontinuity Design
as.npregbw Convert an rdd_reg object to a npreg object
gen_mc_ik Generate Monte Carlo simulations of Imbens and Kalyanaraman
No Results!

Vignettes of rddtools

No Results!

Last month downloads


License GPL (>= 2)
URL https://github.com/bquast/RDDtools
BugReports https://github.com/bquast/RDDtools/issues
VignetteBuilder knitr
NeedsCompilation no
Packaged 2015-07-27 11:01:48 UTC; quast2
Repository CRAN
Date/Publication 2015-07-27 13:32:08

Include our badge in your README