rdq.test: tests for QTE

View source: R/rdq.test.R

rdq.testR Documentation

tests for QTE

Description

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.

Usage

rdq.test(y,x,d,x0,z0=NULL,tau,bdw,bias,alpha=0.1,type=1,std.opt=1)

Arguments

y

a numeric vector, the outcome variable.

x

a vector (or a matrix) of covariates. When no covariates are included, x is simply a vector of the running variable and z0 can be left unspecified. When covariates are included, x should be a matrix with the running variable in the first column and the covariates in the remaining columns.

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 bdw is a scalar, it is interpreted as the bandwidth for the median. The bandwidths for the rest of the quantiles are computed automatically using the formula in Yu and Jones (1998). If it is a vector with the same dimension as tau, the function will use these values for the respective quantiles accordingly.

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 alpha = 0.1 yields a 90% uniform confidence band. Multiple significance levels can be specified, e.g., alpha = c(0.1, 0.05).

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 std.opt=1, the test statistic is standardized so that the variance is equalized across quantiles; if std.opt=0, the test is not standardized.

Value

A list with elements:

statistic

test statistics.

cr.va

critical values.

p.value

p values.

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; \Sexpr[results=rd]{tools:::Rd_expr_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; \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/07350015.2017.1407323")}

Examples

# 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))



QTE.RD documentation built on Aug. 30, 2025, 9:06 a.m.