| Title: | Estimation of Causal Effects in Regression Discontinuity Designs Under Interference |
|---|---|
| Description: | Implements the distance-based local polynomial estimators proposed by Dal Torrione, Arduini, and Forastiere (2024) <doi:10.48550/arXiv.2410.02727> for sharp regression discontinuity designs when outcomes may depend on the treatment assignments of connected units. The package constructs effective-treatment boundaries, estimates direct and indirect effects, and provides network-robust inference. |
| Authors: | Elena Dal Torrione [aut, cre], Tiziano Arduini [aut], Laura Forastiere [aut] (ORCID: <https://orcid.org/0000-0003-3721-9826>) |
| Maintainer: | Elena Dal Torrione <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-12-04 20:04:58 UTC |
| Source: | https://github.com/cran/rddinterf |
Builds boundary objects describing the separating set between two effective treatment regions under a specified exposure mapping.
get_boundary(neighbors, contrast, exposure)get_boundary(neighbors, contrast, exposure)
neighbors |
List of neighbor indices for each observation. |
contrast |
A length-2 list describing the two effective treatments to compare. |
exposure |
Character string specifying the exposure mapping. Supported
values currently include |
An object of class "rdd_boundary". Each element corresponds to a
distinct neighborhood size and contains the information needed to describe
the effective treatment boundary.
neighbors <- list(c(2, 3), c(1, 3), c(1, 2)) contrast <- list(c(1, 1), c(0, 0)) get_boundary(neighbors, contrast, exposure = "one.treated")neighbors <- list(c(2, 3), c(1, 3), c(1, 2)) contrast <- list(c(1, 1), c(0, 0)) get_boundary(neighbors, contrast, exposure = "one.treated")
Displays a human-readable representation of a boundary object, listing each interference set along with its size and description.
## S3 method for class 'rdd_boundary' print(x, ...)## S3 method for class 'rdd_boundary' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored). |
Boundary objects are typically created using get_boundary.
The input object, invisibly.
Displays the estimation method and design settings followed by a compact table of effect estimates. The full boundary objects, distance variables, bandwidths, and estimation samples remain available in the fitted object.
## S3 method for class 'rddinterf' print(x, digits = 3, ...)## S3 method for class 'rddinterf' print(x, digits = 3, ...)
x |
An object of class |
digits |
Number of digits shown for estimates, standard errors, and confidence intervals. |
... |
Additional arguments (ignored). |
The input object, invisibly.
Estimates overall direct effects, overall indirect effects, and specific interference effects in regression discontinuity designs with interference using distance-based local polynomial estimators and network-robust variance estimators.
rddinterf( Yi, Xi, neighbors, W, contrasts, exposure, boundary = NULL, cutoff = 0, subset = NULL, estimator = c("conventional", "robust"), p = 1, q = p + 1, h = NULL, b = NULL, overall_direct = TRUE, overall_indirect = TRUE )rddinterf( Yi, Xi, neighbors, W, contrasts, exposure, boundary = NULL, cutoff = 0, subset = NULL, estimator = c("conventional", "robust"), p = 1, q = p + 1, h = NULL, b = NULL, overall_direct = TRUE, overall_indirect = TRUE )
Yi |
Numeric vector of observed outcomes. |
Xi |
Numeric vector of individual running variables. |
neighbors |
List whose |
W |
Binary dependency graph, with rows and columns ordered like |
contrasts |
Named list of effective treatment contrasts to estimate. Each element should define a treated and control effective treatment. |
exposure |
Character string specifying the exposure mapping. Supported
values currently include |
boundary |
Optional named list of boundary objects returned by
|
cutoff |
Numeric cutoff defining treatment assignment. Default is |
subset |
Optional logical vector indicating the subset of observations to use. |
estimator |
Character string specifying the estimator. Must be one of
|
p |
Integer specifying the order of the local polynomial estimator. |
q |
Integer specifying the order of the local polynomial estimator used for bias correction. |
h |
Optional manual bandwidth for estimation. Can be a scalar, named vector, or named list. |
b |
Optional manual bandwidth for bias correction. Can be a scalar, named vector, or named list. |
overall_direct |
Logical; if |
overall_indirect |
Logical; if |
The function supports two estimators:
"conventional"Local polynomial estimator without bias correction.
"robust"Bias-corrected local polynomial estimator with robust inference.
The own treatment indicator is computed internally from Xi and cutoff.
The neighbors' running-variable lists and neighborhood treatments are also
computed internally from Xi, neighbors, and exposure.
If a contrast pools active neighborhood strata with different boundary codimensions, the function issues a warning. In that setting, the pooled estimator converges to an effect over the minimum-codimension strata. Effects for every stratum should instead be estimated separately and aggregated with the appropriate density weights.
An object of class "rddinterf" with components:
estimatesNamed list of estimation results.
boundaryList of boundary objects used for estimation.
exposureExposure mapping used.
estimatorEstimation method used.
cutoffCutoff used to define treatment.
pOrder of the main local polynomial fit.
qOrder of the bias-correction fit.
callMatched function call.
Each element of estimates is either NA or a list containing:
estPoint estimate.
seEstimated standard error.
ci95% confidence interval.
mean_leftEstimated conditional mean at the boundary from the left.
mean_rightEstimated conditional mean at the boundary from the right.
boundaryBoundary object or boundary description.
dstarSigned running variable used for estimation.
YiOutcome vector in the estimation sample.
N_rEffective sample size to the right of the cutoff.
N_lEffective sample size to the left of the cutoff.
hBandwidth used for estimation.
bBandwidth used for bias correction.
trLogical indicator for the estimation sample.
pOrder of the main local polynomial fit.
qOrder of the bias-correction fit.
set.seed(123) n <- 80 Xi <- runif(n, -1, 1) neighbors <- lapply(seq_len(n), function(i) { c(if (i == 1) n else i - 1L, if (i == n) 1L else i + 1L) }) W <- diag(n) for (i in seq_len(n)) W[i, neighbors[[i]]] <- 1 W <- (W + t(W) > 0) * 1 Di <- as.integer(Xi >= 0) Gi <- as.numeric(vapply(neighbors, function(j) any(Di[j] == 1), logical(1))) Yi <- 1 + Di + 0.3 * Gi + 0.5 * Xi + rnorm(n, sd = 0.2) contrasts <- list( direct = list(c(1, 0), c(0, 0)), spillover = list(c(0, 1), c(0, 0)) ) fit <- rddinterf( Yi, Xi, neighbors, W, contrasts, exposure = "one.treated", estimator = "conventional", h = 0.8, b = 1 ) fitset.seed(123) n <- 80 Xi <- runif(n, -1, 1) neighbors <- lapply(seq_len(n), function(i) { c(if (i == 1) n else i - 1L, if (i == n) 1L else i + 1L) }) W <- diag(n) for (i in seq_len(n)) W[i, neighbors[[i]]] <- 1 W <- (W + t(W) > 0) * 1 Di <- as.integer(Xi >= 0) Gi <- as.numeric(vapply(neighbors, function(j) any(Di[j] == 1), logical(1))) Yi <- 1 + Di + 0.3 * Gi + 0.5 * Xi + rnorm(n, sd = 0.2) contrasts <- list( direct = list(c(1, 0), c(0, 0)), spillover = list(c(0, 1), c(0, 0)) ) fit <- rddinterf( Yi, Xi, neighbors, W, contrasts, exposure = "one.treated", estimator = "conventional", h = 0.8, b = 1 ) fit
Produces a compact summary table for objects returned by rddinterf.
## S3 method for class 'rddinterf' summary(object, ...)## S3 method for class 'rddinterf' summary(object, ...)
object |
An object of class |
... |
Additional arguments (ignored). |
A numeric matrix with columns:
EstimatePoint estimate.
S.E.Estimated standard error.
CI.lLower endpoint of the 95% confidence interval.
CI.uUpper endpoint of the 95% confidence interval.
p.valueTwo-sided p-value based on a normal approximation.
N.lEffective sample size to the left of the cutoff.
N.rEffective sample size to the right of the cutoff.