Test for Granger Causality
ms_grangertest2.Rd
Faster implementation of the vector version of lmtest::grangertest()
. The
function assumes time series always have the same start date and periodicity,
which is true for the data in this package.
Usage
ms_grangertest2(x, y, order = 1, na.action = stats::na.omit, ...)
Arguments
- x
either a bivariate series (in which case y has to be missing) or a univariate series of observations
- y
a univariate series of observations (if x is univariate, too).
- order
number of lags (in frames).
- na.action
a function for eliminating NAs after aligning the series x and y.
- ...
passed to
lmtest::waldtest()
.
See also
Other Granger Causality:
autoplot.GrangerTime()
,
get_granger_interactions()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
Examples
data(ChickEgg, package = "lmtest")
ms_grangertest2(ChickEgg, order = 3)
#> Granger causality test
#>
#> Model 1: egg ~ Lags(egg, 1:3) + Lags(chicken, 1:3)
#> Model 2: egg ~ Lags(egg, 1:3)
#> Res.Df Df F Pr(>F)
#> 1 44
#> 2 47 -3 0.5916 0.6238