Tests the null hypothesis of no cross-sectional error dependence (CSD) in panel quantile regressions. Implements the T_tau and T-tilde_tau statistics of Demetrescu, Hosseinkouchack and Rodrigues (2023).
xtcsdq(
formula = NULL,
data = NULL,
index = NULL,
quantiles,
mode = c("pooled", "individual", "residuals"),
residuals = NULL,
bandwidth = NULL,
correction = TRUE
)An object of class "xtcsdq" with components:
Numeric vector of T_tau statistics (one per quantile).
Numeric vector of bias-corrected T-tilde_tau statistics.
p-values for T_tau.
p-values for T-tilde_tau.
KDE density estimates at zero (one per quantile).
Portmanteau statistic (average of T_tau over quantiles).
Bias-corrected portmanteau statistic.
p-value for M_K.
p-value for Mtilde_K.
Quantile levels used.
Number of cross-sectional units.
Number of time periods.
KDE bandwidth used.
A formula of the form y ~ x1 + x2 + .... Required for
mode = "pooled" (default) and mode = "individual".
Not used when residuals is provided.
A data frame containing the panel data in long format. Required
unless residuals is provided.
A character vector of length 2: c("id_var", "time_var").
Required unless residuals is provided.
A numeric vector of quantile levels, each strictly between 0 and 1.
Estimation mode: "pooled" (default, pooled FE-QR),
"individual" (per-unit QR), or "residuals" (provide
pre-computed residuals via the residuals argument).
A list (or named list) of numeric vectors or a matrix with
one column per quantile, containing pre-computed QR residuals. Only used
when mode = "residuals".
Numeric. KDE bandwidth for sparsity estimation. If
NULL (default), uses \(0.35 (NT)^{-0.2}\).
Logical. If TRUE (default), reports the
bias-corrected T-tilde statistic in addition to T_tau.
The T_tau statistic (Equation 3 in Demetrescu et al., 2023) tests for CSD by examining pairwise correlations of demeaned QR residuals across units. Under the null of no CSD, T_tau is asymptotically standard normal.
The bias-corrected version T-tilde_tau (Equation 5) subtracts two correction terms that account for the estimation uncertainty in the QR slope and the sparsity at the quantile. Reject H0 for large positive values.
The portmanteau statistic \(M_K = K^{-1} \sum_{q=1}^K T_\tau^{(q)}\) aggregates across K quantile levels.
The KDE bandwidth defaults to \(h = 0.35 (NT)^{-0.2}\) as in the original paper.
Demetrescu, M., Hosseinkouchack, M. and Rodrigues, P.M.M. (2023). Testing for No Cross-Sectional Error Dependence in Panel Quantile Regressions. Ruhr Economic Papers, No. 1041. tools:::Rd_expr_doi("10.4419/96973002")
# \donttest{
set.seed(42)
n <- 8; tt <- 20
dat <- data.frame(
id = rep(1:n, each = tt),
time = rep(1:tt, times = n),
y = rnorm(n * tt),
x1 = rnorm(n * tt)
)
res <- xtcsdq(y ~ x1, data = dat, index = c("id", "time"),
quantiles = c(0.25, 0.5, 0.75))
print(res)
summary(res)
# }
Run the code above in your browser using DataLab