Skip to contents

Computes all five of Pedroni's tabulated panel cointegration statistics and standardises each one, following his own five-step recipe: fit the cointegrating regression and keep the residuals; regress the differenced dependent on the differenced regressors and take the long-run variance of those residuals as \(\hat L_{11i}^2\); fit \(\hat e_{i,t} = \hat\gamma_i \hat e_{i,t-1} + \hat u_{i,t}\) and form \(\hat\lambda_i = (\hat\sigma_i^2 - \hat s_i^2)/2\). Long-run variances use the Newey-West estimator.

Usage

morie_panel_cointegration(
  x,
  groups,
  lags = 1L,
  case = "intercept",
  bandwidth = NULL
)

Arguments

x

Numeric matrix; first column the dependent variable, the rest regressors.

groups

Unit label per row. At least two units.

lags

Augmentation lags in the residual ADF regressions.

case

One of "intercept" (default), "standard", "trend".

bandwidth

Newey-West truncation lag; default 4 (T/100)^(2/9).

Value

Named list with statistics and z and p_values (each a named list over panel_v, panel_rho, panel_t, group_rho, group_t), plus n_units, n_regressors, case, p_value, method and warnings.

Details

Each statistic is read against a normal only after his equation (2), \(Z = (\chi_{N,T} - \mu\sqrt{N})/\sqrt{v}\), with \(\mu\) and \(v\) from Table 2, transcribed here for all three deterministic cases and m = 2..7 regressors.

The panel variance statistic diverges to \(+\infty\) under the alternative, so it alone is read from the right tail; the other four go negative under cointegration and are read from the left.

Table 2 has no m = 1 row, so a bivariate cointegrating regression cannot be standardised from it and that case is refused rather than extrapolated.

Mirrors morie.fn.pdcoin on the Python side.

References

Pedroni P (1999). Critical values for cointegration tests in heterogeneous panels with multiple regressors. Oxford Bulletin of Economics and Statistics, 61(S1), 653-670.

Examples

set.seed(1)
Tn <- 80
N <- 6
x1 <- unlist(lapply(seq_len(N), function(i) cumsum(rnorm(Tn))))
x2 <- unlist(lapply(seq_len(N), function(i) cumsum(rnorm(Tn))))
y <- x1 + 0.5 * x2 + rnorm(N * Tn)
morie_panel_cointegration(cbind(y, x1, x2), rep(seq_len(N), each = Tn))$p_value
#> [1] 4.480984e-89