Skip to content

Estimation and Inference for Boundary Discontinuity Designs

0packages depend
3.4Kdownloads / year
76.7%test coverage
13/13flavors OK

Overview

About

Provides pointwise and uniform estimation and inference methods for boundary discontinuity (BD) designs, a causal inference design that generalizes univariate regression discontinuity (RD) designs to settings with bivariate scores. Implements local polynomial methods for location-based and distance-based analyses, including sharp and fuzzy designs, data-driven bandwidth selection, pointwise confidence intervals, and uniform confidence bands. Methodology is developed in Cattaneo, Titiunik, and Yu (2026) doi:10.48550/arXiv.2505.05670 for location-based methods and Cattaneo, Titiunik, and Yu (2026) doi:10.48550/arXiv.2510.26051 for distance-based methods. For an overview and empirical guidance, see Cattaneo, Titiunik, and Yu (2026) doi:10.48550/arXiv.2511.06474. The companion software article is Cattaneo, Titiunik, and Yu (2025) doi:10.48550/arXiv.2505.07989.

Changes in 1.0.0
  • Adds fitmethod = c("joint", "separate") to rd2d(), rdbw2d(), rd2d.distance(), and rdbw2d.distance(). The new default fitmethod = "joint" preserves legacy point estimates while using joint variance corrections, including joint HC1 degrees-of-freedom factors and cluster-robust covariance calculations that account for clusters observed on both treatment sides. fitmethod = "separate" retains the previous side-specific variance calculation. Bandwidth selection keeps the existing plug-in bias estimator and now applies the same joint/separate convention to the selector's variance constants.
  • Adds covs.eff to rd2d(), rdbw2d(), rd2d.distance(), and rdbw2d.distance() for efficiency adjustment using pre-intervention covariates with a common covariate coefficient across treatment sides, including sharp, fuzzy, joint, separate, fixed-bandwidth, and automatic-bandwidth paths.
Show all changes in 1.0.0Hide the rest of the changes in 1.0.0
  • Adds covs.drop and covs.tol safeguards for rank-deficient covs.eff. Redundant covariate columns are dropped by default after residualizing on the local polynomial basis, with diagnostics stored in opt.
  • Adds S3 methods requested for the JSS resubmission: plot() for estimation and bandwidth-selection objects, plus coef(), vcov(), and confint() for rd2d() and rd2d.distance() estimation objects.
  • Improves exported R argument validation so invalid inputs raise informative errors directly rather than printing a message followed by an empty error.
  • Adds fuzzy boundary RD support for both location-based and distance-based methods, including fuzzy main effects, ITT, first-stage, and optional one-sided outputs.
  • Adds params.other and params.cov controls to rd2d() for optional companion tables and covariance storage.
  • Moves the Gaussian simulation count repp from rd2d() and rd2d.distance() to the summary methods that use it for uniform confidence bands and LBATE critical values.
  • Reports pointwise CI columns and optional uniform CB columns separately in summary.rd2d() and summary.rd2d.distance().
  • Speeds up location-based and distance-based fits by reducing repeated low-order basis, kernel, covariance projection, and masspoint-counting work.
  • Moves location-based uniform confidence band, WBATE, and LBATE construction to summary.rd2d().
  • Adds distance-based WBATE and LBATE construction to summary.rd2d.distance(), including fuzzy main, ITT, and first-stage outputs.
  • Updates location-based return tables to use lowercase column names such as estimate.p, std.err.q, t.value, and p.value.
  • Fixes location-based covariance construction for signed cross-evaluation covariance, clustered finite-sample scaling, and right-sided simulated critical values.
  • Fixes distance-based covariance construction to use signed local-polynomial residuals, corrected cluster covariance halves, and side-specific bandwidth plug-in matrices.
  • Adds CER-optimal bandwidth selectors cerrd, certwo, icerrd, and icertwo for location-based and distance-based methods.
  • Replaces the distance-based kink/rbc options with kink.unknown and kink.position, including adaptive known-kink bandwidths based on boundary point locations.
  • Uses smooth-boundary robust bias-corrected inference as the distance-based default, and uses the same stabilized Gram-matrix inversion helper as the location-based methods.
  • Uses q = p by default for distance-based unknown-kink specifications to avoid compounding the unknown-kink bandwidth shrinkage with an additional polynomial-order change.
  • Aligns distance-based return tables with location-based naming conventions, including main, main.0, main.1, bw, estimate.p, std.err.q, N.Co, and N.Tr.
  • Updates public notation to use fuzzy for treatment receipt/status, tau.itt/tau.itt.q for reduced-form outcome estimates, tau.fs/tau.fs.q for first-stage estimates, assignment for assignment, cluster for cluster identifiers, and distance for signed distance scores.
  • Removes user-facing derivative notation from distance-based help files and printed output.
  • Adds focused tests for location-based returns, lazy confidence bands, aggregate inference, covariance regularization, clustered covariance consistency, and numerical preservation.
  • Adds focused tests for distance-based return names, fuzzy outputs, heteroskedastic and clustered standard errors, covariance diagonals, aggregate inference, and polynomial-order validation.
  • Simplifies repository illustration files to R/rd2d_illustration.R and R/rd2d_plot.R.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.1 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 1.0.0
