Welcome to the GitHub page of Regression Discontinuity Tree. This page provides the codes for this method proposed by Reguly (2025): Discovering Heterogeneous Treatment Effects in Regression Discontinuity Designs.
This repository contains codes and a description of how to estimate heterogeneous treatment effects in RDD. Codes are built under MatLab, version 2024a.
- Add the downloaded/forked/cloned algorithm folder to your path in MatLab.
- Open tryout.m, which gives a toy example of how to use the package.
- The main function is
runTree_uni()function. - However, you need to carefully specify your
sampleobject as well asoptCARTobject. The comments should guide you on how to set them.
tostring()function will draw you the resulting tree.
Note: This is the second version, containing nonparametric estimator.
- algorithm folder contains necessary functions to run regression discontinuity tree. One needs to add this folder to the path when using any other script.
- simulations folder contain codes to replicate simulation results reported in Section 4. sharp folder contains
runRDD_sharp.mfile which runs the monte carlo simulations. Caution -- it takes considerable amount of time and uses multiple cores. (1day+ with Apple M1 Max chip with 64GB memory and 9 cores) Note if one does not run with 50,000 observations or reduces the MC iteration number it reduces the time significantly. After running the simulations, one can evaluate the results withevaluate_results/createTables.m. - empirical_application folder contains codes to replicate Section 5. It also contains a further readme file to navigate through the replication.
All feedbacks are welcomed! Please write to: agoston.reguly@uni-corvinus.hu
A python implementation of the parametric version of the paper is done by Firat Yaman. Check here.