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(3353,1,3186,1,3902,1,4164,1,3499,1,4145,1,3796,1,3711,1,3949,1,3740,1,3243,1,4407,1,4814,1,3908,1,5250,1,3937,1,4004,1,5560,1,3922,1,3759,1,4138,1,4634,1,3996,1,4308,1,4143,0,4429,0,5219,0,4929,0,5755,0,5592,0,4163,0,4962,0,5208,0,4755,0,4491,0,5732,0,5731,0,5040,0,6102,0,4904,0,5369,0,5578,0,4619,0,4731,0,5011,0,5299,0,4146,0,4625,0,4736,0,4219,0,5116,0,4205,0,4121,0,5103,1,4300,1,4578,1,3809,1,5526,1,4247,1,3830,1,4394,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > 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 3353 1 2 3186 1 3 3902 1 4 4164 1 5 3499 1 6 4145 1 7 3796 1 8 3711 1 9 3949 1 10 3740 1 11 3243 1 12 4407 1 13 4814 1 14 3908 1 15 5250 1 16 3937 1 17 4004 1 18 5560 1 19 3922 1 20 3759 1 21 4138 1 22 4634 1 23 3996 1 24 4308 1 25 4143 0 26 4429 0 27 5219 0 28 4929 0 29 5755 0 30 5592 0 31 4163 0 32 4962 0 33 5208 0 34 4755 0 35 4491 0 36 5732 0 37 5731 0 38 5040 0 39 6102 0 40 4904 0 41 5369 0 42 5578 0 43 4619 0 44 4731 0 45 5011 0 46 5299 0 47 4146 0 48 4625 0 49 4736 0 50 4219 0 51 5116 0 52 4205 0 53 4121 0 54 5103 1 55 4300 1 56 4578 1 57 3809 1 58 5526 1 59 4247 1 60 3830 1 61 4394 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 4928.6 -768.9 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -973.75 -363.75 -24.62 290.38 1400.25 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4928.6 108.1 45.586 < 2e-16 *** X -768.9 149.3 -5.151 3.14e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 582.2 on 59 degrees of freedom Multiple R-squared: 0.3102, Adjusted R-squared: 0.2985 F-statistic: 26.53 on 1 and 59 DF, p-value: 3.139e-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.42182845 0.8436569 0.5781716 [2,] 0.37813358 0.7562672 0.6218664 [3,] 0.24713968 0.4942794 0.7528603 [4,] 0.15242525 0.3048505 0.8475748 [5,] 0.09835470 0.1967094 0.9016453 [6,] 0.05627188 0.1125438 0.9437281 [7,] 0.07382301 0.1476460 0.9261770 [8,] 0.11764506 0.2352901 0.8823549 [9,] 0.29929605 0.5985921 0.7007039 [10,] 0.22943053 0.4588611 0.7705695 [11,] 0.59935315 0.8012937 0.4006468 [12,] 0.52276203 0.9544759 0.4772380 [13,] 0.44582441 0.8916488 0.5541756 [14,] 0.83219366 0.3356127 0.1678063 [15,] 0.78716203 0.4256759 0.2128380 [16,] 0.75759485 0.4848103 0.2424051 [17,] 0.69837187 0.6032563 0.3016281 [18,] 0.67654159 0.6469168 0.3234584 [19,] 0.61935367 0.7612927 0.3806463 [20,] 0.55428805 0.8914239 0.4457119 [21,] 0.53625750 0.9274850 0.4637425 [22,] 0.49303400 0.9860680 0.5069660 [23,] 0.49990288 0.9998058 0.5000971 [24,] 0.43463473 0.8692695 0.5653653 [25,] 0.53751045 0.9249791 0.4624896 [26,] 0.55676738 0.8864652 0.4432326 [27,] 0.61298236 0.7740353 0.3870176 [28,] 0.53907478 0.9218504 0.4609252 [29,] 0.48094390 0.9618878 0.5190561 [30,] 0.41212009 0.8242402 0.5878799 [31,] 0.37896996 0.7579399 0.6210300 [32,] 0.44596798 0.8919360 0.5540320 [33,] 0.51711174 0.9657765 0.4828883 [34,] 0.44383887 0.8876777 0.5561611 [35,] 0.71347283 0.5730543 0.2865272 [36,] 0.64651394 0.7069721 0.3534861 [37,] 0.64737460 0.7052508 0.3526254 [38,] 0.74019508 0.5196098 0.2598049 [39,] 0.68090379 0.6381924 0.3190962 [40,] 0.61048152 0.7790370 0.3895185 [41,] 0.56379052 0.8724190 0.4362095 [42,] 0.62483514 0.7503297 0.3751649 [43,] 0.61006448 0.7798710 0.3899355 [44,] 0.52861414 0.9427717 0.4713859 [45,] 0.45464949 0.9092990 0.5453505 [46,] 0.39783539 0.7956708 0.6021646 [47,] 0.45538558 0.9107712 0.5446144 [48,] 0.37156982 0.7431396 0.6284302 [49,] 0.28908458 0.5781692 0.7109154 [50,] 0.32760550 0.6552110 0.6723945 [51,] 0.21407303 0.4281461 0.7859270 [52,] 0.12792019 0.2558404 0.8720798 > postscript(file="/var/www/html/rcomp/tmp/1y10m1258617442.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/2q0y61258617442.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/3b5u21258617442.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/4t58r1258617442.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/5xfer1258617442.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 = 61 Frequency = 1 1 2 3 4 5 6 -806.7500000 -973.7500000 -257.7500000 4.2500000 -660.7500000 -14.7500000 7 8 9 10 11 12 -363.7500000 -448.7500000 -210.7500000 -419.7500000 -916.7500000 247.2500000 13 14 15 16 17 18 654.2500000 -251.7500000 1090.2500000 -222.7500000 -155.7500000 1400.2500000 19 20 21 22 23 24 -237.7500000 -400.7500000 -21.7500000 474.2500000 -163.7500000 148.2500000 25 26 27 28 29 30 -785.6206897 -499.6206897 290.3793103 0.3793103 826.3793103 663.3793103 31 32 33 34 35 36 -765.6206897 33.3793103 279.3793103 -173.6206897 -437.6206897 803.3793103 37 38 39 40 41 42 802.3793103 111.3793103 1173.3793103 -24.6206897 440.3793103 649.3793103 43 44 45 46 47 48 -309.6206897 -197.6206897 82.3793103 370.3793103 -782.6206897 -303.6206897 49 50 51 52 53 54 -192.6206897 -709.6206897 187.3793103 -723.6206897 -807.6206897 943.2500000 55 56 57 58 59 60 140.2500000 418.2500000 -350.7500000 1366.2500000 87.2500000 -329.7500000 61 234.2500000 > postscript(file="/var/www/html/rcomp/tmp/6xlzy1258617442.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 -806.7500000 NA 1 -973.7500000 -806.7500000 2 -257.7500000 -973.7500000 3 4.2500000 -257.7500000 4 -660.7500000 4.2500000 5 -14.7500000 -660.7500000 6 -363.7500000 -14.7500000 7 -448.7500000 -363.7500000 8 -210.7500000 -448.7500000 9 -419.7500000 -210.7500000 10 -916.7500000 -419.7500000 11 247.2500000 -916.7500000 12 654.2500000 247.2500000 13 -251.7500000 654.2500000 14 1090.2500000 -251.7500000 15 -222.7500000 1090.2500000 16 -155.7500000 -222.7500000 17 1400.2500000 -155.7500000 18 -237.7500000 1400.2500000 19 -400.7500000 -237.7500000 20 -21.7500000 -400.7500000 21 474.2500000 -21.7500000 22 -163.7500000 474.2500000 23 148.2500000 -163.7500000 24 -785.6206897 148.2500000 25 -499.6206897 -785.6206897 26 290.3793103 -499.6206897 27 0.3793103 290.3793103 28 826.3793103 0.3793103 29 663.3793103 826.3793103 30 -765.6206897 663.3793103 31 33.3793103 -765.6206897 32 279.3793103 33.3793103 33 -173.6206897 279.3793103 34 -437.6206897 -173.6206897 35 803.3793103 -437.6206897 36 802.3793103 803.3793103 37 111.3793103 802.3793103 38 1173.3793103 111.3793103 39 -24.6206897 1173.3793103 40 440.3793103 -24.6206897 41 649.3793103 440.3793103 42 -309.6206897 649.3793103 43 -197.6206897 -309.6206897 44 82.3793103 -197.6206897 45 370.3793103 82.3793103 46 -782.6206897 370.3793103 47 -303.6206897 -782.6206897 48 -192.6206897 -303.6206897 49 -709.6206897 -192.6206897 50 187.3793103 -709.6206897 51 -723.6206897 187.3793103 52 -807.6206897 -723.6206897 53 943.2500000 -807.6206897 54 140.2500000 943.2500000 55 418.2500000 140.2500000 56 -350.7500000 418.2500000 57 1366.2500000 -350.7500000 58 87.2500000 1366.2500000 59 -329.7500000 87.2500000 60 234.2500000 -329.7500000 61 NA 234.2500000 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -973.7500000 -806.7500000 [2,] -257.7500000 -973.7500000 [3,] 4.2500000 -257.7500000 [4,] -660.7500000 4.2500000 [5,] -14.7500000 -660.7500000 [6,] -363.7500000 -14.7500000 [7,] -448.7500000 -363.7500000 [8,] -210.7500000 -448.7500000 [9,] -419.7500000 -210.7500000 [10,] -916.7500000 -419.7500000 [11,] 247.2500000 -916.7500000 [12,] 654.2500000 247.2500000 [13,] -251.7500000 654.2500000 [14,] 1090.2500000 -251.7500000 [15,] -222.7500000 1090.2500000 [16,] -155.7500000 -222.7500000 [17,] 1400.2500000 -155.7500000 [18,] -237.7500000 1400.2500000 [19,] -400.7500000 -237.7500000 [20,] -21.7500000 -400.7500000 [21,] 474.2500000 -21.7500000 [22,] -163.7500000 474.2500000 [23,] 148.2500000 -163.7500000 [24,] -785.6206897 148.2500000 [25,] -499.6206897 -785.6206897 [26,] 290.3793103 -499.6206897 [27,] 0.3793103 290.3793103 [28,] 826.3793103 0.3793103 [29,] 663.3793103 826.3793103 [30,] -765.6206897 663.3793103 [31,] 33.3793103 -765.6206897 [32,] 279.3793103 33.3793103 [33,] -173.6206897 279.3793103 [34,] -437.6206897 -173.6206897 [35,] 803.3793103 -437.6206897 [36,] 802.3793103 803.3793103 [37,] 111.3793103 802.3793103 [38,] 1173.3793103 111.3793103 [39,] -24.6206897 1173.3793103 [40,] 440.3793103 -24.6206897 [41,] 649.3793103 440.3793103 [42,] -309.6206897 649.3793103 [43,] -197.6206897 -309.6206897 [44,] 82.3793103 -197.6206897 [45,] 370.3793103 82.3793103 [46,] -782.6206897 370.3793103 [47,] -303.6206897 -782.6206897 [48,] -192.6206897 -303.6206897 [49,] -709.6206897 -192.6206897 [50,] 187.3793103 -709.6206897 [51,] -723.6206897 187.3793103 [52,] -807.6206897 -723.6206897 [53,] 943.2500000 -807.6206897 [54,] 140.2500000 943.2500000 [55,] 418.2500000 140.2500000 [56,] -350.7500000 418.2500000 [57,] 1366.2500000 -350.7500000 [58,] 87.2500000 1366.2500000 [59,] -329.7500000 87.2500000 [60,] 234.2500000 -329.7500000 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -973.7500000 -806.7500000 2 -257.7500000 -973.7500000 3 4.2500000 -257.7500000 4 -660.7500000 4.2500000 5 -14.7500000 -660.7500000 6 -363.7500000 -14.7500000 7 -448.7500000 -363.7500000 8 -210.7500000 -448.7500000 9 -419.7500000 -210.7500000 10 -916.7500000 -419.7500000 11 247.2500000 -916.7500000 12 654.2500000 247.2500000 13 -251.7500000 654.2500000 14 1090.2500000 -251.7500000 15 -222.7500000 1090.2500000 16 -155.7500000 -222.7500000 17 1400.2500000 -155.7500000 18 -237.7500000 1400.2500000 19 -400.7500000 -237.7500000 20 -21.7500000 -400.7500000 21 474.2500000 -21.7500000 22 -163.7500000 474.2500000 23 148.2500000 -163.7500000 24 -785.6206897 148.2500000 25 -499.6206897 -785.6206897 26 290.3793103 -499.6206897 27 0.3793103 290.3793103 28 826.3793103 0.3793103 29 663.3793103 826.3793103 30 -765.6206897 663.3793103 31 33.3793103 -765.6206897 32 279.3793103 33.3793103 33 -173.6206897 279.3793103 34 -437.6206897 -173.6206897 35 803.3793103 -437.6206897 36 802.3793103 803.3793103 37 111.3793103 802.3793103 38 1173.3793103 111.3793103 39 -24.6206897 1173.3793103 40 440.3793103 -24.6206897 41 649.3793103 440.3793103 42 -309.6206897 649.3793103 43 -197.6206897 -309.6206897 44 82.3793103 -197.6206897 45 370.3793103 82.3793103 46 -782.6206897 370.3793103 47 -303.6206897 -782.6206897 48 -192.6206897 -303.6206897 49 -709.6206897 -192.6206897 50 187.3793103 -709.6206897 51 -723.6206897 187.3793103 52 -807.6206897 -723.6206897 53 943.2500000 -807.6206897 54 140.2500000 943.2500000 55 418.2500000 140.2500000 56 -350.7500000 418.2500000 57 1366.2500000 -350.7500000 58 87.2500000 1366.2500000 59 -329.7500000 87.2500000 60 234.2500000 -329.7500000 > 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/7x33c1258617442.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/8hnir1258617442.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/935kb1258617442.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/104a8q1258617442.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/11h1zn1258617442.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/12onol1258617442.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/137nwx1258617442.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/14ae3w1258617442.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/15a29n1258617442.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/16oqxp1258617442.tab") + } > > system("convert tmp/1y10m1258617442.ps tmp/1y10m1258617442.png") > system("convert tmp/2q0y61258617442.ps tmp/2q0y61258617442.png") > system("convert tmp/3b5u21258617442.ps tmp/3b5u21258617442.png") > system("convert tmp/4t58r1258617442.ps tmp/4t58r1258617442.png") > system("convert tmp/5xfer1258617442.ps tmp/5xfer1258617442.png") > system("convert tmp/6xlzy1258617442.ps tmp/6xlzy1258617442.png") > system("convert tmp/7x33c1258617442.ps tmp/7x33c1258617442.png") > system("convert tmp/8hnir1258617442.ps tmp/8hnir1258617442.png") > system("convert tmp/935kb1258617442.ps tmp/935kb1258617442.png") > system("convert tmp/104a8q1258617442.ps tmp/104a8q1258617442.png") > > > proc.time() user system elapsed 2.444 1.533 3.574