| Type: | Package |
| Title: | Panel Quantile Autoregressive Distributed Lag Model |
| Version: | 1.0.1 |
| Date: | 2026-02-20 |
| Description: | Estimation of Panel Quantile Autoregressive Distributed Lag (PQARDL) models that combine panel ARDL methodology with quantile regression. Supports Pooled Mean Group (PMG), Mean Group (MG), and Dynamic Fixed Effects (DFE) estimators across multiple quantiles. Computes long-run cointegrating parameters, error correction term speed of adjustment, half-life of adjustment, and performs Wald tests for parameter equality across quantiles. Based on the econometric frameworks of Pesaran, Shin, and Smith (1999) <doi:10.1080/01621459.1999.10474156>, Cho, Kim, and Shin (2015) <doi:10.1016/j.jeconom.2015.02.030>, and Bildirici and Kayikci (2022) <doi:10.1016/j.energy.2022.124303>. |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| LazyData: | true |
| Depends: | R (≥ 3.5.0) |
| Imports: | stats, quantreg |
| Suggests: | testthat (≥ 3.0.0) |
| RoxygenNote: | 7.3.3 |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-03-07 13:56:08 UTC; acad_ |
| Author: | Muhammad Alkhalaf |
| Maintainer: | Muhammad Alkhalaf <muhammedalkhalaf@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-03-12 08:10:03 UTC |
Panel Quantile Autoregressive Distributed Lag Model
Description
The xtpqardl package provides functions for estimating Panel Quantile Autoregressive Distributed Lag (PQARDL) models. It combines the panel ARDL methodology of Pesaran, Shin, and Smith (1999) with quantile regression to allow for heterogeneous effects across the conditional distribution of the response variable.
Details
The main function is xtpqardl, which estimates PQARDL models
using Pooled Mean Group (PMG), Mean Group (MG), or Dynamic Fixed Effects
(DFE) estimators. Key features include:
Estimation at multiple quantiles simultaneously
Long-run cointegrating parameter estimation
Error correction term (ECT) speed of adjustment
Half-life of adjustment computation
Wald tests for parameter equality across quantiles
Impulse response function computation
Automatic lag selection using BIC or AIC
Main Functions
-
xtpqardl: Estimate PQARDL model -
summary.xtpqardl: Detailed results summary -
wald_test: Test parameter equality across quantiles -
compute_irf: Compute impulse response function
Author(s)
Merwan Roudane merwanroudane920@gmail.com
References
Pesaran MH, Shin Y, Smith RP (1999). "Pooled Mean Group Estimation of Dynamic Heterogeneous Panels." Journal of the American Statistical Association, 94(446), 621-634. doi:10.1080/01621459.1999.10474156
Cho JS, Kim TH, Shin Y (2015). "Quantile Cointegration in the Autoregressive Distributed-Lag Modeling Framework." Journal of Econometrics, 188(1), 281-300. doi:10.1016/j.jeconom.2015.02.030
Bildirici M, Kayikci F (2022). "Uncertainty, Renewable Energy, and CO2 Emissions in Top Renewable Energy Countries: A Panel Quantile Regression Approach." Energy, 247, 124303. doi:10.1016/j.energy.2022.124303
Koenker R, Bassett G (1978). "Regression Quantiles." Econometrica, 46(1), 33-50. doi:10.2307/1913643
Coefficients Method for xtpqardl Objects
Description
Extract estimated coefficients from a Panel Quantile ARDL model.
Usage
## S3 method for class 'xtpqardl'
coef(object, type = c("beta", "rho", "all"), ...)
Arguments
object |
An object of class |
type |
Character string specifying which coefficients to extract:
|
... |
Additional arguments (currently unused). |
Value
A named numeric vector or list of coefficients.
Examples
data(pqardl_sample)
fit <- xtpqardl(
formula = d_y ~ d_x1 + d_x2,
data = pqardl_sample,
id = "country",
time = "year",
lr = c("L_y", "x1", "x2"),
tau = c(0.25, 0.50, 0.75)
)
coef(fit)
coef(fit, type = "rho")
Compute Impulse Response Function
Description
Computes the impulse response function (IRF) for Panel Quantile ARDL models, showing the response to a one-unit shock via the error correction mechanism.
Usage
compute_irf(object, horizon = 20)
Arguments
object |
An object of class |
horizon |
Integer specifying the number of periods for the IRF. Default is 20. |
Details
The IRF for the error correction model is computed as:
IRF_t(\tau) = (1 + \rho(\tau))^t
which shows the decay of a unit shock over time through the error
correction mechanism. Values approach zero as t \to \infty when
-1 < \rho(\tau) < 0.
Value
A matrix with rows representing time periods and columns representing quantiles. Each entry shows the response at that period for that quantile.
Examples
data(pqardl_sample)
fit <- xtpqardl(
formula = d_y ~ d_x1 + d_x2,
data = pqardl_sample,
id = "country",
time = "year",
lr = c("L_y", "x1", "x2"),
tau = c(0.25, 0.50, 0.75)
)
irf <- compute_irf(fit, horizon = 15)
print(irf)
Simulated Panel Data for PQARDL Estimation
Description
A simulated panel dataset for demonstrating Panel Quantile ARDL estimation. Contains 10 countries observed over 30 years with variables suitable for error correction modeling.
Usage
pqardl_sample
Format
A data frame with 300 rows and 9 variables:
- country
Factor indicating the panel unit (10 countries)
- year
Integer year variable (1990-2019)
- y
Dependent variable in levels (e.g., GDP per capita)
- x1
First explanatory variable in levels (e.g., investment)
- x2
Second explanatory variable in levels (e.g., trade openness)
- L_y
Lagged dependent variable (y at t-1)
- d_y
First difference of y
- d_x1
First difference of x1
- d_x2
First difference of x2
Details
The data are simulated from a panel error correction model with heterogeneous adjustment speeds across countries. The true long-run relationship is:
y_{it} = \beta_1 x_{1,it} + \beta_2 x_{2,it} + \mu_i + \varepsilon_{it}
with error correction dynamics:
\Delta y_{it} = \rho_i (y_{i,t-1} - \beta_1 x_{1,i,t-1} - \beta_2 x_{2,i,t-1})
+ \gamma_1 \Delta x_{1,it} + \gamma_2 \Delta x_{2,it} + u_{it}
where \rho_i \sim U(-0.6, -0.2) varies by panel.
Source
Simulated data for package demonstration.
Examples
data(pqardl_sample)
head(pqardl_sample)
# Check panel structure
table(pqardl_sample$country)
Print Method for irf.xtpqardl Objects
Description
Print Method for irf.xtpqardl Objects
Usage
## S3 method for class 'irf.xtpqardl'
print(x, ...)
Arguments
x |
An object of class |
... |
Additional arguments (currently unused). |
Value
Invisibly returns the input object.
Print Method for summary.xtpqardl Objects
Description
Print Method for summary.xtpqardl Objects
Usage
## S3 method for class 'summary.xtpqardl'
print(x, digits = 4, ...)
Arguments
x |
An object of class |
digits |
Number of significant digits to display. Default is 4. |
... |
Additional arguments (currently unused). |
Value
Invisibly returns the input object.
Print Method for wald_test.xtpqardl Objects
Description
Print Method for wald_test.xtpqardl Objects
Usage
## S3 method for class 'wald_test.xtpqardl'
print(x, ...)
Arguments
x |
An object of class |
... |
Additional arguments (currently unused). |
Value
Invisibly returns the input object.
Print Method for xtpqardl Objects
Description
Print Method for xtpqardl Objects
Usage
## S3 method for class 'xtpqardl'
print(x, ...)
Arguments
x |
An object of class |
... |
Additional arguments (currently unused). |
Value
Invisibly returns the input object.
Summary Method for xtpqardl Objects
Description
Produces a detailed summary of Panel Quantile ARDL estimation results, including long-run coefficients, ECT speed of adjustment, half-life of adjustment, and short-run parameters by quantile.
Usage
## S3 method for class 'xtpqardl'
summary(object, ...)
Arguments
object |
An object of class |
... |
Additional arguments (currently unused). |
Value
An object of class "summary.xtpqardl" containing formatted
tables of results.
Examples
data(pqardl_sample)
fit <- xtpqardl(
formula = d_y ~ d_x1 + d_x2,
data = pqardl_sample,
id = "country",
time = "year",
lr = c("L_y", "x1", "x2"),
tau = c(0.25, 0.50, 0.75)
)
summary(fit)
Variance-Covariance Matrix for xtpqardl Objects
Description
Extract the variance-covariance matrix of the estimated parameters.
Usage
## S3 method for class 'xtpqardl'
vcov(object, type = c("beta", "rho"), ...)
Arguments
object |
An object of class |
type |
Character string specifying which covariance matrix to extract:
|
... |
Additional arguments (currently unused). |
Value
A variance-covariance matrix.
Wald Test for Parameter Equality Across Quantiles
Description
Performs Wald tests for the null hypothesis that parameters are equal across different quantiles. Tests both long-run coefficients (beta) and ECT speed of adjustment (rho).
Usage
wald_test(object, joint = TRUE)
## S3 method for class 'xtpqardl'
wald_test(object, joint = TRUE)
Arguments
object |
An object of class |
joint |
Logical. If |
Details
The Wald test statistic is computed as:
W = (R\theta)'[R V R']^{-1}(R\theta)
where \theta is the vector of coefficients, V is the
variance-covariance matrix, and R is a restriction matrix testing
equality of coefficients across quantiles.
Under the null hypothesis of equal coefficients, W follows a
chi-squared distribution with degrees of freedom equal to the number of
restrictions.
Value
An object of class "wald_test.xtpqardl" containing:
- beta_test
Wald test result for long-run coefficients
- rho_test
Wald test result for ECT coefficients
- individual_beta
Individual tests for each long-run variable (if joint = FALSE)
- tau
Quantiles tested
References
Koenker R, Bassett G (1982). "Tests of Linear Hypotheses and L1 Estimation." Econometrica, 50(6), 1577-1583. doi:10.2307/1913398
Examples
data(pqardl_sample)
fit <- xtpqardl(
formula = d_y ~ d_x1 + d_x2,
data = pqardl_sample,
id = "country",
time = "year",
lr = c("L_y", "x1", "x2"),
tau = c(0.25, 0.50, 0.75)
)
wald_test(fit)
Panel Quantile Autoregressive Distributed Lag Model
Description
Estimate Panel Quantile ARDL (PQARDL) models that combine panel ARDL methodology with quantile regression. Supports Pooled Mean Group (PMG), Mean Group (MG), and Dynamic Fixed Effects (DFE) estimators.
Usage
xtpqardl(
formula,
data,
id,
time,
lr,
tau = c(0.25, 0.5, 0.75),
p = 1,
q = 1,
model = c("pmg", "mg", "dfe"),
lagsel = NULL,
pmax = 4,
qmax = 4,
constant = TRUE
)
Arguments
formula |
A formula specifying the model. The response variable should
be in first differences (e.g., |
data |
A data frame containing panel data with variables specified in
the formula and |
id |
Character string specifying the panel (cross-section) identifier variable name. |
time |
Character string specifying the time variable name. |
lr |
Character vector of long-run level variable names. The first element should be the lagged dependent variable level (for the error correction term), and remaining elements are the long-run explanatory variables. |
tau |
Numeric vector of quantiles to estimate, each in (0,1).
Default is |
p |
Integer specifying the autoregressive lag order for the dependent variable. Default is 1. |
q |
Integer or integer vector specifying the distributed lag order(s) for explanatory variables. If a single integer, the same lag order is applied to all variables. Default is 1. |
model |
Character string specifying the estimation method:
|
lagsel |
Character string for automatic lag selection. If |
pmax |
Maximum p to consider in lag selection. Default is 4. |
qmax |
Maximum q to consider in lag selection. Default is 4. |
constant |
Logical. Include a constant term? Default is |
Details
The PQARDL model extends the standard panel ARDL framework to allow for heterogeneous effects across the conditional distribution of the response variable. The error correction representation is:
\Delta y_{it} = \rho_i(\tau) \cdot ECT_{i,t-1} + \sum_{j=1}^{p-1}
\phi_{ij} \Delta y_{i,t-j} + \sum_{m=0}^{q-1} \theta_{im} \Delta x_{i,t-m}
+ \varepsilon_{it}(\tau)
where ECT_{i,t-1} = y_{i,t-1} - \beta(\tau)' X_{i,t-1} is the error
correction term, \rho(\tau) is the speed of adjustment (should be
negative for convergence), and \beta(\tau) are the long-run
cointegrating parameters.
Value
An object of class "xtpqardl" containing:
- beta_mg
Matrix of mean group long-run coefficients across quantiles
- rho_mg
Vector of mean group ECT speed of adjustment by quantile
- halflife_mg
Vector of mean group half-life of adjustment by quantile
- sr_mg
Matrix of mean group short-run coefficients
- phi_mg
Matrix of mean group AR coefficients (if p > 1)
- beta_V
Variance-covariance matrix for beta_mg
- rho_V
Variance-covariance matrix for rho_mg
- beta_all
Matrix of per-panel long-run coefficients
- rho_all
Matrix of per-panel ECT coefficients
- halflife_all
Matrix of per-panel half-life values
- tau
Vector of estimated quantiles
- p
AR lag order used
- q
Distributed lag order(s) used
- model
Estimation method used
- n_obs
Total number of observations
- n_panels
Number of panels
- valid_panels
Number of successfully estimated panels
- depvar
Dependent variable name
- lrvars
Long-run variable names
- call
The matched call
References
Pesaran MH, Shin Y, Smith RP (1999). "Pooled Mean Group Estimation of Dynamic Heterogeneous Panels." Journal of the American Statistical Association, 94(446), 621-634. doi:10.1080/01621459.1999.10474156
Cho JS, Kim TH, Shin Y (2015). "Quantile Cointegration in the Autoregressive Distributed-Lag Modeling Framework." Journal of Econometrics, 188(1), 281-300. doi:10.1016/j.jeconom.2015.02.030
Bildirici M, Kayikci F (2022). "Uncertainty, Renewable Energy, and CO2 Emissions in Top Renewable Energy Countries: A Panel Quantile Regression Approach." Energy, 247, 124303. doi:10.1016/j.energy.2022.124303
Koenker R, Bassett G (1978). "Regression Quantiles." Econometrica, 46(1), 33-50. doi:10.2307/1913643
Examples
# Load example panel data
data(pqardl_sample)
# Estimate PQARDL model at 25th, 50th, and 75th quantiles
fit <- xtpqardl(
formula = d_y ~ d_x1 + d_x2,
data = pqardl_sample,
id = "country",
time = "year",
lr = c("L_y", "x1", "x2"),
tau = c(0.25, 0.50, 0.75),
model = "pmg"
)
# View results
summary(fit)
# Wald test for parameter equality across quantiles
wald_test(fit)