rdbwhte: MSE-Optimal Bandwidth Selection for RD Heterogeneous...

View source: R/rdbwhte.R

rdbwhteR Documentation

MSE-Optimal Bandwidth Selection for RD Heterogeneous Treatment Effects Estimation

Description

rdbwhte computes MSE-optimal bandwidths for estimating RD heterogeneous treatment effects based on covariates.

Companion commands: rdhte for RD HTE estimation and inference.

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,
  kernel = "tri",
  vce = "hc3",
  cluster = NULL,
  bw.joint = FALSE
)

Arguments

y

Outcome variable.

x

Running variable.

c

Cutoff value (default = 0).

covs.hte

Covariate(s) for heterogeneous treatment effects (required).

covs.eff

Additional covariates for efficiency (optional).

p

Polynomial order (default = 1).

kernel

Kernel type (default = "tri").

vce

Variance estimator (default = "hc3").

cluster

Optional cluster variable.

bw.joint

Logical, use joint bandwidth selection (default = FALSE).

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 of 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.

coef_report

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

rdbwhte

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)

rdhte documentation built on April 12, 2025, 1:49 a.m.