R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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. > x <- array(list(33024 + ,31086 + ,19828 + ,18932 + ,32526 + ,30839 + ,19967 + ,18927 + ,31455 + ,30051 + ,19814 + ,19124 + ,31524 + ,29976 + ,20053 + ,19066 + ,31856 + ,30463 + ,20719 + ,19971 + ,32696 + ,31422 + ,21174 + ,20165 + ,32584 + ,31588 + ,20648 + ,19705 + ,33498 + ,31900 + ,20659 + ,19718 + ,34175 + ,32878 + ,20733 + ,19938 + ,34172 + ,33010 + ,21069 + ,20039 + ,34379 + ,32954 + ,20566 + ,19721 + ,34988 + ,33076 + ,20839 + ,19777 + ,36158 + ,35057 + ,21615 + ,20505 + ,37411 + ,35906 + ,22739 + ,21763 + ,38015 + ,36100 + ,23222 + ,22404 + ,37577 + ,35824 + ,23031 + ,22038 + ,36354 + ,34579 + ,23014 + ,22038 + ,36030 + ,34484 + ,22868 + ,21874 + ,35636 + ,33920 + ,22182 + ,21269 + ,35669 + ,34059 + ,22177 + ,21127 + ,34635 + ,33812 + ,21216 + ,20609 + ,35496 + ,34594 + ,21031 + ,20565 + ,36376 + ,36083 + ,20968 + ,19791 + ,37635 + ,36563 + ,21049 + ,20672 + ,38875 + ,37416 + ,21033 + ,20938 + ,38372 + ,37953 + ,21078 + ,20675 + ,38897 + ,37517 + ,20702 + ,19992 + ,38018 + ,37467 + ,20309 + ,19801 + ,37325 + ,36963 + ,20449 + ,20050 + ,36893 + ,36019 + ,20737 + ,20427 + ,36117 + ,35232 + ,20849 + ,20815 + ,37599 + ,36857 + ,21966 + ,21666 + ,39037 + ,37978 + ,23100 + ,22720 + ,40809 + ,40160 + ,23975 + ,23650 + ,42508 + ,42165 + ,24350 + ,24244 + ,44021 + ,43069 + ,24020 + ,23669 + ,44088 + ,43021 + ,24005 + ,23881 + ,44510 + ,43376 + ,23602 + ,23857 + ,45786 + ,43978 + ,24120 + ,23999 + ,47349 + ,45911 + ,24847 + ,24780 + ,48696 + ,47107 + ,25702 + ,25426 + ,50598 + ,49168 + ,26312 + ,26229 + ,50066 + ,48390 + ,25891 + ,25973 + ,49367 + ,47678 + ,25172 + ,25375 + ,48784 + ,47822 + ,25698 + ,25966 + ,47841 + ,46695 + ,25833 + ,25391 + ,48300 + ,47185 + ,25658 + ,26046 + ,47518 + ,45684 + ,25269 + ,25572 + ,46504 + ,44884 + ,24846 + ,24900 + ,45147 + ,44256 + ,24390 + ,24744 + ,44404 + ,43637 + ,23954 + ,24526 + ,43455 + ,42368 + ,23828 + ,24274 + ,42299 + ,40892 + ,23507 + ,23774 + ,42105 + ,40616 + ,23144 + ,23414 + ,40152 + ,39026 + ,22302 + ,23002 + ,39519 + ,38921 + ,23028 + ,23137 + ,39633 + ,38512 + ,22741 + ,22947 + ,39376 + ,38884 + ,23129 + ,23733 + ,38850 + ,38406 + ,22911 + ,23234 + ,39657 + ,38804 + ,22071 + ,22969 + ,34804 + ,34871 + ,16466 + ,17708 + ,34372 + ,34660 + ,16370 + ,17377 + ,32678 + ,33104 + ,15049 + ,16273 + ,28420 + ,28952 + ,13174 + ,14342 + ,25420 + ,26488 + ,12231 + ,13522 + ,27683 + ,29418 + ,13620 + ,15210 + ,29904 + ,32315 + ,14317 + ,16493 + ,30546 + ,32885 + ,14039 + ,16701 + ,29142 + ,31565 + ,13526 + ,15662 + ,27724 + ,30782 + ,12826 + ,15526 + ,27069 + ,30442 + ,12360 + ,15413 + ,26665 + ,30851 + ,12592 + ,15805 + ,26004 + ,30432 + ,12381 + ,15802 + ,25767 + ,31260 + ,12554 + ,16753 + ,24915 + ,30737 + ,12338 + ,16906 + ,23689 + ,30129 + ,11768 + ,16891 + ,20915 + ,27672 + ,10687 + ,15703 + ,19414 + ,26469 + ,9964 + ,15429 + ,17824 + ,24895 + ,9338 + ,14762 + ,16348 + ,24427 + ,8697 + ,14426 + ,15571 + ,23252 + ,8068 + ,14250 + ,13929 + ,21815 + ,7295 + ,13267 + ,12480 + ,20837 + ,6372 + ,12397 + ,10837 + ,18537 + ,5649 + ,11586 + ,9473 + ,17237 + ,4926 + ,10888 + ,8051 + ,15476 + ,4199 + ,9841 + ,5278 + ,10709 + ,2568 + ,6443 + ,3008 + ,6776 + ,1461 + ,4019 + ,2404 + ,5810 + ,1173 + ,3449 + ,2298 + ,5765 + ,1084 + ,3179 + ,2260 + ,5775 + ,978 + ,3341 + ,1938 + ,5589 + ,947 + ,3325 + ,1371 + ,4687 + ,679 + ,2478 + ,1009 + ,3630 + ,457 + ,1982 + ,686 + ,2552 + ,262 + ,1405 + ,493 + ,1928 + ,218 + ,1059 + ,285 + ,1323 + ,132 + ,740 + ,192 + ,1005 + ,70 + ,533 + ,129 + ,678 + ,44 + ,366 + ,60 + ,397 + ,24 + ,224 + ,54 + ,286 + ,20 + ,147 + ,26 + ,166 + ,4 + ,75 + ,11 + ,80 + ,4 + ,54 + ,3 + ,53 + ,1 + ,23 + ,0 + ,32 + ,0 + ,16 + ,2 + ,11 + ,0 + ,6 + ,1 + ,6 + ,0 + ,7 + ,0 + ,4 + ,0 + ,2 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0) + ,dim=c(4 + ,111) + ,dimnames=list(c('MVG' + ,'VVG' + ,'MWG' + ,'VWG') + ,1:111)) > y <- array(NA,dim=c(4,111),dimnames=list(c('MVG','VVG','MWG','VWG'),1:111)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x MVG VVG MWG VWG t 1 33024 31086 19828 18932 1 2 32526 30839 19967 18927 2 3 31455 30051 19814 19124 3 4 31524 29976 20053 19066 4 5 31856 30463 20719 19971 5 6 32696 31422 21174 20165 6 7 32584 31588 20648 19705 7 8 33498 31900 20659 19718 8 9 34175 32878 20733 19938 9 10 34172 33010 21069 20039 10 11 34379 32954 20566 19721 11 12 34988 33076 20839 19777 12 13 36158 35057 21615 20505 13 14 37411 35906 22739 21763 14 15 38015 36100 23222 22404 15 16 37577 35824 23031 22038 16 17 36354 34579 23014 22038 17 18 36030 34484 22868 21874 18 19 35636 33920 22182 21269 19 20 35669 34059 22177 21127 20 21 34635 33812 21216 20609 21 22 35496 34594 21031 20565 22 23 36376 36083 20968 19791 23 24 37635 36563 21049 20672 24 25 38875 37416 21033 20938 25 26 38372 37953 21078 20675 26 27 38897 37517 20702 19992 27 28 38018 37467 20309 19801 28 29 37325 36963 20449 20050 29 30 36893 36019 20737 20427 30 31 36117 35232 20849 20815 31 32 37599 36857 21966 21666 32 33 39037 37978 23100 22720 33 34 40809 40160 23975 23650 34 35 42508 42165 24350 24244 35 36 44021 43069 24020 23669 36 37 44088 43021 24005 23881 37 38 44510 43376 23602 23857 38 39 45786 43978 24120 23999 39 40 47349 45911 24847 24780 40 41 48696 47107 25702 25426 41 42 50598 49168 26312 26229 42 43 50066 48390 25891 25973 43 44 49367 47678 25172 25375 44 45 48784 47822 25698 25966 45 46 47841 46695 25833 25391 46 47 48300 47185 25658 26046 47 48 47518 45684 25269 25572 48 49 46504 44884 24846 24900 49 50 45147 44256 24390 24744 50 51 44404 43637 23954 24526 51 52 43455 42368 23828 24274 52 53 42299 40892 23507 23774 53 54 42105 40616 23144 23414 54 55 40152 39026 22302 23002 55 56 39519 38921 23028 23137 56 57 39633 38512 22741 22947 57 58 39376 38884 23129 23733 58 59 38850 38406 22911 23234 59 60 39657 38804 22071 22969 60 61 34804 34871 16466 17708 61 62 34372 34660 16370 17377 62 63 32678 33104 15049 16273 63 64 28420 28952 13174 14342 64 65 25420 26488 12231 13522 65 66 27683 29418 13620 15210 66 67 29904 32315 14317 16493 67 68 30546 32885 14039 16701 68 69 29142 31565 13526 15662 69 70 27724 30782 12826 15526 70 71 27069 30442 12360 15413 71 72 26665 30851 12592 15805 72 73 26004 30432 12381 15802 73 74 25767 31260 12554 16753 74 75 24915 30737 12338 16906 75 76 23689 30129 11768 16891 76 77 20915 27672 10687 15703 77 78 19414 26469 9964 15429 78 79 17824 24895 9338 14762 79 80 16348 24427 8697 14426 80 81 15571 23252 8068 14250 81 82 13929 21815 7295 13267 82 83 12480 20837 6372 12397 83 84 10837 18537 5649 11586 84 85 9473 17237 4926 10888 85 86 8051 15476 4199 9841 86 87 5278 10709 2568 6443 87 88 3008 6776 1461 4019 88 89 2404 5810 1173 3449 89 90 2298 5765 1084 3179 90 91 2260 5775 978 3341 91 92 1938 5589 947 3325 92 93 1371 4687 679 2478 93 94 1009 3630 457 1982 94 95 686 2552 262 1405 95 96 493 1928 218 1059 96 97 285 1323 132 740 97 98 192 1005 70 533 98 99 129 678 44 366 99 100 60 397 24 224 100 101 54 286 20 147 101 102 26 166 4 75 102 103 11 80 4 54 103 104 3 53 1 23 104 105 0 32 0 16 105 106 2 11 0 6 106 107 1 6 0 7 107 108 0 4 0 2 108 109 0 2 0 0 109 110 0 0 0 0 110 111 0 1 0 0 111 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) VVG MWG VWG t -2483.046 1.001 1.467 -1.357 22.824 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1707.86 -233.16 -2.61 271.79 953.21 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.483e+03 2.984e+02 -8.322 3.24e-13 *** VVG 1.001e+00 2.258e-02 44.349 < 2e-16 *** MWG 1.467e+00 2.652e-02 55.343 < 2e-16 *** VWG -1.357e+00 4.617e-02 -29.393 < 2e-16 *** t 2.282e+01 3.032e+00 7.529 1.78e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 429.3 on 106 degrees of freedom Multiple R-squared: 0.9994, Adjusted R-squared: 0.9993 F-statistic: 4.105e+04 on 4 and 106 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.31010882 6.202176e-01 6.898912e-01 [2,] 0.16995195 3.399039e-01 8.300480e-01 [3,] 0.08716824 1.743365e-01 9.128318e-01 [4,] 0.05281347 1.056269e-01 9.471865e-01 [5,] 0.13467074 2.693415e-01 8.653293e-01 [6,] 0.09262753 1.852551e-01 9.073725e-01 [7,] 0.14938577 2.987715e-01 8.506142e-01 [8,] 0.23628227 4.725645e-01 7.637177e-01 [9,] 0.19758992 3.951798e-01 8.024101e-01 [10,] 0.17545175 3.509035e-01 8.245483e-01 [11,] 0.12210417 2.442083e-01 8.778958e-01 [12,] 0.09978977 1.995795e-01 9.002102e-01 [13,] 0.06790887 1.358177e-01 9.320911e-01 [14,] 0.07800702 1.560140e-01 9.219930e-01 [15,] 0.05344551 1.068910e-01 9.465545e-01 [16,] 0.15825672 3.165134e-01 8.417433e-01 [17,] 0.14557760 2.911552e-01 8.544224e-01 [18,] 0.23304775 4.660955e-01 7.669523e-01 [19,] 0.26859159 5.371832e-01 7.314084e-01 [20,] 0.42162527 8.432505e-01 5.783747e-01 [21,] 0.37458800 7.491760e-01 6.254120e-01 [22,] 0.36800934 7.360187e-01 6.319907e-01 [23,] 0.31718470 6.343694e-01 6.828153e-01 [24,] 0.29068557 5.813711e-01 7.093144e-01 [25,] 0.25295040 5.059008e-01 7.470496e-01 [26,] 0.20614886 4.122977e-01 7.938511e-01 [27,] 0.29093474 5.818695e-01 7.090653e-01 [28,] 0.47065565 9.413113e-01 5.293443e-01 [29,] 0.51191473 9.761705e-01 4.880853e-01 [30,] 0.50932543 9.813491e-01 4.906746e-01 [31,] 0.49370112 9.874022e-01 5.062989e-01 [32,] 0.67904237 6.419153e-01 3.209576e-01 [33,] 0.64903541 7.019292e-01 3.509646e-01 [34,] 0.63449640 7.310072e-01 3.655036e-01 [35,] 0.60117589 7.976482e-01 3.988241e-01 [36,] 0.56844193 8.631161e-01 4.315581e-01 [37,] 0.58184138 8.363172e-01 4.181586e-01 [38,] 0.57807946 8.438411e-01 4.219205e-01 [39,] 0.77755627 4.448875e-01 2.224437e-01 [40,] 0.73614069 5.277186e-01 2.638593e-01 [41,] 0.84591114 3.081777e-01 1.540889e-01 [42,] 0.86809251 2.638150e-01 1.319075e-01 [43,] 0.84461936 3.107613e-01 1.553806e-01 [44,] 0.80935026 3.812995e-01 1.906497e-01 [45,] 0.78714915 4.257017e-01 2.128508e-01 [46,] 0.81909460 3.618108e-01 1.809054e-01 [47,] 0.86010420 2.797916e-01 1.398958e-01 [48,] 0.91149729 1.770054e-01 8.850271e-02 [49,] 0.93972664 1.205467e-01 6.027336e-02 [50,] 0.92688153 1.462369e-01 7.311847e-02 [51,] 0.92663667 1.467267e-01 7.336333e-02 [52,] 0.99069106 1.861787e-02 9.308935e-03 [53,] 0.99238083 1.523835e-02 7.619174e-03 [54,] 0.99418243 1.163513e-02 5.817566e-03 [55,] 0.99127189 1.745623e-02 8.728113e-03 [56,] 0.99347976 1.304048e-02 6.520238e-03 [57,] 0.99582374 8.352510e-03 4.176255e-03 [58,] 0.99472866 1.054268e-02 5.271338e-03 [59,] 0.99792466 4.150673e-03 2.075337e-03 [60,] 0.99966231 6.753775e-04 3.376888e-04 [61,] 0.99998445 3.110044e-05 1.555022e-05 [62,] 0.99998565 2.870931e-05 1.435466e-05 [63,] 0.99999471 1.057765e-05 5.288824e-06 [64,] 0.99999997 6.146915e-08 3.073457e-08 [65,] 0.99999999 1.804807e-08 9.024034e-09 [66,] 1.00000000 4.178076e-09 2.089038e-09 [67,] 1.00000000 1.827618e-09 9.138088e-10 [68,] 1.00000000 7.577714e-10 3.788857e-10 [69,] 1.00000000 5.890736e-13 2.945368e-13 [70,] 1.00000000 3.184961e-13 1.592481e-13 [71,] 1.00000000 5.811889e-15 2.905944e-15 [72,] 1.00000000 1.521837e-14 7.609186e-15 [73,] 1.00000000 7.747537e-17 3.873768e-17 [74,] 1.00000000 6.403197e-17 3.201599e-17 [75,] 1.00000000 2.329335e-16 1.164667e-16 [76,] 1.00000000 1.212167e-15 6.060837e-16 [77,] 1.00000000 8.427372e-15 4.213686e-15 [78,] 1.00000000 5.131418e-14 2.565709e-14 [79,] 1.00000000 1.220723e-15 6.103614e-16 [80,] 1.00000000 9.610191e-15 4.805096e-15 [81,] 1.00000000 8.438963e-14 4.219482e-14 [82,] 1.00000000 3.443906e-13 1.721953e-13 [83,] 1.00000000 2.562385e-12 1.281193e-12 [84,] 1.00000000 1.095196e-19 5.475978e-20 [85,] 1.00000000 1.673886e-18 8.369432e-19 [86,] 1.00000000 3.753924e-17 1.876962e-17 [87,] 1.00000000 7.059218e-16 3.529609e-16 [88,] 1.00000000 7.365261e-20 3.682631e-20 [89,] 1.00000000 2.355858e-20 1.177929e-20 [90,] 1.00000000 3.250307e-18 1.625154e-18 [91,] 1.00000000 3.212197e-16 1.606098e-16 [92,] 1.00000000 3.717776e-15 1.858888e-15 [93,] 1.00000000 7.370835e-14 3.685418e-14 [94,] 1.00000000 1.726442e-11 8.632211e-12 [95,] 1.00000000 1.817930e-11 9.089650e-12 [96,] 0.99999999 1.232968e-08 6.164841e-09 > postscript(file="/var/www/rcomp/tmp/1btov1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2btov1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/34kny1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/44kny1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/54kny1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 111 Frequency = 1 1 2 3 4 5 6 953.210126 468.960298 656.113342 347.947474 420.394976 -127.148049 7 8 9 10 11 12 -280.627471 299.621161 164.447135 -349.551116 197.246941 336.638664 13 14 15 16 17 18 -650.615501 -212.671939 335.421412 -65.476371 -39.642991 -299.668599 19 20 21 22 23 24 33.854792 -280.547436 -382.826676 -115.960113 -1707.862821 124.493385 25 26 27 28 29 30 871.995587 -614.550040 -50.982094 -585.248255 -663.880146 -84.370261 31 32 33 34 35 36 267.128665 -385.107663 -326.084172 -783.737230 -859.433994 -570.631865 37 38 39 40 41 42 -168.648742 433.858084 516.779591 114.429928 -136.967643 -126.940027 43 44 45 46 47 48 367.664427 602.318299 -117.481718 -933.264424 158.021037 783.787096 49 50 51 52 53 54 256.755789 -36.762886 161.209341 303.012473 394.668401 498.319408 55 56 57 58 59 60 791.120669 -641.721494 22.310579 -132.634617 -560.142499 698.502806 61 62 63 64 65 66 845.971655 294.077030 575.559620 583.173736 298.647476 -142.546825 67 68 69 70 71 72 -126.875448 611.775340 -150.566319 35.335871 228.456427 -416.355915 73 74 75 76 77 78 -375.039137 -427.163702 -253.641311 -77.528299 -440.007458 -70.071807 79 80 81 82 83 84 -93.356402 -638.910727 422.050860 -3.582866 -322.361001 275.258080 85 86 87 88 89 90 303.868357 268.314314 27.677161 7.864046 -2.612350 -322.217329 91 92 93 94 95 96 -17.634462 -152.426895 -595.288922 -269.059742 -32.357821 -28.351849 97 98 99 100 101 102 39.906694 52.559481 105.684125 131.871069 115.563754 110.664560 103 104 105 106 107 108 130.456973 88.998605 76.170177 62.802634 45.342459 16.734880 109 110 111 -6.801058 -27.622569 -51.448202 > postscript(file="/var/www/rcomp/tmp/64kny1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 111 Frequency = 1 lag(myerror, k = 1) myerror 0 953.210126 NA 1 468.960298 953.210126 2 656.113342 468.960298 3 347.947474 656.113342 4 420.394976 347.947474 5 -127.148049 420.394976 6 -280.627471 -127.148049 7 299.621161 -280.627471 8 164.447135 299.621161 9 -349.551116 164.447135 10 197.246941 -349.551116 11 336.638664 197.246941 12 -650.615501 336.638664 13 -212.671939 -650.615501 14 335.421412 -212.671939 15 -65.476371 335.421412 16 -39.642991 -65.476371 17 -299.668599 -39.642991 18 33.854792 -299.668599 19 -280.547436 33.854792 20 -382.826676 -280.547436 21 -115.960113 -382.826676 22 -1707.862821 -115.960113 23 124.493385 -1707.862821 24 871.995587 124.493385 25 -614.550040 871.995587 26 -50.982094 -614.550040 27 -585.248255 -50.982094 28 -663.880146 -585.248255 29 -84.370261 -663.880146 30 267.128665 -84.370261 31 -385.107663 267.128665 32 -326.084172 -385.107663 33 -783.737230 -326.084172 34 -859.433994 -783.737230 35 -570.631865 -859.433994 36 -168.648742 -570.631865 37 433.858084 -168.648742 38 516.779591 433.858084 39 114.429928 516.779591 40 -136.967643 114.429928 41 -126.940027 -136.967643 42 367.664427 -126.940027 43 602.318299 367.664427 44 -117.481718 602.318299 45 -933.264424 -117.481718 46 158.021037 -933.264424 47 783.787096 158.021037 48 256.755789 783.787096 49 -36.762886 256.755789 50 161.209341 -36.762886 51 303.012473 161.209341 52 394.668401 303.012473 53 498.319408 394.668401 54 791.120669 498.319408 55 -641.721494 791.120669 56 22.310579 -641.721494 57 -132.634617 22.310579 58 -560.142499 -132.634617 59 698.502806 -560.142499 60 845.971655 698.502806 61 294.077030 845.971655 62 575.559620 294.077030 63 583.173736 575.559620 64 298.647476 583.173736 65 -142.546825 298.647476 66 -126.875448 -142.546825 67 611.775340 -126.875448 68 -150.566319 611.775340 69 35.335871 -150.566319 70 228.456427 35.335871 71 -416.355915 228.456427 72 -375.039137 -416.355915 73 -427.163702 -375.039137 74 -253.641311 -427.163702 75 -77.528299 -253.641311 76 -440.007458 -77.528299 77 -70.071807 -440.007458 78 -93.356402 -70.071807 79 -638.910727 -93.356402 80 422.050860 -638.910727 81 -3.582866 422.050860 82 -322.361001 -3.582866 83 275.258080 -322.361001 84 303.868357 275.258080 85 268.314314 303.868357 86 27.677161 268.314314 87 7.864046 27.677161 88 -2.612350 7.864046 89 -322.217329 -2.612350 90 -17.634462 -322.217329 91 -152.426895 -17.634462 92 -595.288922 -152.426895 93 -269.059742 -595.288922 94 -32.357821 -269.059742 95 -28.351849 -32.357821 96 39.906694 -28.351849 97 52.559481 39.906694 98 105.684125 52.559481 99 131.871069 105.684125 100 115.563754 131.871069 101 110.664560 115.563754 102 130.456973 110.664560 103 88.998605 130.456973 104 76.170177 88.998605 105 62.802634 76.170177 106 45.342459 62.802634 107 16.734880 45.342459 108 -6.801058 16.734880 109 -27.622569 -6.801058 110 -51.448202 -27.622569 111 NA -51.448202 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 468.960298 953.210126 [2,] 656.113342 468.960298 [3,] 347.947474 656.113342 [4,] 420.394976 347.947474 [5,] -127.148049 420.394976 [6,] -280.627471 -127.148049 [7,] 299.621161 -280.627471 [8,] 164.447135 299.621161 [9,] -349.551116 164.447135 [10,] 197.246941 -349.551116 [11,] 336.638664 197.246941 [12,] -650.615501 336.638664 [13,] -212.671939 -650.615501 [14,] 335.421412 -212.671939 [15,] -65.476371 335.421412 [16,] -39.642991 -65.476371 [17,] -299.668599 -39.642991 [18,] 33.854792 -299.668599 [19,] -280.547436 33.854792 [20,] -382.826676 -280.547436 [21,] -115.960113 -382.826676 [22,] -1707.862821 -115.960113 [23,] 124.493385 -1707.862821 [24,] 871.995587 124.493385 [25,] -614.550040 871.995587 [26,] -50.982094 -614.550040 [27,] -585.248255 -50.982094 [28,] -663.880146 -585.248255 [29,] -84.370261 -663.880146 [30,] 267.128665 -84.370261 [31,] -385.107663 267.128665 [32,] -326.084172 -385.107663 [33,] -783.737230 -326.084172 [34,] -859.433994 -783.737230 [35,] -570.631865 -859.433994 [36,] -168.648742 -570.631865 [37,] 433.858084 -168.648742 [38,] 516.779591 433.858084 [39,] 114.429928 516.779591 [40,] -136.967643 114.429928 [41,] -126.940027 -136.967643 [42,] 367.664427 -126.940027 [43,] 602.318299 367.664427 [44,] -117.481718 602.318299 [45,] -933.264424 -117.481718 [46,] 158.021037 -933.264424 [47,] 783.787096 158.021037 [48,] 256.755789 783.787096 [49,] -36.762886 256.755789 [50,] 161.209341 -36.762886 [51,] 303.012473 161.209341 [52,] 394.668401 303.012473 [53,] 498.319408 394.668401 [54,] 791.120669 498.319408 [55,] -641.721494 791.120669 [56,] 22.310579 -641.721494 [57,] -132.634617 22.310579 [58,] -560.142499 -132.634617 [59,] 698.502806 -560.142499 [60,] 845.971655 698.502806 [61,] 294.077030 845.971655 [62,] 575.559620 294.077030 [63,] 583.173736 575.559620 [64,] 298.647476 583.173736 [65,] -142.546825 298.647476 [66,] -126.875448 -142.546825 [67,] 611.775340 -126.875448 [68,] -150.566319 611.775340 [69,] 35.335871 -150.566319 [70,] 228.456427 35.335871 [71,] -416.355915 228.456427 [72,] -375.039137 -416.355915 [73,] -427.163702 -375.039137 [74,] -253.641311 -427.163702 [75,] -77.528299 -253.641311 [76,] -440.007458 -77.528299 [77,] -70.071807 -440.007458 [78,] -93.356402 -70.071807 [79,] -638.910727 -93.356402 [80,] 422.050860 -638.910727 [81,] -3.582866 422.050860 [82,] -322.361001 -3.582866 [83,] 275.258080 -322.361001 [84,] 303.868357 275.258080 [85,] 268.314314 303.868357 [86,] 27.677161 268.314314 [87,] 7.864046 27.677161 [88,] -2.612350 7.864046 [89,] -322.217329 -2.612350 [90,] -17.634462 -322.217329 [91,] -152.426895 -17.634462 [92,] -595.288922 -152.426895 [93,] -269.059742 -595.288922 [94,] -32.357821 -269.059742 [95,] -28.351849 -32.357821 [96,] 39.906694 -28.351849 [97,] 52.559481 39.906694 [98,] 105.684125 52.559481 [99,] 131.871069 105.684125 [100,] 115.563754 131.871069 [101,] 110.664560 115.563754 [102,] 130.456973 110.664560 [103,] 88.998605 130.456973 [104,] 76.170177 88.998605 [105,] 62.802634 76.170177 [106,] 45.342459 62.802634 [107,] 16.734880 45.342459 [108,] -6.801058 16.734880 [109,] -27.622569 -6.801058 [110,] -51.448202 -27.622569 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 468.960298 953.210126 2 656.113342 468.960298 3 347.947474 656.113342 4 420.394976 347.947474 5 -127.148049 420.394976 6 -280.627471 -127.148049 7 299.621161 -280.627471 8 164.447135 299.621161 9 -349.551116 164.447135 10 197.246941 -349.551116 11 336.638664 197.246941 12 -650.615501 336.638664 13 -212.671939 -650.615501 14 335.421412 -212.671939 15 -65.476371 335.421412 16 -39.642991 -65.476371 17 -299.668599 -39.642991 18 33.854792 -299.668599 19 -280.547436 33.854792 20 -382.826676 -280.547436 21 -115.960113 -382.826676 22 -1707.862821 -115.960113 23 124.493385 -1707.862821 24 871.995587 124.493385 25 -614.550040 871.995587 26 -50.982094 -614.550040 27 -585.248255 -50.982094 28 -663.880146 -585.248255 29 -84.370261 -663.880146 30 267.128665 -84.370261 31 -385.107663 267.128665 32 -326.084172 -385.107663 33 -783.737230 -326.084172 34 -859.433994 -783.737230 35 -570.631865 -859.433994 36 -168.648742 -570.631865 37 433.858084 -168.648742 38 516.779591 433.858084 39 114.429928 516.779591 40 -136.967643 114.429928 41 -126.940027 -136.967643 42 367.664427 -126.940027 43 602.318299 367.664427 44 -117.481718 602.318299 45 -933.264424 -117.481718 46 158.021037 -933.264424 47 783.787096 158.021037 48 256.755789 783.787096 49 -36.762886 256.755789 50 161.209341 -36.762886 51 303.012473 161.209341 52 394.668401 303.012473 53 498.319408 394.668401 54 791.120669 498.319408 55 -641.721494 791.120669 56 22.310579 -641.721494 57 -132.634617 22.310579 58 -560.142499 -132.634617 59 698.502806 -560.142499 60 845.971655 698.502806 61 294.077030 845.971655 62 575.559620 294.077030 63 583.173736 575.559620 64 298.647476 583.173736 65 -142.546825 298.647476 66 -126.875448 -142.546825 67 611.775340 -126.875448 68 -150.566319 611.775340 69 35.335871 -150.566319 70 228.456427 35.335871 71 -416.355915 228.456427 72 -375.039137 -416.355915 73 -427.163702 -375.039137 74 -253.641311 -427.163702 75 -77.528299 -253.641311 76 -440.007458 -77.528299 77 -70.071807 -440.007458 78 -93.356402 -70.071807 79 -638.910727 -93.356402 80 422.050860 -638.910727 81 -3.582866 422.050860 82 -322.361001 -3.582866 83 275.258080 -322.361001 84 303.868357 275.258080 85 268.314314 303.868357 86 27.677161 268.314314 87 7.864046 27.677161 88 -2.612350 7.864046 89 -322.217329 -2.612350 90 -17.634462 -322.217329 91 -152.426895 -17.634462 92 -595.288922 -152.426895 93 -269.059742 -595.288922 94 -32.357821 -269.059742 95 -28.351849 -32.357821 96 39.906694 -28.351849 97 52.559481 39.906694 98 105.684125 52.559481 99 131.871069 105.684125 100 115.563754 131.871069 101 110.664560 115.563754 102 130.456973 110.664560 103 88.998605 130.456973 104 76.170177 88.998605 105 62.802634 76.170177 106 45.342459 62.802634 107 16.734880 45.342459 108 -6.801058 16.734880 109 -27.622569 -6.801058 110 -51.448202 -27.622569 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/7xb4j1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/8q3mm1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/9q3mm1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/10q3mm1292262484.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/11wm4q1292262485.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/127wlb1292262485.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/13exi41292262485.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/1466h71292262485.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/15soyv1292262485.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/16ogem1292262485.tab") + } > > try(system("convert tmp/1btov1292262484.ps tmp/1btov1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/2btov1292262484.ps tmp/2btov1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/34kny1292262484.ps tmp/34kny1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/44kny1292262484.ps tmp/44kny1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/54kny1292262484.ps tmp/54kny1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/64kny1292262484.ps tmp/64kny1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/7xb4j1292262484.ps tmp/7xb4j1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/8q3mm1292262484.ps tmp/8q3mm1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/9q3mm1292262484.ps tmp/9q3mm1292262484.png",intern=TRUE)) character(0) > try(system("convert tmp/10q3mm1292262484.ps tmp/10q3mm1292262484.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.730 1.750 5.443