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(10872,10625,10407,10463,10556,10646,10702,11353,11346,11451,11964,12574,13031,13812,14544,14931,14886,16005,17064,15168,16050,15839,15137,14954,15648,15305,15579,16348,15928,16171,15937,15713,15594,15683,16438,17032,17696,17745,19394,20148,20108,18584,18441,18391,19178,18079,18483,19644,19195,19650,20830,23595,22937,21814,21928,21777,21383,21467,22052) > x <- c(2921.44,2981.85,3080.58,3106.22,3119.31,3061.26,3097.31,3161.69,3257.16,3277.01,3295.32,3363.99,3494.17,3667.03,3813.06,3917.96,3895.51,3801.06,3570.12,3701.61,3862.27,3970.1,4138.52,4199.75,4290.89,4443.91,4502.64,4356.98,4591.27,4696.96,4621.4,4562.84,4202.52,4296.49,4435.23,4105.18,4116.68,3844.49,3720.98,3674.4,3857.62,3801.06,3504.37,3032.6,3047.03,2962.34,2197.82,2014.45,1862.83,1905.41,1810.99,1670.07,1864.44,2052.02,2029.6,2070.83,2293.41,2443.27,2513.17) > 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] 60.41 98.73 25.64 13.09 -58.05 36.05 64.38 95.47 19.85 [10] 18.31 68.67 130.18 172.86 146.03 104.90 -22.45 -94.45 -230.94 [19] 131.49 160.66 107.83 168.42 61.23 91.14 153.02 58.73 -145.66 [28] 234.29 105.69 -75.56 -58.56 -360.32 93.97 138.74 -330.05 11.50 [37] -272.19 -123.51 -46.58 183.22 -56.56 -296.69 -471.77 14.43 -84.69 [46] -764.52 -183.37 -151.62 42.58 -94.42 -140.92 194.37 187.58 -22.42 [55] 41.23 222.58 149.86 69.90 > y [1] -247 -218 56 93 90 56 651 -7 105 513 610 457 [13] 781 732 387 -45 1119 1059 -1896 882 -211 -702 -183 694 [25] -343 274 769 -420 243 -234 -224 -119 89 755 594 664 [37] 49 1649 754 -40 -1524 -143 -50 787 -1099 404 1161 -449 [49] 455 1180 2765 -658 -1123 114 -151 -394 84 585 > (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