*! version 1.0.0 25feb2026

Title

xtcspqardl -- Cross-Sectionally Augmented Panel Quantile ARDL, Quantile CCE Mean Group, and Quantile CCE Pooled Mean Group Estimation

Syntax

CS-PQARDL Estimator (default):

xtcspqardl
depvar indepvars
[if] [in]
, tau(numlist) lr(varlist)
[cs-pqardl_options]

QCCEMG Estimator:

xtcspqardl
depvar indepvars
[if] [in]
, tau(numlist) qccemg
[qccemg_options]

QCCEPMG Estimator:

xtcspqardl
depvar indepvars
[if] [in]
, tau(numlist) qccepmg
[qccepmg_options]

Required
tau(numlist) quantiles for estimation, e.g., tau(0.25 0.5 0.75)

Estimator Selection
qccemg use Quantile CCE Mean Group estimator (Harding, Lamarche & Pesaran 2018)

qccepmg use Quantile CCE Pooled Mean Group estimator (Pesaran 2006; HLP 2018)

lr(varlist) long-run level variables for CS-PQARDL;
first variable is the lagged dependent (ECT), remaining are long-run regressors

CS-PQARDL Options
pmg Pooled Mean Group estimator (default)

mg Mean Group estimator

dfe Dynamic Fixed Effects estimator

