rdq.sim {QTE.RD}R Documentation

Simulation the asymptotic distributions

Description

rdq.sim produces iid draws from the asymptotic distribution of the conditional quantile process estimate.

Usage

rdq.sim(x, d, x0, z0, dz, cov, tt, hh, hh2, fxp, fxm, n.sim)

Arguments

x

a vector (or a matrix) of covariates.

d

a numeric vector, the treatment status.

x0

the cutoff point.

z0

the value of the covariates at which to evaluate the effects.

dz

the number of covariates.

cov

either 0 or 1. Set cov=1 if covariates are present in the model; otherwise set cov=0.

tt

a vector of quantiles.

hh

the bandwidth values (specified for each quantile level).

hh2

the bandwidth values for the local quadratic quantile regression.

fxp

conditional density estimates on the right side of x_0.

fxm

conditional density estimates on the left side of x_0.

n.sim

the number of simulation repetitions.

Value

A list with elements:

dcp

realizations from the asymptotic distribution of the conditional quantile process, from the right side of x_0.

dcm

realizations from the asymptotic distribution of the conditional quantile process, from the left side of x_0.

drp

realizations from the asymptotic distribution of the bias corrected conditional quantile process, from the right side of x_0.

drm

realizations from the asymptotic distribution of the bias corrected conditional quantile process, from the left side of x_0.

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)
tlevel = seq(0.1,0.9,by=0.1)
tlevel2 = c(0.05,tlevel,0.95)
hh = rep(2,length(tlevel))
hh2 = rep(2,length(tlevel2))

ab = rdq(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel2,h.tau=hh2,cov=0)
delta = c(0.05,0.09,0.14,0.17,0.19,0.17,0.14,0.09,0.05)
fp = rdq.condf(x=x,Q=ab$qp.est,bcoe=ab$bcoe.p,taus=tlevel,taul=tlevel2,delta,cov=0)
fm = rdq.condf(x=x,Q=ab$qm.est,bcoe=ab$bcoe.m,taus=tlevel,taul=tlevel2,delta,cov=0)
sa = rdq.sim(x=x,d=d,x0=0,z0=NULL,dz=0,cov=0,tt=tlevel,hh,hh,fxp=fp$ff,fxm=fm$ff,n.sim=200)


[Package QTE.RD version 1.0.0 Index]