pgrangertest: Panel Granger (Non-)Causality Test (Dumitrescu/Hurlin (2012))

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/test_granger.R

Description

Test for Granger (non-)causality in panel data.

Usage

1
2
3
4
5
6
7
pgrangertest(
  formula,
  data,
  test = c("Ztilde", "Zbar", "Wbar"),
  order = 1L,
  index = NULL
)

Arguments

formula

a formula object to describe the direction of the hypothesized Granger causation,

data

a pdata.frame or a data.frame,

test

a character to request the statistic to be returned, either "Ztilde" (default), or "Zbar",

order

integer(s) giving the number of lags to include in the test's auxiliary regressions, the length of order must be either 1 (same lag order for all individuals) or equal to the number of individuals (to specify a lag order per individual),

index

only relevant if data is data.frame and not a pdata.frame; if NULL, the first two columns of the data.frame are assumed to be the index variables, for further details see pdata.frame().

Details

The panel Granger (non-)causality test is a combination of Granger tests \insertCiteGRAN:69plm performed per individual. The test is developed by \insertCiteDUMI:HURL:12;textualplm, a shorter exposition is given in \insertCiteLOPE:WEBE:17;textualplm.

The formula formula describes the direction of the (panel) Granger causation where y ~ x means "x (panel) Granger causes y".

By setting argument test to either "Ztilde" (default) or "Zbar", two different statistics can be requested. "Ztilde" gives the standardised statistic recommended by Dumitrescu/Hurlin (2012) for fixed T samples. If set to "Wbar", the intermediate Wbar statistic (average of individual Granger chi-square statistics) is given which is used to derive the other two.

The Zbar statistic is not suitable for unbalanced panels. For the Wbar statistic, no p-value is available.

The implementation uses lmtest::grangertest() from package lmtest to perform the individual Granger tests.

Value

An object of class c("pgrangertest", "htest"). Besides the usual elements of a htest object, it contains the data frame indgranger which carries the Granger test statistics per individual along the associated p-values, degrees of freedom, and the specified lag order.

Author(s)

Kevin Tappe

References

\insertRef

DUMI:HURL:12plm

\insertRef

GRAN:69plm

\insertRef

LOPE:WEBE:17plm

See Also

lmtest::grangertest() for the original (non-panel) Granger causality test in lmtest.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## not meaningful, just to demonstrate usage
## H0: 'value' does not Granger cause 'inv' for all invididuals

data("Grunfeld", package = "plm")
pgrangertest(inv ~ value, data = Grunfeld)
pgrangertest(inv ~ value, data = Grunfeld, order = 2L)
pgrangertest(inv ~ value, data = Grunfeld, order = 2L, test = "Zbar")

# varying lag order (last individual lag order 3, others lag order 2)
(pgrt <- pgrangertest(inv ~ value, data = Grunfeld, order = c(rep(2L, 9), 3L)))
# chisq statistics per individual
pgrt$indgranger

plm documentation built on Sept. 21, 2021, 3:01 p.m.