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(71.7,0,77.5,0,89.8,0,80.3,0,78.7,0,93.8,0,57.6,0,60.6,0,91,0,85.3,0,77.4,0,77.3,0,68.3,0,69.9,0,81.7,0,75.1,0,69.9,0,84,0,54.3,0,60,0,89.9,0,77,0,85.3,0,77.6,0,69.2,0,75.5,0,85.7,0,72.2,0,79.9,0,85.3,0,52.2,0,61.2,0,82.4,0,85.4,0,78.2,0,70.2,1,70.2,1,69.3,1,77.5,1,66.1,1,69,1,79.2,1,56.2,1,63.3,1,77.8,1,92,1,78.1,1,65.1,1,71.1,1,70.9,1,72,1,81.9,1,70.6,1,72.5,1,65.1,1,61.1,1),dim=c(2,56),dimnames=list(c('y','x'),1:56)) > y <- array(NA,dim=c(2,56),dimnames=list(c('y','x'),1:56)) > 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 71.7 0 2 77.5 0 3 89.8 0 4 80.3 0 5 78.7 0 6 93.8 0 7 57.6 0 8 60.6 0 9 91.0 0 10 85.3 0 11 77.4 0 12 77.3 0 13 68.3 0 14 69.9 0 15 81.7 0 16 75.1 0 17 69.9 0 18 84.0 0 19 54.3 0 20 60.0 0 21 89.9 0 22 77.0 0 23 85.3 0 24 77.6 0 25 69.2 0 26 75.5 0 27 85.7 0 28 72.2 0 29 79.9 0 30 85.3 0 31 52.2 0 32 61.2 0 33 82.4 0 34 85.4 0 35 78.2 0 36 70.2 1 37 70.2 1 38 69.3 1 39 77.5 1 40 66.1 1 41 69.0 1 42 79.2 1 43 56.2 1 44 63.3 1 45 77.8 1 46 92.0 1 47 78.1 1 48 65.1 1 49 71.1 1 50 70.9 1 51 72.0 1 52 81.9 1 53 70.6 1 54 72.5 1 55 65.1 1 56 61.1 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) x 76.034 -4.644 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -23.8343 -6.1343 0.7876 6.4845 20.6095 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 76.034 1.644 46.26 <2e-16 *** x -4.644 2.684 -1.73 0.0893 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 9.724 on 54 degrees of freedom Multiple R-squared: 0.05252, Adjusted R-squared: 0.03497 F-statistic: 2.993 on 1 and 54 DF, p-value: 0.08933 > 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.3681445 0.73628897 0.63185552 [2,] 0.5313492 0.93730163 0.46865081 [3,] 0.8874305 0.22513897 0.11256949 [4,] 0.9375300 0.12493999 0.06246999 [5,] 0.9545787 0.09084262 0.04542131 [6,] 0.9406197 0.11876062 0.05938031 [7,] 0.9049286 0.19014280 0.09507140 [8,] 0.8572093 0.28558138 0.14279069 [9,] 0.8412446 0.31751083 0.15875541 [10,] 0.8067771 0.38644582 0.19322291 [11,] 0.7560756 0.48784888 0.24392444 [12,] 0.6830543 0.63389144 0.31694572 [13,] 0.6361150 0.72776999 0.36388500 [14,] 0.6008152 0.79836968 0.39918484 [15,] 0.8454201 0.30915972 0.15457986 [16,] 0.9062350 0.18753010 0.09376505 [17,] 0.9316891 0.13662177 0.06831088 [18,] 0.9010577 0.19788457 0.09894228 [19,] 0.8958275 0.20834497 0.10417249 [20,] 0.8564132 0.28717358 0.14358679 [21,] 0.8296023 0.34079531 0.17039765 [22,] 0.7743958 0.45120843 0.22560421 [23,] 0.7744516 0.45109677 0.22554838 [24,] 0.7180411 0.56391780 0.28195890 [25,] 0.6629631 0.67407388 0.33703694 [26,] 0.6776648 0.64467049 0.32233524 [27,] 0.9127370 0.17452595 0.08726298 [28,] 0.9662863 0.06742734 0.03371367 [29,] 0.9504482 0.09910354 0.04955177 [30,] 0.9383369 0.12332622 0.06166311 [31,] 0.9083823 0.18323548 0.09161774 [32,] 0.8683191 0.26336171 0.13168085 [33,] 0.8169940 0.36601199 0.18300599 [34,] 0.7559716 0.48805680 0.24402840 [35,] 0.7123724 0.57525516 0.28762758 [36,] 0.6553183 0.68936334 0.34468167 [37,] 0.5724016 0.85519673 0.42759836 [38,] 0.5360593 0.92788148 0.46394074 [39,] 0.6743824 0.65123514 0.32561757 [40,] 0.6634649 0.67307014 0.33653507 [41,] 0.5950101 0.80997979 0.40498990 [42,] 0.9185744 0.16285118 0.08142559 [43,] 0.9108077 0.17838453 0.08919227 [44,] 0.8738645 0.25227090 0.12613545 [45,] 0.7802367 0.43952652 0.21976326 [46,] 0.6446929 0.71061428 0.35530714 [47,] 0.4751968 0.95039353 0.52480324 > postscript(file="/var/www/html/rcomp/tmp/1zmdz1227349995.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/2w51r1227349995.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/3wmpo1227349995.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/4dij21227349995.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/5efx31227349995.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 = 56 Frequency = 1 1 2 3 4 5 6 -4.3342857 1.4657143 13.7657143 4.2657143 2.6657143 17.7657143 7 8 9 10 11 12 -18.4342857 -15.4342857 14.9657143 9.2657143 1.3657143 1.2657143 13 14 15 16 17 18 -7.7342857 -6.1342857 5.6657143 -0.9342857 -6.1342857 7.9657143 19 20 21 22 23 24 -21.7342857 -16.0342857 13.8657143 0.9657143 9.2657143 1.5657143 25 26 27 28 29 30 -6.8342857 -0.5342857 9.6657143 -3.8342857 3.8657143 9.2657143 31 32 33 34 35 36 -23.8342857 -14.8342857 6.3657143 9.3657143 2.1657143 -1.1904762 37 38 39 40 41 42 -1.1904762 -2.0904762 6.1095238 -5.2904762 -2.3904762 7.8095238 43 44 45 46 47 48 -15.1904762 -8.0904762 6.4095238 20.6095238 6.7095238 -6.2904762 49 50 51 52 53 54 -0.2904762 -0.4904762 0.6095238 10.5095238 -0.7904762 1.1095238 55 56 -6.2904762 -10.2904762 > postscript(file="/var/www/html/rcomp/tmp/61e0l1227349995.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 = 56 Frequency = 1 lag(myerror, k = 1) myerror 0 -4.3342857 NA 1 1.4657143 -4.3342857 2 13.7657143 1.4657143 3 4.2657143 13.7657143 4 2.6657143 4.2657143 5 17.7657143 2.6657143 6 -18.4342857 17.7657143 7 -15.4342857 -18.4342857 8 14.9657143 -15.4342857 9 9.2657143 14.9657143 10 1.3657143 9.2657143 11 1.2657143 1.3657143 12 -7.7342857 1.2657143 13 -6.1342857 -7.7342857 14 5.6657143 -6.1342857 15 -0.9342857 5.6657143 16 -6.1342857 -0.9342857 17 7.9657143 -6.1342857 18 -21.7342857 7.9657143 19 -16.0342857 -21.7342857 20 13.8657143 -16.0342857 21 0.9657143 13.8657143 22 9.2657143 0.9657143 23 1.5657143 9.2657143 24 -6.8342857 1.5657143 25 -0.5342857 -6.8342857 26 9.6657143 -0.5342857 27 -3.8342857 9.6657143 28 3.8657143 -3.8342857 29 9.2657143 3.8657143 30 -23.8342857 9.2657143 31 -14.8342857 -23.8342857 32 6.3657143 -14.8342857 33 9.3657143 6.3657143 34 2.1657143 9.3657143 35 -1.1904762 2.1657143 36 -1.1904762 -1.1904762 37 -2.0904762 -1.1904762 38 6.1095238 -2.0904762 39 -5.2904762 6.1095238 40 -2.3904762 -5.2904762 41 7.8095238 -2.3904762 42 -15.1904762 7.8095238 43 -8.0904762 -15.1904762 44 6.4095238 -8.0904762 45 20.6095238 6.4095238 46 6.7095238 20.6095238 47 -6.2904762 6.7095238 48 -0.2904762 -6.2904762 49 -0.4904762 -0.2904762 50 0.6095238 -0.4904762 51 10.5095238 0.6095238 52 -0.7904762 10.5095238 53 1.1095238 -0.7904762 54 -6.2904762 1.1095238 55 -10.2904762 -6.2904762 56 NA -10.2904762 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.4657143 -4.3342857 [2,] 13.7657143 1.4657143 [3,] 4.2657143 13.7657143 [4,] 2.6657143 4.2657143 [5,] 17.7657143 2.6657143 [6,] -18.4342857 17.7657143 [7,] -15.4342857 -18.4342857 [8,] 14.9657143 -15.4342857 [9,] 9.2657143 14.9657143 [10,] 1.3657143 9.2657143 [11,] 1.2657143 1.3657143 [12,] -7.7342857 1.2657143 [13,] -6.1342857 -7.7342857 [14,] 5.6657143 -6.1342857 [15,] -0.9342857 5.6657143 [16,] -6.1342857 -0.9342857 [17,] 7.9657143 -6.1342857 [18,] -21.7342857 7.9657143 [19,] -16.0342857 -21.7342857 [20,] 13.8657143 -16.0342857 [21,] 0.9657143 13.8657143 [22,] 9.2657143 0.9657143 [23,] 1.5657143 9.2657143 [24,] -6.8342857 1.5657143 [25,] -0.5342857 -6.8342857 [26,] 9.6657143 -0.5342857 [27,] -3.8342857 9.6657143 [28,] 3.8657143 -3.8342857 [29,] 9.2657143 3.8657143 [30,] -23.8342857 9.2657143 [31,] -14.8342857 -23.8342857 [32,] 6.3657143 -14.8342857 [33,] 9.3657143 6.3657143 [34,] 2.1657143 9.3657143 [35,] -1.1904762 2.1657143 [36,] -1.1904762 -1.1904762 [37,] -2.0904762 -1.1904762 [38,] 6.1095238 -2.0904762 [39,] -5.2904762 6.1095238 [40,] -2.3904762 -5.2904762 [41,] 7.8095238 -2.3904762 [42,] -15.1904762 7.8095238 [43,] -8.0904762 -15.1904762 [44,] 6.4095238 -8.0904762 [45,] 20.6095238 6.4095238 [46,] 6.7095238 20.6095238 [47,] -6.2904762 6.7095238 [48,] -0.2904762 -6.2904762 [49,] -0.4904762 -0.2904762 [50,] 0.6095238 -0.4904762 [51,] 10.5095238 0.6095238 [52,] -0.7904762 10.5095238 [53,] 1.1095238 -0.7904762 [54,] -6.2904762 1.1095238 [55,] -10.2904762 -6.2904762 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.4657143 -4.3342857 2 13.7657143 1.4657143 3 4.2657143 13.7657143 4 2.6657143 4.2657143 5 17.7657143 2.6657143 6 -18.4342857 17.7657143 7 -15.4342857 -18.4342857 8 14.9657143 -15.4342857 9 9.2657143 14.9657143 10 1.3657143 9.2657143 11 1.2657143 1.3657143 12 -7.7342857 1.2657143 13 -6.1342857 -7.7342857 14 5.6657143 -6.1342857 15 -0.9342857 5.6657143 16 -6.1342857 -0.9342857 17 7.9657143 -6.1342857 18 -21.7342857 7.9657143 19 -16.0342857 -21.7342857 20 13.8657143 -16.0342857 21 0.9657143 13.8657143 22 9.2657143 0.9657143 23 1.5657143 9.2657143 24 -6.8342857 1.5657143 25 -0.5342857 -6.8342857 26 9.6657143 -0.5342857 27 -3.8342857 9.6657143 28 3.8657143 -3.8342857 29 9.2657143 3.8657143 30 -23.8342857 9.2657143 31 -14.8342857 -23.8342857 32 6.3657143 -14.8342857 33 9.3657143 6.3657143 34 2.1657143 9.3657143 35 -1.1904762 2.1657143 36 -1.1904762 -1.1904762 37 -2.0904762 -1.1904762 38 6.1095238 -2.0904762 39 -5.2904762 6.1095238 40 -2.3904762 -5.2904762 41 7.8095238 -2.3904762 42 -15.1904762 7.8095238 43 -8.0904762 -15.1904762 44 6.4095238 -8.0904762 45 20.6095238 6.4095238 46 6.7095238 20.6095238 47 -6.2904762 6.7095238 48 -0.2904762 -6.2904762 49 -0.4904762 -0.2904762 50 0.6095238 -0.4904762 51 10.5095238 0.6095238 52 -0.7904762 10.5095238 53 1.1095238 -0.7904762 54 -6.2904762 1.1095238 55 -10.2904762 -6.2904762 > 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/7340r1227349995.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/8ncns1227349995.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/9z4oh1227349995.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/101ucz1227349995.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/11xd2o1227349995.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/12tzdq1227349995.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/13fsdo1227349996.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/149nuf1227349996.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/15hara1227349996.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/168xnc1227349996.tab") + } > > system("convert tmp/1zmdz1227349995.ps tmp/1zmdz1227349995.png") > system("convert tmp/2w51r1227349995.ps tmp/2w51r1227349995.png") > system("convert tmp/3wmpo1227349995.ps tmp/3wmpo1227349995.png") > system("convert tmp/4dij21227349995.ps tmp/4dij21227349995.png") > system("convert tmp/5efx31227349995.ps tmp/5efx31227349995.png") > system("convert tmp/61e0l1227349995.ps tmp/61e0l1227349995.png") > system("convert tmp/7340r1227349995.ps tmp/7340r1227349995.png") > system("convert tmp/8ncns1227349995.ps tmp/8ncns1227349995.png") > system("convert tmp/9z4oh1227349995.ps tmp/9z4oh1227349995.png") > system("convert tmp/101ucz1227349995.ps tmp/101ucz1227349995.png") > > > proc.time() user system elapsed 2.413 1.568 5.559