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(296.95,17.20,296.84,17.20,287.54,17.20,287.81,17.20,283.99,20.63,275.79,20.63,269.52,20.63,278.35,20.63,283.43,19.32,289.46,19.32,282.30,19.32,293.55,19.32,304.78,12.99,300.99,12.99,315.29,12.99,316.21,12.99,331.79,18.13,329.38,18.13,317.27,18.13,317.98,18.13,340.28,28.37,339.21,28.37,336.71,28.37,340.11,28.37,347.72,24.35,328.68,24.35,303.05,24.35,299.83,24.35,320.04,24.99,317.94,24.99,303.31,24.99,308.85,24.99,319.19,28.84,314.52,28.84,312.39,28.84,315.77,28.84,320.23,37.88,309.45,37.88,296.54,37.88,297.28,37.88,301.39,54.04,306.68,54.04,305.91,54.04,314.76,54.04,323.34,64.93,341.58,64.93,330.12,64.93,318.16,64.93,317.84,71.81,325.39,71.81,327.56,71.81,329.77,71.81,333.29,99.75,346.10,99.75,358.00,99.75,344.82,99.75,313.30,61.25,301.26,61.25,306.38,61.25,319.31,61.25),dim=c(2,60),dimnames=list(c('Gemiddelde_prijs_vliegticket_in$','Gemiddelde_olieprijs_in$'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Gemiddelde_prijs_vliegticket_in$','Gemiddelde_olieprijs_in$'),1:60)) > 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 Gemiddelde_prijs_vliegticket_in$ Gemiddelde_olieprijs_in$ 1 296.95 17.20 2 296.84 17.20 3 287.54 17.20 4 287.81 17.20 5 283.99 20.63 6 275.79 20.63 7 269.52 20.63 8 278.35 20.63 9 283.43 19.32 10 289.46 19.32 11 282.30 19.32 12 293.55 19.32 13 304.78 12.99 14 300.99 12.99 15 315.29 12.99 16 316.21 12.99 17 331.79 18.13 18 329.38 18.13 19 317.27 18.13 20 317.98 18.13 21 340.28 28.37 22 339.21 28.37 23 336.71 28.37 24 340.11 28.37 25 347.72 24.35 26 328.68 24.35 27 303.05 24.35 28 299.83 24.35 29 320.04 24.99 30 317.94 24.99 31 303.31 24.99 32 308.85 24.99 33 319.19 28.84 34 314.52 28.84 35 312.39 28.84 36 315.77 28.84 37 320.23 37.88 38 309.45 37.88 39 296.54 37.88 40 297.28 37.88 41 301.39 54.04 42 306.68 54.04 43 305.91 54.04 44 314.76 54.04 45 323.34 64.93 46 341.58 64.93 47 330.12 64.93 48 318.16 64.93 49 317.84 71.81 50 325.39 71.81 51 327.56 71.81 52 329.77 71.81 53 333.29 99.75 54 346.10 99.75 55 358.00 99.75 56 344.82 99.75 57 313.30 61.25 58 301.26 61.25 59 306.38 61.25 60 319.31 61.25 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `Gemiddelde_olieprijs_in$` 297.3331 0.4086 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -36.243 -12.927 -1.468 10.921 40.437 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 297.33307 4.11862 72.192 < 2e-16 *** `Gemiddelde_olieprijs_in$` 0.40861 0.08934 4.573 2.57e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 17.05 on 58 degrees of freedom Multiple R-squared: 0.265, Adjusted R-squared: 0.2524 F-statistic: 20.92 on 1 and 58 DF, p-value: 2.571e-05 > 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.0384401133 0.0768802266 9.615599e-01 [2,] 0.0202692489 0.0405384978 9.797308e-01 [3,] 0.0211184470 0.0422368940 9.788816e-01 [4,] 0.0091061523 0.0182123045 9.908938e-01 [5,] 0.0036418727 0.0072837455 9.963581e-01 [6,] 0.0025832205 0.0051664411 9.974168e-01 [7,] 0.0012622968 0.0025245936 9.987377e-01 [8,] 0.0021389622 0.0042779244 9.978610e-01 [9,] 0.0010348558 0.0020697116 9.989651e-01 [10,] 0.0005857694 0.0011715387 9.994142e-01 [11,] 0.0005967824 0.0011935649 9.994032e-01 [12,] 0.0004421807 0.0008843614 9.995578e-01 [13,] 0.2371157689 0.4742315377 7.628842e-01 [14,] 0.5842957330 0.8314085340 4.157043e-01 [15,] 0.6315952363 0.7368095273 3.684048e-01 [16,] 0.6626712321 0.6746575358 3.373288e-01 [17,] 0.9663443702 0.0673112596 3.365563e-02 [18,] 0.9864600605 0.0270798791 1.353994e-02 [19,] 0.9912167299 0.0175665402 8.783270e-03 [20,] 0.9959336073 0.0081327855 4.066393e-03 [21,] 0.9998083094 0.0003833812 1.916906e-04 [22,] 0.9999061230 0.0001877541 9.387705e-05 [23,] 0.9998322671 0.0003354657 1.677329e-04 [24,] 0.9997373270 0.0005253460 2.626730e-04 [25,] 0.9997039586 0.0005920828 2.960414e-04 [26,] 0.9996541010 0.0006917979 3.458990e-04 [27,] 0.9993832130 0.0012335740 6.167870e-04 [28,] 0.9989403796 0.0021192408 1.059620e-03 [29,] 0.9989740534 0.0020518931 1.025947e-03 [30,] 0.9988176082 0.0023647836 1.182392e-03 [31,] 0.9986476829 0.0027046343 1.352317e-03 [32,] 0.9991695069 0.0016609861 8.304931e-04 [33,] 0.9996922774 0.0006154452 3.077226e-04 [34,] 0.9997160141 0.0005679718 2.839859e-04 [35,] 0.9995904617 0.0008190766 4.095383e-04 [36,] 0.9993046156 0.0013907689 6.953844e-04 [37,] 0.9991713142 0.0016573717 8.286858e-04 [38,] 0.9984255360 0.0031489281 1.574464e-03 [39,] 0.9971854784 0.0056290433 2.814522e-03 [40,] 0.9942725069 0.0114549862 5.727493e-03 [41,] 0.9890323125 0.0219353749 1.096769e-02 [42,] 0.9979045613 0.0041908774 2.095439e-03 [43,] 0.9983355255 0.0033289491 1.664475e-03 [44,] 0.9959838635 0.0080322729 4.016136e-03 [45,] 0.9913989274 0.0172021452 8.601073e-03 [46,] 0.9813393516 0.0373212968 1.866065e-02 [47,] 0.9656476934 0.0687046132 3.435231e-02 [48,] 0.9506058197 0.0987883607 4.939418e-02 [49,] 0.9640860229 0.0718279542 3.591398e-02 [50,] 0.9213791655 0.1572416690 7.862083e-02 [51,] 0.8911094361 0.2177811278 1.088906e-01 > postscript(file="/var/www/html/rcomp/tmp/1qpiz1292001339.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/2qpiz1292001339.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/31zij1292001339.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/41zij1292001339.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/51zij1292001339.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 = 60 Frequency = 1 1 2 3 4 5 6 -7.4111494 -7.5211494 -16.8211494 -16.5511494 -21.7726793 -29.9726793 7 8 9 10 11 12 -36.2426793 -27.4126793 -21.7974011 -15.7674011 -22.9274011 -11.6774011 13 14 15 16 17 18 2.1390956 -1.6509044 12.6490956 13.5690956 27.0488439 24.6388439 19 20 21 22 23 24 12.5288439 13.2388439 31.3546849 30.2846849 27.7846849 31.1846849 25 26 27 28 29 30 40.4372942 21.3972942 -4.2327058 -7.4527058 12.4957842 10.3957842 31 32 33 34 35 36 -4.2342158 1.3057842 10.0726385 5.4026385 3.2726385 6.6526385 37 38 39 40 41 42 7.4188106 -3.3611894 -16.2711894 -15.5311894 -18.0243154 -12.7343154 43 44 45 46 47 48 -13.5043154 -4.6543154 -0.5240705 17.7159295 6.2559295 -5.7040705 49 50 51 52 53 54 -8.8353023 -1.2853023 0.8846977 3.0946977 -4.8018457 8.0081543 55 56 57 58 59 60 19.9081543 6.7281543 -9.0603883 -21.1003883 -15.9803883 -3.0503883 > postscript(file="/var/www/html/rcomp/tmp/6cqzn1292001339.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 -7.4111494 NA 1 -7.5211494 -7.4111494 2 -16.8211494 -7.5211494 3 -16.5511494 -16.8211494 4 -21.7726793 -16.5511494 5 -29.9726793 -21.7726793 6 -36.2426793 -29.9726793 7 -27.4126793 -36.2426793 8 -21.7974011 -27.4126793 9 -15.7674011 -21.7974011 10 -22.9274011 -15.7674011 11 -11.6774011 -22.9274011 12 2.1390956 -11.6774011 13 -1.6509044 2.1390956 14 12.6490956 -1.6509044 15 13.5690956 12.6490956 16 27.0488439 13.5690956 17 24.6388439 27.0488439 18 12.5288439 24.6388439 19 13.2388439 12.5288439 20 31.3546849 13.2388439 21 30.2846849 31.3546849 22 27.7846849 30.2846849 23 31.1846849 27.7846849 24 40.4372942 31.1846849 25 21.3972942 40.4372942 26 -4.2327058 21.3972942 27 -7.4527058 -4.2327058 28 12.4957842 -7.4527058 29 10.3957842 12.4957842 30 -4.2342158 10.3957842 31 1.3057842 -4.2342158 32 10.0726385 1.3057842 33 5.4026385 10.0726385 34 3.2726385 5.4026385 35 6.6526385 3.2726385 36 7.4188106 6.6526385 37 -3.3611894 7.4188106 38 -16.2711894 -3.3611894 39 -15.5311894 -16.2711894 40 -18.0243154 -15.5311894 41 -12.7343154 -18.0243154 42 -13.5043154 -12.7343154 43 -4.6543154 -13.5043154 44 -0.5240705 -4.6543154 45 17.7159295 -0.5240705 46 6.2559295 17.7159295 47 -5.7040705 6.2559295 48 -8.8353023 -5.7040705 49 -1.2853023 -8.8353023 50 0.8846977 -1.2853023 51 3.0946977 0.8846977 52 -4.8018457 3.0946977 53 8.0081543 -4.8018457 54 19.9081543 8.0081543 55 6.7281543 19.9081543 56 -9.0603883 6.7281543 57 -21.1003883 -9.0603883 58 -15.9803883 -21.1003883 59 -3.0503883 -15.9803883 60 NA -3.0503883 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -7.5211494 -7.4111494 [2,] -16.8211494 -7.5211494 [3,] -16.5511494 -16.8211494 [4,] -21.7726793 -16.5511494 [5,] -29.9726793 -21.7726793 [6,] -36.2426793 -29.9726793 [7,] -27.4126793 -36.2426793 [8,] -21.7974011 -27.4126793 [9,] -15.7674011 -21.7974011 [10,] -22.9274011 -15.7674011 [11,] -11.6774011 -22.9274011 [12,] 2.1390956 -11.6774011 [13,] -1.6509044 2.1390956 [14,] 12.6490956 -1.6509044 [15,] 13.5690956 12.6490956 [16,] 27.0488439 13.5690956 [17,] 24.6388439 27.0488439 [18,] 12.5288439 24.6388439 [19,] 13.2388439 12.5288439 [20,] 31.3546849 13.2388439 [21,] 30.2846849 31.3546849 [22,] 27.7846849 30.2846849 [23,] 31.1846849 27.7846849 [24,] 40.4372942 31.1846849 [25,] 21.3972942 40.4372942 [26,] -4.2327058 21.3972942 [27,] -7.4527058 -4.2327058 [28,] 12.4957842 -7.4527058 [29,] 10.3957842 12.4957842 [30,] -4.2342158 10.3957842 [31,] 1.3057842 -4.2342158 [32,] 10.0726385 1.3057842 [33,] 5.4026385 10.0726385 [34,] 3.2726385 5.4026385 [35,] 6.6526385 3.2726385 [36,] 7.4188106 6.6526385 [37,] -3.3611894 7.4188106 [38,] -16.2711894 -3.3611894 [39,] -15.5311894 -16.2711894 [40,] -18.0243154 -15.5311894 [41,] -12.7343154 -18.0243154 [42,] -13.5043154 -12.7343154 [43,] -4.6543154 -13.5043154 [44,] -0.5240705 -4.6543154 [45,] 17.7159295 -0.5240705 [46,] 6.2559295 17.7159295 [47,] -5.7040705 6.2559295 [48,] -8.8353023 -5.7040705 [49,] -1.2853023 -8.8353023 [50,] 0.8846977 -1.2853023 [51,] 3.0946977 0.8846977 [52,] -4.8018457 3.0946977 [53,] 8.0081543 -4.8018457 [54,] 19.9081543 8.0081543 [55,] 6.7281543 19.9081543 [56,] -9.0603883 6.7281543 [57,] -21.1003883 -9.0603883 [58,] -15.9803883 -21.1003883 [59,] -3.0503883 -15.9803883 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -7.5211494 -7.4111494 2 -16.8211494 -7.5211494 3 -16.5511494 -16.8211494 4 -21.7726793 -16.5511494 5 -29.9726793 -21.7726793 6 -36.2426793 -29.9726793 7 -27.4126793 -36.2426793 8 -21.7974011 -27.4126793 9 -15.7674011 -21.7974011 10 -22.9274011 -15.7674011 11 -11.6774011 -22.9274011 12 2.1390956 -11.6774011 13 -1.6509044 2.1390956 14 12.6490956 -1.6509044 15 13.5690956 12.6490956 16 27.0488439 13.5690956 17 24.6388439 27.0488439 18 12.5288439 24.6388439 19 13.2388439 12.5288439 20 31.3546849 13.2388439 21 30.2846849 31.3546849 22 27.7846849 30.2846849 23 31.1846849 27.7846849 24 40.4372942 31.1846849 25 21.3972942 40.4372942 26 -4.2327058 21.3972942 27 -7.4527058 -4.2327058 28 12.4957842 -7.4527058 29 10.3957842 12.4957842 30 -4.2342158 10.3957842 31 1.3057842 -4.2342158 32 10.0726385 1.3057842 33 5.4026385 10.0726385 34 3.2726385 5.4026385 35 6.6526385 3.2726385 36 7.4188106 6.6526385 37 -3.3611894 7.4188106 38 -16.2711894 -3.3611894 39 -15.5311894 -16.2711894 40 -18.0243154 -15.5311894 41 -12.7343154 -18.0243154 42 -13.5043154 -12.7343154 43 -4.6543154 -13.5043154 44 -0.5240705 -4.6543154 45 17.7159295 -0.5240705 46 6.2559295 17.7159295 47 -5.7040705 6.2559295 48 -8.8353023 -5.7040705 49 -1.2853023 -8.8353023 50 0.8846977 -1.2853023 51 3.0946977 0.8846977 52 -4.8018457 3.0946977 53 8.0081543 -4.8018457 54 19.9081543 8.0081543 55 6.7281543 19.9081543 56 -9.0603883 6.7281543 57 -21.1003883 -9.0603883 58 -15.9803883 -21.1003883 59 -3.0503883 -15.9803883 > 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/7cqzn1292001339.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/8mhgp1292001339.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/9mhgp1292001339.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/10f9fa1292001339.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/1119ey1292001339.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/1249u41292001339.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/13ijav1292001339.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/14lk911292001339.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/157kp71292001339.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/16lcnf1292001339.tab") + } > > try(system("convert tmp/1qpiz1292001339.ps tmp/1qpiz1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/2qpiz1292001339.ps tmp/2qpiz1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/31zij1292001339.ps tmp/31zij1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/41zij1292001339.ps tmp/41zij1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/51zij1292001339.ps tmp/51zij1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/6cqzn1292001339.ps tmp/6cqzn1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/7cqzn1292001339.ps tmp/7cqzn1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/8mhgp1292001339.ps tmp/8mhgp1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/9mhgp1292001339.ps tmp/9mhgp1292001339.png",intern=TRUE)) character(0) > try(system("convert tmp/10f9fa1292001339.ps tmp/10f9fa1292001339.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.501 1.642 8.422