Learn R Programming

NlinTS (version 1.3.5)

causality.test: 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.

Value

pvalue: the p-value of the test.

Ftest: the statistic of the test.

summary (): shows the test results.

Details

The test evaluates if the second time series causes the first one using the Granger test of causality.

References

granger1980NlinTS

Examples

Run this code
# NOT RUN {
library (timeSeries) # to extract time series
library (NlinTS)
data = LPP2005REC
model = causality.test (data[,1], data[,2], 2)
model$summary ()
# }

Run the code above in your browser using DataLab