| xtbreakcoint | R Documentation |
Implements the panel cointegration test of Banerjee and Carrion-i-Silvestre (2015), allowing for structural breaks and cross-section dependence through common factors.
xtbreakcoint(
formula,
data,
id,
time,
model = "trendshift",
max_factors = 5,
max_lag = 4,
lag_method = c("auto", "fixed"),
trim = 0.15,
max_iter = 20,
tolerance = 0.001
)
formula |
A formula of the form |
data |
A data frame containing panel data with columns for the panel identifier, time identifier, and all variables in the formula. |
id |
Character string naming the panel (cross-section) identifier. |
time |
Character string naming the time identifier. |
model |
Model specification for deterministic components. One of:
|
max_factors |
Maximum number of common factors to estimate (default: 5). Set to 0 to skip factor estimation. |
max_lag |
Maximum lag order for ADF tests (default: 4). |
lag_method |
Method for selecting ADF lag order: |
trim |
Trimming parameter for break estimation, proportion of sample excluded from endpoints (default: 0.15). Must be in (0, 0.5). |
max_iter |
Maximum iterations for factor-break estimation (default: 20). |
tolerance |
Convergence tolerance for iterative estimation (default: 0.001). |
This function tests for panel cointegration in the presence of structural breaks and cross-sectional dependence. The methodology follows these steps:
Iterative Factor-Break Estimation: Jointly estimates common factors and individual break dates using an iterative procedure.
Individual ADF Tests: Applies ADF tests to the defactored (idiosyncratic) residuals for each cross-section unit.
Panel Test Statistic: Combines individual ADF statistics into a standardized panel statistic using Monte Carlo moments.
MQ Test: If factors are detected, tests whether they are stationary or represent stochastic trends (Bai & Ng, 2004).
An object of class "xtbreakcoint" containing:
Panel test statistic (standard normal under H0)
One-sided p-value for Z_t
Average of individual ADF t-statistics
Expected value of t-statistic under H0
Variance of t-statistic under H0
Number of cross-section units
Number of time periods
Number of estimated common factors
Number of stochastic trends (from MQ test)
Non-parametric MQ test statistic
Parametric MQ test statistic
Number of iterations for factor-break convergence
Percentage of individual units rejecting H0 at 5%
Vector of individual ADF t-statistics
Vector of selected lag orders for each unit
Vector of estimated break dates (periods from start)
Matrix of estimated common factors (T-1 x n_factors)
Model specification used
The matched call
Constant only
Constant plus linear trend
Constant plus level shift at break
Constant, trend, plus level shift (default)
Constant, trend, level shift, plus slope shift
Muhammad Alkhalaf
Banerjee, A., & Carrion-i-Silvestre, J. L. (2015). Cointegration in panel data with structural breaks and cross-section dependence. Journal of Applied Econometrics, 30(1), 1-22. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/jae.2348")}
Bai, J., & Ng, S. (2004). A PANIC attack on unit roots and cointegration. Econometrica, 72(4), 1127-1177. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1468-0262.2004.00528.x")}
# Generate example panel data
set.seed(42)
N <- 10 # panels
T <- 50 # time periods
# Create cointegrated data with a structural break
panel_data <- data.frame(
id = rep(1:N, each = T),
time = rep(1:T, N),
y = NA,
x = NA
)
for (i in 1:N) {
idx <- panel_data$id == i
x <- cumsum(rnorm(T))
u <- rnorm(T, sd = 0.5)
# Cointegrating relationship with break at t=25
beta <- ifelse(1:T <= 25, 1, 1.5)
y <- 1 + beta * x + u
panel_data$x[idx] <- x
panel_data$y[idx] <- y
}
# Test for cointegration
result <- xtbreakcoint(y ~ x, data = panel_data, id = "id", time = "time")
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.