R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(0,0,9,0,1,0,4,0,6,0,21,0,24,0,23,0,22,0,21,0,20,0,16,0,18,0,18,0,24,0,16,0,15,0,24,0,18,0,15,0,4,0,3,0,6,0,5,0,12,0,12,0,12,0,14,0,12,0,17,0,12,0,20,0,21,0,15,0,22,0,19,0,19,0,26,0,25,0,19,0,20,0,30,0,31,0,35,0,33,0,26,0,25,0,17,0,14,0,8,0,12,0,7,0,4,0,10,0,8,0,16,1,14,1,20,1,9,1,10,1),dim=c(2,60),dimnames=list(c('Spa','Val'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Spa','Val'),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 Spa Val 1 0 0 2 9 0 3 1 0 4 4 0 5 6 0 6 21 0 7 24 0 8 23 0 9 22 0 10 21 0 11 20 0 12 16 0 13 18 0 14 18 0 15 24 0 16 16 0 17 15 0 18 24 0 19 18 0 20 15 0 21 4 0 22 3 0 23 6 0 24 5 0 25 12 0 26 12 0 27 12 0 28 14 0 29 12 0 30 17 0 31 12 0 32 20 0 33 21 0 34 15 0 35 22 0 36 19 0 37 19 0 38 26 0 39 25 0 40 19 0 41 20 0 42 30 0 43 31 0 44 35 0 45 33 0 46 26 0 47 25 0 48 17 0 49 14 0 50 8 0 51 12 0 52 7 0 53 4 0 54 10 0 55 8 0 56 16 1 57 14 1 58 20 1 59 9 1 60 10 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Val 16.182 -2.382 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -16.1818 -4.3364 0.5091 5.0682 18.8182 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 16.182 1.090 14.840 <2e-16 *** Val -2.382 3.777 -0.631 0.531 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 8.087 on 58 degrees of freedom Multiple R-squared: 0.006808, Adjusted R-squared: -0.01032 F-statistic: 0.3976 on 1 and 58 DF, p-value: 0.5308 > 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.19374682 0.38749364 0.806253182 [2,] 0.72419056 0.55161888 0.275809439 [3,] 0.89774600 0.20450800 0.102254002 [4,] 0.92992377 0.14015246 0.070076229 [5,] 0.93213634 0.13572732 0.067863658 [6,] 0.92032956 0.15934087 0.079670436 [7,] 0.89654102 0.20691796 0.103458979 [8,] 0.84791946 0.30416107 0.152080536 [9,] 0.79538978 0.40922044 0.204610218 [10,] 0.73361518 0.53276963 0.266384817 [11,] 0.73604077 0.52791846 0.263959229 [12,] 0.65939529 0.68120942 0.340604710 [13,] 0.57713211 0.84573578 0.422867888 [14,] 0.57486761 0.85026479 0.425132393 [15,] 0.49638907 0.99277814 0.503610930 [16,] 0.41507659 0.83015319 0.584923406 [17,] 0.50027604 0.99944791 0.499723956 [18,] 0.60689700 0.78620600 0.393103000 [19,] 0.63562419 0.72875163 0.364375813 [20,] 0.68826524 0.62346952 0.311734761 [21,] 0.63666802 0.72666396 0.363331980 [22,] 0.58439416 0.83121167 0.415605837 [23,] 0.53274945 0.93450110 0.467250552 [24,] 0.46823241 0.93646482 0.531767589 [25,] 0.42081836 0.84163672 0.579181642 [26,] 0.35673614 0.71347229 0.643263857 [27,] 0.31668211 0.63336423 0.683317886 [28,] 0.27257593 0.54515186 0.727424068 [29,] 0.23736822 0.47473645 0.762631775 [30,] 0.19027696 0.38055391 0.809723045 [31,] 0.16665136 0.33330272 0.833348642 [32,] 0.12934845 0.25869691 0.870651546 [33,] 0.09775832 0.19551664 0.902241680 [34,] 0.10713119 0.21426239 0.892868807 [35,] 0.10571901 0.21143803 0.894280987 [36,] 0.07629068 0.15258135 0.923709323 [37,] 0.05469597 0.10939195 0.945304025 [38,] 0.09160592 0.18321184 0.908394078 [39,] 0.16783331 0.33566662 0.832166690 [40,] 0.46442023 0.92884047 0.535579766 [41,] 0.81604353 0.36791294 0.183956470 [42,] 0.92394867 0.15210265 0.076051326 [43,] 0.99066405 0.01867190 0.009335950 [44,] 0.99439603 0.01120794 0.005603969 [45,] 0.99428762 0.01142475 0.005712376 [46,] 0.98725440 0.02549121 0.012745604 [47,] 0.98206059 0.03587883 0.017939415 [48,] 0.96086295 0.07827409 0.039137046 [49,] 0.94560881 0.10878237 0.054391185 [50,] 0.88429741 0.23140517 0.115702587 [51,] 0.76456347 0.47087305 0.235436525 > postscript(file="/var/www/html/rcomp/tmp/1rvqt1228496141.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/22rin1228496141.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/3pjoa1228496141.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/4wedp1228496141.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/56eyy1228496141.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 -16.1818182 -7.1818182 -15.1818182 -12.1818182 -10.1818182 4.8181818 7 8 9 10 11 12 7.8181818 6.8181818 5.8181818 4.8181818 3.8181818 -0.1818182 13 14 15 16 17 18 1.8181818 1.8181818 7.8181818 -0.1818182 -1.1818182 7.8181818 19 20 21 22 23 24 1.8181818 -1.1818182 -12.1818182 -13.1818182 -10.1818182 -11.1818182 25 26 27 28 29 30 -4.1818182 -4.1818182 -4.1818182 -2.1818182 -4.1818182 0.8181818 31 32 33 34 35 36 -4.1818182 3.8181818 4.8181818 -1.1818182 5.8181818 2.8181818 37 38 39 40 41 42 2.8181818 9.8181818 8.8181818 2.8181818 3.8181818 13.8181818 43 44 45 46 47 48 14.8181818 18.8181818 16.8181818 9.8181818 8.8181818 0.8181818 49 50 51 52 53 54 -2.1818182 -8.1818182 -4.1818182 -9.1818182 -12.1818182 -6.1818182 55 56 57 58 59 60 -8.1818182 2.2000000 0.2000000 6.2000000 -4.8000000 -3.8000000 > postscript(file="/var/www/html/rcomp/tmp/60spt1228496141.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 -16.1818182 NA 1 -7.1818182 -16.1818182 2 -15.1818182 -7.1818182 3 -12.1818182 -15.1818182 4 -10.1818182 -12.1818182 5 4.8181818 -10.1818182 6 7.8181818 4.8181818 7 6.8181818 7.8181818 8 5.8181818 6.8181818 9 4.8181818 5.8181818 10 3.8181818 4.8181818 11 -0.1818182 3.8181818 12 1.8181818 -0.1818182 13 1.8181818 1.8181818 14 7.8181818 1.8181818 15 -0.1818182 7.8181818 16 -1.1818182 -0.1818182 17 7.8181818 -1.1818182 18 1.8181818 7.8181818 19 -1.1818182 1.8181818 20 -12.1818182 -1.1818182 21 -13.1818182 -12.1818182 22 -10.1818182 -13.1818182 23 -11.1818182 -10.1818182 24 -4.1818182 -11.1818182 25 -4.1818182 -4.1818182 26 -4.1818182 -4.1818182 27 -2.1818182 -4.1818182 28 -4.1818182 -2.1818182 29 0.8181818 -4.1818182 30 -4.1818182 0.8181818 31 3.8181818 -4.1818182 32 4.8181818 3.8181818 33 -1.1818182 4.8181818 34 5.8181818 -1.1818182 35 2.8181818 5.8181818 36 2.8181818 2.8181818 37 9.8181818 2.8181818 38 8.8181818 9.8181818 39 2.8181818 8.8181818 40 3.8181818 2.8181818 41 13.8181818 3.8181818 42 14.8181818 13.8181818 43 18.8181818 14.8181818 44 16.8181818 18.8181818 45 9.8181818 16.8181818 46 8.8181818 9.8181818 47 0.8181818 8.8181818 48 -2.1818182 0.8181818 49 -8.1818182 -2.1818182 50 -4.1818182 -8.1818182 51 -9.1818182 -4.1818182 52 -12.1818182 -9.1818182 53 -6.1818182 -12.1818182 54 -8.1818182 -6.1818182 55 2.2000000 -8.1818182 56 0.2000000 2.2000000 57 6.2000000 0.2000000 58 -4.8000000 6.2000000 59 -3.8000000 -4.8000000 60 NA -3.8000000 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -7.1818182 -16.1818182 [2,] -15.1818182 -7.1818182 [3,] -12.1818182 -15.1818182 [4,] -10.1818182 -12.1818182 [5,] 4.8181818 -10.1818182 [6,] 7.8181818 4.8181818 [7,] 6.8181818 7.8181818 [8,] 5.8181818 6.8181818 [9,] 4.8181818 5.8181818 [10,] 3.8181818 4.8181818 [11,] -0.1818182 3.8181818 [12,] 1.8181818 -0.1818182 [13,] 1.8181818 1.8181818 [14,] 7.8181818 1.8181818 [15,] -0.1818182 7.8181818 [16,] -1.1818182 -0.1818182 [17,] 7.8181818 -1.1818182 [18,] 1.8181818 7.8181818 [19,] -1.1818182 1.8181818 [20,] -12.1818182 -1.1818182 [21,] -13.1818182 -12.1818182 [22,] -10.1818182 -13.1818182 [23,] -11.1818182 -10.1818182 [24,] -4.1818182 -11.1818182 [25,] -4.1818182 -4.1818182 [26,] -4.1818182 -4.1818182 [27,] -2.1818182 -4.1818182 [28,] -4.1818182 -2.1818182 [29,] 0.8181818 -4.1818182 [30,] -4.1818182 0.8181818 [31,] 3.8181818 -4.1818182 [32,] 4.8181818 3.8181818 [33,] -1.1818182 4.8181818 [34,] 5.8181818 -1.1818182 [35,] 2.8181818 5.8181818 [36,] 2.8181818 2.8181818 [37,] 9.8181818 2.8181818 [38,] 8.8181818 9.8181818 [39,] 2.8181818 8.8181818 [40,] 3.8181818 2.8181818 [41,] 13.8181818 3.8181818 [42,] 14.8181818 13.8181818 [43,] 18.8181818 14.8181818 [44,] 16.8181818 18.8181818 [45,] 9.8181818 16.8181818 [46,] 8.8181818 9.8181818 [47,] 0.8181818 8.8181818 [48,] -2.1818182 0.8181818 [49,] -8.1818182 -2.1818182 [50,] -4.1818182 -8.1818182 [51,] -9.1818182 -4.1818182 [52,] -12.1818182 -9.1818182 [53,] -6.1818182 -12.1818182 [54,] -8.1818182 -6.1818182 [55,] 2.2000000 -8.1818182 [56,] 0.2000000 2.2000000 [57,] 6.2000000 0.2000000 [58,] -4.8000000 6.2000000 [59,] -3.8000000 -4.8000000 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -7.1818182 -16.1818182 2 -15.1818182 -7.1818182 3 -12.1818182 -15.1818182 4 -10.1818182 -12.1818182 5 4.8181818 -10.1818182 6 7.8181818 4.8181818 7 6.8181818 7.8181818 8 5.8181818 6.8181818 9 4.8181818 5.8181818 10 3.8181818 4.8181818 11 -0.1818182 3.8181818 12 1.8181818 -0.1818182 13 1.8181818 1.8181818 14 7.8181818 1.8181818 15 -0.1818182 7.8181818 16 -1.1818182 -0.1818182 17 7.8181818 -1.1818182 18 1.8181818 7.8181818 19 -1.1818182 1.8181818 20 -12.1818182 -1.1818182 21 -13.1818182 -12.1818182 22 -10.1818182 -13.1818182 23 -11.1818182 -10.1818182 24 -4.1818182 -11.1818182 25 -4.1818182 -4.1818182 26 -4.1818182 -4.1818182 27 -2.1818182 -4.1818182 28 -4.1818182 -2.1818182 29 0.8181818 -4.1818182 30 -4.1818182 0.8181818 31 3.8181818 -4.1818182 32 4.8181818 3.8181818 33 -1.1818182 4.8181818 34 5.8181818 -1.1818182 35 2.8181818 5.8181818 36 2.8181818 2.8181818 37 9.8181818 2.8181818 38 8.8181818 9.8181818 39 2.8181818 8.8181818 40 3.8181818 2.8181818 41 13.8181818 3.8181818 42 14.8181818 13.8181818 43 18.8181818 14.8181818 44 16.8181818 18.8181818 45 9.8181818 16.8181818 46 8.8181818 9.8181818 47 0.8181818 8.8181818 48 -2.1818182 0.8181818 49 -8.1818182 -2.1818182 50 -4.1818182 -8.1818182 51 -9.1818182 -4.1818182 52 -12.1818182 -9.1818182 53 -6.1818182 -12.1818182 54 -8.1818182 -6.1818182 55 2.2000000 -8.1818182 56 0.2000000 2.2000000 57 6.2000000 0.2000000 58 -4.8000000 6.2000000 59 -3.8000000 -4.8000000 > 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/7tyji1228496141.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/8rbw21228496141.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/9ujcf1228496141.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/10crnx1228496141.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/113mo71228496141.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/12uwpr1228496141.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/13fj5r1228496141.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/14vgcx1228496141.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/15p6h21228496141.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/16y4x21228496141.tab") + } > > system("convert tmp/1rvqt1228496141.ps tmp/1rvqt1228496141.png") > system("convert tmp/22rin1228496141.ps tmp/22rin1228496141.png") > system("convert tmp/3pjoa1228496141.ps tmp/3pjoa1228496141.png") > system("convert tmp/4wedp1228496141.ps tmp/4wedp1228496141.png") > system("convert tmp/56eyy1228496141.ps tmp/56eyy1228496141.png") > system("convert tmp/60spt1228496141.ps tmp/60spt1228496141.png") > system("convert tmp/7tyji1228496141.ps tmp/7tyji1228496141.png") > system("convert tmp/8rbw21228496141.ps tmp/8rbw21228496141.png") > system("convert tmp/9ujcf1228496141.ps tmp/9ujcf1228496141.png") > system("convert tmp/10crnx1228496141.ps tmp/10crnx1228496141.png") > > > proc.time() user system elapsed 2.531 1.572 2.981