rdbwdensity: Bandwidth Selection for Manipulation Testing

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/rdbwdensity.R

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 (2020).

A companion Stata package is described in Cattaneo, Jansson and Ma (2018).

Companion command: rddensity for manipulation (density discontinuity) testing.

Related Stata and R packages useful for inference in regression discontinuity (RD) designs are described in the website: https://rdpackages.github.io/.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rdbwdensity(
  X,
  c = 0,
  p = 2,
  fitselect = "",
  kernel = "",
  vce = "",
  massPoints = TRUE,
  regularize = TRUE,
  nLocalMin = NULL,
  nUniqueMin = NULL
)

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 determines the two samples (e.g., control and treatment units in RD settings). Default is 0.

p

Nonnegative integer, specifies the local polynomial order used to construct the density estimators. Default is 2 (local quadratic approximation).

fitselect

String, specifies the density estimation method. "unrestricted" for density estimation without any restrictions (two-sample, unrestricted inference). This is the default option. "restricted" for density estimation assuming equal distribution function and higher-order derivatives.

kernel

String, specifies the kernel function used to construct the local polynomial estimators. "triangular": K(u)=(1-|u|)*(|u|<=1). This is the default option. "epanechnikov": K(u) = 0.75*(1-u^2)*(|u|<=1). "uniform": K(u) = 0.5 * (|u|<=1).

vce

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

massPoints

TRUE (default) or FALSE, specifies whether to adjust for mass points in the data.

regularize

TRUE (default) or FALSE, specifies whether to conduct local sample size checking. When set to TRUE, the bandwidth is chosen such that the local region includes at least nLocalMin observations and at least nUniqueMin unique observations.

nLocalMin

Nonnegative integer, specifies the minimum number of observations in each local neighborhood. This option will be ignored if set to 0, or if regularize=FALSE is used. Default is 20+p+1.

nUniqueMin

Nonnegative integer, specifies the minimum number of unique observations in each local neighborhood. This option will be ignored if set to 0, or if regularize=FALSE is used. Default is 20+p+1.

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

Options passed to the function.

X_min

Smallest observations to the left and right of the cutoff.

X_max

Largest observations to the left and right of the cutoff.

Author(s)

Matias D. Cattaneo, Princeton University cattaneo@princeton.edu.

Michael Jansson, University of California Berkeley. mjansson@econ.berkeley.edu.

Xinwei Ma (maintainer), University of California San Diego. x1ma@ucsd.edu.

References

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

Cattaneo, M. D., M. Jansson, and X. Ma. 2020. Simple Local Polynomial Density Estimators. Journal of the American Statistical Association, 115(531): 1449-1455.

See Also

rddensity

Examples

1
2
3
4
5
6
# Generate a random sample
set.seed(42)
x <- rnorm(2000, mean = -0.5)

# Bandwidth selection
summary(rdbwdensity(X = x, vce="jackknife"))

rddensity documentation built on March 4, 2021, 9:09 a.m.