Learn R Programming

dcce (version 0.4.2)

cointegration_test: Westerlund (2007) Panel Cointegration Tests

Description

Implements the four error-correction-based panel cointegration tests of Westerlund (2007): two group-mean statistics (Ga, Gt) and two panel statistics (Pa, Pt). The null hypothesis is no cointegration between the dependent variable and the regressors.

Usage

cointegration_test(
  data,
  unit_index,
  time_index,
  formula,
  lags = 1L,
  leads = 1L,
  test = c("ga", "gt", "pa", "pt"),
  n_bootstrap = 0L,
  seed = NULL,
  show_progress = FALSE
)

Value

An object of class dcce_cointegration with elements statistics (a tibble with columns test, statistic, p_value, method), lags, leads, N, T_bar, and call.

Arguments

data

A panel data.frame.

unit_index

Character scalar: unit identifier column.

time_index

Character scalar: time identifier column.

formula

Two-sided formula of the form y ~ x1 + x2 in levels (not first differences).

lags

Integer scalar: ADF lag order for \(\Delta y\) lags in the ECM regression. Default 1L.

leads

Integer scalar: number of leads of \(\Delta x\). Default 1L.

test

Character vector: which statistics to compute. Subset of c("ga", "gt", "pa", "pt"). Default: all four.

n_bootstrap

Integer: number of bootstrap replications for p-values. Default 0L (asymptotic p-values).

seed

Integer: random seed for the bootstrap.

show_progress

Logical: print progress? Default FALSE.

Details

For each unit \(i\), an error-correction regression is fitted $$\Delta y_{it} = \delta_i d_t + \alpha_i y_{i,t-1} + \lambda_i' x_{i,t-1} + \sum_{j=1}^{p_i} \alpha_{ij} \Delta y_{i,t-j} + \sum_{j=-q_i}^{p_i} \gamma_{ij}' \Delta x_{i,t-j} + e_{it},$$ and the t-statistic for \(\alpha_i = 0\) is used to construct the four test statistics:

  • Gt: group-mean of the \(\hat\alpha_i / SE(\hat\alpha_i)\).

  • Ga: group-mean of \(T \hat\alpha_i / \hat\alpha_i(1)\) (unnormalised form).

  • Pt: pooled t-statistic.

  • Pa: pooled alpha-statistic.

A negative, large-magnitude statistic rejects the null of no cointegration. Asymptotic p-values are obtained by linear interpolation on the critical values in Westerlund (2007, Table 3). A bootstrap path (n_bootstrap > 0) is also provided, resampling cross-sectional units with replacement to account for cross-sectional dependence.

References

Westerlund, J. (2007). Testing for Error Correction in Panel Data. Oxford Bulletin of Economics and Statistics, 69(6), 709-748.

Examples

Run this code
data(pwt8)
result <- cointegration_test(
  data       = pwt8,
  unit_index = "country",
  time_index = "year",
  formula    = log_rgdpo ~ log_hc + log_ck,
  test       = c("ga", "gt"),
  lags       = 1L
)
print(result)

Run the code above in your browser using DataLab