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.
rdbwdensity(X, c = 0, p = 2, kernel = "", fitselect = "",
vce = "")
Numeric vector or one dimensional matrix / data frame, the running variable.
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
.
Integer, specifies the order of the local-polynomial used to construct the density
point estimators. Default is 2
(local quadratic approximation).
String, specifies the kernel function used to construct the local-polynomial
estimator(s). Options are: "triangular"
, "epanechnikov"
, and "uniform"
. Default is
"triangular"
.
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.
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.
Bandwidths for density discontinuity test, left and right to the cutoff, and asymptotic variance and bias.
full
: full sample size; left
/right
: sample size to the left/right of the cutoff.
Collects the options used, includes: fitselect
, kernel
,
vce
, c
, p
. See options for rdbwdensity
.
Smallest observations to the left and right of the cutoff.
Largest observations to the left and right of the cutoff.
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.
# 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