READMENoVignettesNoNEWSYes · 100% structured · mentions 1.0.0Citation fileNoWebsiteYes
Help pages
17includes a package overview page
Examples that run
100%4 run in a plain check
Exported functions with examples
100%
Documented parameters
90%
Return-value docs
100%
Help pages citing references
29%

Downloads

3.4K
CRAN downloads in the past year
Rank #9,943 · ~9/day · ~283/mo
Daily download trend is not available in this view yet.
43030 days
1K90 days
3.4K1 year
Compare downloads with other packages →
Also on95 r2u1 autocran

Repository

4Stars
0Forks
0Open issues
0Open PRs
2Releases
64Commits
2Commit identities
64 commits · Last activity 2026-10-24
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
0
Median days to close, 50 most recently updated closed PRs
0

PRs over time

2026-07-14 · 02026-07-25 · 0
PracticesBeta

7 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/rdpackages/rd2d on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux

Governance and community (3)
Issue templatesPR templateSecurity policy
Automation and maintenance (1)
Dependabot
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
3 external dependencies (excludes base and recommended)

Installing rd2d adds 18 packages (8 with compiled code, 14 MB of source tarballs). Heaviest: ggplot2 6.0 MB, isoband 1.5 MB, farver 1.2 MB.

Depends (0)
none
Imports (3)
LinkingTo (0)
none
Suggests (1)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (3)
Author, Maintainer since 0.1.0 (2026)

Previously maintained by Ruiqi Rae Yu (0.0.1 to 0.0.3).

Releases (6)

Pick two releases to compare their code metrics.

  • 1.0.0Latest
    record
    2026-05-28 · current release · diff ↗
  • 0.2.0
    record
    2026-05-23 · diff ↗
  • 0.1.0
    record
    2026-05-14 · diff ↗ ·
    removed 2 exports
    rd2d.dist, rdbw2d.dist
    added 2 exports
    rd2d.distance, rdbw2d.distance
  • R
    R 4.6.0 released · 2026-04-24
  • 0.0.3
    record
    2025-10-24 · diff ↗
  • 0.0.2
    record
    2025-06-10 · diff ↗
  • 0.0.1
    record
    2025-05-14
  • R
    R 4.5.0 released · 2025-04-11

Package metadata

First published
2025-05-14
Total releases
6 / 1 yrs
License
GPL-3 OSI
Download size
102 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("rd2d")
Cattaneo, M. D., Titiunik, R., & Yu, R. R. (2026). rd2d: Estimation and Inference for Boundary Discontinuity Designs (Version 1.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.rd2d

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for rd2d version 1.0.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy