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(100.35,102.1,100.35,102.86,100.36,102.99,100.39,103.73,100.34,105.02,100.34,104.43,100.35,104.63,100.43,104.93,100.47,105.87,100.67,105.66,100.75,106.76,100.78,106,100.79,107.22,100.67,107.33,100.64,107.11,100.64,108.86,100.76,107.72,100.79,107.88,100.79,108.38,100.9,107.72,100.98,108.41,101.11,109.9,101.18,111.45,101.22,112.18,101.23,113.34,101.09,113.46,101.26,114.06,101.28,115.54,101.43,116.39,101.53,115.94,101.54,116.97,101.54,115.94,101.79,115.91,102.18,116.43,102.37,116.26,102.46,116.35,102.46,117.9,102.03,117.7,102.26,117.53,102.33,117.86,102.44,117.65,102.5,116.51,102.52,115.93,102.66,115.31,102.72,115),dim=c(2,45),dimnames=list(c('Ktot','Vmtot'),1:45)) > y <- array(NA,dim=c(2,45),dimnames=list(c('Ktot','Vmtot'),1:45)) > 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 = 'Include Monthly 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 Ktot Vmtot M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 100.35 102.10 1 0 0 0 0 0 0 0 0 0 0 2 100.35 102.86 0 1 0 0 0 0 0 0 0 0 0 3 100.36 102.99 0 0 1 0 0 0 0 0 0 0 0 4 100.39 103.73 0 0 0 1 0 0 0 0 0 0 0 5 100.34 105.02 0 0 0 0 1 0 0 0 0 0 0 6 100.34 104.43 0 0 0 0 0 1 0 0 0 0 0 7 100.35 104.63 0 0 0 0 0 0 1 0 0 0 0 8 100.43 104.93 0 0 0 0 0 0 0 1 0 0 0 9 100.47 105.87 0 0 0 0 0 0 0 0 1 0 0 10 100.67 105.66 0 0 0 0 0 0 0 0 0 1 0 11 100.75 106.76 0 0 0 0 0 0 0 0 0 0 1 12 100.78 106.00 0 0 0 0 0 0 0 0 0 0 0 13 100.79 107.22 1 0 0 0 0 0 0 0 0 0 0 14 100.67 107.33 0 1 0 0 0 0 0 0 0 0 0 15 100.64 107.11 0 0 1 0 0 0 0 0 0 0 0 16 100.64 108.86 0 0 0 1 0 0 0 0 0 0 0 17 100.76 107.72 0 0 0 0 1 0 0 0 0 0 0 18 100.79 107.88 0 0 0 0 0 1 0 0 0 0 0 19 100.79 108.38 0 0 0 0 0 0 1 0 0 0 0 20 100.90 107.72 0 0 0 0 0 0 0 1 0 0 0 21 100.98 108.41 0 0 0 0 0 0 0 0 1 0 0 22 101.11 109.90 0 0 0 0 0 0 0 0 0 1 0 23 101.18 111.45 0 0 0 0 0 0 0 0 0 0 1 24 101.22 112.18 0 0 0 0 0 0 0 0 0 0 0 25 101.23 113.34 1 0 0 0 0 0 0 0 0 0 0 26 101.09 113.46 0 1 0 0 0 0 0 0 0 0 0 27 101.26 114.06 0 0 1 0 0 0 0 0 0 0 0 28 101.28 115.54 0 0 0 1 0 0 0 0 0 0 0 29 101.43 116.39 0 0 0 0 1 0 0 0 0 0 0 30 101.53 115.94 0 0 0 0 0 1 0 0 0 0 0 31 101.54 116.97 0 0 0 0 0 0 1 0 0 0 0 32 101.54 115.94 0 0 0 0 0 0 0 1 0 0 0 33 101.79 115.91 0 0 0 0 0 0 0 0 1 0 0 34 102.18 116.43 0 0 0 0 0 0 0 0 0 1 0 35 102.37 116.26 0 0 0 0 0 0 0 0 0 0 1 36 102.46 116.35 0 0 0 0 0 0 0 0 0 0 0 37 102.46 117.90 1 0 0 0 0 0 0 0 0 0 0 38 102.03 117.70 0 1 0 0 0 0 0 0 0 0 0 39 102.26 117.53 0 0 1 0 0 0 0 0 0 0 0 40 102.33 117.86 0 0 0 1 0 0 0 0 0 0 0 41 102.44 117.65 0 0 0 0 1 0 0 0 0 0 0 42 102.50 116.51 0 0 0 0 0 1 0 0 0 0 0 43 102.52 115.93 0 0 0 0 0 0 1 0 0 0 0 44 102.66 115.31 0 0 0 0 0 0 0 1 0 0 0 45 102.72 115.00 0 0 0 0 0 0 0 0 1 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Vmtot M1 M2 M3 M4 86.33914 0.13584 -0.09307 -0.29239 -0.20894 -0.32497 M5 M6 M7 M8 M9 M10 -0.26930 -0.15320 -0.18225 -0.03149 0.03220 -0.05166 M11 -0.05062 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.51695 -0.24790 -0.02085 0.23465 0.72705 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 86.33914 1.22323 70.583 < 2e-16 *** Vmtot 0.13584 0.01080 12.578 6.29e-14 *** M1 -0.09307 0.28375 -0.328 0.745 M2 -0.29239 0.28364 -1.031 0.310 M3 -0.20894 0.28361 -0.737 0.467 M4 -0.32497 0.28336 -1.147 0.260 M5 -0.26930 0.28337 -0.950 0.349 M6 -0.15320 0.28338 -0.541 0.593 M7 -0.18225 0.28336 -0.643 0.525 M8 -0.03149 0.28342 -0.111 0.912 M9 0.03220 0.28337 0.114 0.910 M10 -0.05166 0.30306 -0.170 0.866 M11 -0.05062 0.30293 -0.167 0.868 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.371 on 32 degrees of freedom Multiple R-squared: 0.837, Adjusted R-squared: 0.7758 F-statistic: 13.69 on 12 and 32 DF, p-value: 2.206e-09 > 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.364328e-03 4.728656e-03 0.9976357 [2,] 3.165983e-03 6.331965e-03 0.9968340 [3,] 1.317605e-03 2.635209e-03 0.9986824 [4,] 3.638281e-04 7.276562e-04 0.9996362 [5,] 2.224135e-04 4.448270e-04 0.9997776 [6,] 1.698906e-04 3.397811e-04 0.9998301 [7,] 4.037038e-05 8.074077e-05 0.9999596 [8,] 7.392088e-06 1.478418e-05 0.9999926 [9,] 1.829876e-06 3.659752e-06 0.9999982 [10,] 3.957021e-07 7.914042e-07 0.9999996 [11,] 8.596165e-08 1.719233e-07 0.9999999 [12,] 1.173299e-08 2.346598e-08 1.0000000 [13,] 4.352621e-09 8.705243e-09 1.0000000 [14,] 6.784876e-08 1.356975e-07 0.9999999 > postscript(file="/var/www/html/rcomp/tmp/1y5qi1258758056.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/2ko4q1258758056.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/3bz4z1258758056.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/4n6bn1258758056.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/5drp11258758056.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 = 45 Frequency = 1 1 2 3 4 5 6 0.234654500 0.330744437 0.239631632 0.285138069 0.004232747 -0.031720843 7 8 9 10 11 12 -0.019834834 -0.131346523 -0.282727793 0.029653360 -0.040809604 0.041812350 13 14 15 16 17 18 -0.020846873 0.043539137 -0.040029629 -0.161721705 0.057464445 -0.050369230 19 20 21 22 23 24 -0.089235253 -0.040340436 -0.117761677 -0.106308715 -0.247899729 -0.357679542 25 26 27 28 29 30 -0.412188358 -0.369160750 -0.364118407 -0.429133652 -0.450269326 -0.405240532 31 32 33 34 35 36 -0.506101815 -0.516946156 -0.326562516 0.076655355 0.288709333 0.315867192 37 38 39 40 41 42 0.198380731 -0.005122824 0.164516404 0.305717288 0.388572133 0.487330605 43 44 45 0.615171902 0.688633115 0.727051986 > postscript(file="/var/www/html/rcomp/tmp/6oeom1258758056.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 = 45 Frequency = 1 lag(myerror, k = 1) myerror 0 0.234654500 NA 1 0.330744437 0.234654500 2 0.239631632 0.330744437 3 0.285138069 0.239631632 4 0.004232747 0.285138069 5 -0.031720843 0.004232747 6 -0.019834834 -0.031720843 7 -0.131346523 -0.019834834 8 -0.282727793 -0.131346523 9 0.029653360 -0.282727793 10 -0.040809604 0.029653360 11 0.041812350 -0.040809604 12 -0.020846873 0.041812350 13 0.043539137 -0.020846873 14 -0.040029629 0.043539137 15 -0.161721705 -0.040029629 16 0.057464445 -0.161721705 17 -0.050369230 0.057464445 18 -0.089235253 -0.050369230 19 -0.040340436 -0.089235253 20 -0.117761677 -0.040340436 21 -0.106308715 -0.117761677 22 -0.247899729 -0.106308715 23 -0.357679542 -0.247899729 24 -0.412188358 -0.357679542 25 -0.369160750 -0.412188358 26 -0.364118407 -0.369160750 27 -0.429133652 -0.364118407 28 -0.450269326 -0.429133652 29 -0.405240532 -0.450269326 30 -0.506101815 -0.405240532 31 -0.516946156 -0.506101815 32 -0.326562516 -0.516946156 33 0.076655355 -0.326562516 34 0.288709333 0.076655355 35 0.315867192 0.288709333 36 0.198380731 0.315867192 37 -0.005122824 0.198380731 38 0.164516404 -0.005122824 39 0.305717288 0.164516404 40 0.388572133 0.305717288 41 0.487330605 0.388572133 42 0.615171902 0.487330605 43 0.688633115 0.615171902 44 0.727051986 0.688633115 45 NA 0.727051986 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.330744437 0.234654500 [2,] 0.239631632 0.330744437 [3,] 0.285138069 0.239631632 [4,] 0.004232747 0.285138069 [5,] -0.031720843 0.004232747 [6,] -0.019834834 -0.031720843 [7,] -0.131346523 -0.019834834 [8,] -0.282727793 -0.131346523 [9,] 0.029653360 -0.282727793 [10,] -0.040809604 0.029653360 [11,] 0.041812350 -0.040809604 [12,] -0.020846873 0.041812350 [13,] 0.043539137 -0.020846873 [14,] -0.040029629 0.043539137 [15,] -0.161721705 -0.040029629 [16,] 0.057464445 -0.161721705 [17,] -0.050369230 0.057464445 [18,] -0.089235253 -0.050369230 [19,] -0.040340436 -0.089235253 [20,] -0.117761677 -0.040340436 [21,] -0.106308715 -0.117761677 [22,] -0.247899729 -0.106308715 [23,] -0.357679542 -0.247899729 [24,] -0.412188358 -0.357679542 [25,] -0.369160750 -0.412188358 [26,] -0.364118407 -0.369160750 [27,] -0.429133652 -0.364118407 [28,] -0.450269326 -0.429133652 [29,] -0.405240532 -0.450269326 [30,] -0.506101815 -0.405240532 [31,] -0.516946156 -0.506101815 [32,] -0.326562516 -0.516946156 [33,] 0.076655355 -0.326562516 [34,] 0.288709333 0.076655355 [35,] 0.315867192 0.288709333 [36,] 0.198380731 0.315867192 [37,] -0.005122824 0.198380731 [38,] 0.164516404 -0.005122824 [39,] 0.305717288 0.164516404 [40,] 0.388572133 0.305717288 [41,] 0.487330605 0.388572133 [42,] 0.615171902 0.487330605 [43,] 0.688633115 0.615171902 [44,] 0.727051986 0.688633115 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.330744437 0.234654500 2 0.239631632 0.330744437 3 0.285138069 0.239631632 4 0.004232747 0.285138069 5 -0.031720843 0.004232747 6 -0.019834834 -0.031720843 7 -0.131346523 -0.019834834 8 -0.282727793 -0.131346523 9 0.029653360 -0.282727793 10 -0.040809604 0.029653360 11 0.041812350 -0.040809604 12 -0.020846873 0.041812350 13 0.043539137 -0.020846873 14 -0.040029629 0.043539137 15 -0.161721705 -0.040029629 16 0.057464445 -0.161721705 17 -0.050369230 0.057464445 18 -0.089235253 -0.050369230 19 -0.040340436 -0.089235253 20 -0.117761677 -0.040340436 21 -0.106308715 -0.117761677 22 -0.247899729 -0.106308715 23 -0.357679542 -0.247899729 24 -0.412188358 -0.357679542 25 -0.369160750 -0.412188358 26 -0.364118407 -0.369160750 27 -0.429133652 -0.364118407 28 -0.450269326 -0.429133652 29 -0.405240532 -0.450269326 30 -0.506101815 -0.405240532 31 -0.516946156 -0.506101815 32 -0.326562516 -0.516946156 33 0.076655355 -0.326562516 34 0.288709333 0.076655355 35 0.315867192 0.288709333 36 0.198380731 0.315867192 37 -0.005122824 0.198380731 38 0.164516404 -0.005122824 39 0.305717288 0.164516404 40 0.388572133 0.305717288 41 0.487330605 0.388572133 42 0.615171902 0.487330605 43 0.688633115 0.615171902 44 0.727051986 0.688633115 > 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/774b01258758056.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/8f6kv1258758056.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/9vldt1258758056.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/105xdc1258758056.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/11auzh1258758056.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/1275u81258758056.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/13zyps1258758056.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/14zg5e1258758056.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/15ngwt1258758056.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/169vun1258758056.tab") + } > > system("convert tmp/1y5qi1258758056.ps tmp/1y5qi1258758056.png") > system("convert tmp/2ko4q1258758056.ps tmp/2ko4q1258758056.png") > system("convert tmp/3bz4z1258758056.ps tmp/3bz4z1258758056.png") > system("convert tmp/4n6bn1258758056.ps tmp/4n6bn1258758056.png") > system("convert tmp/5drp11258758056.ps tmp/5drp11258758056.png") > system("convert tmp/6oeom1258758056.ps tmp/6oeom1258758056.png") > system("convert tmp/774b01258758056.ps tmp/774b01258758056.png") > system("convert tmp/8f6kv1258758056.ps tmp/8f6kv1258758056.png") > system("convert tmp/9vldt1258758056.ps tmp/9vldt1258758056.png") > system("convert tmp/105xdc1258758056.ps tmp/105xdc1258758056.png") > > > proc.time() user system elapsed 2.241 1.554 4.053