| rdhte | R Documentation |
rdhte provides estimation and inference for heterogeneous
treatment effects in RD designs using local polynomial regressions,
allowing for interactions with pretreatment covariates
(Calonico, Cattaneo, Farrell, Palomba and Titiunik, 2025a).
Inference is implemented using robust bias-correction methods
(Calonico, Cattaneo, and Titiunik, 2014)
Companion commands: rdbwhte for data-driven bandwidth selection
and rdhte_lincom for testing linear restrictions of parameters.
A detailed introduction to the software is given in Calonico, Cattaneo, Farrell, Palomba and Titiunik (2025b).
Related software packages for analysis and interpretation of RD designs and related methods are available in: https://rdpackages.github.io/.
For background methodology, see Calonico, Cattaneo, Farrell, and Titiunik (2019), Calonico, Cattaneo and Farrell (2020), and Cattaneo and Titiunik (2022).
rdhte(
y,
x,
c = 0,
covs.hte = NULL,
covs.eff = NULL,
p = 1,
q = NULL,
kernel = "tri",
weights = NULL,
h = NULL,
h.l = NULL,
h.r = NULL,
vce = "hc3",
cluster = NULL,
level = 95,
bwselect = "mserd",
bw.joint = FALSE,
subset = NULL,
data = NULL,
target.contrast = NULL
)
y |
Outcome variable. |
x |
Running variable. |
c |
RD cutoff in |
covs.hte |
covariates for heterogeneous treatment effects. Factor variables can be used to distinguish between continuous and categorical variables, select reference categories, specify interactions between variables, and include polynomials of continuous variables. If not specified, the RD Average Treatment Effect is computed. |
covs.eff |
additional covariates to be used for efficiency improvements. |
p |
order of the local polynomial used to construct the point estimator (default = 1). |
q |
order of the local polynomial used to construct the bias correction.
If |
kernel |
kernel function used to construct the RD estimators. Options are |
weights |
variable used for optional weighting of the estimation procedure. The unit-specific weights multiply the kernel function. |
h |
main bandwidth used to construct the RD estimator. If not specified, bandwidth |
h.l |
same as |
h.r |
same as |
vce |
character string specifying the variance-covariance matrix
estimator type. Without |
cluster |
variable indicating the clustering of observations. |
level |
confidence level for confidence intervals; default is |
bwselect |
bandwidth selection procedure to be used.
Options are:
|
bw.joint |
logical. If |
subset |
optional vector specifying a subset of observations to be used. |
data |
optional data frame. When supplied, |
target.contrast |
(experimental, in-flight) optional contrast vector or
matrix used to refit the bandwidth to be MSE-optimal for a particular
contrast of the CATE vector. |
A list with the following named elements:
Estimate |
Vector of conventional local-polynomial RD estimates, one per group level (or per slope-coefficient for continuous |
Estimate.bc |
Vector of bias-corrected estimates. Also available as |
se.rb |
Vector of robust bias-corrected standard errors. |
ci.rb |
Matrix ( |
t.rb |
Vector of asymptotic z-statistics (named |
pv.rb |
Vector of two-sided p-values from the standard normal. |
vcov |
Group-level variance-covariance matrix of |
coef.full |
Full coefficient vector from the underlying joint local-polynomial regression (used by |
vcov.full |
Full variance-covariance matrix of |
W.lev |
Group-level identifiers (or coefficient names for continuous |
W.names |
Display labels for the rows of |
kernel |
Kernel type used (e.g. |
bwselect |
Bandwidth selection procedure used. |
vce |
Variance estimator display label (e.g. |
vce_select |
Canonical lowercase variance-estimator name
(e.g. |
c |
Cutoff value. |
h |
An |
p |
Order of the polynomial used for estimation. |
q |
Order of the polynomial used for bias correction. |
N |
Length-2 vector |
Nh |
An |
covs.cont |
Logical; |
level |
Confidence level used. |
rdmodel |
Human-readable model description string. |
Sebastian Calonico, University of California, Davis scalonico@ucdavis.edu.
Matias D. Cattaneo, Princeton University matias.d.cattaneo@gmail.com.
Max H. Farrell, University of California, Santa Barbara mhfarrell@gmail.com.
Filippo Palomba, Princeton University filippo.palomba19@gmail.com.
Rocio Titiunik, Princeton University rocio.titiunik@gmail.com.
Calonico, Cattaneo, Farrell, Palomba and Titiunik (2025): rdhte: Conditional Average Treatment Effects in RD Designs. Working paper.
Calonico, Cattaneo, Farrell, Palomba and Titiunik (2025): Treatment Effect Heterogeneity in Regression Discontinuity Designs. Working paper.
Cattaneo and Titiunik. 2022. Regression Discontinuity Designs. Annual Review of Economics, 14: 821-851.
Calonico, Cattaneo, and Farrell. 2020. Optimal Bandwidth Choice for Robust Bias Corrected Inference in Regression Discontinuity Designs. Econometrics Journal, 23(2): 192-210.
Calonico, Cattaneo, Farrell, and Titiunik. 2019. Regression Discontinuity Designs using Covariates. Review of Economics and Statistics, 101(3): 442-451.
Calonico, Cattaneo, and Titiunik. 2014a. Robust Nonparametric Confidence Intervals for Regression-Discontinuity Designs. Econometrica 82(6): 2295-2326.
Granzier, Pons, and Tricaud. 2023. Coordination and Bandwagon Effects: How Past Rankings Shape the Behavior of Voters and Candidates. American Economic Journal: Applied Economics, 15(4): 177-217.
rdbwhte, rdhte_lincom
set.seed(123)
n <- 1000
X <- runif(n, -1, 1)
W <- rbinom(n, 1, 0.5)
Y <- 3 + 2*X + 1.5*X^2 + 0.5*X^3 + sin(2*X) + 3*W*(X>=0) + rnorm(n)
m1 = rdhte(y = Y, x = X, covs.hte = factor(W))
summary(m1)
## Not run:
# Empirical examples using the bundled Granzier, Pons, and Tricaud data.
data(rdhte_dataset)
with(rdhte_dataset, {
rd_left <- rdhte(y = y, x = x, covs.hte = factor(w_left),
cluster = cluster_var)
summary(rd_left)
rdhte_lincom(rd_left,
linfct = "`factor(w_left)1` - `factor(w_left)0` = 0")
summary(rdhte(y = y, x = x, covs.hte = factor(w_left),
cluster = cluster_var, bw.joint = TRUE))
summary(rdhte(y = y, x = x, covs.hte = factor(w_left):factor(w_strong),
cluster = cluster_var))
summary(rdhte(y = y, x = x, covs.hte = w_strength,
kernel = "uni", cluster = cluster_var))
})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.