rdbwhte {rdhte} | R Documentation |
Data-Driven Optimal Bandwidth Selection for RD Heterogeneous Treatment Effects Estimation
Description
rdbwhte
computes MSE- and CER-optimal bandwidths for estimating
RD heterogeneous treatment effects based on covariates.
Companion commands: rdhte
for RD HTE estimation and inference,
and rdhte_lincom
for testing linear restrictions of parameters.
Related Stata and R packages useful for inference in RD designs are described in the website: https://rdpackages.github.io/.
Usage
rdbwhte(
y,
x,
c = 0,
covs.hte = NULL,
covs.eff = NULL,
p = 1,
q = 2,
kernel = "tri",
vce = "hc3",
cluster = NULL,
bwselect = "mserd",
bw.joint = FALSE
)
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. |
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 |
vce |
character string specifying the variance-covariance matrix estimator type (hc0–hc3) (default = "hc3"). |
cluster |
variable indicating the clustering of observations. |
bwselect |
bandwidth selection procedure to be used.
Options are:
|
bw.joint |
logical. If |
Value
A list with selected bandwidths and model information.
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. |
q |
order of the polynomial used for inference. |
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. |
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
See Also
Examples
set.seed(123)
n <- 5000
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)
rdbwhte.1 = rdbwhte(y=Y, x=X, covs.hte=factor(W))
summary(rdbwhte.1)