granger_test {bruceR}R Documentation

Granger causality test (bivariate).

Description

Granger test of predictive causality (between two time series) using the lmtest::grangertest() function.

Usage

granger_test(formula, data, lags = 1:5, test.reverse = FALSE)

Arguments

formula

Model formula like y ~ x.

data

Data frame.

lags

Time lags. Default is 1:5.

test.reverse

Whether to test reverse causality. Default is FALSE.

Details

The Granger causality test examines whether the lagged values of a predictor have any incremental role in predicting an outcome if controlling for the lagged values of the outcome itself.

Value

No return value.

See Also

ccf_plot, granger_causality

Examples

granger_test(chicken ~ egg, data=lmtest::ChickEgg)
granger_test(chicken ~ egg, data=lmtest::ChickEgg, lags=1:10, test.reverse=TRUE)


[Package bruceR version 0.7.0 Index]