xtcspqardl: Cross-Sectionally Augmented Panel Quantile ARDL

Overview

The xtcspqardl package implements the Cross-Sectionally Augmented Panel Quantile ARDL (CS-PQARDL) model and the Quantile Common Correlated Effects Mean Group (QCCEMG/QCCEPMG) estimator for panel data with cross-sectional dependence.

Key Features

Installation

From CRAN (when available)

install.packages("xtcspqardl")

From GitHub

# install.packages("devtools")
devtools::install_github("muhammedalkhalaf/xtcspqardl")

Usage

QCCEMG Estimation

library(xtcspqardl)

# Generate panel data
set.seed(123)
N <- 20  # panels
T <- 50  # time periods

data <- data.frame(
  id = rep(1:N, each = T),
  time = rep(1:T, N),
  x = rnorm(N * T)
)

# Add dynamics
for (i in 1:N) {
  idx <- ((i-1)*T + 2):(i*T)
  data$y[idx] <- 0.5 * data$y[idx-1] + 0.3 * data$x[idx] + rnorm(T-1, sd=0.5)
}

# Estimate QCCEMG
fit <- xtcspqardl(
  formula = y ~ x,
  data = data,
  id = "id",
  time = "time",
  tau = c(0.25, 0.50, 0.75),
  estimator = "qccemg"
)

# View results
summary(fit)

CS-PQARDL Estimation

# With long-run variables
fit_ardl <- xtcspqardl(
  formula = y ~ dx | x,  # dx is short-run, x is long-run
  data = data,
  id = "id",
  time = "time",
  tau = c(0.25, 0.50, 0.75),
  estimator = "cspqardl",
  p = 1,
  q = 1
)

summary(fit_ardl)

Methodology

Cross-Sectional Averages (CSA)

The CCE approach augments individual regressions with cross-sectional averages:

\[\bar{z}_t = \frac{1}{N} \sum_{i=1}^{N} z_{it}\]

where \(z\) includes both the dependent and independent variables.

QCCEMG Model

\[y_{it} = \lambda_i(\tau) y_{i,t-1} + \beta_i(\tau)' x_{it} + \delta_i(\tau)' \bar{z}_t + u_{it}(\tau)\]

Long-Run Coefficients

Long-run effects are computed as:

\[\theta(\tau) = \frac{\beta(\tau)}{1 - \lambda(\tau)}\]

CSA Lag Order

Following Chudik & Pesaran (2015), the default lag order for CSA is:

\[p_T = \lfloor T^{1/3} \rfloor\]

References

Author

Merwan Roudane - merwanroudane920@gmail.com

License

GPL (>= 3)