| Title: | Durbin-Hausman Panel Cointegration Tests |
|---|---|
| Description: | Implements the Durbin-Hausman panel cointegration tests of Westerlund (2008) <doi:10.1002/jae.963>. The tests are robust to cross-sectional dependence through common factor extraction using principal components. Provides both group-mean (DHg) and panel (DHp) test statistics with automatic factor number selection via information criteria. |
| Authors: | Muhammad Alkhalaf [aut, cre, cph] (ORCID: <https://orcid.org/0009-0002-2677-9246>), Joakim Westerlund [ctb] (Original GAUSS code author) |
| Maintainer: | Muhammad Alkhalaf <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.1 |
| Built: | 2026-05-28 07:22:42 UTC |
| Source: | https://github.com/muhammedalkhalaf/xtdhcoint |
Extracts the test statistics from the Durbin-Hausman test.
## S3 method for class 'xtdhcoint' coef(object, ...)## S3 method for class 'xtdhcoint' coef(object, ...)
object |
An object of class |
... |
Additional arguments (currently ignored). |
Named numeric vector of z-statistics and p-values.
Simulated panel dataset for testing the Fisher effect (cointegration between inflation and nominal interest rates). The data are generated with cointegration and common factors, suitable for demonstrating the Durbin-Hausman panel cointegration tests.
fisher_panelfisher_panel
A data frame with 1000 observations and 4 variables:
Character. Country identifier (Country01 through Country20).
Integer. Year (1970-2019).
Numeric. Annual inflation rate (percent).
Numeric. Nominal interest rate (percent).
The data are simulated according to:
where are common factors, are factor loadings,
and is a stationary cointegration error (under cointegration).
The cointegrating coefficient is approximately 1, consistent
with the Fisher hypothesis.
Simulated data.
data(fisher_panel) head(fisher_panel) table(fisher_panel$country)data(fisher_panel) head(fisher_panel) table(fisher_panel$country)
Prints the results of the Durbin-Hausman panel cointegration test.
## S3 method for class 'xtdhcoint' print(x, ...)## S3 method for class 'xtdhcoint' print(x, ...)
x |
An object of class |
... |
Additional arguments (currently ignored). |
Invisibly returns the input object.
Provides a detailed summary of Durbin-Hausman test results with decision tables at various significance levels.
## S3 method for class 'xtdhcoint' summary(object, level = 0.95, ...)## S3 method for class 'xtdhcoint' summary(object, level = 0.95, ...)
object |
An object of class |
level |
Numeric. Confidence level for hypothesis testing. Default is 0.95. |
... |
Additional arguments (currently ignored). |
Invisibly returns a list with summary statistics.
Performs the Durbin-Hausman panel cointegration tests of Westerlund (2008). The tests are robust to cross-sectional dependence through common factor extraction using principal components.
xtdhcoint( formula, data, id, time, kmax = 5, criterion = c("ic", "pc", "aic", "bic"), penalty = 1, bandwidth = -1, predet = 0, constant = TRUE )xtdhcoint( formula, data, id, time, kmax = 5, criterion = c("ic", "pc", "aic", "bic"), penalty = 1, bandwidth = -1, predet = 0, constant = TRUE )
formula |
A formula specifying the cointegrating relationship
(e.g., |
data |
A data frame containing panel data. |
id |
Character string naming the cross-sectional unit identifier. |
time |
Character string naming the time period identifier. |
kmax |
Integer. Maximum number of common factors to consider. Default is 5. |
criterion |
Character string specifying the information criterion for
factor number selection. One of |
penalty |
Integer. Penalty type for factor selection (1, 2, or 3). Default is 1. |
bandwidth |
Integer. Kernel bandwidth for long-run variance estimation. If -1 (default), automatic bandwidth selection using Newey-West rule. |
predet |
Numeric. If non-zero, uses predetermined coefficient instead of OLS estimation. Default is 0 (estimate via OLS). |
constant |
Logical. If TRUE (default), includes a constant term. |
The Durbin-Hausman tests examine the null hypothesis of no cointegration against the alternative of cointegration. The tests are based on comparing OLS and instrumental variable estimators of the autoregressive parameter in the cumulated residuals.
DHg (Group-mean statistic): Tests the null of no cointegration against the heterogeneous alternative that at least some units are cointegrated. Under the null, the standardized statistic is asymptotically N(0,1).
DHp (Panel statistic): Tests the null of no cointegration against the homogeneous alternative that all units are cointegrated with a common autoregressive parameter. Under the null, the standardized statistic is asymptotically N(0,1).
Both statistics are computed using right-tail critical values. Large positive values indicate evidence of cointegration.
Cross-sectional dependence is handled by extracting common factors from the first-differenced residuals using principal components. The number of factors is selected automatically using information criteria.
An object of class "xtdhcoint" containing:
Raw DHg (group-mean) statistic.
Raw DHp (panel) statistic.
Standardized DHg z-statistic.
Standardized DHp z-statistic.
P-value for DHg (right-tail).
P-value for DHp (right-tail).
Estimated number of common factors.
Number of cross-sectional units.
Number of time periods.
Bandwidth used.
Information criterion used.
The matched call.
Westerlund, J. (2008). Panel cointegration tests of the Fisher effect. Journal of Applied Econometrics, 23(2), 193–233. doi:10.1002/jae.963
# Load example data data(fisher_panel) # Basic test with default settings result <- xtdhcoint(inflation ~ interest, data = fisher_panel, id = "country", time = "year") print(result) summary(result)# Load example data data(fisher_panel) # Basic test with default settings result <- xtdhcoint(inflation ~ interest, data = fisher_panel, id = "country", time = "year") print(result) summary(result)