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(107.11,107.56,107.57,107.70,107.81,107.67,108.75,107.67,109.43,107.72,109.62,108.35,109.54,108.25,109.53,108.26,109.84,108.31,109.67,108.33,109.79,108.36,109.56,108.36,110.22,108.97,110.40,109.62,110.69,109.60,110.72,109.64,110.89,109.65,110.58,109.64,110.94,109.93,110.91,109.81,111.22,109.77,111.09,110.10,111.00,110.40,111.06,110.50,111.55,111.89,112.32,112.10,112.64,111.92,112.36,112.15,112.04,112.16,112.37,112.17,112.59,112.32,112.89,112.38,113.22,112.34,112.85,113.14,113.06,113.18,112.99,113.21,113.32,113.76,113.74,113.99,113.91,113.95,114.52,113.93,114.96,114.01,114.91,114.10,115.30,114.11,115.44,114.10,115.52,114.12,116.08,114.68,115.94,114.71,115.56,114.73,115.88,115.81,116.66,116.01,117.41,116.12,117.68,116.49,117.85,116.51,118.21,116.60,118.92,117.01,119.03,117.01,119.17,117.12,118.95,117.22,118.92,118.38,118.90,118.80),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 = '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 107.11 107.56 2 107.57 107.70 3 107.81 107.67 4 108.75 107.67 5 109.43 107.72 6 109.62 108.35 7 109.54 108.25 8 109.53 108.26 9 109.84 108.31 10 109.67 108.33 11 109.79 108.36 12 109.56 108.36 13 110.22 108.97 14 110.40 109.62 15 110.69 109.60 16 110.72 109.64 17 110.89 109.65 18 110.58 109.64 19 110.94 109.93 20 110.91 109.81 21 111.22 109.77 22 111.09 110.10 23 111.00 110.40 24 111.06 110.50 25 111.55 111.89 26 112.32 112.10 27 112.64 111.92 28 112.36 112.15 29 112.04 112.16 30 112.37 112.17 31 112.59 112.32 32 112.89 112.38 33 113.22 112.34 34 112.85 113.14 35 113.06 113.18 36 112.99 113.21 37 113.32 113.76 38 113.74 113.99 39 113.91 113.95 40 114.52 113.93 41 114.96 114.01 42 114.91 114.10 43 115.30 114.11 44 115.44 114.10 45 115.52 114.12 46 116.08 114.68 47 115.94 114.71 48 115.56 114.73 49 115.88 115.81 50 116.66 116.01 51 117.41 116.12 52 117.68 116.49 53 117.85 116.51 54 118.21 116.60 55 118.92 117.01 56 119.03 117.01 57 119.17 117.12 58 118.95 117.22 59 118.92 118.38 60 118.90 118.80 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X -0.2983 1.0100 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.2748 -0.6009 0.1689 0.4893 1.1817 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.29834 3.05351 -0.098 0.923 X 1.00996 0.02719 37.150 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6698 on 58 degrees of freedom Multiple R-squared: 0.9597, Adjusted R-squared: 0.959 F-statistic: 1380 on 1 and 58 DF, p-value: < 2.2e-16 > 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.76761809 0.464763817 0.232381909 [2,] 0.83445848 0.331083048 0.165541524 [3,] 0.73786710 0.524265795 0.262132897 [4,] 0.62835035 0.743299303 0.371649652 [5,] 0.53072215 0.938555701 0.469277851 [6,] 0.42945876 0.858917526 0.570541237 [7,] 0.34258818 0.685176366 0.657411817 [8,] 0.27187825 0.543756490 0.728121755 [9,] 0.31954542 0.639090837 0.680454581 [10,] 0.47422257 0.948445136 0.525777432 [11,] 0.41851435 0.837028692 0.581485654 [12,] 0.35830222 0.716604443 0.641697779 [13,] 0.30533366 0.610667321 0.694666339 [14,] 0.25989531 0.519790624 0.740104688 [15,] 0.21927227 0.438544536 0.780727732 [16,] 0.18744035 0.374880701 0.812559650 [17,] 0.20801729 0.416034587 0.791982707 [18,] 0.20139596 0.402791915 0.798604042 [19,] 0.21121179 0.422423577 0.788788212 [20,] 0.21346338 0.426926750 0.786536625 [21,] 0.36131277 0.722625543 0.638687229 [22,] 0.30980285 0.619605695 0.690197153 [23,] 0.26311290 0.526225805 0.736887097 [24,] 0.21497795 0.429955898 0.785022051 [25,] 0.19936822 0.398736440 0.800631780 [26,] 0.15338453 0.306769060 0.846615470 [27,] 0.11287290 0.225745808 0.887127096 [28,] 0.08251288 0.165025762 0.917487119 [29,] 0.07705510 0.154110197 0.922944902 [30,] 0.07825125 0.156502509 0.921748746 [31,] 0.06776814 0.135536277 0.932231862 [32,] 0.06847862 0.136957249 0.931521376 [33,] 0.11081223 0.221624466 0.889187767 [34,] 0.16621781 0.332435614 0.833782193 [35,] 0.23419203 0.468384064 0.765807968 [36,] 0.24502194 0.490043881 0.754978060 [37,] 0.25676813 0.513536254 0.743231873 [38,] 0.25659452 0.513189041 0.743405479 [39,] 0.26232690 0.524653799 0.737673100 [40,] 0.26537273 0.530745467 0.734627266 [41,] 0.25833182 0.516663635 0.741668183 [42,] 0.24316831 0.486336630 0.756831685 [43,] 0.20189262 0.403785244 0.798107378 [44,] 0.16951758 0.339035167 0.830482416 [45,] 0.41396384 0.827927681 0.586036160 [46,] 0.64170571 0.716588588 0.358294294 [47,] 0.70177667 0.596446666 0.298223333 [48,] 0.79372240 0.412555209 0.206277605 [49,] 0.92368989 0.152620230 0.076310115 [50,] 0.99877615 0.002447703 0.001223852 [51,] 0.99627149 0.007457027 0.003728514 > postscript(file="/var/www/html/rcomp/tmp/1yl7b1258745601.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/26qiq1258745601.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/3jxdx1258745601.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/4xmev1258745601.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/5pu8p1258745601.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.22305131 -0.90444582 -0.63414700 0.30585300 0.93535496 0.48907964 7 8 9 10 11 12 0.51007572 0.48997611 0.74947807 0.55927886 0.64898003 0.41898003 13 14 15 16 17 18 0.46290393 -0.01357061 0.29662861 0.28623017 0.44613057 0.14623017 19 20 21 22 23 24 0.21334154 0.30453683 0.65493527 0.19164820 -0.20134005 -0.24233614 25 26 27 28 29 30 -1.15618168 -0.59827346 -0.09648051 -0.60877150 -0.93887111 -0.61897071 31 32 33 34 35 36 -0.55046484 -0.31106249 0.05933594 -1.11863272 -0.94903115 -1.04932997 37 38 39 40 41 42 -1.27480843 -1.08709942 -0.87670098 -0.24650177 0.11270137 -0.02819511 43 44 45 46 47 48 0.35170528 0.50180489 0.56160567 0.55602761 0.38572879 -0.01447043 49 50 51 52 53 54 -0.78522812 -0.20722029 0.43168402 0.32799852 0.47779930 0.74690283 55 56 57 58 59 60 1.04281889 1.15281889 1.18172320 0.86072711 -0.34082744 -0.78501099 > postscript(file="/var/www/html/rcomp/tmp/6v1g61258745601.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.22305131 NA 1 -0.90444582 -1.22305131 2 -0.63414700 -0.90444582 3 0.30585300 -0.63414700 4 0.93535496 0.30585300 5 0.48907964 0.93535496 6 0.51007572 0.48907964 7 0.48997611 0.51007572 8 0.74947807 0.48997611 9 0.55927886 0.74947807 10 0.64898003 0.55927886 11 0.41898003 0.64898003 12 0.46290393 0.41898003 13 -0.01357061 0.46290393 14 0.29662861 -0.01357061 15 0.28623017 0.29662861 16 0.44613057 0.28623017 17 0.14623017 0.44613057 18 0.21334154 0.14623017 19 0.30453683 0.21334154 20 0.65493527 0.30453683 21 0.19164820 0.65493527 22 -0.20134005 0.19164820 23 -0.24233614 -0.20134005 24 -1.15618168 -0.24233614 25 -0.59827346 -1.15618168 26 -0.09648051 -0.59827346 27 -0.60877150 -0.09648051 28 -0.93887111 -0.60877150 29 -0.61897071 -0.93887111 30 -0.55046484 -0.61897071 31 -0.31106249 -0.55046484 32 0.05933594 -0.31106249 33 -1.11863272 0.05933594 34 -0.94903115 -1.11863272 35 -1.04932997 -0.94903115 36 -1.27480843 -1.04932997 37 -1.08709942 -1.27480843 38 -0.87670098 -1.08709942 39 -0.24650177 -0.87670098 40 0.11270137 -0.24650177 41 -0.02819511 0.11270137 42 0.35170528 -0.02819511 43 0.50180489 0.35170528 44 0.56160567 0.50180489 45 0.55602761 0.56160567 46 0.38572879 0.55602761 47 -0.01447043 0.38572879 48 -0.78522812 -0.01447043 49 -0.20722029 -0.78522812 50 0.43168402 -0.20722029 51 0.32799852 0.43168402 52 0.47779930 0.32799852 53 0.74690283 0.47779930 54 1.04281889 0.74690283 55 1.15281889 1.04281889 56 1.18172320 1.15281889 57 0.86072711 1.18172320 58 -0.34082744 0.86072711 59 -0.78501099 -0.34082744 60 NA -0.78501099 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.90444582 -1.22305131 [2,] -0.63414700 -0.90444582 [3,] 0.30585300 -0.63414700 [4,] 0.93535496 0.30585300 [5,] 0.48907964 0.93535496 [6,] 0.51007572 0.48907964 [7,] 0.48997611 0.51007572 [8,] 0.74947807 0.48997611 [9,] 0.55927886 0.74947807 [10,] 0.64898003 0.55927886 [11,] 0.41898003 0.64898003 [12,] 0.46290393 0.41898003 [13,] -0.01357061 0.46290393 [14,] 0.29662861 -0.01357061 [15,] 0.28623017 0.29662861 [16,] 0.44613057 0.28623017 [17,] 0.14623017 0.44613057 [18,] 0.21334154 0.14623017 [19,] 0.30453683 0.21334154 [20,] 0.65493527 0.30453683 [21,] 0.19164820 0.65493527 [22,] -0.20134005 0.19164820 [23,] -0.24233614 -0.20134005 [24,] -1.15618168 -0.24233614 [25,] -0.59827346 -1.15618168 [26,] -0.09648051 -0.59827346 [27,] -0.60877150 -0.09648051 [28,] -0.93887111 -0.60877150 [29,] -0.61897071 -0.93887111 [30,] -0.55046484 -0.61897071 [31,] -0.31106249 -0.55046484 [32,] 0.05933594 -0.31106249 [33,] -1.11863272 0.05933594 [34,] -0.94903115 -1.11863272 [35,] -1.04932997 -0.94903115 [36,] -1.27480843 -1.04932997 [37,] -1.08709942 -1.27480843 [38,] -0.87670098 -1.08709942 [39,] -0.24650177 -0.87670098 [40,] 0.11270137 -0.24650177 [41,] -0.02819511 0.11270137 [42,] 0.35170528 -0.02819511 [43,] 0.50180489 0.35170528 [44,] 0.56160567 0.50180489 [45,] 0.55602761 0.56160567 [46,] 0.38572879 0.55602761 [47,] -0.01447043 0.38572879 [48,] -0.78522812 -0.01447043 [49,] -0.20722029 -0.78522812 [50,] 0.43168402 -0.20722029 [51,] 0.32799852 0.43168402 [52,] 0.47779930 0.32799852 [53,] 0.74690283 0.47779930 [54,] 1.04281889 0.74690283 [55,] 1.15281889 1.04281889 [56,] 1.18172320 1.15281889 [57,] 0.86072711 1.18172320 [58,] -0.34082744 0.86072711 [59,] -0.78501099 -0.34082744 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.90444582 -1.22305131 2 -0.63414700 -0.90444582 3 0.30585300 -0.63414700 4 0.93535496 0.30585300 5 0.48907964 0.93535496 6 0.51007572 0.48907964 7 0.48997611 0.51007572 8 0.74947807 0.48997611 9 0.55927886 0.74947807 10 0.64898003 0.55927886 11 0.41898003 0.64898003 12 0.46290393 0.41898003 13 -0.01357061 0.46290393 14 0.29662861 -0.01357061 15 0.28623017 0.29662861 16 0.44613057 0.28623017 17 0.14623017 0.44613057 18 0.21334154 0.14623017 19 0.30453683 0.21334154 20 0.65493527 0.30453683 21 0.19164820 0.65493527 22 -0.20134005 0.19164820 23 -0.24233614 -0.20134005 24 -1.15618168 -0.24233614 25 -0.59827346 -1.15618168 26 -0.09648051 -0.59827346 27 -0.60877150 -0.09648051 28 -0.93887111 -0.60877150 29 -0.61897071 -0.93887111 30 -0.55046484 -0.61897071 31 -0.31106249 -0.55046484 32 0.05933594 -0.31106249 33 -1.11863272 0.05933594 34 -0.94903115 -1.11863272 35 -1.04932997 -0.94903115 36 -1.27480843 -1.04932997 37 -1.08709942 -1.27480843 38 -0.87670098 -1.08709942 39 -0.24650177 -0.87670098 40 0.11270137 -0.24650177 41 -0.02819511 0.11270137 42 0.35170528 -0.02819511 43 0.50180489 0.35170528 44 0.56160567 0.50180489 45 0.55602761 0.56160567 46 0.38572879 0.55602761 47 -0.01447043 0.38572879 48 -0.78522812 -0.01447043 49 -0.20722029 -0.78522812 50 0.43168402 -0.20722029 51 0.32799852 0.43168402 52 0.47779930 0.32799852 53 0.74690283 0.47779930 54 1.04281889 0.74690283 55 1.15281889 1.04281889 56 1.18172320 1.15281889 57 0.86072711 1.18172320 58 -0.34082744 0.86072711 59 -0.78501099 -0.34082744 > 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/7mnmn1258745601.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/8xqmg1258745601.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/9wpoh1258745601.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/1060ax1258745601.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/11z0lc1258745601.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/1216us1258745601.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/13iujo1258745601.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/140b5j1258745601.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/15z8lw1258745601.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/16tsoe1258745601.tab") + } > system("convert tmp/1yl7b1258745601.ps tmp/1yl7b1258745601.png") > system("convert tmp/26qiq1258745601.ps tmp/26qiq1258745601.png") > system("convert tmp/3jxdx1258745601.ps tmp/3jxdx1258745601.png") > system("convert tmp/4xmev1258745601.ps tmp/4xmev1258745601.png") > system("convert tmp/5pu8p1258745601.ps tmp/5pu8p1258745601.png") > system("convert tmp/6v1g61258745601.ps tmp/6v1g61258745601.png") > system("convert tmp/7mnmn1258745601.ps tmp/7mnmn1258745601.png") > system("convert tmp/8xqmg1258745601.ps tmp/8xqmg1258745601.png") > system("convert tmp/9wpoh1258745601.ps tmp/9wpoh1258745601.png") > system("convert tmp/1060ax1258745601.ps tmp/1060ax1258745601.png") > > > proc.time() user system elapsed 2.451 1.530 2.849