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(10,24.1,9.2,24.1,9.2,24.1,9.5,21.3,9.6,21.3,9.5,21.3,9.1,19.1,8.9,19.1,9,19.1,10.1,26.2,10.3,26.2,10.2,26.2,9.6,21.7,9.2,21.7,9.3,21.7,9.4,19.4,9.4,19.4,9.2,19.4,9,19.5,9,19.5,9,19.5,9.8,28.7,10,28.7,9.8,28.7,9.3,21.8,9,21.8,9,21.8,9.1,20,9.1,20,9.1,20,9.2,22.6,8.8,22.6,8.3,22.6,8.4,22.4,8.1,22.4,7.7,22.4,7.9,18.6,7.9,18.6,8,18.6,7.9,16.2,7.6,16.2,7.1,16.2,6.8,13.8,6.5,13.8,6.9,13.8,8.2,24.1,8.7,24.1,8.3,24.1,7.9,19.9,7.5,19.9,7.8,19.9,8.3,22.3,8.4,22.3,8.2,22.3,7.7,20.9,7.2,20.9,7.3,20.9,8.1,25.5,8.5,25.5,8.4,25.5),dim=c(2,60),dimnames=list(c('TWV','WV-25'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('TWV','WV-25'),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 TWV WV-25 1 10.0 24.1 2 9.2 24.1 3 9.2 24.1 4 9.5 21.3 5 9.6 21.3 6 9.5 21.3 7 9.1 19.1 8 8.9 19.1 9 9.0 19.1 10 10.1 26.2 11 10.3 26.2 12 10.2 26.2 13 9.6 21.7 14 9.2 21.7 15 9.3 21.7 16 9.4 19.4 17 9.4 19.4 18 9.2 19.4 19 9.0 19.5 20 9.0 19.5 21 9.0 19.5 22 9.8 28.7 23 10.0 28.7 24 9.8 28.7 25 9.3 21.8 26 9.0 21.8 27 9.0 21.8 28 9.1 20.0 29 9.1 20.0 30 9.1 20.0 31 9.2 22.6 32 8.8 22.6 33 8.3 22.6 34 8.4 22.4 35 8.1 22.4 36 7.7 22.4 37 7.9 18.6 38 7.9 18.6 39 8.0 18.6 40 7.9 16.2 41 7.6 16.2 42 7.1 16.2 43 6.8 13.8 44 6.5 13.8 45 6.9 13.8 46 8.2 24.1 47 8.7 24.1 48 8.3 24.1 49 7.9 19.9 50 7.5 19.9 51 7.8 19.9 52 8.3 22.3 53 8.4 22.3 54 8.2 22.3 55 7.7 20.9 56 7.2 20.9 57 7.3 20.9 58 8.1 25.5 59 8.5 25.5 60 8.4 25.5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `WV-25` 5.0770 0.1673 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.37384 -0.59108 0.01625 0.66448 1.07713 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.07704 0.60420 8.403 1.30e-11 *** `WV-25` 0.16731 0.02789 5.999 1.37e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.7186 on 58 degrees of freedom Multiple R-squared: 0.3829, Adjusted R-squared: 0.3722 F-statistic: 35.98 on 1 and 58 DF, p-value: 1.371e-07 > 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.1598561519 0.3197123039 0.840143848 [2,] 0.0698587674 0.1397175347 0.930141233 [3,] 0.0448097964 0.0896195927 0.955190204 [4,] 0.0295184942 0.0590369884 0.970481506 [5,] 0.0140273828 0.0280547657 0.985972617 [6,] 0.0082895279 0.0165790557 0.991710472 [7,] 0.0065244974 0.0130489947 0.993475503 [8,] 0.0035207565 0.0070415130 0.996479243 [9,] 0.0020824641 0.0041649282 0.997917536 [10,] 0.0011677835 0.0023355670 0.998832217 [11,] 0.0005706064 0.0011412129 0.999429394 [12,] 0.0005962981 0.0011925963 0.999403702 [13,] 0.0006275830 0.0012551660 0.999372417 [14,] 0.0004428106 0.0008856211 0.999557189 [15,] 0.0003247710 0.0006495419 0.999675229 [16,] 0.0002540270 0.0005080540 0.999745973 [17,] 0.0002181780 0.0004363561 0.999781822 [18,] 0.0003486076 0.0006972152 0.999651392 [19,] 0.0002284368 0.0004568736 0.999771563 [20,] 0.0002007716 0.0004015432 0.999799228 [21,] 0.0002150931 0.0004301861 0.999784907 [22,] 0.0003412365 0.0006824731 0.999658763 [23,] 0.0005379083 0.0010758166 0.999462092 [24,] 0.0010579504 0.0021159007 0.998942050 [25,] 0.0030431850 0.0060863700 0.996956815 [26,] 0.0145282261 0.0290564522 0.985471774 [27,] 0.0558636250 0.1117272501 0.944136375 [28,] 0.1768090537 0.3536181075 0.823190946 [29,] 0.5011301622 0.9977396757 0.498869838 [30,] 0.6895039854 0.6209920291 0.310496015 [31,] 0.8476777070 0.3046445859 0.152322293 [32,] 0.9643015914 0.0713968172 0.035698409 [33,] 0.9726748351 0.0546503299 0.027325165 [34,] 0.9769405515 0.0461188969 0.023059448 [35,] 0.9816223339 0.0367553322 0.018377666 [36,] 0.9933845194 0.0132309611 0.006615481 [37,] 0.9958798011 0.0082403978 0.004120199 [38,] 0.9954298400 0.0091403200 0.004570160 [39,] 0.9936576622 0.0126846756 0.006342338 [40,] 0.9931978498 0.0136043003 0.006802150 [41,] 0.9885744728 0.0228510544 0.011425527 [42,] 0.9859647409 0.0280705183 0.014035259 [43,] 0.9872295419 0.0255409163 0.012770458 [44,] 0.9803703091 0.0392593818 0.019629691 [45,] 0.9729584658 0.0540830683 0.027041534 [46,] 0.9559055772 0.0881888456 0.044094423 [47,] 0.9330834256 0.1338331488 0.066916574 [48,] 0.9226342308 0.1547315383 0.077365769 [49,] 0.9526145984 0.0947708031 0.047385402 [50,] 0.9678466579 0.0643066843 0.032153342 [51,] 0.9746472940 0.0507054120 0.025352706 > postscript(file="/var/www/html/rcomp/tmp/10g7p1258661727.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/2yyva1258661727.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/3ob1f1258661727.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/44pny1258661727.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/5ad7q1258661727.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.89076306 0.09076306 0.09076306 0.85923434 0.95923434 0.85923434 7 8 9 10 11 12 0.82731892 0.62731892 0.72731892 0.63940960 0.83940960 0.73940960 13 14 15 16 17 18 0.89230987 0.49230987 0.59230987 1.07712556 1.07712556 0.87712556 19 20 21 22 23 24 0.66039445 0.66039445 0.66039445 -0.07886832 0.12113168 -0.07886832 25 26 27 28 29 30 0.57557875 0.27557875 0.27557875 0.67673886 0.67673886 0.67673886 31 32 33 34 35 36 0.34172982 -0.05827018 -0.55827018 -0.42480795 -0.72480795 -1.12480795 37 38 39 40 41 42 -0.28902550 -0.28902550 -0.18902550 0.11252131 -0.18747869 -0.68747869 43 44 45 46 47 48 -0.58593188 -0.88593188 -0.48593188 -0.90923694 -0.40923694 -0.80923694 49 50 51 52 53 54 -0.50653002 -0.90653002 -0.60653002 -0.50807683 -0.40807683 -0.60807683 55 56 57 58 59 60 -0.87384119 -1.37384119 -1.27384119 -1.24347258 -0.84347258 -0.94347258 > postscript(file="/var/www/html/rcomp/tmp/6o1671258661727.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.89076306 NA 1 0.09076306 0.89076306 2 0.09076306 0.09076306 3 0.85923434 0.09076306 4 0.95923434 0.85923434 5 0.85923434 0.95923434 6 0.82731892 0.85923434 7 0.62731892 0.82731892 8 0.72731892 0.62731892 9 0.63940960 0.72731892 10 0.83940960 0.63940960 11 0.73940960 0.83940960 12 0.89230987 0.73940960 13 0.49230987 0.89230987 14 0.59230987 0.49230987 15 1.07712556 0.59230987 16 1.07712556 1.07712556 17 0.87712556 1.07712556 18 0.66039445 0.87712556 19 0.66039445 0.66039445 20 0.66039445 0.66039445 21 -0.07886832 0.66039445 22 0.12113168 -0.07886832 23 -0.07886832 0.12113168 24 0.57557875 -0.07886832 25 0.27557875 0.57557875 26 0.27557875 0.27557875 27 0.67673886 0.27557875 28 0.67673886 0.67673886 29 0.67673886 0.67673886 30 0.34172982 0.67673886 31 -0.05827018 0.34172982 32 -0.55827018 -0.05827018 33 -0.42480795 -0.55827018 34 -0.72480795 -0.42480795 35 -1.12480795 -0.72480795 36 -0.28902550 -1.12480795 37 -0.28902550 -0.28902550 38 -0.18902550 -0.28902550 39 0.11252131 -0.18902550 40 -0.18747869 0.11252131 41 -0.68747869 -0.18747869 42 -0.58593188 -0.68747869 43 -0.88593188 -0.58593188 44 -0.48593188 -0.88593188 45 -0.90923694 -0.48593188 46 -0.40923694 -0.90923694 47 -0.80923694 -0.40923694 48 -0.50653002 -0.80923694 49 -0.90653002 -0.50653002 50 -0.60653002 -0.90653002 51 -0.50807683 -0.60653002 52 -0.40807683 -0.50807683 53 -0.60807683 -0.40807683 54 -0.87384119 -0.60807683 55 -1.37384119 -0.87384119 56 -1.27384119 -1.37384119 57 -1.24347258 -1.27384119 58 -0.84347258 -1.24347258 59 -0.94347258 -0.84347258 60 NA -0.94347258 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.09076306 0.89076306 [2,] 0.09076306 0.09076306 [3,] 0.85923434 0.09076306 [4,] 0.95923434 0.85923434 [5,] 0.85923434 0.95923434 [6,] 0.82731892 0.85923434 [7,] 0.62731892 0.82731892 [8,] 0.72731892 0.62731892 [9,] 0.63940960 0.72731892 [10,] 0.83940960 0.63940960 [11,] 0.73940960 0.83940960 [12,] 0.89230987 0.73940960 [13,] 0.49230987 0.89230987 [14,] 0.59230987 0.49230987 [15,] 1.07712556 0.59230987 [16,] 1.07712556 1.07712556 [17,] 0.87712556 1.07712556 [18,] 0.66039445 0.87712556 [19,] 0.66039445 0.66039445 [20,] 0.66039445 0.66039445 [21,] -0.07886832 0.66039445 [22,] 0.12113168 -0.07886832 [23,] -0.07886832 0.12113168 [24,] 0.57557875 -0.07886832 [25,] 0.27557875 0.57557875 [26,] 0.27557875 0.27557875 [27,] 0.67673886 0.27557875 [28,] 0.67673886 0.67673886 [29,] 0.67673886 0.67673886 [30,] 0.34172982 0.67673886 [31,] -0.05827018 0.34172982 [32,] -0.55827018 -0.05827018 [33,] -0.42480795 -0.55827018 [34,] -0.72480795 -0.42480795 [35,] -1.12480795 -0.72480795 [36,] -0.28902550 -1.12480795 [37,] -0.28902550 -0.28902550 [38,] -0.18902550 -0.28902550 [39,] 0.11252131 -0.18902550 [40,] -0.18747869 0.11252131 [41,] -0.68747869 -0.18747869 [42,] -0.58593188 -0.68747869 [43,] -0.88593188 -0.58593188 [44,] -0.48593188 -0.88593188 [45,] -0.90923694 -0.48593188 [46,] -0.40923694 -0.90923694 [47,] -0.80923694 -0.40923694 [48,] -0.50653002 -0.80923694 [49,] -0.90653002 -0.50653002 [50,] -0.60653002 -0.90653002 [51,] -0.50807683 -0.60653002 [52,] -0.40807683 -0.50807683 [53,] -0.60807683 -0.40807683 [54,] -0.87384119 -0.60807683 [55,] -1.37384119 -0.87384119 [56,] -1.27384119 -1.37384119 [57,] -1.24347258 -1.27384119 [58,] -0.84347258 -1.24347258 [59,] -0.94347258 -0.84347258 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.09076306 0.89076306 2 0.09076306 0.09076306 3 0.85923434 0.09076306 4 0.95923434 0.85923434 5 0.85923434 0.95923434 6 0.82731892 0.85923434 7 0.62731892 0.82731892 8 0.72731892 0.62731892 9 0.63940960 0.72731892 10 0.83940960 0.63940960 11 0.73940960 0.83940960 12 0.89230987 0.73940960 13 0.49230987 0.89230987 14 0.59230987 0.49230987 15 1.07712556 0.59230987 16 1.07712556 1.07712556 17 0.87712556 1.07712556 18 0.66039445 0.87712556 19 0.66039445 0.66039445 20 0.66039445 0.66039445 21 -0.07886832 0.66039445 22 0.12113168 -0.07886832 23 -0.07886832 0.12113168 24 0.57557875 -0.07886832 25 0.27557875 0.57557875 26 0.27557875 0.27557875 27 0.67673886 0.27557875 28 0.67673886 0.67673886 29 0.67673886 0.67673886 30 0.34172982 0.67673886 31 -0.05827018 0.34172982 32 -0.55827018 -0.05827018 33 -0.42480795 -0.55827018 34 -0.72480795 -0.42480795 35 -1.12480795 -0.72480795 36 -0.28902550 -1.12480795 37 -0.28902550 -0.28902550 38 -0.18902550 -0.28902550 39 0.11252131 -0.18902550 40 -0.18747869 0.11252131 41 -0.68747869 -0.18747869 42 -0.58593188 -0.68747869 43 -0.88593188 -0.58593188 44 -0.48593188 -0.88593188 45 -0.90923694 -0.48593188 46 -0.40923694 -0.90923694 47 -0.80923694 -0.40923694 48 -0.50653002 -0.80923694 49 -0.90653002 -0.50653002 50 -0.60653002 -0.90653002 51 -0.50807683 -0.60653002 52 -0.40807683 -0.50807683 53 -0.60807683 -0.40807683 54 -0.87384119 -0.60807683 55 -1.37384119 -0.87384119 56 -1.27384119 -1.37384119 57 -1.24347258 -1.27384119 58 -0.84347258 -1.24347258 59 -0.94347258 -0.84347258 > 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/77aik1258661727.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/8jsxs1258661727.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/997q01258661727.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/10ft6r1258661727.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/110kpj1258661727.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/12erkn1258661727.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/13uokd1258661727.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/14dk4h1258661727.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/151dan1258661727.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/16kcyt1258661727.tab") + } > > system("convert tmp/10g7p1258661727.ps tmp/10g7p1258661727.png") > system("convert tmp/2yyva1258661727.ps tmp/2yyva1258661727.png") > system("convert tmp/3ob1f1258661727.ps tmp/3ob1f1258661727.png") > system("convert tmp/44pny1258661727.ps tmp/44pny1258661727.png") > system("convert tmp/5ad7q1258661727.ps tmp/5ad7q1258661727.png") > system("convert tmp/6o1671258661727.ps tmp/6o1671258661727.png") > system("convert tmp/77aik1258661727.ps tmp/77aik1258661727.png") > system("convert tmp/8jsxs1258661727.ps tmp/8jsxs1258661727.png") > system("convert tmp/997q01258661727.ps tmp/997q01258661727.png") > system("convert tmp/10ft6r1258661727.ps tmp/10ft6r1258661727.png") > > > proc.time() user system elapsed 2.355 1.532 2.820