⚠️ Beta Release Notice: This package (v0.1.0) is currently in beta. While feature-complete, it may contain bugs and is recommended for testing and evaluation purposes. Please report any issues on GitHub.
rdpartial
implements the partial identification approach for regression discontinuity designs with possible manipulation of the running variable. It provides functions for estimating bounds under both sharp and fuzzy designs, utilities for density estimation of the running variable, a simulation generator and a parametric bootstrap helper.
Installation
The package is not on CRAN. You can install the development version from a GitHub repository with devtools
or remotes
:
# install.packages("devtools")
devtools::install_github("rajkumarkarthik/rdpartial")
Main functions
-
simulate_rdd_data()
– generate synthetic RDD examples with optional manipulation. -
bounds_sharp()
/bounds_fuzzy()
– compute Manski-style bounds for sharp or fuzzy designs given estimated non-manipulated counts. -
bootstrap_bounds()
– parametric bootstrap for confidence intervals around the bounds.
The helper .density_estimation()
(not exported) estimates the number of non-manipulated observations in a manipulation region.
Minimal example
library(rdpartial)
# Simulate a sharp design with manipulation
set.seed(42)
sim <- simulate_rdd_data(n = 2000, cutoff = 16, design = "sharp",
manip_width = 0.4, manip_prob = 0.25)
# Assume 90% of post-cutoff mass is genuine
post <- sim$x[sim$x >= 16]
n_bins <- max(post) - 16 + 1
true_counts <- data.frame(
x = 16:max(post),
n_true = round(tabulate(post - 16 + 1, nbins = n_bins) * 0.9)
)
# Compute lower and upper bounds at the cutoff
bounds_sharp(sim$x, sim$y, cutoff = 16, true_counts = true_counts)
Citation
If you use this package in your research, please cite:
Rosenman, E., Rajkumar, K., Gauriot, R., & Slonim, R. (2025). Donor’s Deferral and Return Behavior: Partial Identification from a Regression Discontinuity Design with Manipulation. arXiv preprint arXiv:1910.02170.
BibTeX:
@misc{rosenman2025donorsdeferralreturnbehavior,
title={Donor's Deferral and Return Behavior: Partial Identification from a Regression Discontinuity Design with Manipulation},
author={Evan Rosenman and Karthik Rajkumar and Romain Gauriot and Robert Slonim},
year={2025},
eprint={1910.02170},
archivePrefix={arXiv},
primaryClass={stat.ME},
url={https://arxiv.org/abs/1910.02170}
}