*!version 2.3 2021-02-28

Title

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

Syntax

rdbwdensity Var [if] [in]
[,

c(#)
p(#)
kernel(KernelFn)
fitselect(FitMethod)
vce(VceMethod)
nomasspoints

nlocalmin(#)
nuniquemin(#)
noregularize

]

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 detailed introduction to this Stata command is given in Cattaneo, Jansson and Ma (2018).

Companion R functions are also available here.

Companion function is rddensity.
See also the
lpdensity
package for other related bandwidth selection methods.

Related Stata and R packages useful for inference in regression discontinuity (RD) designs are described in the following website:

https://rdpackages.github.io/

Options

Bandwidth Selection

c(#) specifies the threshold or cutoff value in the support of Var, which determines the two samples (e.g., control and treatment units in RD settings).
Default is c(0).

p(#) specifies the local polynomial order used to construct the density estimators.
Default is p(2) (local quadratic approximation).

fitselect(FitMethod) 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(KernelFn) 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(VceMethod) 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.

nomasspoints will not adjust for mass points in the data.

Local Sample Size Checking

nlocalmin(#) specifies the minimum number of observations in each local neighborhood.
This option will be ignored if set to 0, or if noregularize is used.
The default value is 20+p(#)+1.

nuniquemin(#) specifies the minimum number of unique observations in each local neighborhood.
This option will be ignored if set to 0, or if noregularize is used.
The default value is 20+p(#)+1.

noregularize suppresses the local sample size checking feature.

Example: Cattaneo, Frandsen and Titiunik (2015) Incumbency Data

.

Load dataset (cutoff is 0 in this dataset):

. use rddensity_senate.dta

Bandwidth selection for manipulation test using default options:

. rdbwdensity margin

Bandwidth selection for manipulation test using plug-in standard errors:

. rdbwdensity margin, vce(plugin)

Saved results

rddensity saves the following in e():

Macros

e(c) cutoff value

e(p) order of the polynomial used for density estimation

e(N_l) sample size to the left of the cutoff

e(N_r) sample size to the right of the cutoff

e(h) matrix of estimated bandwidth (including underlying estimated constants)

e(runningvar) running variable used

e(kernel) kernel used

e(fitmethod) model used

e(vce) standard errors estimator used

References

Cattaneo, M. D., B. Frandsen, and R. Titiunik. 2015.
Randomization Inference in the Regression Discontinuity Design: An Application to the Study of Party Advantages in the U.S. Senate.

Journal of Causal Inference 3(1): 1-24.

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.

Authors

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

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

Xinwei Ma, University of California San Diego, La Jolla, CA.
x1ma@ucsd.edu.