causality.test {NlinTS}R Documentation

The Granger causality test

Description

The Granger causality test

Usage

causality.test(ts1, ts2, lag, diff = FALSE)

Arguments

ts1

Numerical dataframe containing one variable.

ts2

Numerical dataframe containing one variable.

lag

The lag parameter.

diff

Logical argument for the option of making data stationary before making the test.

Details

This is the classical Granger test of causality. The null hypothesis is that the second time series does not cause the first one

Value

gci: the Granger causality index.

Ftest: the statistic of the test.

pvalue: the p-value of the test.

summary (): shows the test results.

References

Granger CWJ (1980). “Testing for Causality.” Journal of Economic Dynamics and Control, 2, 329–352. ISSN 0165-1889, doi: 10.1016/0165-1889(80)90069-X.

Examples

library (timeSeries) # to extract time series
library (NlinTS)
data = LPP2005REC
model = causality.test (data[,1], data[,2], 2)
model$summary ()

[Package NlinTS version 1.4.5 Index]