p(#) autoregressive lag order; default is p(1)

q(numlist) distributed lag orders; single number or per-variable

ecm use ECM reparameterization; CSA in ECT only

lagsel(string) automatic lag selection: aic, bic, or both

pmax(#) maximum AR lag for lag selection; default is pmax(4)

qmax(#) maximum DL lag for lag selection; default is qmax(4)

Cross-Sectional Dependence
cr_lags(#) number of CSA lags (pT); default is floor(T^{1/3})

Advanced Analysis
full perform advanced analysis, including quantile homogeneity test

graph generate graphs: quantile process, ECT heatmap, half-life

Display
showindividual display per-panel estimates

showcsa display Cross-Sectional Average (CSA) nuisance coefficients

notable suppress coefficient tables

noconstant suppress constant term

level(#) confidence level; default is level(95)

Data must be declared as panel data using xtset panelvar timevar
before calling xtcspqardl.

Description

xtcspqardl implements two estimators for dynamic heterogeneous panel data
models with cross-sectional dependence at the quantile level:

1. CS-PQARDL (Cross-Sectionally Augmented Panel Quantile ARDL):
Extends the panel quantile ARDL framework by augmenting unit-specific
regressions with cross-sectional averages (CSA) of the dependent and independent
variables, following Pesaran (2006) and Chudik and Pesaran (2015). This absorbs
unobserved common factors that induce cross-sectional dependence, producing
consistent estimates under factor structures. CSA enter the long-run equation
(or ECT in ECM form), but are excluded from short-run dynamics.

2. QCCEMG (Quantile CCE Mean Group):
Implements the Quantile Common Correlated Effects Mean Group estimator of
Harding, Lamarche, and Pesaran (2018). This is a dynamic panel quantile
regression model where unobserved common factors are proxied by CSA and their
lags. Unit-specific quantile regressions are averaged using the Mean Group
approach, with inference based on the nonparametric between-group variance
(Theorem 4 of HLP 2018).

Both estimators handle heterogeneous slope coefficients across panels,
permit quantile-varying parameters, and are robust to cross-sectional
dependence generated by unobserved common factors.

3. QCCEPMG (Quantile CCE Pooled Mean Group):
Implements the pooled version of the QCCEMG estimator, following Pesaran (2006)
CCEP methodology adapted to the quantile setting. Individual quantile regressions
are estimated identically to QCCEMG, but the Mean Group averaging and inference
follow the Pooled Mean Group approach. Under slope homogeneity, the QCCEPMG
estimator achieves √(NT) convergence compared to √N for QCCEMG.

All three estimators handle heterogeneous slope coefficients across panels,
permit quantile-varying parameters, and are robust to cross-sectional
dependence generated by unobserved common factors.

Estimators

CS-PQARDL Model:

Q_tau(y_it | X_it, z_bar_t) = rho_i(tau) * LR_vars + phi_i(tau) * AR_lags
+ gamma_i(tau) * SR_lags + delta_i(tau) * CSA + alpha_i(tau)

where CSA = (y_bar_t, x1_bar_t, ..., xk_bar_t, L.y_bar_t, ..., L_pT.y_bar_t, ...)
are cross-sectional averages and their lags. Long-run coefficients
beta_j(tau) = -coef(x_j)/rho(tau) are computed from the ARDL representation.

ECM reparameterization (ecm option):

Delta y_it = phi_i(tau) * [y_ - theta'_i(tau) * x_
- delta'_i(tau) * z_bar_] + c_ij(tau) * Delta y_
+ d_im(tau) * Delta x_ + e_it(tau)

CSA enter the error correction term only; short-run CSA differences are dropped.

QCCEMG Model (Harding, Lamarche & Pesaran 2018, eq. 2.17):

y_it = alpha_i(tau) + lambda_i(tau) * y_ + x'_it * beta_i(tau)
+ sum_^ z_bar'_ * delta_(tau) + e_it(tau)

The Mean Group estimator (eq. 2.21): theta_hat(tau) = (1/N) * sum theta_hat_i(tau),
where theta_i = (lambda_i, beta'_i)'.

Long-run effects: theta_j(tau) = beta_j(tau) / (1 - lambda(tau)), with
delta-method standard errors. Half-life: h(tau) = ln(0.5) / ln(|lambda(tau)|).

Inference uses Theorem 4 (heterogeneous coefficients):
V_hat_v = (1/(N-1)) * sum (theta_hat_i - theta_hat)(theta_hat_i - theta_hat)'.

Options

Required

tau(numlist) specifies the quantiles at which estimation is performed.
Values must be between 0 and 1 exclusive.
Example: tau(0.1 0.25 0.5 0.75 0.9) for five quantiles.

Estimator Selection

qccemg specifies the Quantile CCE Mean Group estimator. When this
option is given, the lr() option is not required. The model automatically
includes one lag of the dependent variable (y_) and the independent
variables at their contemporaneous level.

qccepmg specifies the Quantile CCE Pooled Mean Group estimator. This is
the pooled counterpart of QCCEMG, based on Pesaran (2006) CCEP methodology.
The same individual quantile regressions are estimated, but averaging and
inference follow the Pooled Mean Group approach. Cannot be combined with qccemg.

lr(varlist) specifies the long-run level variables for CS-PQARDL.
The first variable must be the lagged dependent variable (e.g., L.y),
which identifies the error correction mechanism. The remaining variables
are the long-run regressors.

CS-PQARDL Options

pmg specifies the Pooled Mean Group estimator. This is the default
for CS-PQARDL.

mg specifies the Mean Group estimator.

dfe specifies the Dynamic Fixed Effects estimator.

p(#) specifies the autoregressive lag order. Default is 1.

q(numlist) specifies distributed lag orders for independent variables.
A single number applies to all variables. A per-variable list is also accepted.

ecm uses the error correction model reparameterization for CS-PQARDL.
In this form, CSA enter the ECT only; short-run CSA differences are dropped.

lagsel(string) activates automatic lag selection (aic or bic).

Cross-Sectional Dependence

cr_lags(#) sets the number of lags of cross-sectional averages.
Default is floor(T^{1/3}) per Chudik and Pesaran (2015).

Advanced Analysis

full requests a comprehensive suite of advanced post-estimation
analysis tables when multiple quantiles are specified. This includes:
(1) Cross-quantile coefficient comparison
(2) Pairwise quantile differences (z-tests)
(3) Persistence profile across quantiles
(4) Quantile slope homogeneity test (Joint Wald test across quantiles)
(5) For QCCEMG/QCCEPMG only: Long-run effects and Impulse Response Functions (IRF).

graph generates and saves figures visualizing the estimation results
across quantiles. This includes: coefficient processes (long-run beta(tau), short-run
impacts, QCCEMG/QCCEPMG theta(tau) and lambda(tau)), ECT heatmaps (for CS-PQARDL),
and half-life comparisons. Short-run coefficient bounds are graphed utilizing
MG-averaged variance (sr_V). Note: For CS-PQARDL, ensure short-run
indepvars are explicitly differenced (e.g. dx1) to avoid collinearity
with lr() level variables, which would flatten the short-run graphs to zero.

Display

showindividual displays per-panel estimation results.

showcsa displays the coefficients of the Cross-Sectional Averages (CSA).
These are treated as nuisance parameters to absorb unobserved common factors.

notable suppresses the coefficient tables.

noconstant suppresses the constant term.

Examples

Setup: generate simulated panel data for testing

. clear

. set seed 12345

. set obs 50

. gen id = _n

. expand 100

. bysort id: gen t = _n

. xtset id t

. gen x1 = rnormal()

. gen x2 = rnormal()

. bysort t: egen f = mean(rnormal())

. gen y = 0.5*L.y + 1.0*x1 + 0.5*x2 + 0.3*f + rnormal() if t > 1

. gen dy = D.y

. gen dx1 = D.x1

. gen dx2 = D.x2

Example 1: QCCEMG at median

. xtcspqardl y x1 x2, tau(0.5) qccemg

Example 2: QCCEMG at multiple quantiles

. xtcspqardl y x1 x2, tau(0.25 0.5 0.75) qccemg

Example 3: CS-PQARDL with long-run specification

. xtcspqardl dy dx1 dx2, lr(L.y x1 x2) tau(0.25 0.5 0.75)

Example 4: CS-PQARDL with ECM reparameterization

. xtcspqardl dy dx1 dx2, lr(L.y x1 x2) tau(0.5) ecm

Example 5: QCCEMG with custom CSA lags

. xtcspqardl y x1 x2, tau(0.25 0.5 0.75) qccemg cr_lags(3)

Example 6: Post-estimation access

. xtcspqardl y x1 x2, tau(0.5) qccemg

. ereturn list

. matrix list e(lambda_mg)

. matrix list e(theta_mg)

Example 7: QCCEPMG at median

. xtcspqardl y x1 x2, tau(0.5) qccepmg

Example 8: QCCEPMG at multiple quantiles with CSA display

. xtcspqardl y x1 x2, tau(0.25 0.5 0.75) qccepmg showcsa

Stored results

xtcspqardl stores the following in e():

When estimator is QCCEMG or QCCEPMG:

Scalars

e(N) number of observations

e(n_g) number of panels

e(valid_panels) number of panels successfully estimated

e(k) number of independent variables

e(ntau) number of quantiles

e(cr_lags) number of CSA lags

e(avg_T) average time periods per panel

Macros

e(cmd) xtcspqardl

e(estimator) qccemg or qccepmg

e(depvar) dependent variable name

e(indepvars) independent variable names

Matrices

e(lambda_mg) MG autoregressive coefficient lambda(tau)

e(lambda_V) variance of lambda_mg

e(beta_mg) MG contemporaneous coefficients beta(tau)

e(beta_V) variance-covariance of beta_mg

e(theta_mg) MG long-run effects theta_j(tau) = beta_j/(1-lambda)

e(halflife_mg) MG half-life by quantile

e(lambda_all) panel-specific lambda (N x ntau)

e(beta_all) panel-specific beta (N x k*ntau)

When estimator is CS-PQARDL:

Scalars

e(N) number of observations

e(n_g) number of panels

e(valid_panels) panels successfully estimated

e(p) AR lag order

e(k) number of short-run independent variables

e(k_lr) number of long-run regressors

e(ntau) number of quantiles

e(cr_lags) CSA lag order

Matrices

e(beta_mg) MG long-run cointegrating coefficients

e(beta_V) variance of beta_mg

e(rho_mg) MG speed of adjustment rho(tau)

e(rho_V) variance of rho_mg

e(halflife_mg) MG half-life

e(phi_mg) MG AR lag coefficients

e(sr_mg) MG short-run impact coefficients

e(csa_coef_mg) MG CSA nuisance coefficients

e(beta_all) panel-specific long-run coefficients

e(rho_all) panel-specific speed of adjustment

References

Harding, M., Lamarche, C., and Pesaran, M.H. (2018).
Common correlated effects estimation of heterogeneous dynamic panel quantile regression models.
Journal of Applied Econometrics, 35(3), 294-314.
https://doi.org/10.1002/jae.2753

Pesaran, M.H. (2006).
Estimation and inference in large heterogeneous panels with a multifactor error structure.
Econometrica, 74(4), 967-1012.

Chudik, A. and Pesaran, M.H. (2015).
Common correlated effects estimation of heterogeneous dynamic panel data models with weakly exogenous regressors.
Journal of Econometrics, 188(2), 393-420.

Cho, J.S., Kim, T., and Shin, Y. (2015).
Quantile cointegration in the autoregressive distributed-lag modeling framework.
Journal of Econometrics, 188(1), 281-300.

Pesaran, M.H., Shin, Y., and Smith, R.P. (1999).
Pooled mean group estimation of dynamic heterogeneous panels.
Journal of the American Statistical Association, 94(446), 621-634.

Pesaran, M.H. and Smith, R.P. (1995).
Estimating long-run relationships from dynamic heterogeneous panels.
Journal of Econometrics, 68(1), 79-113.

Koenker, R. and Bassett, G. (1978).
Regression quantiles.
Econometrica, 46(1), 33-50.

Ul-Durar, S., Bakkar, Y., Arshed, N., Naveed, S., and Zhang, B. (2025).
FinTech and economic readiness: Institutional navigation amid climate risks.
Research in International Business and Finance, 73, 102543.

Requirements

Stata 15.1 or later.

Author

Dr Merwan Roudane

Email: merwanroudane920@gmail.com

Please cite this package as:

Roudane, M. (2026). XTCSPQARDL: Stata module for Cross-Sectionally Augmented
Panel Quantile ARDL and Quantile CCE Mean Group estimation.