R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(593408 + ,280190 + ,313218 + ,44148 + ,125326 + ,223560 + ,590072 + ,280408 + ,309664 + ,42065 + ,122716 + ,223789 + ,579799 + ,276836 + ,302963 + ,38546 + ,116615 + ,223893 + ,574205 + ,275216 + ,298989 + ,35324 + ,113719 + ,221010 + ,572775 + ,274352 + ,298423 + ,26599 + ,110737 + ,221742 + ,572942 + ,271311 + ,301631 + ,24935 + ,112093 + ,221353 + ,619567 + ,289802 + ,329765 + ,51349 + ,143565 + ,224844 + ,625809 + ,290726 + ,335083 + ,58672 + ,149946 + ,230418 + ,619916 + ,292300 + ,327616 + ,61271 + ,149147 + ,232189 + ,587625 + ,278506 + ,309119 + ,53145 + ,134339 + ,231219 + ,565742 + ,269826 + ,295916 + ,46211 + ,122683 + ,228209 + ,557274 + ,265861 + ,291413 + ,40744 + ,115614 + ,227941 + ,560576 + ,269034 + ,291542 + ,41248 + ,116566 + ,228128 + ,548854 + ,264176 + ,284678 + ,39032 + ,111272 + ,226309 + ,531673 + ,255198 + ,276475 + ,35907 + ,104609 + ,221990 + ,525919 + ,253353 + ,272566 + ,33335 + ,101802 + ,220386 + ,511038 + ,246057 + ,264981 + ,23988 + ,94542 + ,217415 + ,498662 + ,235372 + ,263290 + ,23099 + ,93051 + ,210394 + ,555362 + ,258556 + ,296806 + ,46390 + ,124129 + ,213985 + ,564591 + ,260993 + ,303598 + ,51588 + ,130374 + ,214552 + ,541657 + ,254663 + ,286994 + ,51579 + ,123946 + ,211797 + ,527070 + ,250643 + ,276427 + ,45390 + ,114971 + ,208512 + ,509846 + ,243422 + ,266424 + ,39215 + ,105531 + ,205708 + ,514258 + ,247105 + ,267153 + ,38433 + ,104919 + ,206890 + ,516922 + ,248541 + ,268381 + ,37676 + ,104782 + ,207069 + ,507561 + ,245039 + ,262522 + ,36055 + ,101281 + ,205305 + ,492622 + ,237080 + ,255542 + ,32986 + ,94545 + ,201504 + ,490243 + ,237085 + ,253158 + ,30953 + ,93248 + ,200517 + ,469357 + ,225554 + ,243803 + ,23558 + ,84031 + ,195771 + ,477580 + ,226839 + ,250741 + ,22487 + ,87486 + ,195259 + ,528379 + ,247934 + ,280445 + ,43528 + ,115867 + ,197579 + ,533590 + ,248333 + ,285257 + ,47913 + ,120327 + ,196985 + ,517945 + ,246969 + ,270976 + ,48621 + ,117008 + ,194382 + ,506174 + ,245098 + ,261076 + ,42169 + ,108811 + ,191580 + ,501866 + ,246263 + ,255603 + ,38444 + ,104519 + ,190765 + ,516141 + ,255765 + ,260376 + ,38692 + ,106758 + ,191480 + ,528222 + ,264319 + ,263903 + ,38124 + ,109337 + ,192277 + ,532638 + ,268347 + ,264291 + ,37886 + ,109078 + ,191632 + ,536322 + ,273046 + ,263276 + ,37310 + ,108293 + ,190757 + ,536535 + ,273963 + ,262572 + ,34689 + ,106534 + ,190995 + ,523597 + ,267430 + ,256167 + ,26450 + ,99197 + ,189081 + ,536214 + ,271993 + ,264221 + ,25565 + ,103493 + ,190028 + ,586570 + ,292710 + ,293860 + ,46562 + ,130676 + ,196146 + ,596594 + ,295881 + ,300713 + ,52653 + ,137448 + ,197070 + ,580523 + ,293299 + ,287224 + ,54807 + ,134704 + ,194893 + ,564478 + ,288576 + ,275902 + ,47534 + ,123725 + ,193246 + ,557560 + ,286445 + ,271115 + ,43565 + ,118277 + ,192484 + ,575093 + ,297584 + ,277509 + ,44051 + ,121225 + ,194924 + ,580112 + ,300431 + ,279681 + ,42622 + ,120528 + ,197394 + ,574761 + ,298522 + ,276239 + ,41761 + ,118240 + ,196598 + ,563250 + ,292213 + ,271037 + ,39086 + ,112514 + ,194409 + ,551531 + ,285383 + ,266148 + ,35438 + ,107304 + ,193431 + ,537034 + ,277537 + ,259497 + ,27356 + ,100001 + ,191942 + ,544686 + ,277891 + ,266795 + ,26149 + ,102082 + ,193323 + ,600991 + ,302686 + ,298305 + ,47034 + ,130455 + ,199654 + ,604378 + ,300653 + ,303725 + ,53091 + ,135574 + ,198422 + ,586111 + ,296369 + ,289742 + ,55718 + ,132540 + ,198219 + ,563668 + ,287224 + ,276444 + ,47637 + ,119920 + ,197157 + ,548604 + ,279998 + ,268606 + ,43237 + ,112454 + ,195115 + ,551174 + ,283495 + ,267679 + ,40597 + ,109415 + ,197296 + ,555654 + ,285775 + ,269879 + ,39884 + ,109843 + ,198178 + ,547970 + ,282329 + ,265641 + ,38504 + ,106365 + ,197787 + ,540324 + ,277799 + ,262525 + ,36393 + ,102304 + ,197622 + ,530577 + ,271980 + ,258597 + ,33740 + ,97968 + ,196683 + ,520579 + ,266730 + ,253849 + ,26131 + ,92462 + ,194590 + ,518654 + ,262433 + ,256221 + ,23885 + ,92286 + ,194316 + ,572273 + ,285378 + ,286895 + ,43899 + ,120092 + ,199598 + ,581302 + ,286692 + ,294610 + ,49871 + ,126656 + ,199055 + ,563280 + ,282917 + ,280363 + ,52292 + ,124144 + ,197482 + ,547612 + ,277686 + ,269926 + ,45493 + ,114045 + ,196440 + ,538712 + ,274371 + ,264341 + ,41124 + ,108120 + ,195338 + ,540735 + ,277466 + ,263269 + ,39385 + ,105698 + ,195589 + ,561649 + ,290604 + ,271045 + ,41472 + ,111203 + ,198936 + ,558685 + ,290770 + ,267915 + ,41688 + ,110030 + ,198262 + ,545732 + ,283654 + ,262078 + ,38711 + ,104009 + ,197275 + ,536352 + ,278601 + ,257751 + ,36840 + ,99772 + ,196007 + ,527676 + ,274405 + ,253271 + ,35141 + ,96301 + ,194447 + ,530455 + ,272817 + ,257638 + ,37443 + ,97680 + ,193951 + ,581744 + ,294292 + ,287452 + ,51905 + ,121563 + ,198396 + ,598714 + ,300562 + ,298152 + ,60016 + ,134210 + ,199486 + ,583775 + ,298982 + ,284793 + ,58611 + ,133111 + ,198688 + ,571477 + ,296917 + ,274560 + ,52097 + ,124527 + ,196729) + ,dim=c(6 + ,82) + ,dimnames=list(c('A' + ,'B' + ,'C' + ,'D' + ,'E' + ,'F') + ,1:82)) > y <- array(NA,dim=c(6,82),dimnames=list(c('A','B','C','D','E','F'),1:82)) > 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' > 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, 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 A B C D E F 1 593408 280190 313218 44148 125326 223560 2 590072 280408 309664 42065 122716 223789 3 579799 276836 302963 38546 116615 223893 4 574205 275216 298989 35324 113719 221010 5 572775 274352 298423 26599 110737 221742 6 572942 271311 301631 24935 112093 221353 7 619567 289802 329765 51349 143565 224844 8 625809 290726 335083 58672 149946 230418 9 619916 292300 327616 61271 149147 232189 10 587625 278506 309119 53145 134339 231219 11 565742 269826 295916 46211 122683 228209 12 557274 265861 291413 40744 115614 227941 13 560576 269034 291542 41248 116566 228128 14 548854 264176 284678 39032 111272 226309 15 531673 255198 276475 35907 104609 221990 16 525919 253353 272566 33335 101802 220386 17 511038 246057 264981 23988 94542 217415 18 498662 235372 263290 23099 93051 210394 19 555362 258556 296806 46390 124129 213985 20 564591 260993 303598 51588 130374 214552 21 541657 254663 286994 51579 123946 211797 22 527070 250643 276427 45390 114971 208512 23 509846 243422 266424 39215 105531 205708 24 514258 247105 267153 38433 104919 206890 25 516922 248541 268381 37676 104782 207069 26 507561 245039 262522 36055 101281 205305 27 492622 237080 255542 32986 94545 201504 28 490243 237085 253158 30953 93248 200517 29 469357 225554 243803 23558 84031 195771 30 477580 226839 250741 22487 87486 195259 31 528379 247934 280445 43528 115867 197579 32 533590 248333 285257 47913 120327 196985 33 517945 246969 270976 48621 117008 194382 34 506174 245098 261076 42169 108811 191580 35 501866 246263 255603 38444 104519 190765 36 516141 255765 260376 38692 106758 191480 37 528222 264319 263903 38124 109337 192277 38 532638 268347 264291 37886 109078 191632 39 536322 273046 263276 37310 108293 190757 40 536535 273963 262572 34689 106534 190995 41 523597 267430 256167 26450 99197 189081 42 536214 271993 264221 25565 103493 190028 43 586570 292710 293860 46562 130676 196146 44 596594 295881 300713 52653 137448 197070 45 580523 293299 287224 54807 134704 194893 46 564478 288576 275902 47534 123725 193246 47 557560 286445 271115 43565 118277 192484 48 575093 297584 277509 44051 121225 194924 49 580112 300431 279681 42622 120528 197394 50 574761 298522 276239 41761 118240 196598 51 563250 292213 271037 39086 112514 194409 52 551531 285383 266148 35438 107304 193431 53 537034 277537 259497 27356 100001 191942 54 544686 277891 266795 26149 102082 193323 55 600991 302686 298305 47034 130455 199654 56 604378 300653 303725 53091 135574 198422 57 586111 296369 289742 55718 132540 198219 58 563668 287224 276444 47637 119920 197157 59 548604 279998 268606 43237 112454 195115 60 551174 283495 267679 40597 109415 197296 61 555654 285775 269879 39884 109843 198178 62 547970 282329 265641 38504 106365 197787 63 540324 277799 262525 36393 102304 197622 64 530577 271980 258597 33740 97968 196683 65 520579 266730 253849 26131 92462 194590 66 518654 262433 256221 23885 92286 194316 67 572273 285378 286895 43899 120092 199598 68 581302 286692 294610 49871 126656 199055 69 563280 282917 280363 52292 124144 197482 70 547612 277686 269926 45493 114045 196440 71 538712 274371 264341 41124 108120 195338 72 540735 277466 263269 39385 105698 195589 73 561649 290604 271045 41472 111203 198936 74 558685 290770 267915 41688 110030 198262 75 545732 283654 262078 38711 104009 197275 76 536352 278601 257751 36840 99772 196007 77 527676 274405 253271 35141 96301 194447 78 530455 272817 257638 37443 97680 193951 79 581744 294292 287452 51905 121563 198396 80 598714 300562 298152 60016 134210 199486 81 583775 298982 284793 58611 133111 198688 82 571477 296917 274560 52097 124527 196729 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) B C D E F 6.056e-11 1.000e+00 1.000e+00 -6.198e-17 1.668e-17 -4.583e-17 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -3.901e-11 -1.681e-12 5.800e-14 1.708e-12 2.324e-11 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.056e-11 1.739e-11 3.483e+00 0.000827 *** B 1.000e+00 5.043e-17 1.983e+16 < 2e-16 *** C 1.000e+00 1.786e-16 5.600e+15 < 2e-16 *** D -6.198e-17 2.311e-16 -2.680e-01 0.789313 E 1.668e-17 3.073e-16 5.400e-02 0.956857 F -4.583e-17 1.262e-16 -3.630e-01 0.717472 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.033e-12 on 76 degrees of freedom Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 4.812e+32 on 5 and 76 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,] 5.993571e-06 1.198714e-05 9.999940e-01 [2,] 3.701072e-01 7.402143e-01 6.298928e-01 [3,] 3.254586e-03 6.509171e-03 9.967454e-01 [4,] 1.616602e-01 3.233205e-01 8.383398e-01 [5,] 4.842652e-09 9.685304e-09 1.000000e+00 [6,] 1.000000e+00 1.268156e-47 6.340778e-48 [7,] 7.292784e-11 1.458557e-10 1.000000e+00 [8,] 4.592865e-02 9.185729e-02 9.540714e-01 [9,] 1.436100e-14 2.872200e-14 1.000000e+00 [10,] 1.058661e-17 2.117321e-17 1.000000e+00 [11,] 8.963646e-16 1.792729e-15 1.000000e+00 [12,] 2.977956e-11 5.955912e-11 1.000000e+00 [13,] 1.000000e+00 2.267315e-51 1.133657e-51 [14,] 9.989657e-01 2.068696e-03 1.034348e-03 [15,] 2.896711e-12 5.793423e-12 1.000000e+00 [16,] 2.464566e-02 4.929131e-02 9.753543e-01 [17,] 4.063759e-15 8.127518e-15 1.000000e+00 [18,] 4.408834e-13 8.817668e-13 1.000000e+00 [19,] 9.759611e-01 4.807776e-02 2.403888e-02 [20,] 1.459573e-15 2.919147e-15 1.000000e+00 [21,] 3.107089e-14 6.214177e-14 1.000000e+00 [22,] 9.949769e-01 1.004612e-02 5.023060e-03 [23,] 1.000000e+00 1.374983e-42 6.874916e-43 [24,] 3.048209e-23 6.096418e-23 1.000000e+00 [25,] 1.000000e+00 1.946258e-38 9.731292e-39 [26,] 9.100454e-01 1.799093e-01 8.995463e-02 [27,] 9.999998e-01 4.779824e-07 2.389912e-07 [28,] 8.296152e-01 3.407697e-01 1.703848e-01 [29,] 9.961068e-01 7.786411e-03 3.893206e-03 [30,] 1.000000e+00 5.804576e-44 2.902288e-44 [31,] 1.000000e+00 1.863233e-37 9.316166e-38 [32,] 1.000000e+00 3.727281e-31 1.863641e-31 [33,] 1.000000e+00 5.568383e-44 2.784191e-44 [34,] 3.136774e-01 6.273548e-01 6.863226e-01 [35,] 4.022734e-26 8.045467e-26 1.000000e+00 [36,] 2.178873e-01 4.357746e-01 7.821127e-01 [37,] 1.000000e+00 1.643595e-11 8.217973e-12 [38,] 9.940870e-01 1.182607e-02 5.913036e-03 [39,] 7.368407e-01 5.263186e-01 2.631593e-01 [40,] 1.000000e+00 8.007175e-31 4.003588e-31 [41,] 9.996581e-01 6.838683e-04 3.419342e-04 [42,] 1.000000e+00 1.056548e-29 5.282739e-30 [43,] 1.000000e+00 6.051741e-22 3.025870e-22 [44,] 2.009718e-29 4.019436e-29 1.000000e+00 [45,] 9.718414e-01 5.631720e-02 2.815860e-02 [46,] 1.368577e-01 2.737153e-01 8.631423e-01 [47,] 2.895741e-01 5.791481e-01 7.104259e-01 [48,] 2.626858e-24 5.253716e-24 1.000000e+00 [49,] 1.103041e-44 2.206081e-44 1.000000e+00 [50,] 2.247521e-30 4.495041e-30 1.000000e+00 [51,] 1.000000e+00 8.381860e-28 4.190930e-28 [52,] 1.955719e-04 3.911439e-04 9.998044e-01 [53,] 1.000000e+00 1.584273e-18 7.921365e-19 [54,] 1.000000e+00 1.411287e-18 7.056435e-19 [55,] 7.792619e-01 4.414762e-01 2.207381e-01 [56,] 4.700176e-01 9.400352e-01 5.299824e-01 [57,] 9.000350e-01 1.999300e-01 9.996499e-02 [58,] 9.997147e-01 5.705790e-04 2.852895e-04 [59,] 9.167494e-01 1.665012e-01 8.325060e-02 [60,] 2.053096e-20 4.106193e-20 1.000000e+00 [61,] 3.142798e-28 6.285595e-28 1.000000e+00 [62,] 9.119240e-27 1.823848e-26 1.000000e+00 [63,] 9.934597e-01 1.308058e-02 6.540290e-03 [64,] 9.999985e-01 3.065751e-06 1.532875e-06 [65,] 9.994478e-01 1.104304e-03 5.521519e-04 > postscript(file="/var/fisher/rcomp/tmp/15zeb1353315977.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/fisher/rcomp/tmp/23ewa1353315977.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/fisher/rcomp/tmp/34wu31353315977.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/fisher/rcomp/tmp/4g9aw1353315977.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/fisher/rcomp/tmp/5qm7l1353315977.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 = 82 Frequency = 1 1 2 3 4 5 1.003798e-11 -3.900733e-11 2.323867e-11 1.852501e-12 5.531215e-13 6 7 8 9 10 -1.118698e-12 1.264153e-13 5.514070e-12 1.276088e-12 -2.549988e-12 11 12 13 14 15 8.620420e-13 4.072327e-14 1.883147e-12 2.642860e-12 2.261998e-13 16 17 18 19 20 1.185957e-12 -5.566684e-12 -2.579915e-12 -3.495407e-12 1.281163e-12 21 22 23 24 25 2.778027e-12 1.451646e-12 -1.746709e-12 -1.769995e-12 -5.082132e-12 26 27 28 29 30 -4.465605e-12 1.651898e-12 -1.042989e-12 8.548155e-12 1.045023e-11 31 32 33 34 35 -2.430961e-12 3.028252e-12 -2.494893e-12 -3.870949e-12 -2.642097e-12 36 37 38 39 40 -3.953602e-12 -9.466723e-13 1.677186e-12 -7.072471e-13 7.445383e-14 41 42 43 44 45 -2.088421e-12 -1.335670e-12 1.747438e-12 -1.437589e-12 1.276402e-12 46 47 48 49 50 -1.019749e-13 -3.374064e-13 1.718243e-12 5.312178e-13 5.472307e-12 51 52 53 54 55 4.289879e-12 -1.267553e-12 -9.836245e-13 2.092376e-12 -3.763713e-12 56 57 58 59 60 -1.483230e-12 2.417616e-12 1.763376e-12 1.220286e-12 9.739490e-13 61 62 63 64 65 -3.240305e-12 -3.299671e-12 2.656522e-12 1.316680e-12 -1.213889e-12 66 67 68 69 70 -9.098542e-13 -5.565865e-15 1.824046e-12 1.836188e-12 -2.293975e-14 71 72 73 74 75 3.948633e-12 -1.148802e-13 -7.155417e-13 -4.678186e-13 -3.401472e-12 76 77 78 79 80 -2.637487e-12 -5.154777e-13 7.859682e-13 3.368700e-13 -3.162065e-12 81 82 9.126778e-13 4.765648e-13 > postscript(file="/var/fisher/rcomp/tmp/6k5ev1353315977.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 = 82 Frequency = 1 lag(myerror, k = 1) myerror 0 1.003798e-11 NA 1 -3.900733e-11 1.003798e-11 2 2.323867e-11 -3.900733e-11 3 1.852501e-12 2.323867e-11 4 5.531215e-13 1.852501e-12 5 -1.118698e-12 5.531215e-13 6 1.264153e-13 -1.118698e-12 7 5.514070e-12 1.264153e-13 8 1.276088e-12 5.514070e-12 9 -2.549988e-12 1.276088e-12 10 8.620420e-13 -2.549988e-12 11 4.072327e-14 8.620420e-13 12 1.883147e-12 4.072327e-14 13 2.642860e-12 1.883147e-12 14 2.261998e-13 2.642860e-12 15 1.185957e-12 2.261998e-13 16 -5.566684e-12 1.185957e-12 17 -2.579915e-12 -5.566684e-12 18 -3.495407e-12 -2.579915e-12 19 1.281163e-12 -3.495407e-12 20 2.778027e-12 1.281163e-12 21 1.451646e-12 2.778027e-12 22 -1.746709e-12 1.451646e-12 23 -1.769995e-12 -1.746709e-12 24 -5.082132e-12 -1.769995e-12 25 -4.465605e-12 -5.082132e-12 26 1.651898e-12 -4.465605e-12 27 -1.042989e-12 1.651898e-12 28 8.548155e-12 -1.042989e-12 29 1.045023e-11 8.548155e-12 30 -2.430961e-12 1.045023e-11 31 3.028252e-12 -2.430961e-12 32 -2.494893e-12 3.028252e-12 33 -3.870949e-12 -2.494893e-12 34 -2.642097e-12 -3.870949e-12 35 -3.953602e-12 -2.642097e-12 36 -9.466723e-13 -3.953602e-12 37 1.677186e-12 -9.466723e-13 38 -7.072471e-13 1.677186e-12 39 7.445383e-14 -7.072471e-13 40 -2.088421e-12 7.445383e-14 41 -1.335670e-12 -2.088421e-12 42 1.747438e-12 -1.335670e-12 43 -1.437589e-12 1.747438e-12 44 1.276402e-12 -1.437589e-12 45 -1.019749e-13 1.276402e-12 46 -3.374064e-13 -1.019749e-13 47 1.718243e-12 -3.374064e-13 48 5.312178e-13 1.718243e-12 49 5.472307e-12 5.312178e-13 50 4.289879e-12 5.472307e-12 51 -1.267553e-12 4.289879e-12 52 -9.836245e-13 -1.267553e-12 53 2.092376e-12 -9.836245e-13 54 -3.763713e-12 2.092376e-12 55 -1.483230e-12 -3.763713e-12 56 2.417616e-12 -1.483230e-12 57 1.763376e-12 2.417616e-12 58 1.220286e-12 1.763376e-12 59 9.739490e-13 1.220286e-12 60 -3.240305e-12 9.739490e-13 61 -3.299671e-12 -3.240305e-12 62 2.656522e-12 -3.299671e-12 63 1.316680e-12 2.656522e-12 64 -1.213889e-12 1.316680e-12 65 -9.098542e-13 -1.213889e-12 66 -5.565865e-15 -9.098542e-13 67 1.824046e-12 -5.565865e-15 68 1.836188e-12 1.824046e-12 69 -2.293975e-14 1.836188e-12 70 3.948633e-12 -2.293975e-14 71 -1.148802e-13 3.948633e-12 72 -7.155417e-13 -1.148802e-13 73 -4.678186e-13 -7.155417e-13 74 -3.401472e-12 -4.678186e-13 75 -2.637487e-12 -3.401472e-12 76 -5.154777e-13 -2.637487e-12 77 7.859682e-13 -5.154777e-13 78 3.368700e-13 7.859682e-13 79 -3.162065e-12 3.368700e-13 80 9.126778e-13 -3.162065e-12 81 4.765648e-13 9.126778e-13 82 NA 4.765648e-13 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.900733e-11 1.003798e-11 [2,] 2.323867e-11 -3.900733e-11 [3,] 1.852501e-12 2.323867e-11 [4,] 5.531215e-13 1.852501e-12 [5,] -1.118698e-12 5.531215e-13 [6,] 1.264153e-13 -1.118698e-12 [7,] 5.514070e-12 1.264153e-13 [8,] 1.276088e-12 5.514070e-12 [9,] -2.549988e-12 1.276088e-12 [10,] 8.620420e-13 -2.549988e-12 [11,] 4.072327e-14 8.620420e-13 [12,] 1.883147e-12 4.072327e-14 [13,] 2.642860e-12 1.883147e-12 [14,] 2.261998e-13 2.642860e-12 [15,] 1.185957e-12 2.261998e-13 [16,] -5.566684e-12 1.185957e-12 [17,] -2.579915e-12 -5.566684e-12 [18,] -3.495407e-12 -2.579915e-12 [19,] 1.281163e-12 -3.495407e-12 [20,] 2.778027e-12 1.281163e-12 [21,] 1.451646e-12 2.778027e-12 [22,] -1.746709e-12 1.451646e-12 [23,] -1.769995e-12 -1.746709e-12 [24,] -5.082132e-12 -1.769995e-12 [25,] -4.465605e-12 -5.082132e-12 [26,] 1.651898e-12 -4.465605e-12 [27,] -1.042989e-12 1.651898e-12 [28,] 8.548155e-12 -1.042989e-12 [29,] 1.045023e-11 8.548155e-12 [30,] -2.430961e-12 1.045023e-11 [31,] 3.028252e-12 -2.430961e-12 [32,] -2.494893e-12 3.028252e-12 [33,] -3.870949e-12 -2.494893e-12 [34,] -2.642097e-12 -3.870949e-12 [35,] -3.953602e-12 -2.642097e-12 [36,] -9.466723e-13 -3.953602e-12 [37,] 1.677186e-12 -9.466723e-13 [38,] -7.072471e-13 1.677186e-12 [39,] 7.445383e-14 -7.072471e-13 [40,] -2.088421e-12 7.445383e-14 [41,] -1.335670e-12 -2.088421e-12 [42,] 1.747438e-12 -1.335670e-12 [43,] -1.437589e-12 1.747438e-12 [44,] 1.276402e-12 -1.437589e-12 [45,] -1.019749e-13 1.276402e-12 [46,] -3.374064e-13 -1.019749e-13 [47,] 1.718243e-12 -3.374064e-13 [48,] 5.312178e-13 1.718243e-12 [49,] 5.472307e-12 5.312178e-13 [50,] 4.289879e-12 5.472307e-12 [51,] -1.267553e-12 4.289879e-12 [52,] -9.836245e-13 -1.267553e-12 [53,] 2.092376e-12 -9.836245e-13 [54,] -3.763713e-12 2.092376e-12 [55,] -1.483230e-12 -3.763713e-12 [56,] 2.417616e-12 -1.483230e-12 [57,] 1.763376e-12 2.417616e-12 [58,] 1.220286e-12 1.763376e-12 [59,] 9.739490e-13 1.220286e-12 [60,] -3.240305e-12 9.739490e-13 [61,] -3.299671e-12 -3.240305e-12 [62,] 2.656522e-12 -3.299671e-12 [63,] 1.316680e-12 2.656522e-12 [64,] -1.213889e-12 1.316680e-12 [65,] -9.098542e-13 -1.213889e-12 [66,] -5.565865e-15 -9.098542e-13 [67,] 1.824046e-12 -5.565865e-15 [68,] 1.836188e-12 1.824046e-12 [69,] -2.293975e-14 1.836188e-12 [70,] 3.948633e-12 -2.293975e-14 [71,] -1.148802e-13 3.948633e-12 [72,] -7.155417e-13 -1.148802e-13 [73,] -4.678186e-13 -7.155417e-13 [74,] -3.401472e-12 -4.678186e-13 [75,] -2.637487e-12 -3.401472e-12 [76,] -5.154777e-13 -2.637487e-12 [77,] 7.859682e-13 -5.154777e-13 [78,] 3.368700e-13 7.859682e-13 [79,] -3.162065e-12 3.368700e-13 [80,] 9.126778e-13 -3.162065e-12 [81,] 4.765648e-13 9.126778e-13 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.900733e-11 1.003798e-11 2 2.323867e-11 -3.900733e-11 3 1.852501e-12 2.323867e-11 4 5.531215e-13 1.852501e-12 5 -1.118698e-12 5.531215e-13 6 1.264153e-13 -1.118698e-12 7 5.514070e-12 1.264153e-13 8 1.276088e-12 5.514070e-12 9 -2.549988e-12 1.276088e-12 10 8.620420e-13 -2.549988e-12 11 4.072327e-14 8.620420e-13 12 1.883147e-12 4.072327e-14 13 2.642860e-12 1.883147e-12 14 2.261998e-13 2.642860e-12 15 1.185957e-12 2.261998e-13 16 -5.566684e-12 1.185957e-12 17 -2.579915e-12 -5.566684e-12 18 -3.495407e-12 -2.579915e-12 19 1.281163e-12 -3.495407e-12 20 2.778027e-12 1.281163e-12 21 1.451646e-12 2.778027e-12 22 -1.746709e-12 1.451646e-12 23 -1.769995e-12 -1.746709e-12 24 -5.082132e-12 -1.769995e-12 25 -4.465605e-12 -5.082132e-12 26 1.651898e-12 -4.465605e-12 27 -1.042989e-12 1.651898e-12 28 8.548155e-12 -1.042989e-12 29 1.045023e-11 8.548155e-12 30 -2.430961e-12 1.045023e-11 31 3.028252e-12 -2.430961e-12 32 -2.494893e-12 3.028252e-12 33 -3.870949e-12 -2.494893e-12 34 -2.642097e-12 -3.870949e-12 35 -3.953602e-12 -2.642097e-12 36 -9.466723e-13 -3.953602e-12 37 1.677186e-12 -9.466723e-13 38 -7.072471e-13 1.677186e-12 39 7.445383e-14 -7.072471e-13 40 -2.088421e-12 7.445383e-14 41 -1.335670e-12 -2.088421e-12 42 1.747438e-12 -1.335670e-12 43 -1.437589e-12 1.747438e-12 44 1.276402e-12 -1.437589e-12 45 -1.019749e-13 1.276402e-12 46 -3.374064e-13 -1.019749e-13 47 1.718243e-12 -3.374064e-13 48 5.312178e-13 1.718243e-12 49 5.472307e-12 5.312178e-13 50 4.289879e-12 5.472307e-12 51 -1.267553e-12 4.289879e-12 52 -9.836245e-13 -1.267553e-12 53 2.092376e-12 -9.836245e-13 54 -3.763713e-12 2.092376e-12 55 -1.483230e-12 -3.763713e-12 56 2.417616e-12 -1.483230e-12 57 1.763376e-12 2.417616e-12 58 1.220286e-12 1.763376e-12 59 9.739490e-13 1.220286e-12 60 -3.240305e-12 9.739490e-13 61 -3.299671e-12 -3.240305e-12 62 2.656522e-12 -3.299671e-12 63 1.316680e-12 2.656522e-12 64 -1.213889e-12 1.316680e-12 65 -9.098542e-13 -1.213889e-12 66 -5.565865e-15 -9.098542e-13 67 1.824046e-12 -5.565865e-15 68 1.836188e-12 1.824046e-12 69 -2.293975e-14 1.836188e-12 70 3.948633e-12 -2.293975e-14 71 -1.148802e-13 3.948633e-12 72 -7.155417e-13 -1.148802e-13 73 -4.678186e-13 -7.155417e-13 74 -3.401472e-12 -4.678186e-13 75 -2.637487e-12 -3.401472e-12 76 -5.154777e-13 -2.637487e-12 77 7.859682e-13 -5.154777e-13 78 3.368700e-13 7.859682e-13 79 -3.162065e-12 3.368700e-13 80 9.126778e-13 -3.162065e-12 81 4.765648e-13 9.126778e-13 > 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/fisher/rcomp/tmp/7vr2i1353315977.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/fisher/rcomp/tmp/8v64l1353315977.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/fisher/rcomp/tmp/9y5qh1353315977.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/fisher/rcomp/tmp/10je4p1353315977.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/111zjr1353315977.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/fisher/rcomp/tmp/12263a1353315977.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/fisher/rcomp/tmp/13o63e1353315977.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/fisher/rcomp/tmp/1416ro1353315977.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/fisher/rcomp/tmp/15opid1353315977.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/fisher/rcomp/tmp/16y36g1353315977.tab") + } > > try(system("convert tmp/15zeb1353315977.ps tmp/15zeb1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/23ewa1353315977.ps tmp/23ewa1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/34wu31353315977.ps tmp/34wu31353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/4g9aw1353315977.ps tmp/4g9aw1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/5qm7l1353315977.ps tmp/5qm7l1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/6k5ev1353315977.ps tmp/6k5ev1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/7vr2i1353315977.ps tmp/7vr2i1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/8v64l1353315977.ps tmp/8v64l1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/9y5qh1353315977.ps tmp/9y5qh1353315977.png",intern=TRUE)) character(0) > try(system("convert tmp/10je4p1353315977.ps tmp/10je4p1353315977.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.518 1.327 7.844