On Sun, 17 Aug 2008, [EMAIL PROTECTED] wrote:

Dear Achim, R Users,

What am I doing wrong in this example ?

The Granger test of x and y with lag k tests the significance of the x variables in
  y ~ Lags(y, 1:k) + Lags(x, 1:k)
If x is already a lag of y (as in your example), this is not really meaningful. In the "lmtest" implementation, it leads to collinearities. I'm not sure what MSBVAR does to resolve that.
Z

a<-zoo(rnorm(100),order.by=1:100)
b<-lag(a)
regr<-na.exclude(merge(a,b))
plot(regr)
grangertest(regr[,1],regr[,2],3)

a<-zoo(rnorm(100),order.by=1:100)
b<-lag(a)
regr<-na.exclude(merge(a,b))
plot(regr)
grangertest(regr[,1],regr[,2],3)
Error in solve(vc[ovar, ovar]) : subscript out of bounds


This works fine in granger.test from the MSBVAR package:

a<-zoo(rnorm(100),order.by=1:100)
b<-lag(a)
regr<-na.exclude(merge(a,b))
plot(regr)
granger.test(regr,3)
       F-statistic   p-value
b -> a 1.259314e+34 0.0000000
a -> b 6.167865e-01 0.6059222


Thanks in advance,
Tolga

Generally, this communication is for informational pur...{{dropped:30}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to