| Title: | Panel Quantile Autoregressive Distributed Lag Model |
|---|---|
| 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>. |
| 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.1 |
| Built: | 2026-05-28 07:21:21 UTC |
| Source: | https://github.com/muhammedalkhalaf/xtpqardl |
Extract estimated coefficients from a Panel Quantile ARDL model.
## S3 method for class 'xtpqardl' coef(object, type = c("beta", "rho", "all"), ...)## S3 method for class 'xtpqardl' coef(object, type = c("beta", "rho", "all"), ...)
object |
An object of class |
type |
Character string specifying which coefficients to extract:
|
... |
Additional arguments (currently unused). |
A named numeric vector or list of coefficients.
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")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")
Computes the impulse response function (IRF) for Panel Quantile ARDL models, showing the response to a one-unit shock via the error correction mechanism.
compute_irf(object, horizon = 20)compute_irf(object, horizon = 20)
object |
An object of class |
horizon |
Integer specifying the number of periods for the IRF. Default is 20. |
The IRF for the error correction model is computed as:
which shows the decay of a unit shock over time through the error
correction mechanism. Values approach zero as when
.
A matrix with rows representing time periods and columns representing quantiles. Each entry shows the response at that period for that quantile.
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)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)
A simulated panel dataset for demonstrating Panel Quantile ARDL estimation. Contains 10 countries observed over 30 years with variables suitable for error correction modeling.
pqardl_samplepqardl_sample
A data frame with 300 rows and 9 variables:
Factor indicating the panel unit (10 countries)
Integer year variable (1990-2019)
Dependent variable in levels (e.g., GDP per capita)
First explanatory variable in levels (e.g., investment)
Second explanatory variable in levels (e.g., trade openness)
Lagged dependent variable (y at t-1)
First difference of y
First difference of x1
First difference of x2
The data are simulated from a panel error correction model with heterogeneous adjustment speeds across countries. The true long-run relationship is:
with error correction dynamics:
where varies by panel.
Simulated data for package demonstration.
data(pqardl_sample) head(pqardl_sample) # Check panel structure table(pqardl_sample$country)data(pqardl_sample) head(pqardl_sample) # Check panel structure table(pqardl_sample$country)
Print Method for irf.xtpqardl Objects
## S3 method for class 'irf.xtpqardl' print(x, ...)## S3 method for class 'irf.xtpqardl' print(x, ...)
x |
An object of class |
... |
Additional arguments (currently unused). |
Invisibly returns the input object.
Print Method for summary.xtpqardl Objects
## S3 method for class 'summary.xtpqardl' print(x, digits = 4, ...)## S3 method for class 'summary.xtpqardl' print(x, digits = 4, ...)
x |
An object of class |
digits |
Number of significant digits to display. Default is 4. |
... |
Additional arguments (currently unused). |
Invisibly returns the input object.
Print Method for wald_test.xtpqardl Objects
## S3 method for class 'wald_test.xtpqardl' print(x, ...)## S3 method for class 'wald_test.xtpqardl' print(x, ...)
x |
An object of class |
... |
Additional arguments (currently unused). |
Invisibly returns the input object.
Print Method for xtpqardl Objects
## S3 method for class 'xtpqardl' print(x, ...)## S3 method for class 'xtpqardl' print(x, ...)
x |
An object of class |
... |
Additional arguments (currently unused). |
Invisibly returns the input object.
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.
## S3 method for class 'xtpqardl' summary(object, ...)## S3 method for class 'xtpqardl' summary(object, ...)
object |
An object of class |
... |
Additional arguments (currently unused). |
An object of class "summary.xtpqardl" containing formatted
tables of results.
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)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)
Extract the variance-covariance matrix of the estimated parameters.
## S3 method for class 'xtpqardl' vcov(object, type = c("beta", "rho"), ...)## S3 method for class 'xtpqardl' vcov(object, type = c("beta", "rho"), ...)
object |
An object of class |
type |
Character string specifying which covariance matrix to extract:
|
... |
Additional arguments (currently unused). |
A variance-covariance matrix.
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).
wald_test(object, joint = TRUE) ## S3 method for class 'xtpqardl' wald_test(object, joint = TRUE)wald_test(object, joint = TRUE) ## S3 method for class 'xtpqardl' wald_test(object, joint = TRUE)
object |
An object of class |
joint |
Logical. If |
The Wald test statistic is computed as:
where is the vector of coefficients, is the
variance-covariance matrix, and is a restriction matrix testing
equality of coefficients across quantiles.
Under the null hypothesis of equal coefficients, follows a
chi-squared distribution with degrees of freedom equal to the number of
restrictions.
An object of class "wald_test.xtpqardl" containing:
Wald test result for long-run coefficients
Wald test result for ECT coefficients
Individual tests for each long-run variable (if joint = FALSE)
Quantiles tested
Koenker R, Bassett G (1982). "Tests of Linear Hypotheses and L1 Estimation." Econometrica, 50(6), 1577-1583. doi:10.2307/1913398
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)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)
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.
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 )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 )
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 |
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:
where is the error
correction term, is the speed of adjustment (should be
negative for convergence), and are the long-run
cointegrating parameters.
An object of class "xtpqardl" containing:
Matrix of mean group long-run coefficients across quantiles
Vector of mean group ECT speed of adjustment by quantile
Vector of mean group half-life of adjustment by quantile
Matrix of mean group short-run coefficients
Matrix of mean group AR coefficients (if p > 1)
Variance-covariance matrix for beta_mg
Variance-covariance matrix for rho_mg
Matrix of per-panel long-run coefficients
Matrix of per-panel ECT coefficients
Matrix of per-panel half-life values
Vector of estimated quantiles
AR lag order used
Distributed lag order(s) used
Estimation method used
Total number of observations
Number of panels
Number of successfully estimated panels
Dependent variable name
Long-run variable names
The matched call
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
# 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)# 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)