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(5560,36.68,3922,36.7,3759,36.71,4138,36.72,4634,36.73,3996,36.73,4308,36.87,4429,37.31,5219,37.39,4929,37.42,5755,37.51,5592,37.67,4163,37.67,4962,37.71,5208,37.78,4755,37.79,4491,37.84,5732,37.88,5731,38.34,5040,38.58,6102,38.72,4904,38.83,5369,38.9,5578,38.92,4619,38.94,4731,39.1,5011,39.14,5299,39.16,4146,39.32,4625,39.34,4736,39.44,4219,39.92,5116,40.19,4205,40.2,4121,40.27,5103,40.28,4300,40.3,4578,40.34,3809,40.4,5526,40.43,4247,40.48,3830,40.48,4394,40.63,4826,40.74,4409,40.77,4569,40.91,4106,40.92,4794,41.03,3914,41,3793,41.04,4405,41.33,4022,41.44,4100,41.46,4788,41.55,3163,41.55,3585,41.81,3903,41.78,4178,41.84,3863,41.84,4187,41.86),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 5560 36.68 2 3922 36.70 3 3759 36.71 4 4138 36.72 5 4634 36.73 6 3996 36.73 7 4308 36.87 8 4429 37.31 9 5219 37.39 10 4929 37.42 11 5755 37.51 12 5592 37.67 13 4163 37.67 14 4962 37.71 15 5208 37.78 16 4755 37.79 17 4491 37.84 18 5732 37.88 19 5731 38.34 20 5040 38.58 21 6102 38.72 22 4904 38.83 23 5369 38.90 24 5578 38.92 25 4619 38.94 26 4731 39.10 27 5011 39.14 28 5299 39.16 29 4146 39.32 30 4625 39.34 31 4736 39.44 32 4219 39.92 33 5116 40.19 34 4205 40.20 35 4121 40.27 36 5103 40.28 37 4300 40.30 38 4578 40.34 39 3809 40.40 40 5526 40.43 41 4247 40.48 42 3830 40.48 43 4394 40.63 44 4826 40.74 45 4409 40.77 46 4569 40.91 47 4106 40.92 48 4794 41.03 49 3914 41.00 50 3793 41.04 51 4405 41.33 52 4022 41.44 53 4100 41.46 54 4788 41.55 55 3163 41.55 56 3585 41.81 57 3903 41.78 58 4178 41.84 59 3863 41.84 60 4187 41.86 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 10478.9 -149.4 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1236.01 -359.94 -27.06 392.50 1407.25 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10478.90 1807.86 5.796 2.95e-07 *** X -149.38 45.83 -3.259 0.00187 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 589.8 on 58 degrees of freedom Multiple R-squared: 0.1548, Adjusted R-squared: 0.1402 F-statistic: 10.62 on 1 and 58 DF, p-value: 0.001870 > 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.8407616 0.31847678 0.15923839 [2,] 0.7798742 0.44025159 0.22012580 [3,] 0.8606223 0.27875534 0.13937767 [4,] 0.8288135 0.34237294 0.17118647 [5,] 0.8203873 0.35922538 0.17961269 [6,] 0.7504903 0.49901934 0.24950967 [7,] 0.7737575 0.45248510 0.22624255 [8,] 0.7037091 0.59258183 0.29629091 [9,] 0.9084967 0.18300660 0.09150330 [10,] 0.8770267 0.24594650 0.12297325 [11,] 0.8271889 0.34562227 0.17281113 [12,] 0.8208855 0.35822896 0.17911448 [13,] 0.8805093 0.23898147 0.11949073 [14,] 0.8767686 0.24646271 0.12323136 [15,] 0.8474732 0.30505355 0.15252678 [16,] 0.8402076 0.31958480 0.15979240 [17,] 0.8851102 0.22977955 0.11488977 [18,] 0.9012026 0.19759487 0.09879743 [19,] 0.8805216 0.23895678 0.11947839 [20,] 0.8763390 0.24732196 0.12366098 [21,] 0.9054483 0.18910330 0.09455165 [22,] 0.9067885 0.18642303 0.09321152 [23,] 0.8839330 0.23213396 0.11606698 [24,] 0.8689424 0.26211525 0.13105762 [25,] 0.9339525 0.13209499 0.06604749 [26,] 0.9231682 0.15366353 0.07683176 [27,] 0.9015124 0.19697524 0.09848762 [28,] 0.9202093 0.15958132 0.07979066 [29,] 0.9132875 0.17342501 0.08671251 [30,] 0.9168281 0.16634381 0.08317191 [31,] 0.9222328 0.15553446 0.07776723 [32,] 0.9173053 0.16538932 0.08269466 [33,] 0.8988775 0.20224498 0.10112249 [34,] 0.8617839 0.27643221 0.13821610 [35,] 0.9075118 0.18497647 0.09248823 [36,] 0.9698658 0.06026845 0.03013422 [37,] 0.9568901 0.08621975 0.04310987 [38,] 0.9717746 0.05645085 0.02822542 [39,] 0.9549511 0.09009775 0.04504888 [40,] 0.9450858 0.10982850 0.05491425 [41,] 0.9144926 0.17101483 0.08550742 [42,] 0.8863481 0.22730389 0.11365195 [43,] 0.8397589 0.32048223 0.16024112 [44,] 0.8741063 0.25178738 0.12589369 [45,] 0.8226129 0.35477417 0.17738709 [46,] 0.7918486 0.41630276 0.20815138 [47,] 0.7216812 0.55663753 0.27831876 [48,] 0.6109435 0.77811291 0.38905645 [49,] 0.4843718 0.96874354 0.51562823 [50,] 0.9704028 0.05919441 0.02959720 [51,] 0.9271474 0.14570521 0.07285260 > postscript(file="/var/www/html/rcomp/tmp/1blnb1258196944.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/2u2mi1258196944.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/37a5i1258196944.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/4sdzk1258196944.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/5hex01258196944.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 560.50718 -1074.50515 -1236.01131 -855.51747 -358.02363 -996.02363 7 8 9 10 11 12 -663.10988 -476.38095 325.56977 40.05129 879.49584 740.39727 13 14 15 16 17 18 -688.60273 116.37263 372.82950 -78.67666 -335.20746 911.76789 19 20 21 22 23 24 979.48450 324.33665 1407.25040 225.68263 701.13950 913.12718 25 26 27 28 29 30 -42.88514 93.01629 378.99165 669.97933 -459.11925 22.86843 31 32 33 34 35 36 148.80683 -296.48889 640.84477 -268.66139 -342.20451 641.28933 37 38 39 40 41 42 -158.72299 125.25236 -634.78460 1086.69692 -184.83389 -601.83389 43 44 45 46 47 48 -15.42630 433.00594 20.48745 201.40120 -260.10496 444.32728 49 50 51 52 53 54 -440.15424 -555.17888 100.14246 -266.42531 -185.43763 516.00692 55 56 57 58 59 60 -1108.99308 -648.15326 -334.63478 -50.67174 -365.67174 -38.68406 > postscript(file="/var/www/html/rcomp/tmp/6nsfy1258196944.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 560.50718 NA 1 -1074.50515 560.50718 2 -1236.01131 -1074.50515 3 -855.51747 -1236.01131 4 -358.02363 -855.51747 5 -996.02363 -358.02363 6 -663.10988 -996.02363 7 -476.38095 -663.10988 8 325.56977 -476.38095 9 40.05129 325.56977 10 879.49584 40.05129 11 740.39727 879.49584 12 -688.60273 740.39727 13 116.37263 -688.60273 14 372.82950 116.37263 15 -78.67666 372.82950 16 -335.20746 -78.67666 17 911.76789 -335.20746 18 979.48450 911.76789 19 324.33665 979.48450 20 1407.25040 324.33665 21 225.68263 1407.25040 22 701.13950 225.68263 23 913.12718 701.13950 24 -42.88514 913.12718 25 93.01629 -42.88514 26 378.99165 93.01629 27 669.97933 378.99165 28 -459.11925 669.97933 29 22.86843 -459.11925 30 148.80683 22.86843 31 -296.48889 148.80683 32 640.84477 -296.48889 33 -268.66139 640.84477 34 -342.20451 -268.66139 35 641.28933 -342.20451 36 -158.72299 641.28933 37 125.25236 -158.72299 38 -634.78460 125.25236 39 1086.69692 -634.78460 40 -184.83389 1086.69692 41 -601.83389 -184.83389 42 -15.42630 -601.83389 43 433.00594 -15.42630 44 20.48745 433.00594 45 201.40120 20.48745 46 -260.10496 201.40120 47 444.32728 -260.10496 48 -440.15424 444.32728 49 -555.17888 -440.15424 50 100.14246 -555.17888 51 -266.42531 100.14246 52 -185.43763 -266.42531 53 516.00692 -185.43763 54 -1108.99308 516.00692 55 -648.15326 -1108.99308 56 -334.63478 -648.15326 57 -50.67174 -334.63478 58 -365.67174 -50.67174 59 -38.68406 -365.67174 60 NA -38.68406 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1074.50515 560.50718 [2,] -1236.01131 -1074.50515 [3,] -855.51747 -1236.01131 [4,] -358.02363 -855.51747 [5,] -996.02363 -358.02363 [6,] -663.10988 -996.02363 [7,] -476.38095 -663.10988 [8,] 325.56977 -476.38095 [9,] 40.05129 325.56977 [10,] 879.49584 40.05129 [11,] 740.39727 879.49584 [12,] -688.60273 740.39727 [13,] 116.37263 -688.60273 [14,] 372.82950 116.37263 [15,] -78.67666 372.82950 [16,] -335.20746 -78.67666 [17,] 911.76789 -335.20746 [18,] 979.48450 911.76789 [19,] 324.33665 979.48450 [20,] 1407.25040 324.33665 [21,] 225.68263 1407.25040 [22,] 701.13950 225.68263 [23,] 913.12718 701.13950 [24,] -42.88514 913.12718 [25,] 93.01629 -42.88514 [26,] 378.99165 93.01629 [27,] 669.97933 378.99165 [28,] -459.11925 669.97933 [29,] 22.86843 -459.11925 [30,] 148.80683 22.86843 [31,] -296.48889 148.80683 [32,] 640.84477 -296.48889 [33,] -268.66139 640.84477 [34,] -342.20451 -268.66139 [35,] 641.28933 -342.20451 [36,] -158.72299 641.28933 [37,] 125.25236 -158.72299 [38,] -634.78460 125.25236 [39,] 1086.69692 -634.78460 [40,] -184.83389 1086.69692 [41,] -601.83389 -184.83389 [42,] -15.42630 -601.83389 [43,] 433.00594 -15.42630 [44,] 20.48745 433.00594 [45,] 201.40120 20.48745 [46,] -260.10496 201.40120 [47,] 444.32728 -260.10496 [48,] -440.15424 444.32728 [49,] -555.17888 -440.15424 [50,] 100.14246 -555.17888 [51,] -266.42531 100.14246 [52,] -185.43763 -266.42531 [53,] 516.00692 -185.43763 [54,] -1108.99308 516.00692 [55,] -648.15326 -1108.99308 [56,] -334.63478 -648.15326 [57,] -50.67174 -334.63478 [58,] -365.67174 -50.67174 [59,] -38.68406 -365.67174 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1074.50515 560.50718 2 -1236.01131 -1074.50515 3 -855.51747 -1236.01131 4 -358.02363 -855.51747 5 -996.02363 -358.02363 6 -663.10988 -996.02363 7 -476.38095 -663.10988 8 325.56977 -476.38095 9 40.05129 325.56977 10 879.49584 40.05129 11 740.39727 879.49584 12 -688.60273 740.39727 13 116.37263 -688.60273 14 372.82950 116.37263 15 -78.67666 372.82950 16 -335.20746 -78.67666 17 911.76789 -335.20746 18 979.48450 911.76789 19 324.33665 979.48450 20 1407.25040 324.33665 21 225.68263 1407.25040 22 701.13950 225.68263 23 913.12718 701.13950 24 -42.88514 913.12718 25 93.01629 -42.88514 26 378.99165 93.01629 27 669.97933 378.99165 28 -459.11925 669.97933 29 22.86843 -459.11925 30 148.80683 22.86843 31 -296.48889 148.80683 32 640.84477 -296.48889 33 -268.66139 640.84477 34 -342.20451 -268.66139 35 641.28933 -342.20451 36 -158.72299 641.28933 37 125.25236 -158.72299 38 -634.78460 125.25236 39 1086.69692 -634.78460 40 -184.83389 1086.69692 41 -601.83389 -184.83389 42 -15.42630 -601.83389 43 433.00594 -15.42630 44 20.48745 433.00594 45 201.40120 20.48745 46 -260.10496 201.40120 47 444.32728 -260.10496 48 -440.15424 444.32728 49 -555.17888 -440.15424 50 100.14246 -555.17888 51 -266.42531 100.14246 52 -185.43763 -266.42531 53 516.00692 -185.43763 54 -1108.99308 516.00692 55 -648.15326 -1108.99308 56 -334.63478 -648.15326 57 -50.67174 -334.63478 58 -365.67174 -50.67174 59 -38.68406 -365.67174 > 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/7ust51258196944.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/8hjgk1258196944.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/9975u1258196944.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/10lnf81258196944.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/112avj1258196944.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/12ehu61258196944.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/13b69f1258196944.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/149rdg1258196944.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/15ve3p1258196945.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/1634c51258196945.tab") + } > > system("convert tmp/1blnb1258196944.ps tmp/1blnb1258196944.png") > system("convert tmp/2u2mi1258196944.ps tmp/2u2mi1258196944.png") > system("convert tmp/37a5i1258196944.ps tmp/37a5i1258196944.png") > system("convert tmp/4sdzk1258196944.ps tmp/4sdzk1258196944.png") > system("convert tmp/5hex01258196944.ps tmp/5hex01258196944.png") > system("convert tmp/6nsfy1258196944.ps tmp/6nsfy1258196944.png") > system("convert tmp/7ust51258196944.ps tmp/7ust51258196944.png") > system("convert tmp/8hjgk1258196944.ps tmp/8hjgk1258196944.png") > system("convert tmp/9975u1258196944.ps tmp/9975u1258196944.png") > system("convert tmp/10lnf81258196944.ps tmp/10lnf81258196944.png") > > > proc.time() user system elapsed 2.494 1.591 4.239