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(8.9,1.4,8.8,1.2,8.3,1,7.5,1.7,7.2,2.4,7.4,2,8.8,2.1,9.3,2,9.3,1.8,8.7,2.7,8.2,2.3,8.3,1.9,8.5,2,8.6,2.3,8.5,2.8,8.2,2.4,8.1,2.3,7.9,2.7,8.6,2.7,8.7,2.9,8.7,3,8.5,2.2,8.4,2.3,8.5,2.8,8.7,2.8,8.7,2.8,8.6,2.2,8.5,2.6,8.3,2.8,8,2.5,8.2,2.4,8.1,2.3,8.1,1.9,8,1.7,7.9,2,7.9,2.1,8,1.7,8,1.8,7.9,1.8,8,1.8,7.7,1.3,7.2,1.3,7.5,1.3,7.3,1.2,7,1.4,7,2.2,7,2.9,7.2,3.1,7.3,3.5,7.1,3.6,6.8,4.4,6.4,4.1,6.1,5.1,6.5,5.8,7.7,5.9,7.9,5.4,7.5,5.5,6.9,4.8,6.6,3.2,6.9,2.7),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 8.9 1.4 2 8.8 1.2 3 8.3 1.0 4 7.5 1.7 5 7.2 2.4 6 7.4 2.0 7 8.8 2.1 8 9.3 2.0 9 9.3 1.8 10 8.7 2.7 11 8.2 2.3 12 8.3 1.9 13 8.5 2.0 14 8.6 2.3 15 8.5 2.8 16 8.2 2.4 17 8.1 2.3 18 7.9 2.7 19 8.6 2.7 20 8.7 2.9 21 8.7 3.0 22 8.5 2.2 23 8.4 2.3 24 8.5 2.8 25 8.7 2.8 26 8.7 2.8 27 8.6 2.2 28 8.5 2.6 29 8.3 2.8 30 8.0 2.5 31 8.2 2.4 32 8.1 2.3 33 8.1 1.9 34 8.0 1.7 35 7.9 2.0 36 7.9 2.1 37 8.0 1.7 38 8.0 1.8 39 7.9 1.8 40 8.0 1.8 41 7.7 1.3 42 7.2 1.3 43 7.5 1.3 44 7.3 1.2 45 7.0 1.4 46 7.0 2.2 47 7.0 2.9 48 7.2 3.1 49 7.3 3.5 50 7.1 3.6 51 6.8 4.4 52 6.4 4.1 53 6.1 5.1 54 6.5 5.8 55 7.7 5.9 56 7.9 5.4 57 7.5 5.5 58 6.9 4.8 59 6.6 3.2 60 6.9 2.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 8.6159 -0.2714 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.23594 -0.56596 0.03971 0.59436 1.22689 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.61588 0.21625 39.842 < 2e-16 *** X -0.27138 0.07566 -3.587 0.000688 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6782 on 58 degrees of freedom Multiple R-squared: 0.1815, Adjusted R-squared: 0.1674 F-statistic: 12.86 on 1 and 58 DF, p-value: 0.0006882 > 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.3843696 0.7687393 0.6156304 [2,] 0.2442667 0.4885333 0.7557333 [3,] 0.5503377 0.8993245 0.4496623 [4,] 0.7928563 0.4142875 0.2071437 [5,] 0.8603273 0.2793455 0.1396727 [6,] 0.8517294 0.2965413 0.1482706 [7,] 0.7869210 0.4261580 0.2130790 [8,] 0.7111681 0.5776638 0.2888319 [9,] 0.6371330 0.7257341 0.3628670 [10,] 0.5808908 0.8382184 0.4191092 [11,] 0.5242787 0.9514427 0.4757213 [12,] 0.4441409 0.8882818 0.5558591 [13,] 0.3704088 0.7408176 0.6295912 [14,] 0.3073341 0.6146681 0.6926659 [15,] 0.2849498 0.5698997 0.7150502 [16,] 0.2890421 0.5780841 0.7109579 [17,] 0.2973898 0.5947797 0.7026102 [18,] 0.2592583 0.5185165 0.7407417 [19,] 0.2205277 0.4410553 0.7794723 [20,] 0.2060250 0.4120500 0.7939750 [21,] 0.2317167 0.4634334 0.7682833 [22,] 0.2738815 0.5477629 0.7261185 [23,] 0.2921901 0.5843802 0.7078099 [24,] 0.3191530 0.6383060 0.6808470 [25,] 0.3324285 0.6648570 0.6675715 [26,] 0.3214435 0.6428870 0.6785565 [27,] 0.3246239 0.6492478 0.6753761 [28,] 0.3229750 0.6459500 0.6770250 [29,] 0.3180423 0.6360846 0.6819577 [30,] 0.3071652 0.6143305 0.6928348 [31,] 0.3020356 0.6040711 0.6979644 [32,] 0.3019366 0.6038732 0.6980634 [33,] 0.3068518 0.6137036 0.6931482 [34,] 0.3287150 0.6574300 0.6712850 [35,] 0.3523391 0.7046781 0.6476609 [36,] 0.4279994 0.8559988 0.5720006 [37,] 0.4549093 0.9098186 0.5450907 [38,] 0.4683009 0.9366017 0.5316991 [39,] 0.4723615 0.9447231 0.5276385 [40,] 0.4660638 0.9321277 0.5339362 [41,] 0.4644949 0.9289898 0.5355051 [42,] 0.4933522 0.9867044 0.5066478 [43,] 0.5313157 0.9373686 0.4686843 [44,] 0.5400269 0.9199461 0.4599731 [45,] 0.5495244 0.9009513 0.4504756 [46,] 0.5238078 0.9523844 0.4761922 [47,] 0.4618510 0.9237019 0.5381490 [48,] 0.4516709 0.9033419 0.5483291 [49,] 0.6716752 0.6566496 0.3283248 [50,] 0.9088520 0.1822960 0.0911480 [51,] 0.8051367 0.3897267 0.1948633 > postscript(file="/var/www/html/rcomp/tmp/16tqi1258481145.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/2qbkk1258481145.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/3duvu1258481145.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/4da2t1258481145.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/5xa8x1258481145.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 0.6640569513 0.5097806246 -0.0444957021 -0.6545285586 -0.7645614152 6 7 8 9 10 -0.6731140686 0.7540240948 1.2268859314 1.1726096047 0.8168530749 11 12 13 14 15 0.2083004215 0.1997477681 0.4268859314 0.6083004215 0.6439912383 16 17 18 19 20 0.2354385848 0.1083004215 0.0168530749 0.7168530749 0.8711294016 21 22 23 24 25 0.8982675650 0.4811622581 0.4083004215 0.6439912383 0.8439912383 26 27 28 29 30 0.8439912383 0.5811622581 0.5897149116 0.4439912383 0.0625767482 31 32 33 34 35 0.2354385848 0.1083004215 -0.0002522319 -0.1545285586 -0.1731140686 36 37 38 39 40 -0.1459759052 -0.1545285586 -0.1273903953 -0.2273903953 -0.1273903953 41 42 43 44 45 -0.5630812120 -1.0630812120 -0.7630812120 -0.9902193754 -1.2359430487 46 47 48 49 50 -1.0188377419 -0.8288705984 -0.5745942717 -0.3660416183 -0.5389034549 51 52 53 54 55 -0.6217981481 -1.1032126381 -1.1318310046 -0.5418638611 0.6852743022 56 57 58 59 60 0.7495834854 0.3767216488 -0.4132454947 -1.1474561083 -0.9831469251 > postscript(file="/var/www/html/rcomp/tmp/6q51s1258481145.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 0.6640569513 NA 1 0.5097806246 0.6640569513 2 -0.0444957021 0.5097806246 3 -0.6545285586 -0.0444957021 4 -0.7645614152 -0.6545285586 5 -0.6731140686 -0.7645614152 6 0.7540240948 -0.6731140686 7 1.2268859314 0.7540240948 8 1.1726096047 1.2268859314 9 0.8168530749 1.1726096047 10 0.2083004215 0.8168530749 11 0.1997477681 0.2083004215 12 0.4268859314 0.1997477681 13 0.6083004215 0.4268859314 14 0.6439912383 0.6083004215 15 0.2354385848 0.6439912383 16 0.1083004215 0.2354385848 17 0.0168530749 0.1083004215 18 0.7168530749 0.0168530749 19 0.8711294016 0.7168530749 20 0.8982675650 0.8711294016 21 0.4811622581 0.8982675650 22 0.4083004215 0.4811622581 23 0.6439912383 0.4083004215 24 0.8439912383 0.6439912383 25 0.8439912383 0.8439912383 26 0.5811622581 0.8439912383 27 0.5897149116 0.5811622581 28 0.4439912383 0.5897149116 29 0.0625767482 0.4439912383 30 0.2354385848 0.0625767482 31 0.1083004215 0.2354385848 32 -0.0002522319 0.1083004215 33 -0.1545285586 -0.0002522319 34 -0.1731140686 -0.1545285586 35 -0.1459759052 -0.1731140686 36 -0.1545285586 -0.1459759052 37 -0.1273903953 -0.1545285586 38 -0.2273903953 -0.1273903953 39 -0.1273903953 -0.2273903953 40 -0.5630812120 -0.1273903953 41 -1.0630812120 -0.5630812120 42 -0.7630812120 -1.0630812120 43 -0.9902193754 -0.7630812120 44 -1.2359430487 -0.9902193754 45 -1.0188377419 -1.2359430487 46 -0.8288705984 -1.0188377419 47 -0.5745942717 -0.8288705984 48 -0.3660416183 -0.5745942717 49 -0.5389034549 -0.3660416183 50 -0.6217981481 -0.5389034549 51 -1.1032126381 -0.6217981481 52 -1.1318310046 -1.1032126381 53 -0.5418638611 -1.1318310046 54 0.6852743022 -0.5418638611 55 0.7495834854 0.6852743022 56 0.3767216488 0.7495834854 57 -0.4132454947 0.3767216488 58 -1.1474561083 -0.4132454947 59 -0.9831469251 -1.1474561083 60 NA -0.9831469251 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.5097806246 0.6640569513 [2,] -0.0444957021 0.5097806246 [3,] -0.6545285586 -0.0444957021 [4,] -0.7645614152 -0.6545285586 [5,] -0.6731140686 -0.7645614152 [6,] 0.7540240948 -0.6731140686 [7,] 1.2268859314 0.7540240948 [8,] 1.1726096047 1.2268859314 [9,] 0.8168530749 1.1726096047 [10,] 0.2083004215 0.8168530749 [11,] 0.1997477681 0.2083004215 [12,] 0.4268859314 0.1997477681 [13,] 0.6083004215 0.4268859314 [14,] 0.6439912383 0.6083004215 [15,] 0.2354385848 0.6439912383 [16,] 0.1083004215 0.2354385848 [17,] 0.0168530749 0.1083004215 [18,] 0.7168530749 0.0168530749 [19,] 0.8711294016 0.7168530749 [20,] 0.8982675650 0.8711294016 [21,] 0.4811622581 0.8982675650 [22,] 0.4083004215 0.4811622581 [23,] 0.6439912383 0.4083004215 [24,] 0.8439912383 0.6439912383 [25,] 0.8439912383 0.8439912383 [26,] 0.5811622581 0.8439912383 [27,] 0.5897149116 0.5811622581 [28,] 0.4439912383 0.5897149116 [29,] 0.0625767482 0.4439912383 [30,] 0.2354385848 0.0625767482 [31,] 0.1083004215 0.2354385848 [32,] -0.0002522319 0.1083004215 [33,] -0.1545285586 -0.0002522319 [34,] -0.1731140686 -0.1545285586 [35,] -0.1459759052 -0.1731140686 [36,] -0.1545285586 -0.1459759052 [37,] -0.1273903953 -0.1545285586 [38,] -0.2273903953 -0.1273903953 [39,] -0.1273903953 -0.2273903953 [40,] -0.5630812120 -0.1273903953 [41,] -1.0630812120 -0.5630812120 [42,] -0.7630812120 -1.0630812120 [43,] -0.9902193754 -0.7630812120 [44,] -1.2359430487 -0.9902193754 [45,] -1.0188377419 -1.2359430487 [46,] -0.8288705984 -1.0188377419 [47,] -0.5745942717 -0.8288705984 [48,] -0.3660416183 -0.5745942717 [49,] -0.5389034549 -0.3660416183 [50,] -0.6217981481 -0.5389034549 [51,] -1.1032126381 -0.6217981481 [52,] -1.1318310046 -1.1032126381 [53,] -0.5418638611 -1.1318310046 [54,] 0.6852743022 -0.5418638611 [55,] 0.7495834854 0.6852743022 [56,] 0.3767216488 0.7495834854 [57,] -0.4132454947 0.3767216488 [58,] -1.1474561083 -0.4132454947 [59,] -0.9831469251 -1.1474561083 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.5097806246 0.6640569513 2 -0.0444957021 0.5097806246 3 -0.6545285586 -0.0444957021 4 -0.7645614152 -0.6545285586 5 -0.6731140686 -0.7645614152 6 0.7540240948 -0.6731140686 7 1.2268859314 0.7540240948 8 1.1726096047 1.2268859314 9 0.8168530749 1.1726096047 10 0.2083004215 0.8168530749 11 0.1997477681 0.2083004215 12 0.4268859314 0.1997477681 13 0.6083004215 0.4268859314 14 0.6439912383 0.6083004215 15 0.2354385848 0.6439912383 16 0.1083004215 0.2354385848 17 0.0168530749 0.1083004215 18 0.7168530749 0.0168530749 19 0.8711294016 0.7168530749 20 0.8982675650 0.8711294016 21 0.4811622581 0.8982675650 22 0.4083004215 0.4811622581 23 0.6439912383 0.4083004215 24 0.8439912383 0.6439912383 25 0.8439912383 0.8439912383 26 0.5811622581 0.8439912383 27 0.5897149116 0.5811622581 28 0.4439912383 0.5897149116 29 0.0625767482 0.4439912383 30 0.2354385848 0.0625767482 31 0.1083004215 0.2354385848 32 -0.0002522319 0.1083004215 33 -0.1545285586 -0.0002522319 34 -0.1731140686 -0.1545285586 35 -0.1459759052 -0.1731140686 36 -0.1545285586 -0.1459759052 37 -0.1273903953 -0.1545285586 38 -0.2273903953 -0.1273903953 39 -0.1273903953 -0.2273903953 40 -0.5630812120 -0.1273903953 41 -1.0630812120 -0.5630812120 42 -0.7630812120 -1.0630812120 43 -0.9902193754 -0.7630812120 44 -1.2359430487 -0.9902193754 45 -1.0188377419 -1.2359430487 46 -0.8288705984 -1.0188377419 47 -0.5745942717 -0.8288705984 48 -0.3660416183 -0.5745942717 49 -0.5389034549 -0.3660416183 50 -0.6217981481 -0.5389034549 51 -1.1032126381 -0.6217981481 52 -1.1318310046 -1.1032126381 53 -0.5418638611 -1.1318310046 54 0.6852743022 -0.5418638611 55 0.7495834854 0.6852743022 56 0.3767216488 0.7495834854 57 -0.4132454947 0.3767216488 58 -1.1474561083 -0.4132454947 59 -0.9831469251 -1.1474561083 > 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/77w1y1258481145.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/8q9z11258481145.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/9g5rr1258481145.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/10gl7x1258481145.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/114ng51258481145.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/12fvhs1258481145.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/13wkrc1258481145.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/1467io1258481145.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/15xjyr1258481145.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/16ivwm1258481145.tab") + } > > system("convert tmp/16tqi1258481145.ps tmp/16tqi1258481145.png") > system("convert tmp/2qbkk1258481145.ps tmp/2qbkk1258481145.png") > system("convert tmp/3duvu1258481145.ps tmp/3duvu1258481145.png") > system("convert tmp/4da2t1258481145.ps tmp/4da2t1258481145.png") > system("convert tmp/5xa8x1258481145.ps tmp/5xa8x1258481145.png") > system("convert tmp/6q51s1258481145.ps tmp/6q51s1258481145.png") > system("convert tmp/77w1y1258481145.ps tmp/77w1y1258481145.png") > system("convert tmp/8q9z11258481145.ps tmp/8q9z11258481145.png") > system("convert tmp/9g5rr1258481145.ps tmp/9g5rr1258481145.png") > system("convert tmp/10gl7x1258481145.ps tmp/10gl7x1258481145.png") > > > proc.time() user system elapsed 2.492 1.596 2.946