Description Usage Arguments Value Author(s) References See Also Examples
rdbwdensity
implements several datadriven 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/.
1 2 3 4 5 6 7 8 9 10 11 12 
X 
Numeric vector or one dimensional matrix/data frame, the running variable. 
c 
Numeric, specifies the threshold or cutoff value in the support of 
p 
Nonnegative integer, specifies the local polynomial order used to construct
the density estimators. Default is 
fitselect 
String, specifies the density estimation method.

kernel 
String, specifies the kernel function used to construct the local
polynomial estimators.

vce 
String, specifies the procedure used to compute the variancecovariance matrix estimator.

massPoints 

regularize 

nLocalMin 
Nonnegative integer, specifies the minimum number of observations in each local neighborhood.
This option will be ignored if set to 
nUniqueMin 
Nonnegative integer, specifies the minimum number of unique observations in
each local neighborhood. This option will be ignored if set to 
h 
Bandwidths for density discontinuity test, left and right to the cutoff, and asymptotic variance and bias. 
N 

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. 
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.
Cattaneo, M. D., M. Jansson, and X. Ma. 2018. Manipulation Testing based on Density Discontinuity. Stata Journal 18(1): 234261.
Cattaneo, M. D., M. Jansson, and X. Ma. 2020. Simple Local Polynomial Density Estimators. Journal of the American Statistical Association, 115(531): 14491455.
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"))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.