R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > y <- c(326011,328282,317480,317539,313737,312276,309391,302950,300316,304035,333476,337698,335932,323931,313927,314485,313218,309664,302963,298989,298423,301631,329765,335083,327616,309119,295916,291413,291542,284678,276475,272566,264981,263290,296806,303598,286994,276427,266424,267153,268381,262522,255542,253158,243803,250741,280445,285257,270976,261076,255603,260376,263903,264291,263276,262572,256167,264221,293860,300713) > x <- c(286602,283042,276687,277915,277128,277103,275037,270150,267140,264993,287259,291186,292300,288186,281477,282656,280190,280408,276836,275216,274352,271311,289802,290726,292300,278506,269826,265861,269034,264176,255198,253353,246057,235372,258556,260993,254663,250643,243422,247105,248541,245039,237080,237085,225554,226839,247934,248333,246969,245098,246263,255765,264319,268347,273046,273963,267430,271993,292710,295881) > par8 = '1' > par7 = '0' > par6 = '1' > par5 = '1' > par4 = '12' > par3 = '0' > par2 = '1' > par1 = '1' > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > par6 <- as.numeric(par6) > par7 <- as.numeric(par7) > par8 <- as.numeric(par8) > par8 <- 26 > ox <- x > oy <- y > if (par1 == 0) { + x <- log(x) + } else { + x <- (x ^ par1 - 1) / par1 + } > if (par5 == 0) { + y <- log(y) + } else { + y <- (y ^ par5 - 1) / par5 + } > if (par2 > 0) x <- diff(x,lag=1,difference=par2) > if (par6 > 0) y <- diff(y,lag=1,difference=par6) > if (par3 > 0) x <- diff(x,lag=par4,difference=par3) > if (par7 > 0) y <- diff(y,lag=par4,difference=par7) > x [1] -3560 -6355 1228 -787 -25 -2066 -4887 -3010 -2147 22266 [11] 3927 1114 -4114 -6709 1179 -2466 218 -3572 -1620 -864 [21] -3041 18491 924 1574 -13794 -8680 -3965 3173 -4858 -8978 [31] -1845 -7296 -10685 23184 2437 -6330 -4020 -7221 3683 1436 [41] -3502 -7959 5 -11531 1285 21095 399 -1364 -1871 1165 [51] 9502 8554 4028 4699 917 -6533 4563 20717 3171 > y [1] 2271 -10802 59 -3802 -1461 -2885 -6441 -2634 3719 29441 [11] 4222 -1766 -12001 -10004 558 -1267 -3554 -6701 -3974 -566 [21] 3208 28134 5318 -7467 -18497 -13203 -4503 129 -6864 -8203 [31] -3909 -7585 -1691 33516 6792 -16604 -10567 -10003 729 1228 [41] -5859 -6980 -2384 -9355 6938 29704 4812 -14281 -9900 -5473 [51] 4773 3527 388 -1015 -704 -6405 8054 29639 6853 > (gyx <- grangertest(y ~ x, order=par8)) Error in solve(vc[ovar, ovar]) : subscript out of bounds Calls: grangertest ... waldtest.lm -> waldtest.default -> modelCompare -> solve Execution halted