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. > x <- array(list(43880 + ,25222 + ,43110 + ,21333 + ,44496 + ,19778 + ,44164 + ,25943 + ,40399 + ,21698 + ,36763 + ,20077 + ,37903 + ,25673 + ,35532 + ,19094 + ,35533 + ,19306 + ,32110 + ,15443 + ,33374 + ,15179 + ,35462 + ,18288 + ,33508 + ,18264 + ,36080 + ,16406 + ,34560 + ,15678 + ,38737 + ,19657 + ,38144 + ,18821 + ,37594 + ,19493 + ,36424 + ,21078 + ,36843 + ,19296 + ,37246 + ,19985 + ,38661 + ,16972 + ,40454 + ,16951 + ,44928 + ,23126 + ,48441 + ,24890 + ,48140 + ,21042 + ,45998 + ,20842 + ,47369 + ,23904 + ,49554 + ,22578 + ,47510 + ,25452 + ,44873 + ,21928 + ,45344 + ,25227 + ,42413 + ,26210 + ,36912 + ,17436 + ,43452 + ,21258 + ,42142 + ,25638 + ,44382 + ,23516 + ,43636 + ,23891 + ,44167 + ,24617 + ,44423 + ,26174 + ,42868 + ,23339 + ,43908 + ,23660 + ,42013 + ,26500 + ,38846 + ,22469 + ,35087 + ,23163 + ,33026 + ,16170 + ,34646 + ,18267 + ,37135 + ,20561 + ,37985 + ,20372 + ,43121 + ,19017 + ,43722 + ,18242 + ,43630 + ,20937 + ,42234 + ,22065 + ,39351 + ,16731 + ,39327 + ,21943 + ,35704 + ,19254 + ,30466 + ,16397 + ,28155 + ,13644 + ,29257 + ,14375 + ,29998 + ,14814 + ,32529 + ,16061 + ,34787 + ,14784 + ,33855 + ,12824 + ,34556 + ,18282 + ,31348 + ,14936 + ,30805 + ,15701 + ,28353 + ,16394 + ,24514 + ,13085 + ,21106 + ,11431 + ,21346 + ,9334 + ,23335 + ,10921 + ,24379 + ,11725 + ,26290 + ,13077 + ,30084 + ,11794 + ,29429 + ,11047 + ,30632 + ,16797 + ,27349 + ,11482 + ,27264 + ,12657 + ,27474 + ,15277 + ,24482 + ,12385 + ,21453 + ,11996 + ,18788 + ,8395 + ,19282 + ,8928 + ,19713 + ,9937 + ,21917 + ,11468 + ,23812 + ,9554 + ,23785 + ,9226 + ,24696 + ,11021 + ,24562 + ,10065 + ,23580 + ,9939 + ,24939 + ,11179 + ,23899 + ,11943 + ,21454 + ,10792 + ,19761 + ,8080 + ,19815 + ,8603 + ,20780 + ,11561 + ,23462 + ,10449 + ,25005 + ,8197 + ,24725 + ,7602 + ,26198 + ,9521 + ,27543 + ,10412 + ,26471 + ,10860 + ,26558 + ,11538 + ,25317 + ,11420 + ,22896 + ,10408 + ,22248 + ,5998 + ,23406 + ,8356 + ,25073 + ,10569 + ,27691 + ,9660 + ,30599 + ,9304 + ,31948 + ,9114 + ,32946 + ,10492 + ,34012 + ,12388 + ,32936 + ,10003 + ,32974 + ,14029 + ,30951 + ,12452 + ,29812 + ,12332 + ,29010 + ,8064 + ,31068 + ,10931 + ,32447 + ,12631 + ,34844 + ,13656 + ,35676 + ,11005 + ,35387 + ,8879 + ,36488 + ,11536 + ,35652 + ,13698 + ,33488 + ,10853 + ,32914 + ,15107 + ,29781 + ,13604 + ,27951 + ,12231) + ,dim=c(2 + ,129) + ,dimnames=list(c('OPENVAC' + ,'OntvangenJobs') + ,1:129)) > y <- array(NA,dim=c(2,129),dimnames=list(c('OPENVAC','OntvangenJobs'),1:129)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No 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 Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > 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 OPENVAC OntvangenJobs 1 43880 25222 2 43110 21333 3 44496 19778 4 44164 25943 5 40399 21698 6 36763 20077 7 37903 25673 8 35532 19094 9 35533 19306 10 32110 15443 11 33374 15179 12 35462 18288 13 33508 18264 14 36080 16406 15 34560 15678 16 38737 19657 17 38144 18821 18 37594 19493 19 36424 21078 20 36843 19296 21 37246 19985 22 38661 16972 23 40454 16951 24 44928 23126 25 48441 24890 26 48140 21042 27 45998 20842 28 47369 23904 29 49554 22578 30 47510 25452 31 44873 21928 32 45344 25227 33 42413 26210 34 36912 17436 35 43452 21258 36 42142 25638 37 44382 23516 38 43636 23891 39 44167 24617 40 44423 26174 41 42868 23339 42 43908 23660 43 42013 26500 44 38846 22469 45 35087 23163 46 33026 16170 47 34646 18267 48 37135 20561 49 37985 20372 50 43121 19017 51 43722 18242 52 43630 20937 53 42234 22065 54 39351 16731 55 39327 21943 56 35704 19254 57 30466 16397 58 28155 13644 59 29257 14375 60 29998 14814 61 32529 16061 62 34787 14784 63 33855 12824 64 34556 18282 65 31348 14936 66 30805 15701 67 28353 16394 68 24514 13085 69 21106 11431 70 21346 9334 71 23335 10921 72 24379 11725 73 26290 13077 74 30084 11794 75 29429 11047 76 30632 16797 77 27349 11482 78 27264 12657 79 27474 15277 80 24482 12385 81 21453 11996 82 18788 8395 83 19282 8928 84 19713 9937 85 21917 11468 86 23812 9554 87 23785 9226 88 24696 11021 89 24562 10065 90 23580 9939 91 24939 11179 92 23899 11943 93 21454 10792 94 19761 8080 95 19815 8603 96 20780 11561 97 23462 10449 98 25005 8197 99 24725 7602 100 26198 9521 101 27543 10412 102 26471 10860 103 26558 11538 104 25317 11420 105 22896 10408 106 22248 5998 107 23406 8356 108 25073 10569 109 27691 9660 110 30599 9304 111 31948 9114 112 32946 10492 113 34012 12388 114 32936 10003 115 32974 14029 116 30951 12452 117 29812 12332 118 29010 8064 119 31068 10931 120 32447 12631 121 34844 13656 122 35676 11005 123 35387 8879 124 36488 11536 125 35652 13698 126 33488 10853 127 32914 15107 128 29781 13604 129 27951 12231 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) OntvangenJobs 13329.223 1.261 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7804.9 -2489.1 -696.8 2178.6 10859.6 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.333e+04 1.069e+03 12.46 <2e-16 *** OntvangenJobs 1.261e+00 6.426e-02 19.63 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3966 on 127 degrees of freedom Multiple R-squared: 0.7521, Adjusted R-squared: 0.7501 F-statistic: 385.2 on 1 and 127 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.115330292 0.23066058 0.88466971 [2,] 0.303117147 0.60623429 0.69688285 [3,] 0.423787567 0.84757513 0.57621243 [4,] 0.465607926 0.93121585 0.53439207 [5,] 0.432881073 0.86576215 0.56711893 [6,] 0.384772345 0.76954469 0.61522766 [7,] 0.288832377 0.57766475 0.71116762 [8,] 0.213477519 0.42695504 0.78652248 [9,] 0.185499224 0.37099845 0.81450078 [10,] 0.138156021 0.27631204 0.86184398 [11,] 0.094193389 0.18838678 0.90580661 [12,] 0.063973007 0.12794601 0.93602699 [13,] 0.042778217 0.08555643 0.95722178 [14,] 0.026459202 0.05291840 0.97354080 [15,] 0.022004427 0.04400885 0.97799557 [16,] 0.013377920 0.02675584 0.98662208 [17,] 0.008038171 0.01607634 0.99196183 [18,] 0.008229190 0.01645838 0.99177081 [19,] 0.014609402 0.02921880 0.98539060 [20,] 0.017703350 0.03540670 0.98229665 [21,] 0.032266205 0.06453241 0.96773380 [22,] 0.132270090 0.26454018 0.86772991 [23,] 0.199858509 0.39971702 0.80014149 [24,] 0.205526403 0.41105281 0.79447360 [25,] 0.347900489 0.69580098 0.65209951 [26,] 0.305433961 0.61086792 0.69456604 [27,] 0.292263349 0.58452670 0.70773665 [28,] 0.244175720 0.48835144 0.75582428 [29,] 0.250245669 0.50049134 0.74975433 [30,] 0.207961648 0.41592330 0.79203835 [31,] 0.190278199 0.38055640 0.80972180 [32,] 0.181983632 0.36396726 0.81801637 [33,] 0.151110626 0.30222125 0.84888937 [34,] 0.120679765 0.24135953 0.87932023 [35,] 0.094945259 0.18989052 0.90505474 [36,] 0.076246026 0.15249205 0.92375397 [37,] 0.058509134 0.11701827 0.94149087 [38,] 0.045081425 0.09016285 0.95491857 [39,] 0.046890498 0.09378100 0.95310950 [40,] 0.041651405 0.08330281 0.95834860 [41,] 0.087388674 0.17477735 0.91261133 [42,] 0.074007934 0.14801587 0.92599207 [43,] 0.064240339 0.12848068 0.93575966 [44,] 0.054857235 0.10971447 0.94514277 [45,] 0.043072965 0.08614593 0.95692704 [46,] 0.055475551 0.11095110 0.94452445 [47,] 0.094652556 0.18930511 0.90534744 [48,] 0.097496497 0.19499299 0.90250350 [49,] 0.081942435 0.16388487 0.91805757 [50,] 0.089193692 0.17838738 0.91080631 [51,] 0.074448748 0.14889750 0.92555125 [52,] 0.065078200 0.13015640 0.93492180 [53,] 0.072365748 0.14473150 0.92763425 [54,] 0.072375963 0.14475193 0.92762404 [55,] 0.066959231 0.13391846 0.93304077 [56,] 0.058973440 0.11794688 0.94102656 [57,] 0.047642563 0.09528513 0.95235744 [58,] 0.041940401 0.08388080 0.95805960 [59,] 0.041835494 0.08367099 0.95816451 [60,] 0.034512016 0.06902403 0.96548798 [61,] 0.027413316 0.05482663 0.97258668 [62,] 0.023379470 0.04675894 0.97662053 [63,] 0.031229427 0.06245885 0.96877057 [64,] 0.041033553 0.08206711 0.95896645 [65,] 0.067203770 0.13440754 0.93279623 [66,] 0.065927106 0.13185421 0.93407289 [67,] 0.062560674 0.12512135 0.93743933 [68,] 0.058098386 0.11619677 0.94190161 [69,] 0.051975654 0.10395131 0.94802435 [70,] 0.043646274 0.08729255 0.95635373 [71,] 0.036938925 0.07387785 0.96306107 [72,] 0.033772161 0.06754432 0.96622784 [73,] 0.025279204 0.05055841 0.97472080 [74,] 0.019685143 0.03937029 0.98031486 [75,] 0.022839524 0.04567905 0.97716048 [76,] 0.023868117 0.04773623 0.97613188 [77,] 0.041605908 0.08321182 0.95839409 [78,] 0.045709506 0.09141901 0.95429049 [79,] 0.053151936 0.10630387 0.94684806 [80,] 0.073512950 0.14702590 0.92648705 [81,] 0.098543976 0.19708795 0.90145602 [82,] 0.083439340 0.16687868 0.91656066 [83,] 0.069442378 0.13888476 0.93055762 [84,] 0.062085787 0.12417157 0.93791421 [85,] 0.051846574 0.10369315 0.94815343 [86,] 0.045905429 0.09181086 0.95409457 [87,] 0.041486729 0.08297346 0.95851327 [88,] 0.050948169 0.10189634 0.94905183 [89,] 0.078618894 0.15723779 0.92138111 [90,] 0.092770393 0.18554079 0.90722961 [91,] 0.129996943 0.25999389 0.87000306 [92,] 0.303142958 0.60628592 0.69685704 [93,] 0.354647188 0.70929438 0.64535281 [94,] 0.334222013 0.66844403 0.66577799 [95,] 0.315647237 0.63129447 0.68435276 [96,] 0.292870674 0.58574135 0.70712933 [97,] 0.264470799 0.52894160 0.73552920 [98,] 0.256647234 0.51329447 0.74335277 [99,] 0.264844248 0.52968850 0.73515575 [100,] 0.322668348 0.64533670 0.67733165 [101,] 0.503190423 0.99361915 0.49680958 [102,] 0.584621534 0.83075693 0.41537847 [103,] 0.765076520 0.46984696 0.23492348 [104,] 0.909825986 0.18034803 0.09017401 [105,] 0.941596842 0.11680632 0.05840316 [106,] 0.937396483 0.12520703 0.06260352 [107,] 0.928714629 0.14257074 0.07128537 [108,] 0.911944490 0.17611102 0.08805551 [109,] 0.890470485 0.21905903 0.10952951 [110,] 0.865271656 0.26945669 0.13472834 [111,] 0.811843642 0.37631272 0.18815636 [112,] 0.762329977 0.47534005 0.23767002 [113,] 0.744177033 0.51164593 0.25582297 [114,] 0.808625522 0.38274896 0.19137448 [115,] 0.791208810 0.41758238 0.20879119 [116,] 0.708914634 0.58217073 0.29108537 [117,] 0.642179945 0.71564011 0.35782006 [118,] 0.571260228 0.85747954 0.42873977 [119,] 0.474821738 0.94964348 0.52517826 [120,] 0.509439905 0.98112019 0.49056009 > postscript(file="/var/www/html/rcomp/tmp/1mtks1290755448.ps",horizontal=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/html/rcomp/tmp/2xl2d1290755448.ps",horizontal=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/html/rcomp/tmp/3xl2d1290755448.ps",horizontal=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/html/rcomp/tmp/4xl2d1290755448.ps",horizontal=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/html/rcomp/tmp/58cjy1290755448.ps",horizontal=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 = 129 Frequency = 1 1 2 3 4 5 6 7 -1259.1160 2875.6764 6222.8367 -1884.4386 -295.6602 -1887.2610 -7804.9156 8 9 10 11 12 13 14 -1878.5051 -2144.8787 -695.8773 901.0785 -931.9808 -2855.7121 2059.5906 15 16 17 18 19 20 21 1457.7415 616.4414 1077.8015 -319.7224 -3488.7185 -822.2667 -1288.2310 22 23 24 25 26 27 28 3926.7535 5746.2386 2432.3514 3720.6011 8272.6845 6382.9238 3892.1407 29 30 31 32 33 34 35 7749.4870 2080.8088 3888.2646 198.5780 -3972.1780 1592.5584 3312.2661 36 37 38 39 40 41 42 -3521.7737 1394.4849 175.5363 -209.0923 -1916.7749 103.7166 738.8726 43 44 45 46 47 48 49 -4737.9249 -2821.0426 -7455.3128 -696.7671 -1721.4957 -2125.6800 -1037.3139 50 51 52 53 54 55 56 5807.6071 7386.0342 3895.1101 1076.4807 4920.7018 -1676.6533 -1908.2965 57 58 59 60 61 62 63 -3543.0586 -2381.9852 -2201.9197 -2014.5849 -1056.2967 2812.2510 4352.1958 64 65 66 67 68 69 70 -1830.4137 -818.4508 -2326.2660 -5652.2750 -5317.9764 -6639.9578 -3755.2291 71 72 73 74 75 76 77 -3767.7476 -3737.7495 -3531.8869 1880.2280 2167.3416 -3881.5371 -461.2788 78 79 80 81 82 83 84 -2028.1844 -5122.5188 -4467.1390 -7005.5337 -5128.9658 -5307.1834 -6148.7305 85 86 87 88 89 90 91 -5875.6220 -1566.6923 -1180.0199 -2532.8673 -1461.1636 -2284.2529 -2489.1363 92 93 94 95 96 97 98 -4492.6903 -5486.0533 -3758.6889 -4364.2946 -7129.9133 -3045.4630 1337.7511 99 100 101 102 103 104 105 1808.1629 860.9272 1082.2013 -554.8147 -1322.9058 -2415.0846 -3559.7539 106 107 108 109 110 111 112 1354.1218 -461.7791 -1585.8065 2178.6209 5535.6068 7124.2341 6384.3056 113 114 115 116 117 118 119 5059.0774 6991.0306 1951.4542 1917.3608 929.7044 5510.4902 3952.6404 120 121 122 123 124 125 126 3187.6067 4291.8805 8467.3119 10859.6152 8609.6166 5046.9102 6471.0137 127 128 129 531.8846 -705.5373 -803.9148 > postscript(file="/var/www/html/rcomp/tmp/68cjy1290755448.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 129 Frequency = 1 lag(myerror, k = 1) myerror 0 -1259.1160 NA 1 2875.6764 -1259.1160 2 6222.8367 2875.6764 3 -1884.4386 6222.8367 4 -295.6602 -1884.4386 5 -1887.2610 -295.6602 6 -7804.9156 -1887.2610 7 -1878.5051 -7804.9156 8 -2144.8787 -1878.5051 9 -695.8773 -2144.8787 10 901.0785 -695.8773 11 -931.9808 901.0785 12 -2855.7121 -931.9808 13 2059.5906 -2855.7121 14 1457.7415 2059.5906 15 616.4414 1457.7415 16 1077.8015 616.4414 17 -319.7224 1077.8015 18 -3488.7185 -319.7224 19 -822.2667 -3488.7185 20 -1288.2310 -822.2667 21 3926.7535 -1288.2310 22 5746.2386 3926.7535 23 2432.3514 5746.2386 24 3720.6011 2432.3514 25 8272.6845 3720.6011 26 6382.9238 8272.6845 27 3892.1407 6382.9238 28 7749.4870 3892.1407 29 2080.8088 7749.4870 30 3888.2646 2080.8088 31 198.5780 3888.2646 32 -3972.1780 198.5780 33 1592.5584 -3972.1780 34 3312.2661 1592.5584 35 -3521.7737 3312.2661 36 1394.4849 -3521.7737 37 175.5363 1394.4849 38 -209.0923 175.5363 39 -1916.7749 -209.0923 40 103.7166 -1916.7749 41 738.8726 103.7166 42 -4737.9249 738.8726 43 -2821.0426 -4737.9249 44 -7455.3128 -2821.0426 45 -696.7671 -7455.3128 46 -1721.4957 -696.7671 47 -2125.6800 -1721.4957 48 -1037.3139 -2125.6800 49 5807.6071 -1037.3139 50 7386.0342 5807.6071 51 3895.1101 7386.0342 52 1076.4807 3895.1101 53 4920.7018 1076.4807 54 -1676.6533 4920.7018 55 -1908.2965 -1676.6533 56 -3543.0586 -1908.2965 57 -2381.9852 -3543.0586 58 -2201.9197 -2381.9852 59 -2014.5849 -2201.9197 60 -1056.2967 -2014.5849 61 2812.2510 -1056.2967 62 4352.1958 2812.2510 63 -1830.4137 4352.1958 64 -818.4508 -1830.4137 65 -2326.2660 -818.4508 66 -5652.2750 -2326.2660 67 -5317.9764 -5652.2750 68 -6639.9578 -5317.9764 69 -3755.2291 -6639.9578 70 -3767.7476 -3755.2291 71 -3737.7495 -3767.7476 72 -3531.8869 -3737.7495 73 1880.2280 -3531.8869 74 2167.3416 1880.2280 75 -3881.5371 2167.3416 76 -461.2788 -3881.5371 77 -2028.1844 -461.2788 78 -5122.5188 -2028.1844 79 -4467.1390 -5122.5188 80 -7005.5337 -4467.1390 81 -5128.9658 -7005.5337 82 -5307.1834 -5128.9658 83 -6148.7305 -5307.1834 84 -5875.6220 -6148.7305 85 -1566.6923 -5875.6220 86 -1180.0199 -1566.6923 87 -2532.8673 -1180.0199 88 -1461.1636 -2532.8673 89 -2284.2529 -1461.1636 90 -2489.1363 -2284.2529 91 -4492.6903 -2489.1363 92 -5486.0533 -4492.6903 93 -3758.6889 -5486.0533 94 -4364.2946 -3758.6889 95 -7129.9133 -4364.2946 96 -3045.4630 -7129.9133 97 1337.7511 -3045.4630 98 1808.1629 1337.7511 99 860.9272 1808.1629 100 1082.2013 860.9272 101 -554.8147 1082.2013 102 -1322.9058 -554.8147 103 -2415.0846 -1322.9058 104 -3559.7539 -2415.0846 105 1354.1218 -3559.7539 106 -461.7791 1354.1218 107 -1585.8065 -461.7791 108 2178.6209 -1585.8065 109 5535.6068 2178.6209 110 7124.2341 5535.6068 111 6384.3056 7124.2341 112 5059.0774 6384.3056 113 6991.0306 5059.0774 114 1951.4542 6991.0306 115 1917.3608 1951.4542 116 929.7044 1917.3608 117 5510.4902 929.7044 118 3952.6404 5510.4902 119 3187.6067 3952.6404 120 4291.8805 3187.6067 121 8467.3119 4291.8805 122 10859.6152 8467.3119 123 8609.6166 10859.6152 124 5046.9102 8609.6166 125 6471.0137 5046.9102 126 531.8846 6471.0137 127 -705.5373 531.8846 128 -803.9148 -705.5373 129 NA -803.9148 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2875.6764 -1259.1160 [2,] 6222.8367 2875.6764 [3,] -1884.4386 6222.8367 [4,] -295.6602 -1884.4386 [5,] -1887.2610 -295.6602 [6,] -7804.9156 -1887.2610 [7,] -1878.5051 -7804.9156 [8,] -2144.8787 -1878.5051 [9,] -695.8773 -2144.8787 [10,] 901.0785 -695.8773 [11,] -931.9808 901.0785 [12,] -2855.7121 -931.9808 [13,] 2059.5906 -2855.7121 [14,] 1457.7415 2059.5906 [15,] 616.4414 1457.7415 [16,] 1077.8015 616.4414 [17,] -319.7224 1077.8015 [18,] -3488.7185 -319.7224 [19,] -822.2667 -3488.7185 [20,] -1288.2310 -822.2667 [21,] 3926.7535 -1288.2310 [22,] 5746.2386 3926.7535 [23,] 2432.3514 5746.2386 [24,] 3720.6011 2432.3514 [25,] 8272.6845 3720.6011 [26,] 6382.9238 8272.6845 [27,] 3892.1407 6382.9238 [28,] 7749.4870 3892.1407 [29,] 2080.8088 7749.4870 [30,] 3888.2646 2080.8088 [31,] 198.5780 3888.2646 [32,] -3972.1780 198.5780 [33,] 1592.5584 -3972.1780 [34,] 3312.2661 1592.5584 [35,] -3521.7737 3312.2661 [36,] 1394.4849 -3521.7737 [37,] 175.5363 1394.4849 [38,] -209.0923 175.5363 [39,] -1916.7749 -209.0923 [40,] 103.7166 -1916.7749 [41,] 738.8726 103.7166 [42,] -4737.9249 738.8726 [43,] -2821.0426 -4737.9249 [44,] -7455.3128 -2821.0426 [45,] -696.7671 -7455.3128 [46,] -1721.4957 -696.7671 [47,] -2125.6800 -1721.4957 [48,] -1037.3139 -2125.6800 [49,] 5807.6071 -1037.3139 [50,] 7386.0342 5807.6071 [51,] 3895.1101 7386.0342 [52,] 1076.4807 3895.1101 [53,] 4920.7018 1076.4807 [54,] -1676.6533 4920.7018 [55,] -1908.2965 -1676.6533 [56,] -3543.0586 -1908.2965 [57,] -2381.9852 -3543.0586 [58,] -2201.9197 -2381.9852 [59,] -2014.5849 -2201.9197 [60,] -1056.2967 -2014.5849 [61,] 2812.2510 -1056.2967 [62,] 4352.1958 2812.2510 [63,] -1830.4137 4352.1958 [64,] -818.4508 -1830.4137 [65,] -2326.2660 -818.4508 [66,] -5652.2750 -2326.2660 [67,] -5317.9764 -5652.2750 [68,] -6639.9578 -5317.9764 [69,] -3755.2291 -6639.9578 [70,] -3767.7476 -3755.2291 [71,] -3737.7495 -3767.7476 [72,] -3531.8869 -3737.7495 [73,] 1880.2280 -3531.8869 [74,] 2167.3416 1880.2280 [75,] -3881.5371 2167.3416 [76,] -461.2788 -3881.5371 [77,] -2028.1844 -461.2788 [78,] -5122.5188 -2028.1844 [79,] -4467.1390 -5122.5188 [80,] -7005.5337 -4467.1390 [81,] -5128.9658 -7005.5337 [82,] -5307.1834 -5128.9658 [83,] -6148.7305 -5307.1834 [84,] -5875.6220 -6148.7305 [85,] -1566.6923 -5875.6220 [86,] -1180.0199 -1566.6923 [87,] -2532.8673 -1180.0199 [88,] -1461.1636 -2532.8673 [89,] -2284.2529 -1461.1636 [90,] -2489.1363 -2284.2529 [91,] -4492.6903 -2489.1363 [92,] -5486.0533 -4492.6903 [93,] -3758.6889 -5486.0533 [94,] -4364.2946 -3758.6889 [95,] -7129.9133 -4364.2946 [96,] -3045.4630 -7129.9133 [97,] 1337.7511 -3045.4630 [98,] 1808.1629 1337.7511 [99,] 860.9272 1808.1629 [100,] 1082.2013 860.9272 [101,] -554.8147 1082.2013 [102,] -1322.9058 -554.8147 [103,] -2415.0846 -1322.9058 [104,] -3559.7539 -2415.0846 [105,] 1354.1218 -3559.7539 [106,] -461.7791 1354.1218 [107,] -1585.8065 -461.7791 [108,] 2178.6209 -1585.8065 [109,] 5535.6068 2178.6209 [110,] 7124.2341 5535.6068 [111,] 6384.3056 7124.2341 [112,] 5059.0774 6384.3056 [113,] 6991.0306 5059.0774 [114,] 1951.4542 6991.0306 [115,] 1917.3608 1951.4542 [116,] 929.7044 1917.3608 [117,] 5510.4902 929.7044 [118,] 3952.6404 5510.4902 [119,] 3187.6067 3952.6404 [120,] 4291.8805 3187.6067 [121,] 8467.3119 4291.8805 [122,] 10859.6152 8467.3119 [123,] 8609.6166 10859.6152 [124,] 5046.9102 8609.6166 [125,] 6471.0137 5046.9102 [126,] 531.8846 6471.0137 [127,] -705.5373 531.8846 [128,] -803.9148 -705.5373 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2875.6764 -1259.1160 2 6222.8367 2875.6764 3 -1884.4386 6222.8367 4 -295.6602 -1884.4386 5 -1887.2610 -295.6602 6 -7804.9156 -1887.2610 7 -1878.5051 -7804.9156 8 -2144.8787 -1878.5051 9 -695.8773 -2144.8787 10 901.0785 -695.8773 11 -931.9808 901.0785 12 -2855.7121 -931.9808 13 2059.5906 -2855.7121 14 1457.7415 2059.5906 15 616.4414 1457.7415 16 1077.8015 616.4414 17 -319.7224 1077.8015 18 -3488.7185 -319.7224 19 -822.2667 -3488.7185 20 -1288.2310 -822.2667 21 3926.7535 -1288.2310 22 5746.2386 3926.7535 23 2432.3514 5746.2386 24 3720.6011 2432.3514 25 8272.6845 3720.6011 26 6382.9238 8272.6845 27 3892.1407 6382.9238 28 7749.4870 3892.1407 29 2080.8088 7749.4870 30 3888.2646 2080.8088 31 198.5780 3888.2646 32 -3972.1780 198.5780 33 1592.5584 -3972.1780 34 3312.2661 1592.5584 35 -3521.7737 3312.2661 36 1394.4849 -3521.7737 37 175.5363 1394.4849 38 -209.0923 175.5363 39 -1916.7749 -209.0923 40 103.7166 -1916.7749 41 738.8726 103.7166 42 -4737.9249 738.8726 43 -2821.0426 -4737.9249 44 -7455.3128 -2821.0426 45 -696.7671 -7455.3128 46 -1721.4957 -696.7671 47 -2125.6800 -1721.4957 48 -1037.3139 -2125.6800 49 5807.6071 -1037.3139 50 7386.0342 5807.6071 51 3895.1101 7386.0342 52 1076.4807 3895.1101 53 4920.7018 1076.4807 54 -1676.6533 4920.7018 55 -1908.2965 -1676.6533 56 -3543.0586 -1908.2965 57 -2381.9852 -3543.0586 58 -2201.9197 -2381.9852 59 -2014.5849 -2201.9197 60 -1056.2967 -2014.5849 61 2812.2510 -1056.2967 62 4352.1958 2812.2510 63 -1830.4137 4352.1958 64 -818.4508 -1830.4137 65 -2326.2660 -818.4508 66 -5652.2750 -2326.2660 67 -5317.9764 -5652.2750 68 -6639.9578 -5317.9764 69 -3755.2291 -6639.9578 70 -3767.7476 -3755.2291 71 -3737.7495 -3767.7476 72 -3531.8869 -3737.7495 73 1880.2280 -3531.8869 74 2167.3416 1880.2280 75 -3881.5371 2167.3416 76 -461.2788 -3881.5371 77 -2028.1844 -461.2788 78 -5122.5188 -2028.1844 79 -4467.1390 -5122.5188 80 -7005.5337 -4467.1390 81 -5128.9658 -7005.5337 82 -5307.1834 -5128.9658 83 -6148.7305 -5307.1834 84 -5875.6220 -6148.7305 85 -1566.6923 -5875.6220 86 -1180.0199 -1566.6923 87 -2532.8673 -1180.0199 88 -1461.1636 -2532.8673 89 -2284.2529 -1461.1636 90 -2489.1363 -2284.2529 91 -4492.6903 -2489.1363 92 -5486.0533 -4492.6903 93 -3758.6889 -5486.0533 94 -4364.2946 -3758.6889 95 -7129.9133 -4364.2946 96 -3045.4630 -7129.9133 97 1337.7511 -3045.4630 98 1808.1629 1337.7511 99 860.9272 1808.1629 100 1082.2013 860.9272 101 -554.8147 1082.2013 102 -1322.9058 -554.8147 103 -2415.0846 -1322.9058 104 -3559.7539 -2415.0846 105 1354.1218 -3559.7539 106 -461.7791 1354.1218 107 -1585.8065 -461.7791 108 2178.6209 -1585.8065 109 5535.6068 2178.6209 110 7124.2341 5535.6068 111 6384.3056 7124.2341 112 5059.0774 6384.3056 113 6991.0306 5059.0774 114 1951.4542 6991.0306 115 1917.3608 1951.4542 116 929.7044 1917.3608 117 5510.4902 929.7044 118 3952.6404 5510.4902 119 3187.6067 3952.6404 120 4291.8805 3187.6067 121 8467.3119 4291.8805 122 10859.6152 8467.3119 123 8609.6166 10859.6152 124 5046.9102 8609.6166 125 6471.0137 5046.9102 126 531.8846 6471.0137 127 -705.5373 531.8846 128 -803.9148 -705.5373 > 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/html/rcomp/tmp/7il0j1290755448.ps",horizontal=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/html/rcomp/tmp/8il0j1290755448.ps",horizontal=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/html/rcomp/tmp/9tuzm1290755448.ps",horizontal=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/html/rcomp/tmp/10tuzm1290755448.ps",horizontal=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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/11fvgs1290755448.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/html/rcomp/tmp/12ivwy1290755448.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/html/rcomp/tmp/13pftr1290755448.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/html/rcomp/tmp/14z6bc1290755448.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/html/rcomp/tmp/15lori1290755448.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/html/rcomp/tmp/1667qo1290755448.tab") + } > > try(system("convert tmp/1mtks1290755448.ps tmp/1mtks1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/2xl2d1290755448.ps tmp/2xl2d1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/3xl2d1290755448.ps tmp/3xl2d1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/4xl2d1290755448.ps tmp/4xl2d1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/58cjy1290755448.ps tmp/58cjy1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/68cjy1290755448.ps tmp/68cjy1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/7il0j1290755448.ps tmp/7il0j1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/8il0j1290755448.ps tmp/8il0j1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/9tuzm1290755448.ps tmp/9tuzm1290755448.png",intern=TRUE)) character(0) > try(system("convert tmp/10tuzm1290755448.ps tmp/10tuzm1290755448.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.319 1.649 7.415