Learn R Programming

rddensity (version 1.0)

rdbwdensity: Bandwidth Selection for Manipulation Testing Using Local Polynomial Density Estimation

Description

rdbwdensity implements several data-driven bandwidth selection methods for the manipulation testing procedure of Cattaneo, Jansson and Ma (2019).

Companion command: rddensity for density discontinuity (manipulation) testing. A companion Stata package is described in Cattaneo, Jansson and Ma (2018).

Related Stata and R packages useful for inference in regression discontinuity (RD) designs are described at https://sites.google.com/site/rdpackages.

Usage

rdbwdensity(X, c = 0, p = 2, kernel = "", fitselect = "",
  vce = "")

Arguments

X

Numeric vector or one dimensional matrix / data frame, the running variable.

c

Numeric, specifies the threshold or cutoff value in the support of X, which determes the two samples (e.g., control and treatment units in RD settings). Default is 0.

p

Integer, specifies the order of the local-polynomial used to construct the density point estimators. Default is 2 (local quadratic approximation).

kernel

String, specifies the kernel function used to construct the local-polynomial estimator(s). Options are: "triangular", "epanechnikov", and "uniform". Default is "triangular".

fitselect

String, specifies whether restrictions should be imposed. Options are: "unrestricted" for density estimation without any restrictions (two-sample, unrestricted inference). This is the default option. "restricted" for density estimation assuming equal c.d.f. and higher-order derivatives.

vce

String, specifies the procedure used to compute the variance-covariance matrix estimator. Options are: "plugin" for asymptotic plug-in standard errors. "jackknife" for jackknife standard errors. This is the default option.

Value

h

Bandwidths for density discontinuity test, left and right to the cutoff, and asymptotic variance and bias.

N

full: full sample size; left/right: sample size to the left/right of the cutoff.

opt

Collects the options used, includes: fitselect, kernel, vce, c, p. See options for rdbwdensity.

X_min

Smallest observations to the left and right of the cutoff.

X_max

Largest observations to the left and right of the cutoff.

References

M.D. Cattaneo, M. Jansson and X. Ma. (2018). Manipulation Testing based on Density Discontinuity. Stata Journal 18(1): 234-261.

M.D. Cattaneo, M. Jansson and X. Ma. (2019). Simple Local Polynomial Density Estimators. Journal of the American Statistical Association, forthcoming.

See Also

rddensity

Examples

Run this code
# NOT RUN {
# Generate a random sample
set.seed(42); x <- rnorm(2000, mean = -0.5)

# Construct bandwidth
summary(rdbwdensity(X = x, vce="jackknife"))

# }

Run the code above in your browser using DataLab