rdhte {rdhte} | R Documentation |
RD Heterogeneous Treatment Effects Estimation and Inference
Description
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.
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), Cattaneo and Titiunik (2022).
Usage
rdhte(
y,
x,
c = 0,
covs.hte = NULL,
covs.eff = NULL,
p = 1,
q = 2,
kernel = "tri",
weights = NULL,
h = NULL,
h.l = NULL,
h.r = NULL,
vce = "hc3",
cluster = NULL,
level = 95,
bwselect = NULL,
bw.joint = FALSE,
subset = NULL
)
Arguments
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 (default = 2). |
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 (hc0–hc3) (default = "hc3").
It is based on the |
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. |
Value
A list with selected RD HTE effects and model information.
Estimate |
vector of conventional local-polynomial RD estimates. |
Estimate.bc |
vector of bias-corrected local-polynomial RD estimates. |
se.rb |
vector containing robust bias corrected standard errors of the local-polynomial RD estimates. |
ci.rb |
matrix containing robust bias corrected confidence intervals. |
t.rb |
vector containing the t-statistics associated with robust local-polynomial RD estimates. |
pv.rb |
vector containing the p-values associated with robust local-polynomial RD estimates. |
coefs |
vector containing the coefficients for the jointly estimated p-th order local polynomial model. |
vcov |
estimated variance-covariance matrix. |
W.lev |
vector of group level identifiers. |
kernel |
kernel type used. |
vce |
variance estimator used. |
c |
cutoff value. |
h |
vector containing the bandwidths used. |
p |
order of the polynomial used for estimation of the regression function. |
q |
order of the polynomial used for inference on the regression function. |
N |
vector with the original number of observations for each group. |
Nh |
vector with the effective number of observations for each group. |
covs.cont |
internal value. |
level |
confidence level used. |
rdmodel |
rd model. |
Author(s)
Sebastian Calonico, University of California, Davis scalonico@ucdavis.edu.
Matias D. Cattaneo, Princeton University cattaneo@princeton.edu.
Max H. Farrell, University of California, Santa Barbara maxhfarrell@ucsb.edu.
Filippo Palomba, Princeton University fpalomba@princeton.edu.
Rocio Titiunik, Princeton University titiunik@princeton.edu.
References
Calonico, Cattaneo, Farrell, Palomba and Titiunik (2025): rdhte: Learning 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, Farrell, 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.
See Also
Examples
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)