rdq | R Documentation |
rdq
estimates QTE under the RDD with or without covariates. This function is used by rd.qte
to generate QTE estimates.
rdq(y, x, d, x0, z0 = NULL, tau, h.tau, cov)
y |
a numeric vector, the outcome variable. |
x |
a vector (or a matrix) of covariates, the first column is the running variable. |
d |
a numeric vector, the treatment status. |
x0 |
the cutoff point. |
z0 |
the value of the covariates at which to evaluate the effects. For example, if a female dummy is included, z0 = 1 may indicate the female subgroup. |
tau |
a vector of quantiles of interest. |
h.tau |
the bandwidth values (specified for each quantile level). |
cov |
either 0 or 1. Set |
A list with elements:
QTE estimates.
conditional quantile estimates on the right side of x_{0}
(or for the D=1 group).
conditional quantile estimates on the left side of x_{0}
(or for the D=0 group).
quantile regression coefficients on the right side of x_{0}
.
quantile regression coefficients on the left side of x_{0}
.
# Without covariate
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)
hh = rep(2,length(tlevel))
rdq(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,h.tau=hh,cov=0)
# (continued) With covariates
z = sample(c(0,1),n,replace=TRUE)
y = x + 0.3*(x^2) - 0.1*(x^3) + 1.5*d + d*z + rnorm(n)
rdq(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,h.tau=hh,cov=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.