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(9.3,104.1,8.7,90.2,8.2,99.2,8.3,116.5,8.5,98.4,8.6,90.6,8.5,130.5,8.2,107.4,8.1,106,7.9,196.5,8.6,107.8,8.7,90.5,8.7,123.8,8.5,114.7,8.4,115.3,8.5,197,8.7,88.4,8.7,93.8,8.6,111.3,8.5,105.9,8.3,123.6,8,171,8.2,97,8.1,99.2,8.1,126.6,8,103.4,7.9,121.3,7.9,129.6,8,110.8,8,98.9,7.9,122.8,8,120.9,7.7,133.1,7.2,203.1,7.5,110.2,7.3,119.5,7,135.1,7,113.9,7,137.4,7.2,157.1,7.3,126.4,7.1,112.2,6.8,128.8,6.4,136.8,6.1,156.5,6.5,215.2,7.7,146.7,7.9,130.8,7.5,133.1,6.9,153.4,6.6,159.9,6.9,174.6,7.7,145,8,112.9,8,137.8,7.7,150.6,7.3,162.1,7.4,226.4,8.1,112.3,8.3,126.3),dim=c(2,60),dimnames=list(c('X','Y'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('X','Y'),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 = '2' > #'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 104.1 9.3 2 90.2 8.7 3 99.2 8.2 4 116.5 8.3 5 98.4 8.5 6 90.6 8.6 7 130.5 8.5 8 107.4 8.2 9 106.0 8.1 10 196.5 7.9 11 107.8 8.6 12 90.5 8.7 13 123.8 8.7 14 114.7 8.5 15 115.3 8.4 16 197.0 8.5 17 88.4 8.7 18 93.8 8.7 19 111.3 8.6 20 105.9 8.5 21 123.6 8.3 22 171.0 8.0 23 97.0 8.2 24 99.2 8.1 25 126.6 8.1 26 103.4 8.0 27 121.3 7.9 28 129.6 7.9 29 110.8 8.0 30 98.9 8.0 31 122.8 7.9 32 120.9 8.0 33 133.1 7.7 34 203.1 7.2 35 110.2 7.5 36 119.5 7.3 37 135.1 7.0 38 113.9 7.0 39 137.4 7.0 40 157.1 7.2 41 126.4 7.3 42 112.2 7.1 43 128.8 6.8 44 136.8 6.4 45 156.5 6.1 46 215.2 6.5 47 146.7 7.7 48 130.8 7.9 49 133.1 7.5 50 153.4 6.9 51 159.9 6.6 52 174.6 6.9 53 145.0 7.7 54 112.9 8.0 55 137.8 8.0 56 150.6 7.7 57 162.1 7.3 58 226.4 7.4 59 112.3 8.1 60 126.3 8.3 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 324.71 -24.88 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -36.629 -17.301 -4.867 10.987 85.824 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 324.707 40.249 8.067 4.72e-11 *** X -24.882 5.111 -4.868 9.04e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 26.9 on 58 degrees of freedom Multiple R-squared: 0.2901, Adjusted R-squared: 0.2778 F-statistic: 23.7 on 1 and 58 DF, p-value: 9.04e-06 > 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.07614576 0.15229152 0.9238542 [2,] 0.03824587 0.07649173 0.9617541 [3,] 0.09987605 0.19975211 0.9001239 [4,] 0.04761780 0.09523559 0.9523822 [5,] 0.02151127 0.04302254 0.9784887 [6,] 0.64548408 0.70903184 0.3545159 [7,] 0.54131570 0.91736860 0.4586843 [8,] 0.46253479 0.92506957 0.5374652 [9,] 0.41591585 0.83183169 0.5840842 [10,] 0.32447740 0.64895481 0.6755226 [11,] 0.24374954 0.48749907 0.7562505 [12,] 0.86291016 0.27417967 0.1370898 [13,] 0.83533707 0.32932586 0.1646629 [14,] 0.79116471 0.41767058 0.2088353 [15,] 0.72680552 0.54638897 0.2731945 [16,] 0.66117295 0.67765409 0.3388270 [17,] 0.58561699 0.82876603 0.4143830 [18,] 0.65882311 0.68235378 0.3411769 [19,] 0.66586352 0.66827296 0.3341365 [20,] 0.67142025 0.65715949 0.3285797 [21,] 0.59966888 0.80066224 0.4003311 [22,] 0.59015218 0.81969565 0.4098478 [23,] 0.52375613 0.95248774 0.4762439 [24,] 0.44742796 0.89485592 0.5525720 [25,] 0.39962286 0.79924571 0.6003771 [26,] 0.40438372 0.80876745 0.5956163 [27,] 0.33720306 0.67440613 0.6627969 [28,] 0.27503497 0.55006993 0.7249650 [29,] 0.21547253 0.43094506 0.7845275 [30,] 0.40520867 0.81041735 0.5947913 [31,] 0.43629782 0.87259564 0.5637022 [32,] 0.42999991 0.85999983 0.5700001 [33,] 0.37925649 0.75851297 0.6207435 [34,] 0.43428689 0.86857378 0.5657131 [35,] 0.37445809 0.74891618 0.6255419 [36,] 0.31382758 0.62765516 0.6861724 [37,] 0.27528103 0.55056206 0.7247190 [38,] 0.33804334 0.67608668 0.6619567 [39,] 0.35217298 0.70434596 0.6478270 [40,] 0.41573844 0.83147688 0.5842616 [41,] 0.51104885 0.97790231 0.4889512 [42,] 0.61569015 0.76861970 0.3843099 [43,] 0.52955041 0.94089917 0.4704496 [44,] 0.43569848 0.87139696 0.5643015 [45,] 0.37287500 0.74575000 0.6271250 [46,] 0.32254190 0.64508379 0.6774581 [47,] 0.40529132 0.81058264 0.5947087 [48,] 0.45220883 0.90441767 0.5477912 [49,] 0.34982697 0.69965393 0.6501730 [50,] 0.29563504 0.59127007 0.7043650 [51,] 0.17644814 0.35289627 0.8235519 > postscript(file="/var/www/html/rcomp/tmp/1z63z1258743441.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/2i0mk1258743441.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/30o7f1258743441.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/4g8bv1258743441.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/5d5wo1258743441.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 10.80069885 -18.02879896 -21.47004713 -1.68179750 -14.80529823 -20.11704859 7 8 9 10 11 12 17.29470177 -13.27004713 -17.15829677 68.36520397 -2.91704859 -17.72879896 13 14 15 16 17 18 15.57120104 1.49470177 -0.39354786 83.79470177 -19.82879896 -14.42879896 19 20 21 22 23 24 0.58295141 -7.30529823 5.41820250 45.35345360 -23.67004713 -23.95829677 25 26 27 28 29 30 3.44170323 -22.24654640 -6.83479603 1.46520397 -14.84654640 -26.74654640 31 32 33 34 35 36 -5.33479603 -4.74654640 -0.01129530 57.54745653 -27.88779457 -23.56429384 37 38 39 40 41 42 -15.42904274 -36.62904274 -13.12904274 11.54745653 -16.66429384 -35.84079311 43 44 45 46 47 48 -26.70554201 -28.65854055 -16.42328945 52.22970908 13.58870470 2.66520397 49 50 51 52 53 54 -4.98779457 0.38270762 -0.58204128 21.58270762 11.88870470 -12.74654640 55 56 57 58 59 60 12.15345360 17.48870470 19.03570616 85.82395579 -10.85829677 8.11820250 > postscript(file="/var/www/html/rcomp/tmp/6ol3a1258743441.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 10.80069885 NA 1 -18.02879896 10.80069885 2 -21.47004713 -18.02879896 3 -1.68179750 -21.47004713 4 -14.80529823 -1.68179750 5 -20.11704859 -14.80529823 6 17.29470177 -20.11704859 7 -13.27004713 17.29470177 8 -17.15829677 -13.27004713 9 68.36520397 -17.15829677 10 -2.91704859 68.36520397 11 -17.72879896 -2.91704859 12 15.57120104 -17.72879896 13 1.49470177 15.57120104 14 -0.39354786 1.49470177 15 83.79470177 -0.39354786 16 -19.82879896 83.79470177 17 -14.42879896 -19.82879896 18 0.58295141 -14.42879896 19 -7.30529823 0.58295141 20 5.41820250 -7.30529823 21 45.35345360 5.41820250 22 -23.67004713 45.35345360 23 -23.95829677 -23.67004713 24 3.44170323 -23.95829677 25 -22.24654640 3.44170323 26 -6.83479603 -22.24654640 27 1.46520397 -6.83479603 28 -14.84654640 1.46520397 29 -26.74654640 -14.84654640 30 -5.33479603 -26.74654640 31 -4.74654640 -5.33479603 32 -0.01129530 -4.74654640 33 57.54745653 -0.01129530 34 -27.88779457 57.54745653 35 -23.56429384 -27.88779457 36 -15.42904274 -23.56429384 37 -36.62904274 -15.42904274 38 -13.12904274 -36.62904274 39 11.54745653 -13.12904274 40 -16.66429384 11.54745653 41 -35.84079311 -16.66429384 42 -26.70554201 -35.84079311 43 -28.65854055 -26.70554201 44 -16.42328945 -28.65854055 45 52.22970908 -16.42328945 46 13.58870470 52.22970908 47 2.66520397 13.58870470 48 -4.98779457 2.66520397 49 0.38270762 -4.98779457 50 -0.58204128 0.38270762 51 21.58270762 -0.58204128 52 11.88870470 21.58270762 53 -12.74654640 11.88870470 54 12.15345360 -12.74654640 55 17.48870470 12.15345360 56 19.03570616 17.48870470 57 85.82395579 19.03570616 58 -10.85829677 85.82395579 59 8.11820250 -10.85829677 60 NA 8.11820250 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -18.02879896 10.80069885 [2,] -21.47004713 -18.02879896 [3,] -1.68179750 -21.47004713 [4,] -14.80529823 -1.68179750 [5,] -20.11704859 -14.80529823 [6,] 17.29470177 -20.11704859 [7,] -13.27004713 17.29470177 [8,] -17.15829677 -13.27004713 [9,] 68.36520397 -17.15829677 [10,] -2.91704859 68.36520397 [11,] -17.72879896 -2.91704859 [12,] 15.57120104 -17.72879896 [13,] 1.49470177 15.57120104 [14,] -0.39354786 1.49470177 [15,] 83.79470177 -0.39354786 [16,] -19.82879896 83.79470177 [17,] -14.42879896 -19.82879896 [18,] 0.58295141 -14.42879896 [19,] -7.30529823 0.58295141 [20,] 5.41820250 -7.30529823 [21,] 45.35345360 5.41820250 [22,] -23.67004713 45.35345360 [23,] -23.95829677 -23.67004713 [24,] 3.44170323 -23.95829677 [25,] -22.24654640 3.44170323 [26,] -6.83479603 -22.24654640 [27,] 1.46520397 -6.83479603 [28,] -14.84654640 1.46520397 [29,] -26.74654640 -14.84654640 [30,] -5.33479603 -26.74654640 [31,] -4.74654640 -5.33479603 [32,] -0.01129530 -4.74654640 [33,] 57.54745653 -0.01129530 [34,] -27.88779457 57.54745653 [35,] -23.56429384 -27.88779457 [36,] -15.42904274 -23.56429384 [37,] -36.62904274 -15.42904274 [38,] -13.12904274 -36.62904274 [39,] 11.54745653 -13.12904274 [40,] -16.66429384 11.54745653 [41,] -35.84079311 -16.66429384 [42,] -26.70554201 -35.84079311 [43,] -28.65854055 -26.70554201 [44,] -16.42328945 -28.65854055 [45,] 52.22970908 -16.42328945 [46,] 13.58870470 52.22970908 [47,] 2.66520397 13.58870470 [48,] -4.98779457 2.66520397 [49,] 0.38270762 -4.98779457 [50,] -0.58204128 0.38270762 [51,] 21.58270762 -0.58204128 [52,] 11.88870470 21.58270762 [53,] -12.74654640 11.88870470 [54,] 12.15345360 -12.74654640 [55,] 17.48870470 12.15345360 [56,] 19.03570616 17.48870470 [57,] 85.82395579 19.03570616 [58,] -10.85829677 85.82395579 [59,] 8.11820250 -10.85829677 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -18.02879896 10.80069885 2 -21.47004713 -18.02879896 3 -1.68179750 -21.47004713 4 -14.80529823 -1.68179750 5 -20.11704859 -14.80529823 6 17.29470177 -20.11704859 7 -13.27004713 17.29470177 8 -17.15829677 -13.27004713 9 68.36520397 -17.15829677 10 -2.91704859 68.36520397 11 -17.72879896 -2.91704859 12 15.57120104 -17.72879896 13 1.49470177 15.57120104 14 -0.39354786 1.49470177 15 83.79470177 -0.39354786 16 -19.82879896 83.79470177 17 -14.42879896 -19.82879896 18 0.58295141 -14.42879896 19 -7.30529823 0.58295141 20 5.41820250 -7.30529823 21 45.35345360 5.41820250 22 -23.67004713 45.35345360 23 -23.95829677 -23.67004713 24 3.44170323 -23.95829677 25 -22.24654640 3.44170323 26 -6.83479603 -22.24654640 27 1.46520397 -6.83479603 28 -14.84654640 1.46520397 29 -26.74654640 -14.84654640 30 -5.33479603 -26.74654640 31 -4.74654640 -5.33479603 32 -0.01129530 -4.74654640 33 57.54745653 -0.01129530 34 -27.88779457 57.54745653 35 -23.56429384 -27.88779457 36 -15.42904274 -23.56429384 37 -36.62904274 -15.42904274 38 -13.12904274 -36.62904274 39 11.54745653 -13.12904274 40 -16.66429384 11.54745653 41 -35.84079311 -16.66429384 42 -26.70554201 -35.84079311 43 -28.65854055 -26.70554201 44 -16.42328945 -28.65854055 45 52.22970908 -16.42328945 46 13.58870470 52.22970908 47 2.66520397 13.58870470 48 -4.98779457 2.66520397 49 0.38270762 -4.98779457 50 -0.58204128 0.38270762 51 21.58270762 -0.58204128 52 11.88870470 21.58270762 53 -12.74654640 11.88870470 54 12.15345360 -12.74654640 55 17.48870470 12.15345360 56 19.03570616 17.48870470 57 85.82395579 19.03570616 58 -10.85829677 85.82395579 59 8.11820250 -10.85829677 > 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/7emjo1258743441.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/8hfn81258743441.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/9rn5w1258743441.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/10o9gi1258743441.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/116p981258743441.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/12xq8a1258743441.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/13ry3y1258743441.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/14m9a01258743441.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/15vymy1258743441.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/16npgb1258743441.tab") + } > > system("convert tmp/1z63z1258743441.ps tmp/1z63z1258743441.png") > system("convert tmp/2i0mk1258743441.ps tmp/2i0mk1258743441.png") > system("convert tmp/30o7f1258743441.ps tmp/30o7f1258743441.png") > system("convert tmp/4g8bv1258743441.ps tmp/4g8bv1258743441.png") > system("convert tmp/5d5wo1258743441.ps tmp/5d5wo1258743441.png") > system("convert tmp/6ol3a1258743441.ps tmp/6ol3a1258743441.png") > system("convert tmp/7emjo1258743441.ps tmp/7emjo1258743441.png") > system("convert tmp/8hfn81258743441.ps tmp/8hfn81258743441.png") > system("convert tmp/9rn5w1258743441.ps tmp/9rn5w1258743441.png") > system("convert tmp/10o9gi1258743441.ps tmp/10o9gi1258743441.png") > > > proc.time() user system elapsed 2.510 1.581 5.633