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(8.9,1.6,8.8,1.3,8.3,1.1,7.5,1.6,7.2,1.9,7.4,1.6,8.8,1.7,9.3,1.6,9.3,1.4,8.7,2.1,8.2,1.9,8.3,1.7,8.5,1.8,8.6,2,8.5,2.5,8.2,2.1,8.1,2.1,7.9,2.3,8.6,2.4,8.7,2.4,8.7,2.3,8.5,1.7,8.4,2,8.5,2.3,8.7,2,8.7,2,8.6,1.3,8.5,1.7,8.3,1.9,8,1.7,8.2,1.6,8.1,1.7,8.1,1.8,8,1.9,7.9,1.9,7.9,1.9,8,2,8,2.1,7.9,1.9,8,1.9,7.7,1.3,7.2,1.3,7.5,1.4,7.3,1.2,7,1.3,7,1.8,7,2.2,7.2,2.6,7.3,2.8,7.1,3.1,6.8,3.9,6.4,3.7,6.1,4.6,6.5,5.1,7.7,5.2,7.9,4.9,7.5,5.1,6.9,4.8,6.6,3.9,6.9,3.5),dim=c(2,60),dimnames=list(c('TWIB','GI'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('TWIB','GI'),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 TWIB GI 1 8.9 1.6 2 8.8 1.3 3 8.3 1.1 4 7.5 1.6 5 7.2 1.9 6 7.4 1.6 7 8.8 1.7 8 9.3 1.6 9 9.3 1.4 10 8.7 2.1 11 8.2 1.9 12 8.3 1.7 13 8.5 1.8 14 8.6 2.0 15 8.5 2.5 16 8.2 2.1 17 8.1 2.1 18 7.9 2.3 19 8.6 2.4 20 8.7 2.4 21 8.7 2.3 22 8.5 1.7 23 8.4 2.0 24 8.5 2.3 25 8.7 2.0 26 8.7 2.0 27 8.6 1.3 28 8.5 1.7 29 8.3 1.9 30 8.0 1.7 31 8.2 1.6 32 8.1 1.7 33 8.1 1.8 34 8.0 1.9 35 7.9 1.9 36 7.9 1.9 37 8.0 2.0 38 8.0 2.1 39 7.9 1.9 40 8.0 1.9 41 7.7 1.3 42 7.2 1.3 43 7.5 1.4 44 7.3 1.2 45 7.0 1.3 46 7.0 1.8 47 7.0 2.2 48 7.2 2.6 49 7.3 2.8 50 7.1 3.1 51 6.8 3.9 52 6.4 3.7 53 6.1 4.6 54 6.5 5.1 55 7.7 5.2 56 7.9 4.9 57 7.5 5.1 58 6.9 4.8 59 6.6 3.9 60 6.9 3.5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) GI 8.7432 -0.3626 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.2717250 -0.5395756 0.0002556 0.5843216 1.1370673 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.74316 0.19592 44.626 < 2e-16 *** GI -0.36264 0.07707 -4.705 1.62e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6378 on 58 degrees of freedom Multiple R-squared: 0.2763, Adjusted R-squared: 0.2638 F-statistic: 22.14 on 1 and 58 DF, p-value: 1.615e-05 > 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.6929324 0.6141351 0.30706756 [2,] 0.6384006 0.7231989 0.36159943 [3,] 0.7407400 0.5185199 0.25925996 [4,] 0.8723379 0.2553243 0.12766214 [5,] 0.8964634 0.2070732 0.10353662 [6,] 0.9048003 0.1903993 0.09519967 [7,] 0.8552995 0.2894011 0.14470055 [8,] 0.7940065 0.4119871 0.20599354 [9,] 0.7348194 0.5303613 0.26518063 [10,] 0.6938684 0.6122632 0.30613161 [11,] 0.6550710 0.6898580 0.34492902 [12,] 0.5789034 0.8421933 0.42109665 [13,] 0.5024491 0.9951018 0.49755091 [14,] 0.4328644 0.8657287 0.56713564 [15,] 0.4204229 0.8408458 0.57957709 [16,] 0.4301572 0.8603145 0.56984276 [17,] 0.4370465 0.8740930 0.56295348 [18,] 0.3880350 0.7760700 0.61196502 [19,] 0.3425130 0.6850260 0.65748698 [20,] 0.3264272 0.6528544 0.67357280 [21,] 0.3477947 0.6955893 0.65220533 [22,] 0.3853761 0.7707523 0.61462387 [23,] 0.3784428 0.7568855 0.62155724 [24,] 0.3825265 0.7650530 0.61747348 [25,] 0.3728647 0.7457294 0.62713532 [26,] 0.3494031 0.6988063 0.65059686 [27,] 0.3320397 0.6640793 0.66796034 [28,] 0.3162726 0.6325452 0.68372740 [29,] 0.3088792 0.6177583 0.69112084 [30,] 0.3031533 0.6063067 0.69684665 [31,] 0.2974580 0.5949160 0.70254199 [32,] 0.2945970 0.5891940 0.70540298 [33,] 0.3091473 0.6182946 0.69085268 [34,] 0.3410018 0.6820037 0.65899815 [35,] 0.3705868 0.7411736 0.62941321 [36,] 0.4512693 0.9025386 0.54873069 [37,] 0.4913482 0.9826964 0.50865178 [38,] 0.5273679 0.9452643 0.47263214 [39,] 0.5370318 0.9259363 0.46296817 [40,] 0.5311991 0.9376017 0.46880086 [41,] 0.5284272 0.9431457 0.47157284 [42,] 0.5355005 0.9289990 0.46449950 [43,] 0.5428967 0.9142066 0.45710330 [44,] 0.5385409 0.9229183 0.46145913 [45,] 0.5673191 0.8653618 0.43268089 [46,] 0.5920980 0.8158040 0.40790201 [47,] 0.5070682 0.9858636 0.49293179 [48,] 0.4304673 0.8609346 0.56953272 [49,] 0.5986611 0.8026779 0.40133894 [50,] 0.8180661 0.3638678 0.18193389 [51,] 0.6974740 0.6050519 0.30252595 > postscript(file="/var/www/html/rcomp/tmp/1gc3l1258756549.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/28pnw1258756549.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/3wffv1258756549.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/4drdj1258756549.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/5per81258756549.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.737067253 0.528275050 -0.044253086 -0.662932747 -0.854140543 -0.762932747 7 8 9 10 11 12 0.673331321 1.137067253 1.064539118 0.718387593 0.145859457 0.173331321 13 14 15 16 17 18 0.409595389 0.582123525 0.663443865 0.218387593 0.118387593 -0.009084271 19 20 21 22 23 24 0.727179797 0.827179797 0.790915729 0.373331321 0.382123525 0.590915729 25 26 27 28 29 30 0.682123525 0.682123525 0.328275050 0.373331321 0.245859457 -0.126668679 31 32 33 34 35 36 0.037067253 -0.026668679 0.009595389 -0.054140543 -0.154140543 -0.154140543 37 38 39 40 41 42 -0.017876475 0.018387593 -0.154140543 -0.054140543 -0.571724950 -1.071724950 43 44 45 46 47 48 -0.735460882 -1.007989018 -1.271724950 -1.090404611 -0.945348339 -0.600292067 49 50 51 52 53 54 -0.427763932 -0.518971728 -0.528859185 -1.001387320 -0.975010709 -0.393690370 55 56 57 58 59 60 0.842573698 0.933781495 0.606309630 -0.102482573 -0.728859185 -0.573915456 > postscript(file="/var/www/html/rcomp/tmp/6yxjy1258756549.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.737067253 NA 1 0.528275050 0.737067253 2 -0.044253086 0.528275050 3 -0.662932747 -0.044253086 4 -0.854140543 -0.662932747 5 -0.762932747 -0.854140543 6 0.673331321 -0.762932747 7 1.137067253 0.673331321 8 1.064539118 1.137067253 9 0.718387593 1.064539118 10 0.145859457 0.718387593 11 0.173331321 0.145859457 12 0.409595389 0.173331321 13 0.582123525 0.409595389 14 0.663443865 0.582123525 15 0.218387593 0.663443865 16 0.118387593 0.218387593 17 -0.009084271 0.118387593 18 0.727179797 -0.009084271 19 0.827179797 0.727179797 20 0.790915729 0.827179797 21 0.373331321 0.790915729 22 0.382123525 0.373331321 23 0.590915729 0.382123525 24 0.682123525 0.590915729 25 0.682123525 0.682123525 26 0.328275050 0.682123525 27 0.373331321 0.328275050 28 0.245859457 0.373331321 29 -0.126668679 0.245859457 30 0.037067253 -0.126668679 31 -0.026668679 0.037067253 32 0.009595389 -0.026668679 33 -0.054140543 0.009595389 34 -0.154140543 -0.054140543 35 -0.154140543 -0.154140543 36 -0.017876475 -0.154140543 37 0.018387593 -0.017876475 38 -0.154140543 0.018387593 39 -0.054140543 -0.154140543 40 -0.571724950 -0.054140543 41 -1.071724950 -0.571724950 42 -0.735460882 -1.071724950 43 -1.007989018 -0.735460882 44 -1.271724950 -1.007989018 45 -1.090404611 -1.271724950 46 -0.945348339 -1.090404611 47 -0.600292067 -0.945348339 48 -0.427763932 -0.600292067 49 -0.518971728 -0.427763932 50 -0.528859185 -0.518971728 51 -1.001387320 -0.528859185 52 -0.975010709 -1.001387320 53 -0.393690370 -0.975010709 54 0.842573698 -0.393690370 55 0.933781495 0.842573698 56 0.606309630 0.933781495 57 -0.102482573 0.606309630 58 -0.728859185 -0.102482573 59 -0.573915456 -0.728859185 60 NA -0.573915456 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.528275050 0.737067253 [2,] -0.044253086 0.528275050 [3,] -0.662932747 -0.044253086 [4,] -0.854140543 -0.662932747 [5,] -0.762932747 -0.854140543 [6,] 0.673331321 -0.762932747 [7,] 1.137067253 0.673331321 [8,] 1.064539118 1.137067253 [9,] 0.718387593 1.064539118 [10,] 0.145859457 0.718387593 [11,] 0.173331321 0.145859457 [12,] 0.409595389 0.173331321 [13,] 0.582123525 0.409595389 [14,] 0.663443865 0.582123525 [15,] 0.218387593 0.663443865 [16,] 0.118387593 0.218387593 [17,] -0.009084271 0.118387593 [18,] 0.727179797 -0.009084271 [19,] 0.827179797 0.727179797 [20,] 0.790915729 0.827179797 [21,] 0.373331321 0.790915729 [22,] 0.382123525 0.373331321 [23,] 0.590915729 0.382123525 [24,] 0.682123525 0.590915729 [25,] 0.682123525 0.682123525 [26,] 0.328275050 0.682123525 [27,] 0.373331321 0.328275050 [28,] 0.245859457 0.373331321 [29,] -0.126668679 0.245859457 [30,] 0.037067253 -0.126668679 [31,] -0.026668679 0.037067253 [32,] 0.009595389 -0.026668679 [33,] -0.054140543 0.009595389 [34,] -0.154140543 -0.054140543 [35,] -0.154140543 -0.154140543 [36,] -0.017876475 -0.154140543 [37,] 0.018387593 -0.017876475 [38,] -0.154140543 0.018387593 [39,] -0.054140543 -0.154140543 [40,] -0.571724950 -0.054140543 [41,] -1.071724950 -0.571724950 [42,] -0.735460882 -1.071724950 [43,] -1.007989018 -0.735460882 [44,] -1.271724950 -1.007989018 [45,] -1.090404611 -1.271724950 [46,] -0.945348339 -1.090404611 [47,] -0.600292067 -0.945348339 [48,] -0.427763932 -0.600292067 [49,] -0.518971728 -0.427763932 [50,] -0.528859185 -0.518971728 [51,] -1.001387320 -0.528859185 [52,] -0.975010709 -1.001387320 [53,] -0.393690370 -0.975010709 [54,] 0.842573698 -0.393690370 [55,] 0.933781495 0.842573698 [56,] 0.606309630 0.933781495 [57,] -0.102482573 0.606309630 [58,] -0.728859185 -0.102482573 [59,] -0.573915456 -0.728859185 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.528275050 0.737067253 2 -0.044253086 0.528275050 3 -0.662932747 -0.044253086 4 -0.854140543 -0.662932747 5 -0.762932747 -0.854140543 6 0.673331321 -0.762932747 7 1.137067253 0.673331321 8 1.064539118 1.137067253 9 0.718387593 1.064539118 10 0.145859457 0.718387593 11 0.173331321 0.145859457 12 0.409595389 0.173331321 13 0.582123525 0.409595389 14 0.663443865 0.582123525 15 0.218387593 0.663443865 16 0.118387593 0.218387593 17 -0.009084271 0.118387593 18 0.727179797 -0.009084271 19 0.827179797 0.727179797 20 0.790915729 0.827179797 21 0.373331321 0.790915729 22 0.382123525 0.373331321 23 0.590915729 0.382123525 24 0.682123525 0.590915729 25 0.682123525 0.682123525 26 0.328275050 0.682123525 27 0.373331321 0.328275050 28 0.245859457 0.373331321 29 -0.126668679 0.245859457 30 0.037067253 -0.126668679 31 -0.026668679 0.037067253 32 0.009595389 -0.026668679 33 -0.054140543 0.009595389 34 -0.154140543 -0.054140543 35 -0.154140543 -0.154140543 36 -0.017876475 -0.154140543 37 0.018387593 -0.017876475 38 -0.154140543 0.018387593 39 -0.054140543 -0.154140543 40 -0.571724950 -0.054140543 41 -1.071724950 -0.571724950 42 -0.735460882 -1.071724950 43 -1.007989018 -0.735460882 44 -1.271724950 -1.007989018 45 -1.090404611 -1.271724950 46 -0.945348339 -1.090404611 47 -0.600292067 -0.945348339 48 -0.427763932 -0.600292067 49 -0.518971728 -0.427763932 50 -0.528859185 -0.518971728 51 -1.001387320 -0.528859185 52 -0.975010709 -1.001387320 53 -0.393690370 -0.975010709 54 0.842573698 -0.393690370 55 0.933781495 0.842573698 56 0.606309630 0.933781495 57 -0.102482573 0.606309630 58 -0.728859185 -0.102482573 59 -0.573915456 -0.728859185 > 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/7mnye1258756549.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/8hsl51258756549.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/9rtrj1258756549.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/10u9kk1258756549.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/11yi9g1258756549.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/12ictd1258756549.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/13p6an1258756549.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/14ifjz1258756549.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/154b9y1258756550.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/16a51g1258756550.tab") + } > > system("convert tmp/1gc3l1258756549.ps tmp/1gc3l1258756549.png") > system("convert tmp/28pnw1258756549.ps tmp/28pnw1258756549.png") > system("convert tmp/3wffv1258756549.ps tmp/3wffv1258756549.png") > system("convert tmp/4drdj1258756549.ps tmp/4drdj1258756549.png") > system("convert tmp/5per81258756549.ps tmp/5per81258756549.png") > system("convert tmp/6yxjy1258756549.ps tmp/6yxjy1258756549.png") > system("convert tmp/7mnye1258756549.ps tmp/7mnye1258756549.png") > system("convert tmp/8hsl51258756549.ps tmp/8hsl51258756549.png") > system("convert tmp/9rtrj1258756549.ps tmp/9rtrj1258756549.png") > system("convert tmp/10u9kk1258756549.ps tmp/10u9kk1258756549.png") > > > proc.time() user system elapsed 2.430 1.568 2.903