The rddensity package provides Stata and R implementations of manipulation tests employing local polynomial density estimation methods. This method is useful for falsification of Regression Discontinuity Designs, as well as for testing for self-selection or sorting in other contexts. This implementation provides hypothesis tests and bandwidth selectors for manipulation testing.

This work was supported in part by the National Science Foundation through grants SES-1357561, SES-1459931, SES-1459967, SES-1947662, SES-1947805, and SES-2019432.

Major Upgrades

This package was first released in Spring 2017, and had one major upgrade in Summer 2020.

Stata Implementation

To install/update in Stata type:

net install rddensity, from(https://raw.githubusercontent.com/rdpackages/rddensity/master/stata) replace

Plotting employs lpdensity, to install/update in Stata type:

net install lpdensity, from(https://raw.githubusercontent.com/nppackages/lpdensity/master/stata) replace

R Implementation

To install/update in R type:


Plotting employs lpdensity, to install/update in R type:



For source code and related files, visit rddensity repository.


For overviews and introductions, see rdpackages website.

Software and Implementation

Technical and Methodological