grangertest              package:lmtest              R Documentation

_T_e_s_t _f_o_r _G_r_a_n_g_e_r _C_a_u_s_a_l_i_t_y

_D_e_s_c_r_i_p_t_i_o_n:

     'grangertest' is a generic function for performing  a test for
     Granger causality.

_U_s_a_g_e:

     ## Default S3 method:
     grangertest(x, y, order = 1, na.action = na.omit, ...)
     ## S3 method for class 'formula':
     grangertest(formula, data = list(), ...)

_A_r_g_u_m_e_n_t_s:

       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: integer specifying th order of lags to include in the
          auxiliary regression.

na.action: a function for eliminating 'NA's after aligning the series
          'x' and 'y'.

     ...: further arguments passed to 'waldtest'.

 formula: a formula specification of a bivariate series like 'y ~ x'.

    data: an optional data frame containing the variables in the model.
          By default the variables are taken from the environment which
          'grangertest' is called from.

_D_e_t_a_i_l_s:

     Currently, the methods for the generic function 'grangertest' only
     perform tests for Granger causality in bivariate series. The test
     is simply a Wald test comparing the unrestricted model-in which
     'y' is explained by the lags (up to order 'order') of 'y' and
     'x'-and the restricted model-in which 'y' is only explained by the
     lags of 'y'.

     Both methods are simply convenience interfaces to 'waldtest'.

_V_a_l_u_e:

     An object of class '"anova"' which contains the residual degrees
     of freedom, the difference in degrees of freedom, Wald statistic
     and corresponding p value.

_S_e_e _A_l_s_o:

     'waldtest', 'ChickEgg'

_E_x_a_m_p_l_e_s:

     ## Which came first: the chicken or the egg?
     data(ChickEgg)
     grangertest(egg ~ chicken, order = 3, data = ChickEgg)
     grangertest(chicken ~ egg, order = 3, data = ChickEgg)

     ## alternative ways of specifying the same test
     grangertest(ChickEgg, order = 3)
     grangertest(ChickEgg[, 1], ChickEgg[, 2], order = 3)

