Learn R Programming

nprobust (version 0.0.1)

kdrobust: Kernel Density Estimation with Robust Confidence Intervals

Description

kdrobust implements kernel density estimators with robust bias-corrected confidence intervals and inference procedures developed in Calonico, Cattaneo and Farrell (2016a). It also computes alternative estimation and inference procedures available in the literature.

For more details, and related Stata and R packages useful for empirical analysis, visit https://sites.google.com/site/rdpackages/

Usage

kdrobust(x, c , deriv = 0, p = 2, h = NULL, b = NULL, rho = NULL, 
kernel = "epan", bwselect = "mse", level = 95, all = FALSE, subset = NULL)

Arguments

x

the data from which the estimate is to be computed.

c

specifies the evalution point in x.

p

specifies the order of the kernel used to construct the point-estimator; default is p = 2.

deriv

specifies the order of the derivative of the density function to be estimated. Default is deriv=0.

h

specifies the main bandwidth used to construct the KD point estimator. If not specified, bandwidth h is computed by the companion command kdbwselect.

b

specifies the bias bandwidth used to construct the bias-correction estimator. If not specified, bandwidth b is computed by the companion command kdbwselect.

rho

specifies the value of rho, so that the bias bandwidth b equals h/rho. Default is rho = 1 if h is specified but b is not.

kernel

is the kernel function used to construct the kernel density estimator(s). Options are triangular (default option), epanechnikov and uniform.

bwselect

specifies the bandwidth selection procedure to be used. By default it computes both h and b, unless rho is specified, in which case it only computes h and sets b=h/rho.

level

sets the confidence level for confidence intervals; default is level = 95.

all

if specified, kdrobust reports three different procedures:

(i) conventional LPR estimates with conventional standard errors.

(ii) bias-corrected estimates with conventional standard errors.

(iii) bias-corrected estimates with robust standard errors.

subset

an optional vector specifying a subset of observations to be used.

Value

c

cutoff value.

N

sample size used.

p

order of the kernel used for estimation of the density function.

h

bandwidth used for estimation of the KDE.

b

bandwidth used for estimation of the bias of the KDE.

coef

vector containing conventional and bias-corrected KDE.

se

vector containing conventional and robust standard errors of the KDE.

pv

vector containing the p-values associated with conventional, bias-corrected and robust KDE.

ci

matrix containing the confidence intervals associated with conventional, bias-corrected and robust KDE.

References

Calonico, S., M. D. Cattaneo, and M. H. Farrell. 2016. On the Effect of Bias Estimation on Coverage Accuracy in Nonparametric Inference. Working Paper. http://www-personal.umich.edu/~cattaneo/papers/Calonico-Cattaneo-Farrell_2016_JASA.pdf.

Calonico, S., M. D. Cattaneo, M. H. Farrell, and R. Titiunik. 2016b. rdrobust: Software for Regression Discontinuity Designs. Working Paper. http://www-personal.umich.edu/~cattaneo/papers/Calonico-Cattaneo-Farrell-Titiunik_2016_Stata.pdf.

Calonico, S., M. D. Cattaneo, and R. Titiunik. 2014a. Robust Nonparametric Confidence Intervals for Regression-Discontinuity Designs. Econometrica 82(6): 2295-2326. http://www-personal.umich.edu/~cattaneo/papers/Calonico-Cattaneo-Titiunik_2014_ECMA.pdf.

Calonico, S., M. D. Cattaneo, and R. Titiunik. 2015b. rdrobust: An R Package for Robust Nonparametric Inference in Regression-Discontinuity Designs. R Journal 7(1): 38-51. http://www-personal.umich.edu/~cattaneo/papers/Calonico-Cattaneo-Titiunik_2015_R.pdf.

See Also

lpbwselect

Examples

Run this code
# NOT RUN {
x<-runif(1000,-1,1)
kdrobust(x, c=0)
# }

Run the code above in your browser using DataLab