cv.bandwidth {QTE.RD}R Documentation

Cross-validation bandwidth

Description

cv.bandwidth implements the cross-validation bandwidth selection rule. The function rdq.bandwidth calls this function to obtain the CV bandwidth.

Usage

cv.bandwidth(y, x, z, dz, x0, val, xl, order, bdy)

Arguments

y

a numeric vector, the outcome variable.

x

the running variable.

z

additional covariates.

dz

the number of covariates z.

x0

the cutoff point.

val

a set of candidate values for the CV bandwidth.

xl

if xl=0.5, the CV bandwidth is computed using the 50% of observations closest to x_0.

order

either 1 or 2. When p.order=1, a local linear regression is used, and when p.order=2, a local quadratic regression is used.

bdy

either 0 or 1. When bdy=1, the CV bandwidth is computed by treating x as a boundary point. Otherwise, x is treated as an interior point.

Value

A list with elements:

h.cv

the selected CV bandwidth values at the median.

cand

the criterion function evaluated at each of candidate value.

References

Zhongjun Qu, Jungmo Yoon, Pierre Perron (2024), "Inference on Conditional Quantile Processes in Partially Linear Models with Applications to the Impact of Unemployment Benefits," The Review of Economics and Statistics; https://doi.org/10.1162/rest_a_01168

Zhongjun Qu and Jungmo Yoon (2019), "Uniform Inference on Quantile Effects under Sharp Regression Discontinuity Designs," Journal of Business and Economic Statistics, 37(4), 625–647; https://doi.org/10.1080/07350015.2017.1407323

See Also

rdq.bandwidth()

Examples

n = 500
x = runif(n,min=-4,max=4)
d = (x > 0)
y = x + 0.3*(x^2) - 0.1*(x^3) + 1.5*d + rnorm(n)
cv.bandwidth(y=y, x=x, z=NULL, dz=0, x0=0, val=c(1,2,3,4), xl=0.5, order=2, bdy=1)
cv.bandwidth(y=y, x=x, z=NULL, dz=0, x0=0, val=c(1,2,3,4), xl=0.5, order=1, bdy=1)


[Package QTE.RD version 1.0.0 Index]