Skip to main content

Local Randomization Methods for RD Designs

Description

The rdlocrand package provides tools to analyze RD designs under local randomization:

  • rdrandinf to perform hypothesis testing using randomization inference.
  • rdwinselect to select a window around the cutoff in which randomization is likely to hold.
  • rdsensitivity to assess the sensitivity of the results to different window lengths and null hypotheses.
  • rdrbounds to 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.



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)

Source distribution for rdlocrand 3.0
File Size Uploaded
rdlocrand-3.0.tar.gz 31.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rdlocrand 3.0
File Interpreter ABI Platform
rdlocrand-3.0-py3-none-any.whl Python 3 none any Details

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 log

Release 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 log

Release history Release notifications | RSS feed

This release

3.0 This release

2 release files

2.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page