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(160.90,334.10,193.70,273.90,201.40,300.20,176.60,300.90,172.00,332.70,200.10,403.60,172.00,341.00,136.10,391.20,182.60,396.60,208.70,434.10,142.30,418.30,188.80,377.20,143.90,424.80,149.70,509.10,196.90,453.70,231.50,435.60,219.20,406.80,220.70,428.30,244.20,418.40,182.50,576.70,229.80,486.80,238.10,423.00,206.50,491.30,249.30,488.80,181.80,522.60,218.00,418.50,246.40,471.30,214.30,424.60,242.30,495.80,220.70,489.50,204.50,460.70,180.70,514.30,233.00,503.20,236.50,561.60,239.40,623.60,208.70,503.10,209.00,674.60,247.20,491.00,284.30,526.30,245.80,501.60,249.10,529.10,251.40,541.90,251.20,671.20,207.20,673.40,228.30,610.30,254.30,625.00,217.90,562.80,244.40,568.50,233.20,691.40,212.60,538.40,239.50,532.10,335.50,595.00,248.80,641.10,264.60,641.90,275.40,658.80,180.70,758.50,256.10,788.80,247.40,946.10,227.80,650.60,248.10,656.70),dim=c(2,60),dimnames=list(c('E','I'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('E','I'),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 E I 1 160.9 334.1 2 193.7 273.9 3 201.4 300.2 4 176.6 300.9 5 172.0 332.7 6 200.1 403.6 7 172.0 341.0 8 136.1 391.2 9 182.6 396.6 10 208.7 434.1 11 142.3 418.3 12 188.8 377.2 13 143.9 424.8 14 149.7 509.1 15 196.9 453.7 16 231.5 435.6 17 219.2 406.8 18 220.7 428.3 19 244.2 418.4 20 182.5 576.7 21 229.8 486.8 22 238.1 423.0 23 206.5 491.3 24 249.3 488.8 25 181.8 522.6 26 218.0 418.5 27 246.4 471.3 28 214.3 424.6 29 242.3 495.8 30 220.7 489.5 31 204.5 460.7 32 180.7 514.3 33 233.0 503.2 34 236.5 561.6 35 239.4 623.6 36 208.7 503.1 37 209.0 674.6 38 247.2 491.0 39 284.3 526.3 40 245.8 501.6 41 249.1 529.1 42 251.4 541.9 43 251.2 671.2 44 207.2 673.4 45 228.3 610.3 46 254.3 625.0 47 217.9 562.8 48 244.4 568.5 49 233.2 691.4 50 212.6 538.4 51 239.5 532.1 52 335.5 595.0 53 248.8 641.1 54 264.6 641.9 55 275.4 658.8 56 180.7 758.5 57 256.1 788.8 58 247.4 946.1 59 227.8 650.6 60 248.1 656.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) I 147.7851 0.1380 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -71.777 -15.112 5.447 18.766 105.590 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 147.78506 17.77438 8.314 1.82e-11 *** I 0.13803 0.03349 4.121 0.000121 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 33.06 on 58 degrees of freedom Multiple R-squared: 0.2265, Adjusted R-squared: 0.2132 F-statistic: 16.98 on 1 and 58 DF, p-value: 0.0001214 > 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.05180064 0.1036013 0.9481994 [2,] 0.11916807 0.2383361 0.8808319 [3,] 0.06472026 0.1294405 0.9352797 [4,] 0.15084237 0.3016847 0.8491576 [5,] 0.10361214 0.2072243 0.8963879 [6,] 0.13175650 0.2635130 0.8682435 [7,] 0.19834144 0.3966829 0.8016586 [8,] 0.14686045 0.2937209 0.8531395 [9,] 0.19867945 0.3973589 0.8013206 [10,] 0.22152360 0.4430472 0.7784764 [11,] 0.25417702 0.5083540 0.7458230 [12,] 0.46890056 0.9378011 0.5310994 [13,] 0.50894762 0.9821048 0.4910524 [14,] 0.53348125 0.9330375 0.4665187 [15,] 0.66550435 0.6689913 0.3344957 [16,] 0.66774019 0.6645196 0.3322598 [17,] 0.67410265 0.6517947 0.3258973 [18,] 0.70643225 0.5871355 0.2935678 [19,] 0.65992783 0.6801443 0.3400722 [20,] 0.70156850 0.5968630 0.2984315 [21,] 0.73455333 0.5308933 0.2654467 [22,] 0.69630868 0.6073826 0.3036913 [23,] 0.70901790 0.5819642 0.2909821 [24,] 0.66339383 0.6732123 0.3366062 [25,] 0.63936079 0.7212784 0.3606392 [26,] 0.58116994 0.8376601 0.4188301 [27,] 0.54963332 0.9007334 0.4503667 [28,] 0.66201595 0.6759681 0.3379840 [29,] 0.61648101 0.7670380 0.3835190 [30,] 0.55617754 0.8876449 0.4438225 [31,] 0.48357952 0.9671590 0.5164205 [32,] 0.48144226 0.9628845 0.5185577 [33,] 0.48103679 0.9620736 0.5189632 [34,] 0.44959176 0.8991835 0.5504082 [35,] 0.57141979 0.8571604 0.4285802 [36,] 0.51608599 0.9678280 0.4839140 [37,] 0.45552703 0.9110541 0.5444730 [38,] 0.39403893 0.7880779 0.6059611 [39,] 0.31910755 0.6382151 0.6808924 [40,] 0.33331647 0.6666329 0.6666835 [41,] 0.27192762 0.5438552 0.7280724 [42,] 0.21090534 0.4218107 0.7890947 [43,] 0.18692706 0.3738541 0.8130729 [44,] 0.13501721 0.2700344 0.8649828 [45,] 0.09499257 0.1899851 0.9050074 [46,] 0.11387767 0.2277553 0.8861223 [47,] 0.10179051 0.2035810 0.8982095 [48,] 0.51635355 0.9672929 0.4836464 [49,] 0.38465970 0.7693194 0.6153403 [50,] 0.29702860 0.5940572 0.7029714 [51,] 0.33230355 0.6646071 0.6676965 > postscript(file="/var/www/html/rcomp/tmp/1weck1258748305.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/20wvx1258748305.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/3en6l1258748305.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/46kzq1258748305.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/580a91258748305.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 -32.9992725 8.1098438 12.1797813 -12.7168363 -21.7060372 -3.3920229 7 8 9 10 11 12 -22.8516463 -65.6805106 -19.9258466 0.9982089 -63.2209932 -11.0481580 13 14 15 16 17 18 -62.5181569 -68.3536801 -13.5070848 23.5911711 15.2662965 13.7987550 19 20 21 22 23 24 38.6652043 -44.8841827 14.8242815 31.9302884 -9.0968318 34.0482312 25 26 27 28 29 30 -38.1170201 12.4514018 33.5636719 7.9094481 26.0820549 5.3516135 31 32 33 34 35 36 -6.8732611 -38.0714111 15.7606685 11.1999976 5.5424360 -8.5255290 37 38 39 40 41 42 -31.8968485 31.6445758 63.8722867 28.7815088 28.2858162 28.8190938 43 44 45 46 47 48 10.7724371 -33.5312183 -3.7218290 20.2492008 -7.5656326 18.1476238 49 50 51 52 53 54 -10.0156716 -9.4978181 18.2717406 105.5899564 12.5269953 28.2165751 55 56 57 58 59 60 36.6839495 -71.7771616 -0.5593248 -30.9706866 -9.7842440 9.6738024 > postscript(file="/var/www/html/rcomp/tmp/68xhs1258748305.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 -32.9992725 NA 1 8.1098438 -32.9992725 2 12.1797813 8.1098438 3 -12.7168363 12.1797813 4 -21.7060372 -12.7168363 5 -3.3920229 -21.7060372 6 -22.8516463 -3.3920229 7 -65.6805106 -22.8516463 8 -19.9258466 -65.6805106 9 0.9982089 -19.9258466 10 -63.2209932 0.9982089 11 -11.0481580 -63.2209932 12 -62.5181569 -11.0481580 13 -68.3536801 -62.5181569 14 -13.5070848 -68.3536801 15 23.5911711 -13.5070848 16 15.2662965 23.5911711 17 13.7987550 15.2662965 18 38.6652043 13.7987550 19 -44.8841827 38.6652043 20 14.8242815 -44.8841827 21 31.9302884 14.8242815 22 -9.0968318 31.9302884 23 34.0482312 -9.0968318 24 -38.1170201 34.0482312 25 12.4514018 -38.1170201 26 33.5636719 12.4514018 27 7.9094481 33.5636719 28 26.0820549 7.9094481 29 5.3516135 26.0820549 30 -6.8732611 5.3516135 31 -38.0714111 -6.8732611 32 15.7606685 -38.0714111 33 11.1999976 15.7606685 34 5.5424360 11.1999976 35 -8.5255290 5.5424360 36 -31.8968485 -8.5255290 37 31.6445758 -31.8968485 38 63.8722867 31.6445758 39 28.7815088 63.8722867 40 28.2858162 28.7815088 41 28.8190938 28.2858162 42 10.7724371 28.8190938 43 -33.5312183 10.7724371 44 -3.7218290 -33.5312183 45 20.2492008 -3.7218290 46 -7.5656326 20.2492008 47 18.1476238 -7.5656326 48 -10.0156716 18.1476238 49 -9.4978181 -10.0156716 50 18.2717406 -9.4978181 51 105.5899564 18.2717406 52 12.5269953 105.5899564 53 28.2165751 12.5269953 54 36.6839495 28.2165751 55 -71.7771616 36.6839495 56 -0.5593248 -71.7771616 57 -30.9706866 -0.5593248 58 -9.7842440 -30.9706866 59 9.6738024 -9.7842440 60 NA 9.6738024 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 8.1098438 -32.9992725 [2,] 12.1797813 8.1098438 [3,] -12.7168363 12.1797813 [4,] -21.7060372 -12.7168363 [5,] -3.3920229 -21.7060372 [6,] -22.8516463 -3.3920229 [7,] -65.6805106 -22.8516463 [8,] -19.9258466 -65.6805106 [9,] 0.9982089 -19.9258466 [10,] -63.2209932 0.9982089 [11,] -11.0481580 -63.2209932 [12,] -62.5181569 -11.0481580 [13,] -68.3536801 -62.5181569 [14,] -13.5070848 -68.3536801 [15,] 23.5911711 -13.5070848 [16,] 15.2662965 23.5911711 [17,] 13.7987550 15.2662965 [18,] 38.6652043 13.7987550 [19,] -44.8841827 38.6652043 [20,] 14.8242815 -44.8841827 [21,] 31.9302884 14.8242815 [22,] -9.0968318 31.9302884 [23,] 34.0482312 -9.0968318 [24,] -38.1170201 34.0482312 [25,] 12.4514018 -38.1170201 [26,] 33.5636719 12.4514018 [27,] 7.9094481 33.5636719 [28,] 26.0820549 7.9094481 [29,] 5.3516135 26.0820549 [30,] -6.8732611 5.3516135 [31,] -38.0714111 -6.8732611 [32,] 15.7606685 -38.0714111 [33,] 11.1999976 15.7606685 [34,] 5.5424360 11.1999976 [35,] -8.5255290 5.5424360 [36,] -31.8968485 -8.5255290 [37,] 31.6445758 -31.8968485 [38,] 63.8722867 31.6445758 [39,] 28.7815088 63.8722867 [40,] 28.2858162 28.7815088 [41,] 28.8190938 28.2858162 [42,] 10.7724371 28.8190938 [43,] -33.5312183 10.7724371 [44,] -3.7218290 -33.5312183 [45,] 20.2492008 -3.7218290 [46,] -7.5656326 20.2492008 [47,] 18.1476238 -7.5656326 [48,] -10.0156716 18.1476238 [49,] -9.4978181 -10.0156716 [50,] 18.2717406 -9.4978181 [51,] 105.5899564 18.2717406 [52,] 12.5269953 105.5899564 [53,] 28.2165751 12.5269953 [54,] 36.6839495 28.2165751 [55,] -71.7771616 36.6839495 [56,] -0.5593248 -71.7771616 [57,] -30.9706866 -0.5593248 [58,] -9.7842440 -30.9706866 [59,] 9.6738024 -9.7842440 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 8.1098438 -32.9992725 2 12.1797813 8.1098438 3 -12.7168363 12.1797813 4 -21.7060372 -12.7168363 5 -3.3920229 -21.7060372 6 -22.8516463 -3.3920229 7 -65.6805106 -22.8516463 8 -19.9258466 -65.6805106 9 0.9982089 -19.9258466 10 -63.2209932 0.9982089 11 -11.0481580 -63.2209932 12 -62.5181569 -11.0481580 13 -68.3536801 -62.5181569 14 -13.5070848 -68.3536801 15 23.5911711 -13.5070848 16 15.2662965 23.5911711 17 13.7987550 15.2662965 18 38.6652043 13.7987550 19 -44.8841827 38.6652043 20 14.8242815 -44.8841827 21 31.9302884 14.8242815 22 -9.0968318 31.9302884 23 34.0482312 -9.0968318 24 -38.1170201 34.0482312 25 12.4514018 -38.1170201 26 33.5636719 12.4514018 27 7.9094481 33.5636719 28 26.0820549 7.9094481 29 5.3516135 26.0820549 30 -6.8732611 5.3516135 31 -38.0714111 -6.8732611 32 15.7606685 -38.0714111 33 11.1999976 15.7606685 34 5.5424360 11.1999976 35 -8.5255290 5.5424360 36 -31.8968485 -8.5255290 37 31.6445758 -31.8968485 38 63.8722867 31.6445758 39 28.7815088 63.8722867 40 28.2858162 28.7815088 41 28.8190938 28.2858162 42 10.7724371 28.8190938 43 -33.5312183 10.7724371 44 -3.7218290 -33.5312183 45 20.2492008 -3.7218290 46 -7.5656326 20.2492008 47 18.1476238 -7.5656326 48 -10.0156716 18.1476238 49 -9.4978181 -10.0156716 50 18.2717406 -9.4978181 51 105.5899564 18.2717406 52 12.5269953 105.5899564 53 28.2165751 12.5269953 54 36.6839495 28.2165751 55 -71.7771616 36.6839495 56 -0.5593248 -71.7771616 57 -30.9706866 -0.5593248 58 -9.7842440 -30.9706866 59 9.6738024 -9.7842440 > 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/704ig1258748305.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/85h901258748305.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/96ykv1258748305.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/10ww7t1258748305.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/112tz01258748305.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/12xoq21258748305.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/13r24c1258748305.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/14a9ap1258748305.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/15x7k51258748305.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/16ad051258748305.tab") + } > > system("convert tmp/1weck1258748305.ps tmp/1weck1258748305.png") > system("convert tmp/20wvx1258748305.ps tmp/20wvx1258748305.png") > system("convert tmp/3en6l1258748305.ps tmp/3en6l1258748305.png") > system("convert tmp/46kzq1258748305.ps tmp/46kzq1258748305.png") > system("convert tmp/580a91258748305.ps tmp/580a91258748305.png") > system("convert tmp/68xhs1258748305.ps tmp/68xhs1258748305.png") > system("convert tmp/704ig1258748305.ps tmp/704ig1258748305.png") > system("convert tmp/85h901258748305.ps tmp/85h901258748305.png") > system("convert tmp/96ykv1258748305.ps tmp/96ykv1258748305.png") > system("convert tmp/10ww7t1258748305.ps tmp/10ww7t1258748305.png") > > > proc.time() user system elapsed 2.417 1.487 3.678