| Title: | Quantile Treatment Effects under the Regression Discontinuity Design |
|---|---|
| Description: | Provides comprehensive methods for testing, estimating, and conducting uniform inference on quantile treatment effects (QTEs) in sharp regression discontinuity (RD) designs, incorporating covariates and implementing robust bias correction methods of Qu, Yoon, Perron (2024) <doi:10.1162/rest_a_01168>. |
| Authors: | Zhongjun Qu [aut, cph], Jungmo Yoon [aut, cre, cph] |
| Maintainer: | Jungmo Yoon <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.2.0 |
| Built: | 2026-05-18 06:29:25 UTC |
| Source: | https://github.com/jungmoyoon/qte.rd |
Provides comprehensive methods for testing, estimating, and conducting uniform inference on quantile treatment effects (QTEs) in sharp regression discontinuity (RD) designs, incorporating covariates and implementing robust bias correction methods of Qu, Yoon, Perron (2024) doi:10.1162/rest_a_01168.
The package QTE.RD includes four main functions:
rd.qte estimates QTEs and provides uniform confidence bands, with or without covariates,
and with or without robust bias correction.
rdq.test conducts tests for three hypotheses, related to the significance of
treatment effects, homogeneous treatment effects, and uniformly positive or negative treatment effects.
rdq.bandwidth implements two bandwidth selection rules:
the cross-validation bandwidth and the MSE optimal bandwidth.
plot.qte generates figures summarizing the treatment effects along with their confidence bands.
Zhongjun Qu [email protected]
Jungmo Yoon [email protected]
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; doi: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; doi:10.1080/07350015.2017.1407323
The student achievement data used in Duflo, Dupas, and Kremer (2011) is available from the Harvard Dataverse (see Source below).
The original dataset contains 7,022 observations and 106 variables.
We extracted 5,795 observations with non-missing values for the outcome variable totalscore and retained 10 key variables.
data(ddk_2011)data(ddk_2011)
A data frame with 5795 rows and 10 columns.
ID of primary school.
School sampled for tracking.
Student's percentile in initial distribution.
Total endline score.
Student assigned to contract teacher.
Student assigned to lower-ability section (if tracking school).
Student assigned to higher-ability section (if tracking school).
Sex of student: female.
Age of student at time of test.
Standardized total endline score.
Esther Duflo, Pascaline Dupas, and Michael Kremer (2011) “Peer Effects, Teacher Incentives, and the Impact of Tracking: Evidence from a Randomized Evaluation in Kenya,” American Economic Review, 1739-1774.
plot.qte generates plots summarizing the QTE estimates and their uniform confidence bands, helping users visualize the results.
It also makes plots for conditional quantile processes for each side of the cutoff.
## S3 method for class 'qte' plot(x, ptype = 1, ytext = NULL, mtext = NULL, subtext = NULL, ...)## S3 method for class 'qte' plot(x, ptype = 1, ytext = NULL, mtext = NULL, subtext = NULL, ...)
x |
an object of class |
ptype |
either 1 or 2. Set ptype=1 for the QTE plots, and ptype=2 for the conditional quantile plots. The default value is 1. |
ytext |
the y-axis label. |
mtext |
the title of the plot. |
subtext |
the subtitles (used for the conditional quantile plots only). |
... |
optional arguments to plot |
plot(s) of the QTE estimates and uniform confidence bands.
# 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) plot(A) y.text = "test scores" m.text = "QTE and Uniform band" plot(A,ytext=y.text,mtext=m.text) A2 <- summary(A,alpha=0.1) plot(A2) 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) A <- rd.qte(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1) y.text = "test scores" m.text = c("D=0","D=1") plot(A2,ytext=y.text,mtext=m.text) # conditional quantile plots 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1) y.text = "test scores" m.text = "Conditional quantile functions" sub.text = c("D=0 group","D=1 group") plot(A2,ptype=2,ytext=y.text,mtext=m.text,subtext=sub.text)# 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) plot(A) y.text = "test scores" m.text = "QTE and Uniform band" plot(A,ytext=y.text,mtext=m.text) A2 <- summary(A,alpha=0.1) plot(A2) 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) A <- rd.qte(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1) y.text = "test scores" m.text = c("D=0","D=1") plot(A2,ytext=y.text,mtext=m.text) # conditional quantile plots 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1) y.text = "test scores" m.text = "Conditional quantile functions" sub.text = c("D=0 group","D=1 group") plot(A2,ptype=2,ytext=y.text,mtext=m.text,subtext=sub.text)
rd.qte is the main function of the QTE.RD package. It estimates QTE with/without covariates.
If bias=1, it corrects the bias in QTE estimates and obtains the robust confidence band and if bias=0, no bias correction is implemented.
rd.qte(y, x, d, x0, z0=NULL, tau, bdw, bias)rd.qte(y, x, d, x0, z0=NULL, tau, bdw, bias)
y |
a numeric vector, the outcome variable. |
x |
a vector (or a matrix) of covariates. When no covariates are included,
|
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 z is included, z0 = 1 may indicate the female subgroup. |
tau |
a vector of quantiles of interest. |
bdw |
the bandwidth value(s). If 'bdw' is a scalar, it is interpreted as the
bandwidth for the median. See the function |
bias |
either 0 or 1. If bias=1, the QTE estimate is bias corrected and the robust confidence band in Qu, Yoon, and Perron (2024) is produced. If bias=0, no bias correction is implemented. |
A list with elements:
QTE estimates.
uniform confidence band for QTE. If bias=1, the band is robust capturing the effect of the bias correction. If bias=0, no bias correction is implemented.
standard errors for each quantile level. If bias=1, its value captures the effect of the bias correction. If bias=0, no bias correction is implemented.
conditional quantile estimates on the right side of (or for the group).
conditional quantile estimates on the left side of (or for the group).
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; doi: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; doi:10.1080/07350015.2017.1407323
Keming Yu and M. C. Jones (1998), “Local Linear Quantile Regression,” Journal of the American Statistical Association, 93(441), 228–237; doi:10.2307/2669619
# 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) # (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) A <- rd.qte(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1)# 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) # (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) A <- rd.qte(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1)
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)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 (or for the D=1 group).
conditional quantile estimates on the left side of (or for the D=0 group).
quantile regression coefficients on the right side of .
quantile regression coefficients on the left side of .
# 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)# 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)
rdq.band produces uniform confidence bands for QTEs with and without bias correction.
This function is used by rd.qte to generate uniform bands.
rdq.band(y, x, d, x0, z0 = NULL, tau, bdw, alpha = 0.1)rdq.band(y, x, d, x0, z0 = NULL, tau, bdw, alpha = 0.1)
y |
a numeric vector, the outcome variable. |
x |
a vector (or a matrix) of covariates, When no covariates are included,
|
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, |
tau |
a vector of quantiles of interest. |
bdw |
the bandwidth value(s). If |
alpha |
a numeric value between 0 and 1 specifying the significance level.
For example, setting |
QTE estimates without bias correction.
bias corrected QTE estimates.
uniform confidence band for QTE without bias correction.
uniform confidence band for QTE with robust bias correction.
standard errors for each quantile level for estimates without bias correction.
standard errors for each quantile level for estimates with robust bias correction.
uniform confidence band for the conditional quantile estimates on the right side of the cutoff, without bias correction.
uniform confidence band for the conditional quantile estimates on the right side of the cutoff, robust to the bias correction.
uniform confidence band for the conditional quantile estimates on the left side of the cutoff, without bias correction.
uniform confidence band for the conditional quantile estimates on the left side of the cutoff, robust to the bias correction.
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; doi: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; doi:10.1080/07350015.2017.1407323
Keming Yu and M. C. Jones (1998), “Local Linear Quantile Regression,” Journal of the American Statistical Association, 93(441), 228–237; doi:10.2307/2669619
# 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) D = rdq.band(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,alpha=0.1) # (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) D = rdq.band(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,alpha=0.1)# 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) D = rdq.band(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,alpha=0.1) # (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) D = rdq.band(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,alpha=0.1)
rdq.bandwidth implements two bandwidth selection rules and obtains the cross-validation (CV) bandwidth and the MSE optimal bandwidth.
rdq.bandwidth(y, x, d, x0, z0=NULL, cv, val, hp=NULL, pm.each=0, bdy=1, p.order=1, xl=0.5)rdq.bandwidth(y, x, d, x0, z0=NULL, cv, val, hp=NULL, pm.each=0, bdy=1, p.order=1, xl=0.5)
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. |
cv |
either 0 or 1. When cv=1, both the CV and MSE optimal bandwidths are produced. When cv=0, the MSE optimal bandwidth is produced. |
val |
a set of candidate values for the CV bandwidth. |
hp |
a pilot bandwidth to estimate nuisance parameters for the MSE optimal bandwidth. It will be used only if cv=0. If cv=1, the CV bandwidth will be used as the pilot bandwidth to compute the MSE optimal bandwidth. |
pm.each |
either 0 or 1. When pm.each=1, the CV bandwidths for each side of the cutoff will be obtained separately. |
bdy |
either 0 or 1. When bdy=1, the CV bandwidth uses the boundary point procdure. |
p.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. |
xl |
if |
A list with elements:
the selected CV bandwidth at the median.
the MSE optimal bandwidth at the median from the right side of .
the MSE optimal bandwidth at the median from the left side of .
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; doi: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; doi:10.1080/07350015.2017.1407323
# 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) rdq.bandwidth(y=y,x=x,d=d,x0=0,z0=NULL,cv=1,val=(1:4)) rdq.bandwidth(y=y,x=x,d=d,x0=0,z0=NULL,cv=0,val=(1:4),hp=2) # (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.bandwidth(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),cv=1,val=(1:4),bdy=1,p.order=1)# 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) rdq.bandwidth(y=y,x=x,d=d,x0=0,z0=NULL,cv=1,val=(1:4)) rdq.bandwidth(y=y,x=x,d=d,x0=0,z0=NULL,cv=0,val=(1:4),hp=2) # (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.bandwidth(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),cv=1,val=(1:4),bdy=1,p.order=1)
rdq.bias estimates the bias terms using the local quadratic quantile regression.
rdq.bias(y, x, dz, x0, z0, taus, h.tau, h.tau2, fx, cov)rdq.bias(y, x, dz, x0, z0, taus, h.tau, h.tau2, fx, cov)
y |
a numeric vector, the outcome variable. |
x |
a vector (or a matrix) of covariates, the first column is the running variable. |
dz |
the number of covariates. |
x0 |
the cutoff point. |
z0 |
the value of the covariates at which to evaluate the effects. |
taus |
a vector of quantiles of interest. |
h.tau |
the bandwidth values (specified for each quantile level), for estimating conditional quantiles. |
h.tau2 |
the bandwidth values for the local quadratic quantile regression, for estimating the bias terms. |
fx |
conditional density estimates. |
cov |
either 0 or 1. Set |
A list with elements:
the bias estimates.
the estimate of the term. See Qu, Yoon, and Perron (2024).
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; doi:10.1162/rest_a_01168
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) hh = rep(2,length(tlevel)) fe = rdq.condf(x,Q=ab$qp.est,bcoe=ab$bcoe.p,taus=tlevel,taul=tlevel2,delta=delta,cov=0) be = rdq.bias(y[d==1],x[d==1],dz=0,x0=0,z0=NULL,taus=tlevel,hh,hh,fx=fe$ff[(d==1),],cov=0)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) hh = rep(2,length(tlevel)) fe = rdq.condf(x,Q=ab$qp.est,bcoe=ab$bcoe.p,taus=tlevel,taul=tlevel2,delta=delta,cov=0) be = rdq.bias(y[d==1],x[d==1],dz=0,x0=0,z0=NULL,taus=tlevel,hh,hh,fx=fe$ff[(d==1),],cov=0)
rdq.condf estimates conditional density functions by using the differencing method.
rdq.condf(x, Q, bcoe, taus, taul, delta, cov)rdq.condf(x, Q, bcoe, taus, taul, delta, cov)
x |
a vector (or a matrix) of covariates. |
Q |
a vector of estimated conditional quantiles. |
bcoe |
quantile regression coefficient estimates. |
taus |
a vector of quantiles of interest. |
taul |
a vector of quantiles used for the conditional density estimation. It is needed to estimate the tail parts of conditional density functions more precisely. |
delta |
bandwidths for estimating the conditional density. |
cov |
either 0 or 1. Set |
conditional density function estimates
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)) ab = rdq(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,h.tau=hh,cov=0) delta = 0.186 fe = rdq.condf(x=x,Q=ab$qp.est,bcoe=ab$bcoe.p,taus=0.5,taul=tlevel,delta=delta,cov=0)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)) ab = rdq(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,h.tau=hh,cov=0) delta = 0.186 fe = rdq.condf(x=x,Q=ab$qp.est,bcoe=ab$bcoe.p,taus=0.5,taul=tlevel,delta=delta,cov=0)
rdq.test provides testing results for hypotheses on the treatment effects concerning (i) treatment significance, (ii) homogeneity of effects over quantiles,
and (iii) positive or negative dominance hypothesis.
rdq.test(y,x,d,x0,z0=NULL,tau,bdw,bias,alpha=0.1,type=1,std.opt=1)rdq.test(y,x,d,x0,z0=NULL,tau,bdw,bias,alpha=0.1,type=1,std.opt=1)
y |
a numeric vector, the outcome variable. |
x |
a vector (or a matrix) of covariates.
When no covariates are included, |
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 indicates the female subgroup. |
tau |
a vector of quantiles of interest. |
bdw |
the bandwidth value(s). If |
bias |
either 0 or 1. If bias=1, the QTE estimate is bias corrected and the robust confidence band in Qu, Yoon, and Perron (2024) is produced. If bias=0, no bias correction is implemented. |
alpha |
a numeric value between 0 and 1 specifying the significance level.
For example, setting |
type |
a value in 1–4. Set type to 1 to test the null hypothesis of a zero treatment effect against the alternative hypothesis of significant treatment effects; set type to 2 to test the null hypothesis of homogeneous treatment against heterogeneous treatment effects; set type to 3 to test the null hypothesis of uniformly non-negative treatment effects against the presence of negative effects; and set type to 4 to test the null hypothesis of uniformly non-positive treatment effects against the presence of positive effects at some quantiles. |
std.opt |
either 0 or 1. If |
A list with elements:
test statistics.
critical values.
p values.
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; doi: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; doi:10.1080/07350015.2017.1407323
# 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) B = rdq.test(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1,alpha=c(0.1,0.05),type=c(1,2,3)) # (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) B = rdq.test(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1, alpha=c(0.1,0.05),type=c(3,4))# 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) B = rdq.test(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1,alpha=c(0.1,0.05),type=c(1,2,3)) # (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) B = rdq.test(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1, alpha=c(0.1,0.05),type=c(3,4))
summary.qte returns uniform confidence bands and standard errors for QTE estimates.
## S3 method for class 'qte' summary(object, alpha = 0.1, ...)## S3 method for class 'qte' summary(object, alpha = 0.1, ...)
object |
It is an object of class "qte" produced by |
alpha |
a number between 0 and 1, the desired significance level.
For example, setting |
... |
optional arguments. |
A list with elements:
QTE estimates.
uniform confidence band for QTE. If bias=1, the band is robust capturing the effect of the bias correction. If bias=0, no bias correction is implemented.
standard errors for each quantile level. If bias=1, its value captures the effect of the bias correction. If bias=0, no bias correction is implemented.
conditional quantile estimates on the right side of (or for the group).
conditional quantile estimates on the left side of (or for the group).
uniform confidence band for conditional quantiles on the right side of .
uniform confidence band for conditional quantiles on the left side of .
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; doi: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; doi:10.1080/07350015.2017.1407323
# 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1) # (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) A <- rd.qte(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1)# 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) A <- rd.qte(y=y,x=x,d=d,x0=0,z0=NULL,tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1) # (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) A <- rd.qte(y=y,x=cbind(x,z),d=d,x0=0,z0=c(0,1),tau=tlevel,bdw=2,bias=1) A2 <- summary(A,alpha=0.1)