Skip to content
Prev 256950 / 398506 Next

Automatically extract info from Granger causality output

Hello Ivan,

see example(causality) for the first question and use count[[i]] and not count$[[i]] for the second. The following works for me:

example(causality)
test1 <- causality(var.2c, "e")
test2 <- causality(var.2c, "prod")
tl <- list(test1, test2)
res <- matrix(NA, ncol = 1, nrow = length(tl))
for(i in 1:length(tl)){
	res[i, ] <- tl[[i]]$Granger$p.value
}
res

hth,
Bernhard