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(108.01,102.9,101.21,97.4,119.93,111.4,94.76,87.4,95.26,96.8,117.96,114.1,115.86,110.3,111.44,103.9,108.16,101.6,108.77,94.6,109.45,95.9,124.83,104.7,115.31,102.8,109.49,98.1,124.24,113.9,92.85,80.9,98.42,95.7,120.88,113.2,111.72,105.9,116.1,108.8,109.37,102.3,111.65,99,114.29,100.7,133.68,115.5,114.27,100.7,126.49,109.9,131,114.6,104,85.4,108.88,100.5,128.48,114.8,132.44,116.5,128.04,112.9,116.35,102,120.93,106,118.59,105.3,133.1,118.8,121.05,106.1,127.62,109.3,135.44,117.2,114.88,92.5,114.34,104.2,128.85,112.5,138.9,122.4,129.44,113.3,114.96,100,127.98,110.7,127.03,112.8,128.75,109.8,137.91,117.3,128.37,109.1,135.9,115.9,122.19,96,113.08,99.8,136.2,116.8,138,115.7,115.24,99.4,110.95,94.3,99.23,91,102.39,93.2,112.67,103.1),dim=c(2,60),dimnames=list(c('Y(omzet)','X(prod)'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y(omzet)','X(prod)'),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 Y(omzet) X(prod) 1 108.01 102.9 2 101.21 97.4 3 119.93 111.4 4 94.76 87.4 5 95.26 96.8 6 117.96 114.1 7 115.86 110.3 8 111.44 103.9 9 108.16 101.6 10 108.77 94.6 11 109.45 95.9 12 124.83 104.7 13 115.31 102.8 14 109.49 98.1 15 124.24 113.9 16 92.85 80.9 17 98.42 95.7 18 120.88 113.2 19 111.72 105.9 20 116.10 108.8 21 109.37 102.3 22 111.65 99.0 23 114.29 100.7 24 133.68 115.5 25 114.27 100.7 26 126.49 109.9 27 131.00 114.6 28 104.00 85.4 29 108.88 100.5 30 128.48 114.8 31 132.44 116.5 32 128.04 112.9 33 116.35 102.0 34 120.93 106.0 35 118.59 105.3 36 133.10 118.8 37 121.05 106.1 38 127.62 109.3 39 135.44 117.2 40 114.88 92.5 41 114.34 104.2 42 128.85 112.5 43 138.90 122.4 44 129.44 113.3 45 114.96 100.0 46 127.98 110.7 47 127.03 112.8 48 128.75 109.8 49 137.91 117.3 50 128.37 109.1 51 135.90 115.9 52 122.19 96.0 53 113.08 99.8 54 136.20 116.8 55 138.00 115.7 56 115.24 99.4 57 110.95 94.3 58 99.23 91.0 59 102.39 93.2 60 112.67 103.1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `X(prod)` -2.977 1.154 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -13.4277 -3.4828 0.9794 3.2292 14.4252 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.97734 8.18347 -0.364 0.717 `X(prod)` 1.15356 0.07756 14.874 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.432 on 58 degrees of freedom Multiple R-squared: 0.7923, Adjusted R-squared: 0.7887 F-statistic: 221.2 on 1 and 58 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.4859858 0.9719715 0.51401423 [2,] 0.3775787 0.7551574 0.62242130 [3,] 0.2703963 0.5407925 0.72960373 [4,] 0.2175040 0.4350080 0.78249600 [5,] 0.1597145 0.3194290 0.84028551 [6,] 0.4305000 0.8610000 0.56950002 [7,] 0.5142435 0.9715131 0.48575654 [8,] 0.8827244 0.2345512 0.11727560 [9,] 0.8600717 0.2798566 0.13992832 [10,] 0.8182245 0.3635510 0.18177549 [11,] 0.7832398 0.4335203 0.21676016 [12,] 0.7229937 0.5540126 0.27700631 [13,] 0.8203017 0.3593967 0.17969834 [14,] 0.8188437 0.3623125 0.18115625 [15,] 0.8513473 0.2973054 0.14865269 [16,] 0.8701643 0.2596714 0.12983572 [17,] 0.8916205 0.2167590 0.10837952 [18,] 0.8784208 0.2431584 0.12157918 [19,] 0.8697606 0.2604788 0.13023939 [20,] 0.9205103 0.1589793 0.07948966 [21,] 0.9068475 0.1863050 0.09315249 [22,] 0.9099867 0.1800266 0.09001329 [23,] 0.9024152 0.1951696 0.09758480 [24,] 0.9393263 0.1213475 0.06067373 [25,] 0.9469450 0.1061100 0.05305502 [26,] 0.9369679 0.1260642 0.06303209 [27,] 0.9248346 0.1503309 0.07516543 [28,] 0.9067469 0.1865062 0.09325311 [29,] 0.8815021 0.2369958 0.11849791 [30,] 0.8524526 0.2950948 0.14754741 [31,] 0.8206451 0.3587098 0.17935491 [32,] 0.7965437 0.4069126 0.20345630 [33,] 0.7538462 0.4923077 0.24615383 [34,] 0.7316457 0.5367086 0.26835430 [35,] 0.6890993 0.6218013 0.31090067 [36,] 0.8614783 0.2770434 0.13852170 [37,] 0.8667290 0.2665420 0.13327101 [38,] 0.8264770 0.3470460 0.17352300 [39,] 0.8031212 0.3937576 0.19687878 [40,] 0.7571343 0.4857315 0.24286574 [41,] 0.6872576 0.6254847 0.31274236 [42,] 0.6158448 0.7683103 0.38415516 [43,] 0.5936894 0.8126212 0.40631059 [44,] 0.5201468 0.9597065 0.47985323 [45,] 0.4442009 0.8884017 0.55579914 [46,] 0.3657093 0.7314187 0.63429066 [47,] 0.2813728 0.5627455 0.71862723 [48,] 0.8758354 0.2483292 0.12416460 [49,] 0.7835582 0.4328836 0.21644180 [50,] 0.6665780 0.6668440 0.33342198 [51,] 0.5771289 0.8457422 0.42287109 > postscript(file="/var/www/html/rcomp/tmp/1xrjc1258656894.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/21ql51258656894.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/363b71258656894.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/4czka1258656894.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/5aclr1258656894.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 = 60 Frequency = 1 1 2 3 4 5 6 -7.7143974 -8.1697953 -5.5996917 -3.0841550 -13.4276568 -10.6843146 7 8 9 10 11 12 -8.4007712 -5.4379615 -6.0647642 2.6201840 1.8005508 7.0291873 13 14 15 16 17 18 -0.2990410 -0.6972901 -4.1736018 2.5040112 -8.9987364 -6.7261069 19 20 21 22 23 24 -7.4650895 -6.4304252 -5.6622590 0.4245023 1.1034434 3.4206958 25 26 27 28 29 30 1.0834434 2.6906544 1.7789034 8.4629731 -4.0758438 -0.9718094 31 32 33 34 35 36 1.0271318 0.7799623 1.6638102 1.6295541 0.0970489 -0.9660655 37 38 39 40 41 42 1.6341977 4.5127928 3.2196369 11.1526685 -2.8840307 2.0513879 43 44 45 46 47 48 0.6811040 1.7185367 2.5809383 3.2578031 -0.1146813 5.0660108 49 50 51 52 53 54 5.5742805 5.4935056 5.1792702 14.4251944 0.9316511 4.4410626 55 56 57 58 59 60 7.5099830 3.5530767 5.1462532 -2.7669855 -2.1448263 -3.2851102 > postscript(file="/var/www/html/rcomp/tmp/6r6v31258656894.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 -7.7143974 NA 1 -8.1697953 -7.7143974 2 -5.5996917 -8.1697953 3 -3.0841550 -5.5996917 4 -13.4276568 -3.0841550 5 -10.6843146 -13.4276568 6 -8.4007712 -10.6843146 7 -5.4379615 -8.4007712 8 -6.0647642 -5.4379615 9 2.6201840 -6.0647642 10 1.8005508 2.6201840 11 7.0291873 1.8005508 12 -0.2990410 7.0291873 13 -0.6972901 -0.2990410 14 -4.1736018 -0.6972901 15 2.5040112 -4.1736018 16 -8.9987364 2.5040112 17 -6.7261069 -8.9987364 18 -7.4650895 -6.7261069 19 -6.4304252 -7.4650895 20 -5.6622590 -6.4304252 21 0.4245023 -5.6622590 22 1.1034434 0.4245023 23 3.4206958 1.1034434 24 1.0834434 3.4206958 25 2.6906544 1.0834434 26 1.7789034 2.6906544 27 8.4629731 1.7789034 28 -4.0758438 8.4629731 29 -0.9718094 -4.0758438 30 1.0271318 -0.9718094 31 0.7799623 1.0271318 32 1.6638102 0.7799623 33 1.6295541 1.6638102 34 0.0970489 1.6295541 35 -0.9660655 0.0970489 36 1.6341977 -0.9660655 37 4.5127928 1.6341977 38 3.2196369 4.5127928 39 11.1526685 3.2196369 40 -2.8840307 11.1526685 41 2.0513879 -2.8840307 42 0.6811040 2.0513879 43 1.7185367 0.6811040 44 2.5809383 1.7185367 45 3.2578031 2.5809383 46 -0.1146813 3.2578031 47 5.0660108 -0.1146813 48 5.5742805 5.0660108 49 5.4935056 5.5742805 50 5.1792702 5.4935056 51 14.4251944 5.1792702 52 0.9316511 14.4251944 53 4.4410626 0.9316511 54 7.5099830 4.4410626 55 3.5530767 7.5099830 56 5.1462532 3.5530767 57 -2.7669855 5.1462532 58 -2.1448263 -2.7669855 59 -3.2851102 -2.1448263 60 NA -3.2851102 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -8.1697953 -7.7143974 [2,] -5.5996917 -8.1697953 [3,] -3.0841550 -5.5996917 [4,] -13.4276568 -3.0841550 [5,] -10.6843146 -13.4276568 [6,] -8.4007712 -10.6843146 [7,] -5.4379615 -8.4007712 [8,] -6.0647642 -5.4379615 [9,] 2.6201840 -6.0647642 [10,] 1.8005508 2.6201840 [11,] 7.0291873 1.8005508 [12,] -0.2990410 7.0291873 [13,] -0.6972901 -0.2990410 [14,] -4.1736018 -0.6972901 [15,] 2.5040112 -4.1736018 [16,] -8.9987364 2.5040112 [17,] -6.7261069 -8.9987364 [18,] -7.4650895 -6.7261069 [19,] -6.4304252 -7.4650895 [20,] -5.6622590 -6.4304252 [21,] 0.4245023 -5.6622590 [22,] 1.1034434 0.4245023 [23,] 3.4206958 1.1034434 [24,] 1.0834434 3.4206958 [25,] 2.6906544 1.0834434 [26,] 1.7789034 2.6906544 [27,] 8.4629731 1.7789034 [28,] -4.0758438 8.4629731 [29,] -0.9718094 -4.0758438 [30,] 1.0271318 -0.9718094 [31,] 0.7799623 1.0271318 [32,] 1.6638102 0.7799623 [33,] 1.6295541 1.6638102 [34,] 0.0970489 1.6295541 [35,] -0.9660655 0.0970489 [36,] 1.6341977 -0.9660655 [37,] 4.5127928 1.6341977 [38,] 3.2196369 4.5127928 [39,] 11.1526685 3.2196369 [40,] -2.8840307 11.1526685 [41,] 2.0513879 -2.8840307 [42,] 0.6811040 2.0513879 [43,] 1.7185367 0.6811040 [44,] 2.5809383 1.7185367 [45,] 3.2578031 2.5809383 [46,] -0.1146813 3.2578031 [47,] 5.0660108 -0.1146813 [48,] 5.5742805 5.0660108 [49,] 5.4935056 5.5742805 [50,] 5.1792702 5.4935056 [51,] 14.4251944 5.1792702 [52,] 0.9316511 14.4251944 [53,] 4.4410626 0.9316511 [54,] 7.5099830 4.4410626 [55,] 3.5530767 7.5099830 [56,] 5.1462532 3.5530767 [57,] -2.7669855 5.1462532 [58,] -2.1448263 -2.7669855 [59,] -3.2851102 -2.1448263 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -8.1697953 -7.7143974 2 -5.5996917 -8.1697953 3 -3.0841550 -5.5996917 4 -13.4276568 -3.0841550 5 -10.6843146 -13.4276568 6 -8.4007712 -10.6843146 7 -5.4379615 -8.4007712 8 -6.0647642 -5.4379615 9 2.6201840 -6.0647642 10 1.8005508 2.6201840 11 7.0291873 1.8005508 12 -0.2990410 7.0291873 13 -0.6972901 -0.2990410 14 -4.1736018 -0.6972901 15 2.5040112 -4.1736018 16 -8.9987364 2.5040112 17 -6.7261069 -8.9987364 18 -7.4650895 -6.7261069 19 -6.4304252 -7.4650895 20 -5.6622590 -6.4304252 21 0.4245023 -5.6622590 22 1.1034434 0.4245023 23 3.4206958 1.1034434 24 1.0834434 3.4206958 25 2.6906544 1.0834434 26 1.7789034 2.6906544 27 8.4629731 1.7789034 28 -4.0758438 8.4629731 29 -0.9718094 -4.0758438 30 1.0271318 -0.9718094 31 0.7799623 1.0271318 32 1.6638102 0.7799623 33 1.6295541 1.6638102 34 0.0970489 1.6295541 35 -0.9660655 0.0970489 36 1.6341977 -0.9660655 37 4.5127928 1.6341977 38 3.2196369 4.5127928 39 11.1526685 3.2196369 40 -2.8840307 11.1526685 41 2.0513879 -2.8840307 42 0.6811040 2.0513879 43 1.7185367 0.6811040 44 2.5809383 1.7185367 45 3.2578031 2.5809383 46 -0.1146813 3.2578031 47 5.0660108 -0.1146813 48 5.5742805 5.0660108 49 5.4935056 5.5742805 50 5.1792702 5.4935056 51 14.4251944 5.1792702 52 0.9316511 14.4251944 53 4.4410626 0.9316511 54 7.5099830 4.4410626 55 3.5530767 7.5099830 56 5.1462532 3.5530767 57 -2.7669855 5.1462532 58 -2.1448263 -2.7669855 59 -3.2851102 -2.1448263 > 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/7gv8n1258656894.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/8tgad1258656894.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/957g41258656894.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/10a0451258656894.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/11i8ee1258656894.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/12jns91258656894.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/13xu1w1258656894.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/14ewvt1258656894.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/15tfd81258656894.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/16nuok1258656894.tab") + } > > system("convert tmp/1xrjc1258656894.ps tmp/1xrjc1258656894.png") > system("convert tmp/21ql51258656894.ps tmp/21ql51258656894.png") > system("convert tmp/363b71258656894.ps tmp/363b71258656894.png") > system("convert tmp/4czka1258656894.ps tmp/4czka1258656894.png") > system("convert tmp/5aclr1258656894.ps tmp/5aclr1258656894.png") > system("convert tmp/6r6v31258656894.ps tmp/6r6v31258656894.png") > system("convert tmp/7gv8n1258656894.ps tmp/7gv8n1258656894.png") > system("convert tmp/8tgad1258656894.ps tmp/8tgad1258656894.png") > system("convert tmp/957g41258656894.ps tmp/957g41258656894.png") > system("convert tmp/10a0451258656894.ps tmp/10a0451258656894.png") > > > proc.time() user system elapsed 2.494 1.605 3.015