MyNixOS website logo
Description

Panel Cointegration Tests with Structural Breaks.

Implements panel cointegration tests allowing for structural breaks and cross-section dependence following the methodology of Banerjee and Carrion-i-Silvestre (2015) <doi:10.1002/jae.2348>. The package provides iterative factor-break estimation, individual ADF tests on defactored residuals, standardized panel test statistics, and the Bai and Ng (2004) <doi:10.1111/j.1468-0262.2004.00528.x> MQ test for identifying common stochastic trends. Supports five model specifications with varying deterministic components and break structures.

xtbreakcoint

CRAN status

Panel cointegration tests allowing for structural breaks and cross-section dependence, implementing the methodology of Banerjee and Carrion-i-Silvestre (2015).

Installation

You can install the development version from GitHub:

# install.packages("devtools")

Overview

The xtbreakcoint package tests for panel cointegration when:

  • Structural breaks may be present in the cointegrating relationship
  • Cross-section dependence exists through common factors

The methodology follows four steps:

  1. Iterative Factor-Break Estimation: Jointly estimates common factors and individual break dates
  2. Individual ADF Tests: Applies ADF tests to defactored residuals
  3. Panel Test Statistic: Combines individual statistics into a standardized panel statistic
  4. MQ Test: Tests whether common factors are I(1) stochastic trends

Example

library(xtbreakcoint)

# Generate example panel data
set.seed(42)
N <- 10   # panels
T <- 50   # time periods

panel_data <- data.frame(
  id = rep(1:N, each = T),
  time = rep(1:T, N),
  y = NA,
  x = NA
)

# Create cointegrated data with a structural break at t=25
for (i in 1:N) {
  idx <- panel_data$id == i
  x <- cumsum(rnorm(T))
  u <- rnorm(T, sd = 0.5)
  beta <- ifelse(1:T <= 25, 1, 1.5)  # Break in slope
  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)

Model Specifications

ModelNameDeterministics
1constantConstant only
2trendConstant + trend
3levelshiftConstant + level shift
4trendshiftConstant + trend + level shift (default)
5regimeshiftConstant + trend + level + slope shift

References

  • 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. doi:10.1002/jae.2348

  • Bai, J., & Ng, S. (2004). A PANIC attack on unit roots and cointegration. Econometrica, 72(4), 1127-1177. doi:10.1111/j.1468-0262.2004.00528.x

  • Bai, J., & Ng, S. (2002). Determining the number of factors in approximate factor models. Econometrica, 70(1), 191-221. doi:10.1111/1468-0262.00273

Author

Based on original GAUSS code by A. Banerjee and J.L. Carrion-i-Silvestre.

License

GPL (>= 3)

Metadata

Version

1.0.4

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows