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(126.51,0,131.02,0,136.51,0,138.04,0,132.92,0,129.61,0,122.96,0,124.04,0,121.29,0,124.56,0,118.53,0,113.14,0,114.15,0,122.17,0,129.23,0,131.19,0,129.12,0,128.28,0,126.83,0,138.13,0,140.52,0,146.83,0,135.14,0,131.84,0,125.7,0,128.98,0,133.25,0,136.76,0,133.24,0,128.54,0,121.08,0,120.23,0,119.08,0,125.75,0,126.89,0,126.6,0,121.89,0,123.44,0,126.46,0,129.49,0,127.78,0,125.29,0,119.02,0,119.96,0,122.86,0,131.89,0,132.73,0,135.01,0,136.71,1,142.73,1,144.43,1,144.93,1,138.75,1,130.22,1,122.19,1,128.4,1,140.43,1,153.5,1,149.33,1,142.97,1),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 = '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 t 1 126.51 0 1 2 131.02 0 2 3 136.51 0 3 4 138.04 0 4 5 132.92 0 5 6 129.61 0 6 7 122.96 0 7 8 124.04 0 8 9 121.29 0 9 10 124.56 0 10 11 118.53 0 11 12 113.14 0 12 13 114.15 0 13 14 122.17 0 14 15 129.23 0 15 16 131.19 0 16 17 129.12 0 17 18 128.28 0 18 19 126.83 0 19 20 138.13 0 20 21 140.52 0 21 22 146.83 0 22 23 135.14 0 23 24 131.84 0 24 25 125.70 0 25 26 128.98 0 26 27 133.25 0 27 28 136.76 0 28 29 133.24 0 29 30 128.54 0 30 31 121.08 0 31 32 120.23 0 32 33 119.08 0 33 34 125.75 0 34 35 126.89 0 35 36 126.60 0 36 37 121.89 0 37 38 123.44 0 38 39 126.46 0 39 40 129.49 0 40 41 127.78 0 41 42 125.29 0 42 43 119.02 0 43 44 119.96 0 44 45 122.86 0 45 46 131.89 0 46 47 132.73 0 47 48 135.01 0 48 49 136.71 1 49 50 142.73 1 50 51 144.43 1 51 52 144.93 1 52 53 138.75 1 53 54 130.22 1 54 55 122.19 1 55 56 128.40 1 56 57 140.43 1 57 58 153.50 1 58 59 149.33 1 59 60 142.97 1 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X t 128.46112 12.55500 -0.02692 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -17.3457 -4.6206 0.3629 4.6969 18.9610 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 128.46112 2.14339 59.934 < 2e-16 *** X 12.55500 3.29093 3.815 0.000337 *** t -0.02692 0.07601 -0.354 0.724560 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 7.352 on 57 degrees of freedom Multiple R-squared: 0.3018, Adjusted R-squared: 0.2773 F-statistic: 12.32 on 2 and 57 DF, p-value: 3.579e-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.32822178 0.65644355 0.6717782 [2,] 0.41154771 0.82309542 0.5884523 [3,] 0.30096075 0.60192150 0.6990393 [4,] 0.21838529 0.43677058 0.7816147 [5,] 0.13635905 0.27271810 0.8636410 [6,] 0.09636269 0.19272537 0.9036373 [7,] 0.10908374 0.21816748 0.8909163 [8,] 0.09701914 0.19403828 0.9029809 [9,] 0.12728972 0.25457945 0.8727103 [10,] 0.30707518 0.61415035 0.6929248 [11,] 0.45492207 0.90984413 0.5450779 [12,] 0.46920027 0.93840054 0.5307997 [13,] 0.44432849 0.88865697 0.5556715 [14,] 0.40022626 0.80045253 0.5997737 [15,] 0.54973765 0.90052471 0.4502624 [16,] 0.67951159 0.64097682 0.3204884 [17,] 0.89740733 0.20518534 0.1025927 [18,] 0.87897572 0.24204856 0.1210243 [19,] 0.84372976 0.31254049 0.1562702 [20,] 0.81249612 0.37500777 0.1875039 [21,] 0.76160977 0.47678047 0.2383902 [22,] 0.72993822 0.54012356 0.2700618 [23,] 0.76958029 0.46083943 0.2304197 [24,] 0.78118538 0.43762924 0.2188146 [25,] 0.76650504 0.46698992 0.2334950 [26,] 0.76793434 0.46413131 0.2320657 [27,] 0.76237010 0.47525979 0.2376299 [28,] 0.75991436 0.48017128 0.2400856 [29,] 0.70323484 0.59353033 0.2967652 [30,] 0.64407027 0.71185946 0.3559297 [31,] 0.58077532 0.83844935 0.4192247 [32,] 0.52189671 0.95620658 0.4781033 [33,] 0.44919822 0.89839644 0.5508018 [34,] 0.37329589 0.74659178 0.6267041 [35,] 0.32243941 0.64487882 0.6775606 [36,] 0.26198887 0.52397774 0.7380111 [37,] 0.19960358 0.39920717 0.8003964 [38,] 0.18804406 0.37608812 0.8119559 [39,] 0.18367448 0.36734896 0.8163255 [40,] 0.17061189 0.34122378 0.8293881 [41,] 0.12785771 0.25571541 0.8721423 [42,] 0.09303855 0.18607711 0.9069614 [43,] 0.06746558 0.13493117 0.9325344 [44,] 0.04035995 0.08071989 0.9596401 [45,] 0.02920409 0.05840818 0.9707959 [46,] 0.03132946 0.06265892 0.9686705 [47,] 0.07805532 0.15611065 0.9219447 [48,] 0.16155794 0.32311588 0.8384421 [49,] 0.13605869 0.27211738 0.8639413 > postscript(file="/var/www/html/rcomp/tmp/15fdb1258718236.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/2jnhb1258718236.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/3z2qz1258718236.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/4llbe1258718236.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/5hr5b1258718236.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 -1.9242073 2.6127093 8.1296260 9.6865426 4.5934592 1.3103758 7 8 9 10 11 12 -5.3127076 -4.2057909 -6.9288743 -3.6319577 -9.6350411 -14.9981244 13 14 15 16 17 18 -13.9612078 -5.9142912 1.1726254 3.1595420 1.1164587 0.3033753 19 20 21 22 23 24 -1.1197081 10.2072085 12.6241252 18.9610418 7.2979584 4.0248750 25 26 27 28 29 30 -2.0882084 1.2187083 5.5156249 9.0525415 5.5594581 0.8863748 31 32 33 34 35 36 -6.5467086 -7.3697920 -8.4928754 -1.7959588 -0.6290421 -0.8921255 37 38 39 40 41 42 -5.5752089 -3.9982923 -0.9513756 2.1055410 0.4224576 -2.0406258 43 44 45 46 47 48 -8.2837092 -7.3167925 -4.3898759 4.6670407 5.5339573 7.8408740 49 50 51 52 53 54 -2.9872081 3.0597085 4.7866252 5.3135418 -0.8395416 -9.3426250 55 56 57 58 59 60 -17.3457084 -11.1087917 0.9481249 14.0450415 9.9019581 3.5688748 > postscript(file="/var/www/html/rcomp/tmp/634941258718236.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 -1.9242073 NA 1 2.6127093 -1.9242073 2 8.1296260 2.6127093 3 9.6865426 8.1296260 4 4.5934592 9.6865426 5 1.3103758 4.5934592 6 -5.3127076 1.3103758 7 -4.2057909 -5.3127076 8 -6.9288743 -4.2057909 9 -3.6319577 -6.9288743 10 -9.6350411 -3.6319577 11 -14.9981244 -9.6350411 12 -13.9612078 -14.9981244 13 -5.9142912 -13.9612078 14 1.1726254 -5.9142912 15 3.1595420 1.1726254 16 1.1164587 3.1595420 17 0.3033753 1.1164587 18 -1.1197081 0.3033753 19 10.2072085 -1.1197081 20 12.6241252 10.2072085 21 18.9610418 12.6241252 22 7.2979584 18.9610418 23 4.0248750 7.2979584 24 -2.0882084 4.0248750 25 1.2187083 -2.0882084 26 5.5156249 1.2187083 27 9.0525415 5.5156249 28 5.5594581 9.0525415 29 0.8863748 5.5594581 30 -6.5467086 0.8863748 31 -7.3697920 -6.5467086 32 -8.4928754 -7.3697920 33 -1.7959588 -8.4928754 34 -0.6290421 -1.7959588 35 -0.8921255 -0.6290421 36 -5.5752089 -0.8921255 37 -3.9982923 -5.5752089 38 -0.9513756 -3.9982923 39 2.1055410 -0.9513756 40 0.4224576 2.1055410 41 -2.0406258 0.4224576 42 -8.2837092 -2.0406258 43 -7.3167925 -8.2837092 44 -4.3898759 -7.3167925 45 4.6670407 -4.3898759 46 5.5339573 4.6670407 47 7.8408740 5.5339573 48 -2.9872081 7.8408740 49 3.0597085 -2.9872081 50 4.7866252 3.0597085 51 5.3135418 4.7866252 52 -0.8395416 5.3135418 53 -9.3426250 -0.8395416 54 -17.3457084 -9.3426250 55 -11.1087917 -17.3457084 56 0.9481249 -11.1087917 57 14.0450415 0.9481249 58 9.9019581 14.0450415 59 3.5688748 9.9019581 60 NA 3.5688748 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.6127093 -1.9242073 [2,] 8.1296260 2.6127093 [3,] 9.6865426 8.1296260 [4,] 4.5934592 9.6865426 [5,] 1.3103758 4.5934592 [6,] -5.3127076 1.3103758 [7,] -4.2057909 -5.3127076 [8,] -6.9288743 -4.2057909 [9,] -3.6319577 -6.9288743 [10,] -9.6350411 -3.6319577 [11,] -14.9981244 -9.6350411 [12,] -13.9612078 -14.9981244 [13,] -5.9142912 -13.9612078 [14,] 1.1726254 -5.9142912 [15,] 3.1595420 1.1726254 [16,] 1.1164587 3.1595420 [17,] 0.3033753 1.1164587 [18,] -1.1197081 0.3033753 [19,] 10.2072085 -1.1197081 [20,] 12.6241252 10.2072085 [21,] 18.9610418 12.6241252 [22,] 7.2979584 18.9610418 [23,] 4.0248750 7.2979584 [24,] -2.0882084 4.0248750 [25,] 1.2187083 -2.0882084 [26,] 5.5156249 1.2187083 [27,] 9.0525415 5.5156249 [28,] 5.5594581 9.0525415 [29,] 0.8863748 5.5594581 [30,] -6.5467086 0.8863748 [31,] -7.3697920 -6.5467086 [32,] -8.4928754 -7.3697920 [33,] -1.7959588 -8.4928754 [34,] -0.6290421 -1.7959588 [35,] -0.8921255 -0.6290421 [36,] -5.5752089 -0.8921255 [37,] -3.9982923 -5.5752089 [38,] -0.9513756 -3.9982923 [39,] 2.1055410 -0.9513756 [40,] 0.4224576 2.1055410 [41,] -2.0406258 0.4224576 [42,] -8.2837092 -2.0406258 [43,] -7.3167925 -8.2837092 [44,] -4.3898759 -7.3167925 [45,] 4.6670407 -4.3898759 [46,] 5.5339573 4.6670407 [47,] 7.8408740 5.5339573 [48,] -2.9872081 7.8408740 [49,] 3.0597085 -2.9872081 [50,] 4.7866252 3.0597085 [51,] 5.3135418 4.7866252 [52,] -0.8395416 5.3135418 [53,] -9.3426250 -0.8395416 [54,] -17.3457084 -9.3426250 [55,] -11.1087917 -17.3457084 [56,] 0.9481249 -11.1087917 [57,] 14.0450415 0.9481249 [58,] 9.9019581 14.0450415 [59,] 3.5688748 9.9019581 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.6127093 -1.9242073 2 8.1296260 2.6127093 3 9.6865426 8.1296260 4 4.5934592 9.6865426 5 1.3103758 4.5934592 6 -5.3127076 1.3103758 7 -4.2057909 -5.3127076 8 -6.9288743 -4.2057909 9 -3.6319577 -6.9288743 10 -9.6350411 -3.6319577 11 -14.9981244 -9.6350411 12 -13.9612078 -14.9981244 13 -5.9142912 -13.9612078 14 1.1726254 -5.9142912 15 3.1595420 1.1726254 16 1.1164587 3.1595420 17 0.3033753 1.1164587 18 -1.1197081 0.3033753 19 10.2072085 -1.1197081 20 12.6241252 10.2072085 21 18.9610418 12.6241252 22 7.2979584 18.9610418 23 4.0248750 7.2979584 24 -2.0882084 4.0248750 25 1.2187083 -2.0882084 26 5.5156249 1.2187083 27 9.0525415 5.5156249 28 5.5594581 9.0525415 29 0.8863748 5.5594581 30 -6.5467086 0.8863748 31 -7.3697920 -6.5467086 32 -8.4928754 -7.3697920 33 -1.7959588 -8.4928754 34 -0.6290421 -1.7959588 35 -0.8921255 -0.6290421 36 -5.5752089 -0.8921255 37 -3.9982923 -5.5752089 38 -0.9513756 -3.9982923 39 2.1055410 -0.9513756 40 0.4224576 2.1055410 41 -2.0406258 0.4224576 42 -8.2837092 -2.0406258 43 -7.3167925 -8.2837092 44 -4.3898759 -7.3167925 45 4.6670407 -4.3898759 46 5.5339573 4.6670407 47 7.8408740 5.5339573 48 -2.9872081 7.8408740 49 3.0597085 -2.9872081 50 4.7866252 3.0597085 51 5.3135418 4.7866252 52 -0.8395416 5.3135418 53 -9.3426250 -0.8395416 54 -17.3457084 -9.3426250 55 -11.1087917 -17.3457084 56 0.9481249 -11.1087917 57 14.0450415 0.9481249 58 9.9019581 14.0450415 59 3.5688748 9.9019581 > 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/7iszj1258718236.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/8aria1258718236.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/9mzwz1258718236.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/10a3f01258718236.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/11bz7d1258718236.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/12ne3t1258718236.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/13z5ak1258718236.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/14m5d11258718236.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/15vwl01258718236.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/1607c01258718236.tab") + } > > system("convert tmp/15fdb1258718236.ps tmp/15fdb1258718236.png") > system("convert tmp/2jnhb1258718236.ps tmp/2jnhb1258718236.png") > system("convert tmp/3z2qz1258718236.ps tmp/3z2qz1258718236.png") > system("convert tmp/4llbe1258718236.ps tmp/4llbe1258718236.png") > system("convert tmp/5hr5b1258718236.ps tmp/5hr5b1258718236.png") > system("convert tmp/634941258718236.ps tmp/634941258718236.png") > system("convert tmp/7iszj1258718236.ps tmp/7iszj1258718236.png") > system("convert tmp/8aria1258718236.ps tmp/8aria1258718236.png") > system("convert tmp/9mzwz1258718236.ps tmp/9mzwz1258718236.png") > system("convert tmp/10a3f01258718236.ps tmp/10a3f01258718236.png") > > > proc.time() user system elapsed 2.466 1.536 3.083