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(3.58,98.2,3.52,98.71,3.45,98.54,3.36,98.2,3.27,96.92,3.21,99.06,3.19,99.65,3.16,99.82,3.12,99.99,3.06,100.33,3.01,99.31,2.98,101.1,2.97,101.1,3.02,100.93,3.07,100.85,3.18,100.93,3.29,99.6,3.43,101.88,3.61,101.81,3.74,102.38,3.87,102.74,3.88,102.82,4.09,101.72,4.19,103.47,4.2,102.98,4.29,102.68,4.37,102.9,4.47,103.03,4.61,101.29,4.65,103.69,4.69,103.68,4.82,104.2,4.86,104.08,4.87,104.16,5.01,103.05,5.03,104.66,5.13,104.46,5.18,104.95,5.21,105.85,5.26,106.23,5.25,104.86,5.2,107.44,5.16,108.23,5.19,108.45,5.39,109.39,5.58,110.15,5.76,109.13,5.89,110.28,5.98,110.17,6.02,109.99,5.62,109.26,4.87,109.11,4.24,107.06,4.02,109.53,3.74,108.92,3.45,109.24,3.34,109.12,3.21,109,3.12,107.23,3.04,109.49),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 X 1 3.58 98.20 2 3.52 98.71 3 3.45 98.54 4 3.36 98.20 5 3.27 96.92 6 3.21 99.06 7 3.19 99.65 8 3.16 99.82 9 3.12 99.99 10 3.06 100.33 11 3.01 99.31 12 2.98 101.10 13 2.97 101.10 14 3.02 100.93 15 3.07 100.85 16 3.18 100.93 17 3.29 99.60 18 3.43 101.88 19 3.61 101.81 20 3.74 102.38 21 3.87 102.74 22 3.88 102.82 23 4.09 101.72 24 4.19 103.47 25 4.20 102.98 26 4.29 102.68 27 4.37 102.90 28 4.47 103.03 29 4.61 101.29 30 4.65 103.69 31 4.69 103.68 32 4.82 104.20 33 4.86 104.08 34 4.87 104.16 35 5.01 103.05 36 5.03 104.66 37 5.13 104.46 38 5.18 104.95 39 5.21 105.85 40 5.26 106.23 41 5.25 104.86 42 5.20 107.44 43 5.16 108.23 44 5.19 108.45 45 5.39 109.39 46 5.58 110.15 47 5.76 109.13 48 5.89 110.28 49 5.98 110.17 50 6.02 109.99 51 5.62 109.26 52 4.87 109.11 53 4.24 107.06 54 4.02 109.53 55 3.74 108.92 56 3.45 109.24 57 3.34 109.12 58 3.21 109.00 59 3.12 107.23 60 3.04 109.49 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X -11.3900 0.1497 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.9614 -0.4389 0.1414 0.6211 0.9727 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -11.38998 2.62920 -4.332 5.94e-05 *** X 0.14971 0.02523 5.933 1.75e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.7524 on 58 degrees of freedom Multiple R-squared: 0.3777, Adjusted R-squared: 0.367 F-statistic: 35.21 on 1 and 58 DF, p-value: 1.755e-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,] 2.452648e-03 4.905296e-03 0.99754735 [2,] 3.199230e-03 6.398459e-03 0.99680077 [3,] 1.081452e-03 2.162904e-03 0.99891855 [4,] 2.677921e-04 5.355842e-04 0.99973221 [5,] 6.100051e-05 1.220010e-04 0.99993900 [6,] 1.351710e-05 2.703420e-05 0.99998648 [7,] 7.378202e-06 1.475640e-05 0.99999262 [8,] 1.504740e-06 3.009481e-06 0.99999850 [9,] 3.056559e-07 6.113118e-07 0.99999969 [10,] 5.948841e-08 1.189768e-07 0.99999994 [11,] 1.192441e-08 2.384882e-08 0.99999999 [12,] 4.046123e-09 8.092247e-09 1.00000000 [13,] 9.319110e-10 1.863822e-09 1.00000000 [14,] 1.136625e-08 2.273251e-08 0.99999999 [15,] 9.933168e-08 1.986634e-07 0.99999990 [16,] 5.282834e-07 1.056567e-06 0.99999947 [17,] 1.621916e-06 3.243833e-06 0.99999838 [18,] 2.131018e-06 4.262036e-06 0.99999787 [19,] 6.804224e-06 1.360845e-05 0.99999320 [20,] 9.204999e-06 1.841000e-05 0.99999080 [21,] 1.023084e-05 2.046168e-05 0.99998977 [22,] 1.321917e-05 2.643835e-05 0.99998678 [23,] 1.512416e-05 3.024831e-05 0.99998488 [24,] 1.708190e-05 3.416381e-05 0.99998292 [25,] 7.028906e-05 1.405781e-04 0.99992971 [26,] 5.737977e-05 1.147595e-04 0.99994262 [27,] 4.372284e-05 8.744569e-05 0.99995628 [28,] 2.991740e-05 5.983481e-05 0.99997008 [29,] 2.040618e-05 4.081236e-05 0.99997959 [30,] 1.235608e-05 2.471215e-05 0.99998764 [31,] 1.650232e-05 3.300464e-05 0.99998350 [32,] 8.910169e-06 1.782034e-05 0.99999109 [33,] 5.761339e-06 1.152268e-05 0.99999424 [34,] 3.280111e-06 6.560223e-06 0.99999672 [35,] 1.630100e-06 3.260199e-06 0.99999837 [36,] 9.100913e-07 1.820183e-06 0.99999909 [37,] 2.182131e-06 4.364261e-06 0.99999782 [38,] 3.520446e-06 7.040891e-06 0.99999648 [39,] 5.227242e-06 1.045448e-05 0.99999477 [40,] 7.405755e-06 1.481151e-05 0.99999259 [41,] 6.063299e-06 1.212660e-05 0.99999394 [42,] 3.449188e-06 6.898375e-06 0.99999655 [43,] 6.923259e-06 1.384652e-05 0.99999308 [44,] 5.849762e-06 1.169952e-05 0.99999415 [45,] 1.382335e-05 2.764670e-05 0.99998618 [46,] 3.334916e-04 6.669832e-04 0.99966651 [47,] 2.802272e-02 5.604545e-02 0.97197728 [48,] 3.301243e-01 6.602486e-01 0.66987570 [49,] 6.469071e-01 7.061859e-01 0.35309293 [50,] 8.586483e-01 2.827033e-01 0.14135165 [51,] 9.495762e-01 1.008476e-01 0.05042378 > postscript(file="/var/www/html/rcomp/tmp/168vx1258559376.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/2ktlx1258559376.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/3w5sz1258559376.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/4u7xf1258559376.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/5x7s71258559376.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 0.26876129 0.13241074 0.08786092 0.04876129 0.15038619 -0.22998670 7 8 9 10 11 12 -0.33831380 -0.39376399 -0.45921417 -0.57011454 -0.46741344 -0.76538889 13 14 15 16 17 18 -0.77538889 -0.69993871 -0.63796215 -0.53993871 -0.23082846 -0.43216032 19 20 21 22 23 24 -0.24168083 -0.19701380 -0.12090830 -0.12288486 0.25179279 0.08980562 25 26 27 28 29 30 0.17316203 0.30807411 0.35513858 0.43567668 0.83616678 0.51687008 31 32 33 34 35 36 0.55836715 0.61051954 0.66848437 0.66650781 0.97268254 0.75165434 37 38 39 40 41 42 0.88159573 0.85823932 0.75350306 0.74661441 0.94171294 0.50546899 43 44 45 46 47 48 0.34720049 0.34426496 0.40354042 0.47976314 0.81246423 0.77030123 49 50 51 52 53 54 0.87676900 0.94371625 0.65300233 -0.07454163 -0.39764236 -0.98741855 55 56 57 58 59 60 -1.17609731 -1.51400353 -1.60603870 -1.71807386 -1.54309255 -1.96143027 > postscript(file="/var/www/html/rcomp/tmp/66rd61258559376.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 0.26876129 NA 1 0.13241074 0.26876129 2 0.08786092 0.13241074 3 0.04876129 0.08786092 4 0.15038619 0.04876129 5 -0.22998670 0.15038619 6 -0.33831380 -0.22998670 7 -0.39376399 -0.33831380 8 -0.45921417 -0.39376399 9 -0.57011454 -0.45921417 10 -0.46741344 -0.57011454 11 -0.76538889 -0.46741344 12 -0.77538889 -0.76538889 13 -0.69993871 -0.77538889 14 -0.63796215 -0.69993871 15 -0.53993871 -0.63796215 16 -0.23082846 -0.53993871 17 -0.43216032 -0.23082846 18 -0.24168083 -0.43216032 19 -0.19701380 -0.24168083 20 -0.12090830 -0.19701380 21 -0.12288486 -0.12090830 22 0.25179279 -0.12288486 23 0.08980562 0.25179279 24 0.17316203 0.08980562 25 0.30807411 0.17316203 26 0.35513858 0.30807411 27 0.43567668 0.35513858 28 0.83616678 0.43567668 29 0.51687008 0.83616678 30 0.55836715 0.51687008 31 0.61051954 0.55836715 32 0.66848437 0.61051954 33 0.66650781 0.66848437 34 0.97268254 0.66650781 35 0.75165434 0.97268254 36 0.88159573 0.75165434 37 0.85823932 0.88159573 38 0.75350306 0.85823932 39 0.74661441 0.75350306 40 0.94171294 0.74661441 41 0.50546899 0.94171294 42 0.34720049 0.50546899 43 0.34426496 0.34720049 44 0.40354042 0.34426496 45 0.47976314 0.40354042 46 0.81246423 0.47976314 47 0.77030123 0.81246423 48 0.87676900 0.77030123 49 0.94371625 0.87676900 50 0.65300233 0.94371625 51 -0.07454163 0.65300233 52 -0.39764236 -0.07454163 53 -0.98741855 -0.39764236 54 -1.17609731 -0.98741855 55 -1.51400353 -1.17609731 56 -1.60603870 -1.51400353 57 -1.71807386 -1.60603870 58 -1.54309255 -1.71807386 59 -1.96143027 -1.54309255 60 NA -1.96143027 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.13241074 0.26876129 [2,] 0.08786092 0.13241074 [3,] 0.04876129 0.08786092 [4,] 0.15038619 0.04876129 [5,] -0.22998670 0.15038619 [6,] -0.33831380 -0.22998670 [7,] -0.39376399 -0.33831380 [8,] -0.45921417 -0.39376399 [9,] -0.57011454 -0.45921417 [10,] -0.46741344 -0.57011454 [11,] -0.76538889 -0.46741344 [12,] -0.77538889 -0.76538889 [13,] -0.69993871 -0.77538889 [14,] -0.63796215 -0.69993871 [15,] -0.53993871 -0.63796215 [16,] -0.23082846 -0.53993871 [17,] -0.43216032 -0.23082846 [18,] -0.24168083 -0.43216032 [19,] -0.19701380 -0.24168083 [20,] -0.12090830 -0.19701380 [21,] -0.12288486 -0.12090830 [22,] 0.25179279 -0.12288486 [23,] 0.08980562 0.25179279 [24,] 0.17316203 0.08980562 [25,] 0.30807411 0.17316203 [26,] 0.35513858 0.30807411 [27,] 0.43567668 0.35513858 [28,] 0.83616678 0.43567668 [29,] 0.51687008 0.83616678 [30,] 0.55836715 0.51687008 [31,] 0.61051954 0.55836715 [32,] 0.66848437 0.61051954 [33,] 0.66650781 0.66848437 [34,] 0.97268254 0.66650781 [35,] 0.75165434 0.97268254 [36,] 0.88159573 0.75165434 [37,] 0.85823932 0.88159573 [38,] 0.75350306 0.85823932 [39,] 0.74661441 0.75350306 [40,] 0.94171294 0.74661441 [41,] 0.50546899 0.94171294 [42,] 0.34720049 0.50546899 [43,] 0.34426496 0.34720049 [44,] 0.40354042 0.34426496 [45,] 0.47976314 0.40354042 [46,] 0.81246423 0.47976314 [47,] 0.77030123 0.81246423 [48,] 0.87676900 0.77030123 [49,] 0.94371625 0.87676900 [50,] 0.65300233 0.94371625 [51,] -0.07454163 0.65300233 [52,] -0.39764236 -0.07454163 [53,] -0.98741855 -0.39764236 [54,] -1.17609731 -0.98741855 [55,] -1.51400353 -1.17609731 [56,] -1.60603870 -1.51400353 [57,] -1.71807386 -1.60603870 [58,] -1.54309255 -1.71807386 [59,] -1.96143027 -1.54309255 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.13241074 0.26876129 2 0.08786092 0.13241074 3 0.04876129 0.08786092 4 0.15038619 0.04876129 5 -0.22998670 0.15038619 6 -0.33831380 -0.22998670 7 -0.39376399 -0.33831380 8 -0.45921417 -0.39376399 9 -0.57011454 -0.45921417 10 -0.46741344 -0.57011454 11 -0.76538889 -0.46741344 12 -0.77538889 -0.76538889 13 -0.69993871 -0.77538889 14 -0.63796215 -0.69993871 15 -0.53993871 -0.63796215 16 -0.23082846 -0.53993871 17 -0.43216032 -0.23082846 18 -0.24168083 -0.43216032 19 -0.19701380 -0.24168083 20 -0.12090830 -0.19701380 21 -0.12288486 -0.12090830 22 0.25179279 -0.12288486 23 0.08980562 0.25179279 24 0.17316203 0.08980562 25 0.30807411 0.17316203 26 0.35513858 0.30807411 27 0.43567668 0.35513858 28 0.83616678 0.43567668 29 0.51687008 0.83616678 30 0.55836715 0.51687008 31 0.61051954 0.55836715 32 0.66848437 0.61051954 33 0.66650781 0.66848437 34 0.97268254 0.66650781 35 0.75165434 0.97268254 36 0.88159573 0.75165434 37 0.85823932 0.88159573 38 0.75350306 0.85823932 39 0.74661441 0.75350306 40 0.94171294 0.74661441 41 0.50546899 0.94171294 42 0.34720049 0.50546899 43 0.34426496 0.34720049 44 0.40354042 0.34426496 45 0.47976314 0.40354042 46 0.81246423 0.47976314 47 0.77030123 0.81246423 48 0.87676900 0.77030123 49 0.94371625 0.87676900 50 0.65300233 0.94371625 51 -0.07454163 0.65300233 52 -0.39764236 -0.07454163 53 -0.98741855 -0.39764236 54 -1.17609731 -0.98741855 55 -1.51400353 -1.17609731 56 -1.60603870 -1.51400353 57 -1.71807386 -1.60603870 58 -1.54309255 -1.71807386 59 -1.96143027 -1.54309255 > 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/7xrlz1258559376.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/8kotm1258559376.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/9aid81258559376.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/10b7i41258559376.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/11giuw1258559376.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/12qzp71258559376.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/134apj1258559376.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/14u8k71258559376.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/15ym2u1258559376.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/16a7u21258559376.tab") + } > > system("convert tmp/168vx1258559376.ps tmp/168vx1258559376.png") > system("convert tmp/2ktlx1258559376.ps tmp/2ktlx1258559376.png") > system("convert tmp/3w5sz1258559376.ps tmp/3w5sz1258559376.png") > system("convert tmp/4u7xf1258559376.ps tmp/4u7xf1258559376.png") > system("convert tmp/5x7s71258559376.ps tmp/5x7s71258559376.png") > system("convert tmp/66rd61258559376.ps tmp/66rd61258559376.png") > system("convert tmp/7xrlz1258559376.ps tmp/7xrlz1258559376.png") > system("convert tmp/8kotm1258559376.ps tmp/8kotm1258559376.png") > system("convert tmp/9aid81258559376.ps tmp/9aid81258559376.png") > system("convert tmp/10b7i41258559376.ps tmp/10b7i41258559376.png") > > > proc.time() user system elapsed 2.511 1.580 4.061