Local Randomization Methods for RD Designs
Description
The rdlocrand package provides tools to analyze RD designs under local randomization:
rdrandinfto perform hypothesis testing using randomization inference.rdwinselectto select a window around the cutoff in which randomization is likely to hold.rdsensitivityto assess the sensitivity of the results to different window lengths and null hypotheses.rdrboundsto construct Rosenbaum bounds for sensitivity to unobserved confounders.
For more details, and related R, Python, and Stata packages useful for the analysis of RD designs, visit https://rdpackages.github.io/.
Source code is available at https://github.com/rdpackages/rdlocrand.
Authors
Matias D. Cattaneo, Princeton University. Email: matias.d.cattaneo@gmail.com
Ricardo Masini, UC Davis. Email: ricardo.masini@gmail.com
Rocio Titiunik, Princeton University. Email: rocio.titiunik@gmail.com
Gonzalo Vazquez-Bare, UC Santa Barbara. Email: gvazquezbare@gmail.com
Installation
To install or update from PyPI:
pip install rdlocrand
Usage
from rdlocrand import rdrandinf, rdwinselect, rdsensitivity, rdrbounds
out = rdrandinf(Y, R, wl=-0.75, wr=0.75, quietly=True)
print(out["p.value"])
Package functions return dictionaries whose keys match the names documented in
the function docstrings, such as p.value, obs.stat, results, and
p.values.
References
For overviews and introductions, see rdpackages website.
-
Cattaneo, M.D., B. Frandsen, and R. Titiunik. (2015). Randomization Inference in the Regression Discontinuity Design: An Application to Party Advantages in the U.S. Senate. Journal of Causal Inference 3(1): 1-24.
-
Cattaneo, M.D., R. Titiunik, and G. Vazquez-Bare. (2016). Inference in Regression Discontinuity Designs under Local Randomization. Stata Journal 16(2): 331-367.
-
Cattaneo, M.D., R. Titiunik, and G. Vazquez-Bare. (2017). Comparing Inference Approaches for RD Designs: A Reexamination of the Effect of Head Start on Child Mortality. Journal of Policy Analysis and Management 36(3): 643-681.
Metadata
Release files for rdlocrand 3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rdlocrand-3.0.tar.gz | 31.5 kB | With provenance | Details for rdlocrand-3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rdlocrand-3.0-py3-none-any.whl | Python 3 | none | any | Details for rdlocrand-3.0-py3-none-any.whl |
Total release size: 63.5 kB
Release files / rdlocrand-3.0.tar.gz
| Download URL | rdlocrand-3.0.tar.gz |
|---|---|
| Size | 31.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8532a62f6c3be72b5c828f4ce97826a18bdb491bb164616c48d3f7e9fcc8575a
|
|
BLAKE2b-256 checksum How to use checksums |
6878715baa345534d8f54cf675d0d79165344a59b53598b9117350090455675b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logRelease files / rdlocrand-3.0-py3-none-any.whl
| Download URL | rdlocrand-3.0-py3-none-any.whl |
|---|---|
| Size | 32.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2056d257ff70124cf3b149b29cc6b961d1cee0feda64b8efdc63c0a180350f7
|
|
BLAKE2b-256 checksum How to use checksums |
16a61bf402e1c4ffecf64690748ca8e1a307633403ee0308886fc2b8e6461ea6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logSecurity for rdlocrand 3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for rdlocrand-3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.