Learn R Programming

rddensity (version 0.2.1)

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

Description

rdbwdensity implements several data-driven bandwidth selection methods useful to construct manipulation testing procedures using the local polynomial density estimators proposed in Cattaneo, Jansson and Ma (2017a).

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

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. (2017a). Simple Local Polynomial Density Estimators. Working Paper, University of Michigan.

M. D. Cattaneo, M. Jansson and X. Ma. (2017b). rddensity: Manipulation Testing based on Density Discontinuity. Working Paper, University of Michigan.

See Also

rddensity

Examples

Run this code
# NOT RUN {
set.seed(42); x <- rnorm(2000, mean = -0.5)
summary(rdbwdensity(X = x, vce="jackknife"))

# }

Run the code above in your browser using DataLab