| Title: | Cross-Sectionally Augmented Panel Quantile ARDL |
|---|---|
| Description: | Implements the Cross-Sectionally Augmented Panel Quantile Autoregressive Distributed Lag (CS-PQARDL) model and the Quantile Common Correlated Effects Mean Group (QCCEMG) estimator for panel data with cross-sectional dependence. The package handles unobserved common factors through cross-sectional averages following Pesaran (2006) <doi:10.1111/j.1468-0262.2006.00692.x> and Chudik and Pesaran (2015) <doi:10.1016/j.jeconom.2015.03.007>. Quantile regression for dynamic panels follows Harding, Lamarche, and Pesaran (2018) <doi:10.1016/j.jeconom.2018.07.010>. The ARDL approach to cointegration testing is based on Pesaran, Shin, and Smith (2001) <doi:10.1002/jae.616>. |
| Authors: | Muhammad Alkhalaf [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-2677-9246>) |
| Maintainer: | Muhammad Alkhalaf <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.2 |
| Built: | 2026-05-28 07:22:14 UTC |
| Source: | https://github.com/muhammedalkhalaf/xtcspqardl |
Extract coefficients from xtcspqardl object
## S3 method for class 'xtcspqardl' coef(object, tau = NULL, type = "short_run", ...)## S3 method for class 'xtcspqardl' coef(object, tau = NULL, type = "short_run", ...)
object |
An object of class |
tau |
Optional quantile(s) to extract. If NULL, returns all. |
type |
Character; |
... |
Additional arguments (ignored). |
Named numeric vector or list of coefficients.
Computes cross-sectional averages (CSA) of all variables at each time period, following the CCE approach of Pesaran (2006).
compute_csa(data, id, time, depvar, indepvars, cr_lags = 0)compute_csa(data, id, time, depvar, indepvars, cr_lags = 0)
data |
Data frame with panel data. |
id |
Character string naming the cross-sectional identifier. |
time |
Character string naming the time variable. |
depvar |
Character string naming the dependent variable. |
indepvars |
Character vector of independent variable names. |
cr_lags |
Integer number of lags for CSA (Chudik & Pesaran, 2015). |
Cross-sectional averages are computed as:
for each variable in .
Following Chudik and Pesaran (2015), lagged CSA are included with
default lag order floor(T^{1/3}).
A list containing:
data |
Data frame with CSA columns added. |
csa_vars |
Character vector of CSA variable names. |
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. doi:10.1016/j.jeconom.2015.03.007
Pesaran, M.H. (2006). Estimation and Inference in Large Heterogeneous Panels with a Multifactor Error Structure. Econometrica, 74(4), 967-1012. doi:10.1111/j.1468-0262.2006.00692.x
Fitted values from xtcspqardl model
## S3 method for class 'xtcspqardl' fitted(object, ...)## S3 method for class 'xtcspqardl' fitted(object, ...)
object |
An object of class |
... |
Additional arguments (ignored). |
This function is not yet implemented for xtcspqardl objects.
Print method for summary.xtcspqardl
## S3 method for class 'summary.xtcspqardl' print(x, digits = 4, signif.stars = TRUE, ...)## S3 method for class 'summary.xtcspqardl' print(x, digits = 4, signif.stars = TRUE, ...)
x |
An object of class |
digits |
Number of significant digits. |
signif.stars |
Logical; print significance stars. |
... |
Additional arguments (ignored). |
Invisibly returns the input object.
Print method for xtcspqardl objects
## S3 method for class 'xtcspqardl' print(x, ...)## S3 method for class 'xtcspqardl' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored). |
Invisibly returns the input object.
Residuals from xtcspqardl model
## S3 method for class 'xtcspqardl' residuals(object, ...)## S3 method for class 'xtcspqardl' residuals(object, ...)
object |
An object of class |
... |
Additional arguments (ignored). |
This function is not yet implemented for xtcspqardl objects.
Summary method for xtcspqardl objects
## S3 method for class 'xtcspqardl' summary(object, ...)## S3 method for class 'xtcspqardl' summary(object, ...)
object |
An object of class |
... |
Additional arguments (ignored). |
An object of class "summary.xtcspqardl".
Extract variance-covariance matrix from xtcspqardl object
## S3 method for class 'xtcspqardl' vcov(object, tau = NULL, ...)## S3 method for class 'xtcspqardl' vcov(object, tau = NULL, ...)
object |
An object of class |
tau |
Optional quantile to extract. If NULL, returns all. |
... |
Additional arguments (ignored). |
Variance-covariance matrix or list of matrices.
Estimates the Cross-Sectionally Augmented Panel Quantile ARDL (CS-PQARDL) model or the Quantile Common Correlated Effects Mean Group (QCCEMG/QCCEPMG) estimator for panel data with cross-sectional dependence.
xtcspqardl( formula, data, id, time, tau = 0.5, estimator = c("qccemg", "qccepmg", "cspqardl"), p = 1L, q = 1L, cr_lags = NULL, constant = TRUE, model = c("pmg", "mg", "dfe") )xtcspqardl( formula, data, id, time, tau = 0.5, estimator = c("qccemg", "qccepmg", "cspqardl"), p = 1L, q = 1L, cr_lags = NULL, constant = TRUE, model = c("pmg", "mg", "dfe") )
formula |
A formula of the form
|
data |
A data frame containing panel data. |
id |
Character string naming the cross-sectional unit identifier. |
time |
Character string naming the time variable. |
tau |
Numeric vector of quantiles to estimate (between 0 and 1). |
estimator |
Character string specifying the estimator:
|
p |
Integer specifying the number of lags for the dependent variable (default 1, for CS-PQARDL). |
q |
Integer or vector specifying the number of lags for each regressor (default 1, for CS-PQARDL). |
cr_lags |
Integer specifying the number of lags for cross-sectional
averages. Default is |
constant |
Logical; if |
model |
Character string for CS-PQARDL pooling:
|
The package implements two main estimators for panel quantile regression with cross-sectional dependence:
QCCEMG (Quantile CCE Mean Group): Estimates unit-by-unit quantile regressions augmented with cross-sectional averages, then aggregates using mean group estimator. The model is:
where contains cross-sectional averages of and
.
CS-PQARDL (CS Panel Quantile ARDL): Extends the ARDL approach to cointegration (Pesaran, Shin & Smith, 2001) to quantile regression with CCE augmentation. Estimates error-correction form with long-run relationships.
Cross-sectional dependence is handled through the CCE approach (Pesaran,
2006), which augments regressions with cross-sectional averages of all
variables. Lagged CSA follow Chudik & Pesaran (2015) with default
floor(T^{1/3}) lags.
An object of class "xtcspqardl" containing:
coefficients |
Mean group coefficients across panels. |
se |
Standard errors using mean group variance. |
vcov |
Variance-covariance matrix. |
individual |
List of unit-specific estimates. |
long_run |
Long-run coefficient estimates. |
speed_adj |
Speed of adjustment coefficients. |
half_life |
Half-life of adjustment. |
tau |
Quantiles estimated. |
call |
The matched call. |
formula |
The formula used. |
n_panels |
Number of panels. |
n_obs |
Total observations. |
avg_T |
Average time periods per panel. |
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. doi:10.1016/j.jeconom.2015.03.007
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. doi:10.1016/j.jeconom.2018.07.010
Pesaran, M.H. (2006). Estimation and Inference in Large Heterogeneous Panels with a Multifactor Error Structure. Econometrica, 74(4), 967-1012. doi:10.1111/j.1468-0262.2006.00692.x
Pesaran, M.H., Shin, Y., and Smith, R.J. (2001). Bounds Testing Approaches to the Analysis of Level Relationships. Journal of Applied Econometrics, 16(3), 289-326. doi:10.1002/jae.616
# Generate example 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), y = 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) } # QCCEMG estimation fit <- xtcspqardl(y ~ x, data = data, id = "id", time = "time", tau = c(0.25, 0.50, 0.75), estimator = "qccemg") summary(fit)# Generate example 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), y = 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) } # QCCEMG estimation fit <- xtcspqardl(y ~ x, data = data, id = "id", time = "time", tau = c(0.25, 0.50, 0.75), estimator = "qccemg") summary(fit)