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(631923.00 + ,-12 + ,-10.8 + ,654294.00 + ,-13 + ,-12.2 + ,671833.00 + ,-16 + ,-14.1 + ,586840.00 + ,-10 + ,-15.2 + ,600969.00 + ,-4 + ,-15.8 + ,625568.00 + ,-9 + ,-15.8 + ,558110.00 + ,-8 + ,-14.9 + ,630577.00 + ,-9 + ,-12.6 + ,628654.00 + ,-3 + ,-9.9 + ,603184.00 + ,-13 + ,-7.8 + ,656255.00 + ,-3 + ,-6 + ,600730.00 + ,-1 + ,-5 + ,670326.00 + ,-2 + ,-4.5 + ,678423.00 + ,0 + ,-3.9 + ,641502.00 + ,0 + ,-2.9 + ,625311.00 + ,-3 + ,-1.5 + ,628177.00 + ,0 + ,-0.5 + ,589767.00 + ,5 + ,0 + ,582471.00 + ,3 + ,0.5 + ,636248.00 + ,4 + ,0.9 + ,599885.00 + ,3 + ,0.8 + ,621694.00 + ,1 + ,0.1 + ,637406.00 + ,-1 + ,-1 + ,595994.00 + ,0 + ,-2 + ,696308.00 + ,-2 + ,-3 + ,674201.00 + ,-1 + ,-3.7 + ,648861.00 + ,2 + ,-4.7 + ,649605.00 + ,0 + ,-6.4 + ,672392.00 + ,-6 + ,-7.5 + ,598396.00 + ,-7 + ,-7.8 + ,613177.00 + ,-6 + ,-7.7 + ,638104.00 + ,-4 + ,-6.6 + ,615632.00 + ,-9 + ,-4.2 + ,634465.00 + ,-2 + ,-2 + ,638686.00 + ,-3 + ,-0.7 + ,604243.00 + ,2 + ,0.1 + ,706669.00 + ,3 + ,0.9 + ,677185.00 + ,1 + ,2.1 + ,644328.00 + ,0 + ,3.5 + ,644825.00 + ,1 + ,4.9 + ,605707.00 + ,1 + ,5.7 + ,600136.00 + ,3 + ,6.2 + ,612166.00 + ,5 + ,6.5 + ,599659.00 + ,5 + ,6.5 + ,634210.00 + ,4 + ,6.3 + ,618234.00 + ,11 + ,6.2 + ,613576.00 + ,8 + ,6.4 + ,627200.00 + ,-1 + ,6.3 + ,668973.00 + ,4 + ,5.8 + ,651479.00 + ,4 + ,5.1 + ,619661.00 + ,4 + ,5.1 + ,644260.00 + ,6 + ,5.8 + ,579936.00 + ,6 + ,6.7 + ,601752.00 + ,6 + ,7.1 + ,595376.00 + ,6 + ,6.7 + ,588902.00 + ,4 + ,5.5 + ,634341.00 + ,1 + ,4.2 + ,594305.00 + ,6 + ,3 + ,606200.00 + ,0 + ,2.2 + ,610926.00 + ,2 + ,2 + ,633685.00 + ,-2 + ,1.8 + ,639696.00 + ,0 + ,1.8 + ,659451.00 + ,1 + ,1.5 + ,593248.00 + ,-3 + ,0.4 + ,606677.00 + ,-3 + ,-0.9 + ,599434.00 + ,-5 + ,-1.7 + ,569578.00 + ,-7 + ,-2.6 + ,629873.00 + ,-7 + ,-4.4 + ,613438.00 + ,-5 + ,-8.3 + ,604172.00 + ,-13 + ,-14.4 + ,658328.00 + ,-16 + ,-21.3 + ,612633.00 + ,-20 + ,-26.5 + ,707372.00 + ,-18 + ,-29.2 + ,739770.00 + ,-21 + ,-30.8 + ,777535.00 + ,-20 + ,-30.9 + ,685030.00 + ,-16 + ,-29.5 + ,730234.00 + ,-14 + ,-27.1 + ,714154.00 + ,-12 + ,-24.4 + ,630872.00 + ,-10 + ,-21.9 + ,719492.00 + ,-3 + ,-19.3 + ,677023.00 + ,-4 + ,-17 + ,679272.00 + ,-4 + ,-13.8 + ,718317.00 + ,-1 + ,-9.9 + ,645672.00 + ,-8 + ,-7.9) + ,dim=c(3 + ,84) + ,dimnames=list(c('Werkloosheid' + ,'Consumentenvertrouwen' + ,'Producentenvertrouwen') + ,1:84)) > y <- array(NA,dim=c(3,84),dimnames=list(c('Werkloosheid','Consumentenvertrouwen','Producentenvertrouwen'),1:84)) > 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 Werkloosheid Consumentenvertrouwen Producentenvertrouwen 1 631923 -12 -10.8 2 654294 -13 -12.2 3 671833 -16 -14.1 4 586840 -10 -15.2 5 600969 -4 -15.8 6 625568 -9 -15.8 7 558110 -8 -14.9 8 630577 -9 -12.6 9 628654 -3 -9.9 10 603184 -13 -7.8 11 656255 -3 -6.0 12 600730 -1 -5.0 13 670326 -2 -4.5 14 678423 0 -3.9 15 641502 0 -2.9 16 625311 -3 -1.5 17 628177 0 -0.5 18 589767 5 0.0 19 582471 3 0.5 20 636248 4 0.9 21 599885 3 0.8 22 621694 1 0.1 23 637406 -1 -1.0 24 595994 0 -2.0 25 696308 -2 -3.0 26 674201 -1 -3.7 27 648861 2 -4.7 28 649605 0 -6.4 29 672392 -6 -7.5 30 598396 -7 -7.8 31 613177 -6 -7.7 32 638104 -4 -6.6 33 615632 -9 -4.2 34 634465 -2 -2.0 35 638686 -3 -0.7 36 604243 2 0.1 37 706669 3 0.9 38 677185 1 2.1 39 644328 0 3.5 40 644825 1 4.9 41 605707 1 5.7 42 600136 3 6.2 43 612166 5 6.5 44 599659 5 6.5 45 634210 4 6.3 46 618234 11 6.2 47 613576 8 6.4 48 627200 -1 6.3 49 668973 4 5.8 50 651479 4 5.1 51 619661 4 5.1 52 644260 6 5.8 53 579936 6 6.7 54 601752 6 7.1 55 595376 6 6.7 56 588902 4 5.5 57 634341 1 4.2 58 594305 6 3.0 59 606200 0 2.2 60 610926 2 2.0 61 633685 -2 1.8 62 639696 0 1.8 63 659451 1 1.5 64 593248 -3 0.4 65 606677 -3 -0.9 66 599434 -5 -1.7 67 569578 -7 -2.6 68 629873 -7 -4.4 69 613438 -5 -8.3 70 604172 -13 -14.4 71 658328 -16 -21.3 72 612633 -20 -26.5 73 707372 -18 -29.2 74 739770 -21 -30.8 75 777535 -20 -30.9 76 685030 -16 -29.5 77 730234 -14 -27.1 78 714154 -12 -24.4 79 630872 -10 -21.9 80 719492 -3 -19.3 81 677023 -4 -17.0 82 679272 -4 -13.8 83 718317 -1 -9.9 84 645672 -8 -7.9 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Consumentenvertrouwen Producentenvertrouwen 625608 2020 -3338 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -101076.6 -24197.5 -350.4 22324.5 89177.5 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 625608.2 4315.6 144.963 < 2e-16 *** Consumentenvertrouwen 2019.8 1181.2 1.710 0.091106 . Producentenvertrouwen -3338.1 820.8 -4.067 0.000110 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 35380 on 81 degrees of freedom Multiple R-squared: 0.2907, Adjusted R-squared: 0.2732 F-statistic: 16.6 on 2 and 81 DF, p-value: 9.08e-07 > 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.34212882 0.68425763 0.65787118 [2,] 0.59480461 0.81039078 0.40519539 [3,] 0.48634026 0.97268051 0.51365974 [4,] 0.42125051 0.84250101 0.57874949 [5,] 0.58171766 0.83656469 0.41828234 [6,] 0.56609638 0.86780724 0.43390362 [7,] 0.53590138 0.92819724 0.46409862 [8,] 0.56407591 0.87184818 0.43592409 [9,] 0.57865928 0.84268145 0.42134072 [10,] 0.49380893 0.98761785 0.50619107 [11,] 0.47875366 0.95750732 0.52124634 [12,] 0.42284160 0.84568320 0.57715840 [13,] 0.49648171 0.99296341 0.50351829 [14,] 0.58527278 0.82945443 0.41472722 [15,] 0.51508780 0.96982440 0.48491220 [16,] 0.49523544 0.99047088 0.50476456 [17,] 0.42278962 0.84557923 0.57721038 [18,] 0.35360435 0.70720870 0.64639565 [19,] 0.35485309 0.70970617 0.64514691 [20,] 0.57653326 0.84693348 0.42346674 [21,] 0.62622572 0.74754855 0.37377428 [22,] 0.60151781 0.79696438 0.39848219 [23,] 0.56955779 0.86088442 0.43044221 [24,] 0.58248800 0.83502400 0.41751200 [25,] 0.60113531 0.79772938 0.39886469 [26,] 0.56768089 0.86463821 0.43231911 [27,] 0.50516193 0.98967615 0.49483807 [28,] 0.46608393 0.93216786 0.53391607 [29,] 0.40083329 0.80166658 0.59916671 [30,] 0.34383352 0.68766705 0.65616648 [31,] 0.33045564 0.66091127 0.66954436 [32,] 0.57038674 0.85922653 0.42961326 [33,] 0.62567196 0.74865608 0.37432804 [34,] 0.59473478 0.81053044 0.40526522 [35,] 0.57518856 0.84962289 0.42481144 [36,] 0.56487226 0.87025549 0.43512774 [37,] 0.55094484 0.89811032 0.44905516 [38,] 0.50320385 0.99359230 0.49679615 [39,] 0.47597487 0.95194974 0.52402513 [40,] 0.42990847 0.85981694 0.57009153 [41,] 0.37964188 0.75928376 0.62035812 [42,] 0.32924595 0.65849190 0.67075405 [43,] 0.31713866 0.63427732 0.68286134 [44,] 0.40083343 0.80166686 0.59916657 [45,] 0.40440260 0.80880521 0.59559740 [46,] 0.34977519 0.69955038 0.65022481 [47,] 0.32824086 0.65648171 0.67175914 [48,] 0.35180551 0.70361103 0.64819449 [49,] 0.30791909 0.61583818 0.69208091 [50,] 0.27697907 0.55395814 0.72302093 [51,] 0.26140670 0.52281339 0.73859330 [52,] 0.23929519 0.47859038 0.76070481 [53,] 0.24952447 0.49904893 0.75047553 [54,] 0.20553278 0.41106556 0.79446722 [55,] 0.16619507 0.33239014 0.83380493 [56,] 0.14736710 0.29473421 0.85263290 [57,] 0.13003517 0.26007034 0.86996483 [58,] 0.16139513 0.32279026 0.83860487 [59,] 0.13412205 0.26824410 0.86587795 [60,] 0.10238269 0.20476538 0.89761731 [61,] 0.07869693 0.15739385 0.92130307 [62,] 0.07970867 0.15941735 0.92029133 [63,] 0.06565510 0.13131019 0.93434490 [64,] 0.04857732 0.09715465 0.95142268 [65,] 0.04497755 0.08995510 0.95502245 [66,] 0.03138394 0.06276788 0.96861606 [67,] 0.14317229 0.28634458 0.85682771 [68,] 0.13113563 0.26227126 0.86886437 [69,] 0.12975609 0.25951218 0.87024391 [70,] 0.44473748 0.88947496 0.55526252 [71,] 0.32888619 0.65777237 0.67111381 [72,] 0.40767066 0.81534133 0.59232934 [73,] 0.92999397 0.14001206 0.07000603 > postscript(file="/var/www/html/rcomp/tmp/1vrad1292961499.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/html/rcomp/tmp/2vrad1292961499.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/html/rcomp/tmp/35iag1292961499.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/html/rcomp/tmp/45iag1292961499.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/html/rcomp/tmp/55iag1292961499.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 = 84 Frequency = 1 1 2 3 4 5 6 -5498.2625 14219.2894 31475.4675 -69308.3494 -69301.1397 -34603.0077 7 8 9 10 11 12 -101076.5862 -18912.2375 -23941.4522 -22203.2765 16677.9553 -39548.6443 13 14 15 16 17 18 33736.2087 39796.3878 6213.4410 755.1947 899.7687 -45940.3367 19 20 21 22 23 24 -47527.6573 5564.7376 -29112.2413 -5600.2258 10479.5685 -36290.3111 25 26 27 28 29 30 64725.2885 38261.8249 3524.2924 2633.2548 33867.3547 -39110.2349 31 32 33 34 35 36 -26015.2560 -1456.0502 -5817.5905 6220.3417 16800.6373 -25071.0522 37 38 39 40 41 42 78005.5640 56566.8806 30402.9815 33553.4296 -2894.1278 -10835.7540 43 44 45 46 47 48 -1843.9909 -14350.9909 21552.2249 -8896.3652 -6827.2754 24641.3569 49 50 51 52 53 54 54646.1983 34815.5611 2997.5611 25893.5455 -35426.2066 -12274.9853 55 56 57 58 59 60 -19986.2066 -26426.2177 20732.7924 -33408.0035 -12064.4876 -12045.7511 61 62 63 64 65 66 18124.9439 20096.2911 36830.0487 -24965.5042 -15875.9734 -21749.7631 67 68 69 70 71 72 -50570.3582 3716.1460 -29776.9143 -43246.4276 -6063.5155 -61037.0866 73 74 75 76 77 78 20649.5169 53766.1110 89177.4793 -6733.5518 42442.1231 31335.2139 79 80 81 82 83 84 -47641.3059 35518.8477 2747.1964 15677.9667 61681.8950 9851.7862 > postscript(file="/var/www/html/rcomp/tmp/6ysr11292961499.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 = 84 Frequency = 1 lag(myerror, k = 1) myerror 0 -5498.2625 NA 1 14219.2894 -5498.2625 2 31475.4675 14219.2894 3 -69308.3494 31475.4675 4 -69301.1397 -69308.3494 5 -34603.0077 -69301.1397 6 -101076.5862 -34603.0077 7 -18912.2375 -101076.5862 8 -23941.4522 -18912.2375 9 -22203.2765 -23941.4522 10 16677.9553 -22203.2765 11 -39548.6443 16677.9553 12 33736.2087 -39548.6443 13 39796.3878 33736.2087 14 6213.4410 39796.3878 15 755.1947 6213.4410 16 899.7687 755.1947 17 -45940.3367 899.7687 18 -47527.6573 -45940.3367 19 5564.7376 -47527.6573 20 -29112.2413 5564.7376 21 -5600.2258 -29112.2413 22 10479.5685 -5600.2258 23 -36290.3111 10479.5685 24 64725.2885 -36290.3111 25 38261.8249 64725.2885 26 3524.2924 38261.8249 27 2633.2548 3524.2924 28 33867.3547 2633.2548 29 -39110.2349 33867.3547 30 -26015.2560 -39110.2349 31 -1456.0502 -26015.2560 32 -5817.5905 -1456.0502 33 6220.3417 -5817.5905 34 16800.6373 6220.3417 35 -25071.0522 16800.6373 36 78005.5640 -25071.0522 37 56566.8806 78005.5640 38 30402.9815 56566.8806 39 33553.4296 30402.9815 40 -2894.1278 33553.4296 41 -10835.7540 -2894.1278 42 -1843.9909 -10835.7540 43 -14350.9909 -1843.9909 44 21552.2249 -14350.9909 45 -8896.3652 21552.2249 46 -6827.2754 -8896.3652 47 24641.3569 -6827.2754 48 54646.1983 24641.3569 49 34815.5611 54646.1983 50 2997.5611 34815.5611 51 25893.5455 2997.5611 52 -35426.2066 25893.5455 53 -12274.9853 -35426.2066 54 -19986.2066 -12274.9853 55 -26426.2177 -19986.2066 56 20732.7924 -26426.2177 57 -33408.0035 20732.7924 58 -12064.4876 -33408.0035 59 -12045.7511 -12064.4876 60 18124.9439 -12045.7511 61 20096.2911 18124.9439 62 36830.0487 20096.2911 63 -24965.5042 36830.0487 64 -15875.9734 -24965.5042 65 -21749.7631 -15875.9734 66 -50570.3582 -21749.7631 67 3716.1460 -50570.3582 68 -29776.9143 3716.1460 69 -43246.4276 -29776.9143 70 -6063.5155 -43246.4276 71 -61037.0866 -6063.5155 72 20649.5169 -61037.0866 73 53766.1110 20649.5169 74 89177.4793 53766.1110 75 -6733.5518 89177.4793 76 42442.1231 -6733.5518 77 31335.2139 42442.1231 78 -47641.3059 31335.2139 79 35518.8477 -47641.3059 80 2747.1964 35518.8477 81 15677.9667 2747.1964 82 61681.8950 15677.9667 83 9851.7862 61681.8950 84 NA 9851.7862 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 14219.2894 -5498.2625 [2,] 31475.4675 14219.2894 [3,] -69308.3494 31475.4675 [4,] -69301.1397 -69308.3494 [5,] -34603.0077 -69301.1397 [6,] -101076.5862 -34603.0077 [7,] -18912.2375 -101076.5862 [8,] -23941.4522 -18912.2375 [9,] -22203.2765 -23941.4522 [10,] 16677.9553 -22203.2765 [11,] -39548.6443 16677.9553 [12,] 33736.2087 -39548.6443 [13,] 39796.3878 33736.2087 [14,] 6213.4410 39796.3878 [15,] 755.1947 6213.4410 [16,] 899.7687 755.1947 [17,] -45940.3367 899.7687 [18,] -47527.6573 -45940.3367 [19,] 5564.7376 -47527.6573 [20,] -29112.2413 5564.7376 [21,] -5600.2258 -29112.2413 [22,] 10479.5685 -5600.2258 [23,] -36290.3111 10479.5685 [24,] 64725.2885 -36290.3111 [25,] 38261.8249 64725.2885 [26,] 3524.2924 38261.8249 [27,] 2633.2548 3524.2924 [28,] 33867.3547 2633.2548 [29,] -39110.2349 33867.3547 [30,] -26015.2560 -39110.2349 [31,] -1456.0502 -26015.2560 [32,] -5817.5905 -1456.0502 [33,] 6220.3417 -5817.5905 [34,] 16800.6373 6220.3417 [35,] -25071.0522 16800.6373 [36,] 78005.5640 -25071.0522 [37,] 56566.8806 78005.5640 [38,] 30402.9815 56566.8806 [39,] 33553.4296 30402.9815 [40,] -2894.1278 33553.4296 [41,] -10835.7540 -2894.1278 [42,] -1843.9909 -10835.7540 [43,] -14350.9909 -1843.9909 [44,] 21552.2249 -14350.9909 [45,] -8896.3652 21552.2249 [46,] -6827.2754 -8896.3652 [47,] 24641.3569 -6827.2754 [48,] 54646.1983 24641.3569 [49,] 34815.5611 54646.1983 [50,] 2997.5611 34815.5611 [51,] 25893.5455 2997.5611 [52,] -35426.2066 25893.5455 [53,] -12274.9853 -35426.2066 [54,] -19986.2066 -12274.9853 [55,] -26426.2177 -19986.2066 [56,] 20732.7924 -26426.2177 [57,] -33408.0035 20732.7924 [58,] -12064.4876 -33408.0035 [59,] -12045.7511 -12064.4876 [60,] 18124.9439 -12045.7511 [61,] 20096.2911 18124.9439 [62,] 36830.0487 20096.2911 [63,] -24965.5042 36830.0487 [64,] -15875.9734 -24965.5042 [65,] -21749.7631 -15875.9734 [66,] -50570.3582 -21749.7631 [67,] 3716.1460 -50570.3582 [68,] -29776.9143 3716.1460 [69,] -43246.4276 -29776.9143 [70,] -6063.5155 -43246.4276 [71,] -61037.0866 -6063.5155 [72,] 20649.5169 -61037.0866 [73,] 53766.1110 20649.5169 [74,] 89177.4793 53766.1110 [75,] -6733.5518 89177.4793 [76,] 42442.1231 -6733.5518 [77,] 31335.2139 42442.1231 [78,] -47641.3059 31335.2139 [79,] 35518.8477 -47641.3059 [80,] 2747.1964 35518.8477 [81,] 15677.9667 2747.1964 [82,] 61681.8950 15677.9667 [83,] 9851.7862 61681.8950 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 14219.2894 -5498.2625 2 31475.4675 14219.2894 3 -69308.3494 31475.4675 4 -69301.1397 -69308.3494 5 -34603.0077 -69301.1397 6 -101076.5862 -34603.0077 7 -18912.2375 -101076.5862 8 -23941.4522 -18912.2375 9 -22203.2765 -23941.4522 10 16677.9553 -22203.2765 11 -39548.6443 16677.9553 12 33736.2087 -39548.6443 13 39796.3878 33736.2087 14 6213.4410 39796.3878 15 755.1947 6213.4410 16 899.7687 755.1947 17 -45940.3367 899.7687 18 -47527.6573 -45940.3367 19 5564.7376 -47527.6573 20 -29112.2413 5564.7376 21 -5600.2258 -29112.2413 22 10479.5685 -5600.2258 23 -36290.3111 10479.5685 24 64725.2885 -36290.3111 25 38261.8249 64725.2885 26 3524.2924 38261.8249 27 2633.2548 3524.2924 28 33867.3547 2633.2548 29 -39110.2349 33867.3547 30 -26015.2560 -39110.2349 31 -1456.0502 -26015.2560 32 -5817.5905 -1456.0502 33 6220.3417 -5817.5905 34 16800.6373 6220.3417 35 -25071.0522 16800.6373 36 78005.5640 -25071.0522 37 56566.8806 78005.5640 38 30402.9815 56566.8806 39 33553.4296 30402.9815 40 -2894.1278 33553.4296 41 -10835.7540 -2894.1278 42 -1843.9909 -10835.7540 43 -14350.9909 -1843.9909 44 21552.2249 -14350.9909 45 -8896.3652 21552.2249 46 -6827.2754 -8896.3652 47 24641.3569 -6827.2754 48 54646.1983 24641.3569 49 34815.5611 54646.1983 50 2997.5611 34815.5611 51 25893.5455 2997.5611 52 -35426.2066 25893.5455 53 -12274.9853 -35426.2066 54 -19986.2066 -12274.9853 55 -26426.2177 -19986.2066 56 20732.7924 -26426.2177 57 -33408.0035 20732.7924 58 -12064.4876 -33408.0035 59 -12045.7511 -12064.4876 60 18124.9439 -12045.7511 61 20096.2911 18124.9439 62 36830.0487 20096.2911 63 -24965.5042 36830.0487 64 -15875.9734 -24965.5042 65 -21749.7631 -15875.9734 66 -50570.3582 -21749.7631 67 3716.1460 -50570.3582 68 -29776.9143 3716.1460 69 -43246.4276 -29776.9143 70 -6063.5155 -43246.4276 71 -61037.0866 -6063.5155 72 20649.5169 -61037.0866 73 53766.1110 20649.5169 74 89177.4793 53766.1110 75 -6733.5518 89177.4793 76 42442.1231 -6733.5518 77 31335.2139 42442.1231 78 -47641.3059 31335.2139 79 35518.8477 -47641.3059 80 2747.1964 35518.8477 81 15677.9667 2747.1964 82 61681.8950 15677.9667 83 9851.7862 61681.8950 > 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/79jqm1292961499.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/html/rcomp/tmp/89jqm1292961499.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/html/rcomp/tmp/99jqm1292961499.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/html/rcomp/tmp/10japp1292961499.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/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/115b6v1292961499.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/128tn11292961499.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/13m3kr1292961499.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/148l1f1292961499.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/15b4z31292961499.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/16f5gr1292961499.tab") + } > > try(system("convert tmp/1vrad1292961499.ps tmp/1vrad1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/2vrad1292961499.ps tmp/2vrad1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/35iag1292961499.ps tmp/35iag1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/45iag1292961499.ps tmp/45iag1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/55iag1292961499.ps tmp/55iag1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/6ysr11292961499.ps tmp/6ysr11292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/79jqm1292961499.ps tmp/79jqm1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/89jqm1292961499.ps tmp/89jqm1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/99jqm1292961499.ps tmp/99jqm1292961499.png",intern=TRUE)) character(0) > try(system("convert tmp/10japp1292961499.ps tmp/10japp1292961499.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.808 1.668 6.451