R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,5 + ,4 + ,4 + ,4 + ,5 + ,5 + ,5 + ,4 + ,5 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,3 + ,3 + ,2 + ,3 + ,4 + ,2 + ,2 + ,4 + ,3 + ,4 + ,2 + ,3 + ,4 + ,5 + ,4 + ,5 + ,4 + ,5 + ,4 + ,3 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,4 + ,2 + ,2 + ,4 + ,2 + ,4 + ,2 + ,4 + ,4 + ,4 + ,4 + ,5 + ,3 + ,4 + ,2 + ,4 + ,4 + ,4 + ,2 + ,2 + ,3 + ,4 + ,4 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,2 + ,2 + ,3 + ,2 + ,4 + ,3 + ,4 + ,3 + ,5 + ,5 + ,5 + ,4 + ,5 + ,4 + ,5 + ,5 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,5 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,5 + ,3 + ,4 + ,4 + ,2 + ,2 + ,4 + ,2 + ,3 + ,2 + ,2 + ,3 + ,4 + ,3 + ,4 + ,4 + ,4 + ,2 + ,4 +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,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,4 + ,2 + ,5 + ,5 + ,5 + ,5 + ,5 + ,5 + ,5 + ,5) + ,dim=c(8 + ,152) + ,dimnames=list(c('A' + ,'B' + ,'C' + ,'D' + ,'E' + ,'F' + ,'G' + ,'H') + ,1:152)) > y <- array(NA,dim=c(8,152),dimnames=list(c('A','B','C','D','E','F','G','H'),1:152)) > 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 > 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 B A C D E F G H 1 4 4 4 4 4 4 4 4 2 3 4 4 4 5 4 4 4 3 5 5 5 4 5 4 4 4 4 4 3 4 3 3 2 3 4 5 2 2 4 3 4 2 3 4 6 4 5 5 4 5 4 3 4 7 3 4 4 4 4 3 3 4 8 2 2 4 2 4 2 4 4 9 4 4 5 3 4 2 4 4 10 2 4 2 3 4 4 3 2 11 4 4 4 4 4 3 4 4 12 2 2 3 2 4 3 4 3 13 5 5 5 4 5 4 5 5 14 3 3 4 4 4 3 3 4 15 4 4 4 4 4 4 4 3 16 4 4 5 4 4 4 4 4 17 3 3 3 3 3 3 3 4 18 4 4 4 4 5 3 4 4 19 2 2 4 2 3 2 2 3 20 3 4 4 4 4 2 4 4 21 4 3 4 3 4 3 4 4 22 2 3 3 4 4 4 4 4 23 4 4 4 4 4 4 4 4 24 4 4 4 4 4 4 4 4 25 4 4 4 4 4 4 4 4 26 3 4 4 3 5 3 4 4 27 4 5 4 4 5 4 4 4 28 4 2 4 3 4 3 4 4 29 4 4 4 4 4 4 4 4 30 4 4 3 4 4 4 3 4 31 4 4 4 5 2 4 4 4 32 4 2 4 4 3 3 4 4 33 4 4 3 4 2 4 4 4 34 5 4 4 4 4 4 4 4 35 4 4 4 4 4 4 4 4 36 4 4 4 4 3 4 4 5 37 5 3 4 3 3 3 4 4 38 4 4 4 4 4 4 4 4 39 4 3 4 4 4 3 4 4 40 4 3 4 4 3 4 2 3 41 3 3 3 4 4 4 4 4 42 4 3 4 4 4 4 4 2 43 3 2 2 4 2 3 2 2 44 5 2 2 4 2 2 3 4 45 5 4 4 4 2 4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 2 4 4 103 5 4 4 4 3 4 4 4 104 5 3 4 5 4 4 4 5 105 4 3 5 5 5 3 4 5 106 5 4 5 4 4 4 5 5 107 4 3 4 4 3 4 4 4 108 4 4 3 4 4 4 4 4 109 4 3 4 4 3 4 4 3 110 4 3 4 4 3 4 4 2 111 2 3 3 4 3 4 3 2 112 4 2 2 4 2 2 4 4 113 5 2 5 5 4 4 4 2 114 4 1 3 4 3 3 4 3 115 4 2 4 4 3 3 4 4 116 4 3 3 3 3 4 3 4 117 4 3 3 4 3 3 4 4 118 4 3 5 4 4 4 4 4 119 3 3 4 4 4 3 2 3 120 4 2 3 4 4 3 4 4 121 4 4 4 5 5 4 3 3 122 3 2 4 4 3 3 4 4 123 4 3 4 4 3 4 3 4 124 5 3 4 4 2 3 4 4 125 5 4 4 4 4 4 4 2 126 3 3 4 4 3 2 4 5 127 5 3 4 4 3 3 4 5 128 4 3 4 4 3 4 4 3 129 4 4 2 3 2 3 4 3 130 3 4 5 4 4 4 4 3 131 3 3 4 4 4 3 3 4 132 4 4 4 4 4 4 3 3 133 5 5 4 5 5 1 4 2 134 2 2 1 4 2 2 4 5 135 4 4 4 4 3 4 4 4 136 4 4 4 4 4 4 4 2 137 4 3 4 3 4 3 4 4 138 5 3 4 4 4 4 4 3 139 4 4 2 4 4 4 2 2 140 4 3 4 4 4 2 4 3 141 4 2 4 4 4 4 4 3 142 4 4 3 4 3 4 3 4 143 4 4 4 4 4 4 4 4 144 4 4 4 4 3 4 4 4 145 5 3 4 4 4 4 4 2 146 3 4 3 3 2 2 4 5 147 4 4 4 4 4 4 4 4 148 4 4 2 5 4 3 3 4 149 4 4 4 4 4 4 4 3 150 4 3 4 4 3 3 4 3 151 4 3 4 4 3 4 2 5 152 5 5 5 5 5 5 5 4 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) A C D E F 1.028308 0.084248 0.207214 0.386522 -0.134026 0.004101 G H 0.279830 -0.068410 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.77476 -0.25282 -0.02765 0.39878 1.53668 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.028308 0.478598 2.149 0.033340 * A 0.084248 0.064963 1.297 0.196758 C 0.207214 0.074490 2.782 0.006131 ** D 0.386522 0.090406 4.275 3.45e-05 *** E -0.134026 0.071517 -1.874 0.062949 . F 0.004101 0.078835 0.052 0.958585 G 0.279830 0.079493 3.520 0.000578 *** H -0.068410 0.062201 -1.100 0.273251 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6049 on 144 degrees of freedom Multiple R-squared: 0.3262, Adjusted R-squared: 0.2934 F-statistic: 9.958 on 7 and 144 DF, p-value: 4.146e-10 > 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.4438859 0.88777170 0.55611415 [2,] 0.2945417 0.58908338 0.70545831 [3,] 0.2236507 0.44730141 0.77634929 [4,] 0.1359278 0.27185560 0.86407220 [5,] 0.1016495 0.20329909 0.89835046 [6,] 0.2061075 0.41221510 0.79389245 [7,] 0.1371488 0.27429759 0.86285120 [8,] 0.1820075 0.36401499 0.81799251 [9,] 0.1431359 0.28627172 0.85686414 [10,] 0.2806062 0.56121244 0.71939378 [11,] 0.3552123 0.71042466 0.64478767 [12,] 0.5134873 0.97302544 0.48651272 [13,] 0.4365143 0.87302857 0.56348571 [14,] 0.3628665 0.72573308 0.63713346 [15,] 0.2949515 0.58990297 0.70504851 [16,] 0.2705565 0.54111295 0.72944353 [17,] 0.2144614 0.42892288 0.78553856 [18,] 0.4790368 0.95807365 0.52096317 [19,] 0.4118443 0.82368859 0.58815570 [20,] 0.5163266 0.96734673 0.48367336 [21,] 0.5505074 0.89898518 0.44949259 [22,] 0.5860768 0.82784645 0.41392323 [23,] 0.5244051 0.95118986 0.47559493 [24,] 0.6464588 0.70708250 0.35354125 [25,] 0.5890093 0.82198137 0.41099068 [26,] 0.5732827 0.85343453 0.42671727 [27,] 0.7519538 0.49609247 0.24804623 [28,] 0.7044260 0.59114801 0.29557401 [29,] 0.6900988 0.61980248 0.30990124 [30,] 0.6857286 0.62854287 0.31427143 [31,] 0.6702079 0.65958421 0.32979211 [32,] 0.6323805 0.73523902 0.36761951 [33,] 0.6587227 0.68255452 0.34127726 [34,] 0.9611307 0.07773860 0.03886930 [35,] 0.9596918 0.08061634 0.04030817 [36,] 0.9594748 0.08105033 0.04052517 [37,] 0.9513620 0.09727596 0.04863798 [38,] 0.9416177 0.11676460 0.05838230 [39,] 0.9267045 0.14659092 0.07329546 [40,] 0.9080407 0.18391869 0.09195934 [41,] 0.8922948 0.21541042 0.10770521 [42,] 0.8999873 0.20002547 0.10001274 [43,] 0.8818580 0.23628400 0.11814200 [44,] 0.8605314 0.27893720 0.13946860 [45,] 0.8955531 0.20889374 0.10444687 [46,] 0.8841944 0.23161124 0.11580562 [47,] 0.9317582 0.13648351 0.06824175 [48,] 0.9167125 0.16657501 0.08328751 [49,] 0.9052351 0.18952972 0.09476486 [50,] 0.8826816 0.23463679 0.11731840 [51,] 0.8593821 0.28123581 0.14061791 [52,] 0.8548086 0.29038276 0.14519138 [53,] 0.8252048 0.34959030 0.17479515 [54,] 0.8198648 0.36027040 0.18013520 [55,] 0.7923833 0.41523345 0.20761672 [56,] 0.7557648 0.48847040 0.24423520 [57,] 0.7226123 0.55477534 0.27738767 [58,] 0.6985503 0.60289933 0.30144966 [59,] 0.6988284 0.60234313 0.30117157 [60,] 0.6578746 0.68425082 0.34212541 [61,] 0.6292056 0.74158887 0.37079443 [62,] 0.7380545 0.52389103 0.26194551 [63,] 0.7818471 0.43630587 0.21815294 [64,] 0.7849720 0.43005591 0.21502796 [65,] 0.7519652 0.49606968 0.24803484 [66,] 0.7130044 0.57399121 0.28699561 [67,] 0.7014702 0.59705957 0.29852978 [68,] 0.7023858 0.59522849 0.29761425 [69,] 0.6759794 0.64804124 0.32402062 [70,] 0.6956363 0.60872745 0.30436372 [71,] 0.6649781 0.67004381 0.33502191 [72,] 0.6213663 0.75726748 0.37863374 [73,] 0.5887261 0.82254776 0.41127388 [74,] 0.5405781 0.91884371 0.45942186 [75,] 0.4923585 0.98471698 0.50764151 [76,] 0.4550755 0.91015109 0.54492446 [77,] 0.5156865 0.96862698 0.48431349 [78,] 0.4807633 0.96152658 0.51923671 [79,] 0.4448941 0.88978827 0.55510586 [80,] 0.4021237 0.80424746 0.59787627 [81,] 0.3643029 0.72860582 0.63569709 [82,] 0.4400528 0.88010562 0.55994719 [83,] 0.3947441 0.78948813 0.60525593 [84,] 0.3628607 0.72572131 0.63713935 [85,] 0.3209934 0.64198684 0.67900658 [86,] 0.3357344 0.67146884 0.66426558 [87,] 0.3052794 0.61055877 0.69472061 [88,] 0.2990063 0.59801264 0.70099368 [89,] 0.3191537 0.63830745 0.68084628 [90,] 0.3378752 0.67575033 0.66212483 [91,] 0.2925503 0.58510059 0.70744970 [92,] 0.2661720 0.53234400 0.73382800 [93,] 0.2924897 0.58497949 0.70751025 [94,] 0.3051690 0.61033805 0.69483098 [95,] 0.2732462 0.54649234 0.72675383 [96,] 0.2538782 0.50775634 0.74612183 [97,] 0.2133496 0.42669916 0.78665042 [98,] 0.1772101 0.35442024 0.82278988 [99,] 0.1456832 0.29136637 0.85431681 [100,] 0.1205839 0.24116785 0.87941607 [101,] 0.5282290 0.94354193 0.47177096 [102,] 0.4938392 0.98767841 0.50616079 [103,] 0.4525185 0.90503695 0.54748153 [104,] 0.4014295 0.80285890 0.59857055 [105,] 0.3529744 0.70594882 0.64702559 [106,] 0.3534854 0.70697077 0.64651462 [107,] 0.3054714 0.61094271 0.69452865 [108,] 0.2560082 0.51201641 0.74399179 [109,] 0.2585055 0.51701099 0.74149450 [110,] 0.2451950 0.49039000 0.75480500 [111,] 0.2154226 0.43084511 0.78457745 [112,] 0.2580644 0.51612888 0.74193556 [113,] 0.2086843 0.41736869 0.79131566 [114,] 0.2914104 0.58282074 0.70858963 [115,] 0.2844669 0.56893374 0.71553313 [116,] 0.2953656 0.59073111 0.70463444 [117,] 0.5842299 0.83154029 0.41577015 [118,] 0.5093767 0.98124654 0.49062327 [119,] 0.5021888 0.99562238 0.49781119 [120,] 0.8905896 0.21882072 0.10941036 [121,] 0.9748859 0.05022811 0.02511405 [122,] 0.9760961 0.04780782 0.02390391 [123,] 0.9611109 0.07777829 0.03888915 [124,] 0.9742327 0.05153464 0.02576732 [125,] 0.9520227 0.09595467 0.04797733 [126,] 0.9455541 0.10889187 0.05444594 [127,] 0.9209129 0.15817420 0.07908710 [128,] 0.9730349 0.05393022 0.02696511 [129,] 0.9512107 0.09757853 0.04878926 [130,] 0.8884867 0.22302650 0.11151325 [131,] 0.8573048 0.28539043 0.14269522 > postscript(file="/var/www/rcomp/tmp/1h7841290269273.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/rcomp/tmp/2h7841290269273.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/rcomp/tmp/3agpp1290269273.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/rcomp/tmp/4agpp1290269273.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/rcomp/tmp/5agpp1290269273.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 = 152 Frequency = 1 1 2 3 4 5 6 -0.066220959 -0.932194653 0.776344169 0.558554218 -1.223171974 0.056174016 7 8 9 10 11 12 -0.782290101 -1.116479711 0.121289498 -1.122260925 -0.062119948 -0.981776684 13 14 15 16 17 18 0.564923958 -0.698042597 -0.134630596 -0.273434634 -0.238333118 0.071906358 19 20 21 22 23 24 -0.759255959 -1.058018937 0.408649665 -1.774759780 -0.066220959 -0.066220959 25 26 27 28 29 30 -0.066220959 -0.541571532 -0.016442156 0.492897168 -0.066220959 0.420822564 31 32 33 34 35 36 -0.720795680 -0.027651247 -0.127059895 0.933779041 -0.066220959 -0.131837627 37 38 39 40 41 42 1.274623359 -0.066220959 0.022127555 0.375250296 -0.774759780 -0.118792729 43 44 45 46 47 48 -0.324409782 1.536680656 0.665726430 0.730343379 0.446735519 -0.200247264 49 50 51 52 53 54 -0.295308196 0.002188678 -0.521152705 0.092521957 0.194723573 -0.200247264 55 56 57 58 59 60 0.670525400 0.172668449 1.057229071 -0.200247264 -0.334273570 0.068086406 61 62 63 64 65 66 -0.252819035 0.650332041 0.002188678 -0.552300673 -0.238529890 -0.028135105 67 68 69 70 71 72 -0.318435704 0.413427398 -0.613223897 0.038506989 0.249956830 -1.187590508 73 74 75 76 77 78 0.882127172 0.615666569 -0.216085131 0.060213409 -0.406686943 -0.503485679 79 80 81 82 83 84 -0.486684004 -0.720598908 0.397589531 0.022127555 -0.352657699 -0.038711381 85 86 87 88 89 90 0.015273957 0.272688675 0.899838105 -0.375214009 0.375039248 -0.050383092 91 92 93 94 95 96 0.252178600 0.976449764 -0.061443226 0.306735135 -0.031119443 0.811445684 97 98 99 100 101 102 0.068482069 0.700787565 0.696619917 0.796959767 0.095314925 0.256850809 103 104 105 106 107 108 0.799752736 0.699914072 -0.369172287 0.515145156 -0.115999761 0.140992717 109 110 111 112 113 114 -0.184409398 -0.252819035 -1.765775512 0.256850809 0.371718989 0.195400294 115 116 117 118 119 120 -0.027651247 0.757565871 0.095314925 -0.189187131 -0.486622387 0.313588734 121 122 123 124 125 126 -0.107296552 -1.027651247 0.163830086 0.754074944 0.796959767 -1.039388102 127 128 129 130 131 132 0.956510887 -0.184409398 0.402367264 -1.341844271 -0.698042597 0.145199252 133 134 135 136 137 138 0.472519493 -1.467525879 -0.200247264 -0.203040233 0.408649665 0.949616908 139 140 141 142 143 144 0.771046812 -0.042181071 0.033864411 0.286796258 -0.066220959 -0.200247264 145 146 147 148 149 150 0.881207271 -0.663926126 -0.066220959 0.245615140 -0.134630596 -0.180308387 151 152 0.512069570 0.105891201 > postscript(file="/var/www/rcomp/tmp/6l7pa1290269273.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 = 152 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.066220959 NA 1 -0.932194653 -0.066220959 2 0.776344169 -0.932194653 3 0.558554218 0.776344169 4 -1.223171974 0.558554218 5 0.056174016 -1.223171974 6 -0.782290101 0.056174016 7 -1.116479711 -0.782290101 8 0.121289498 -1.116479711 9 -1.122260925 0.121289498 10 -0.062119948 -1.122260925 11 -0.981776684 -0.062119948 12 0.564923958 -0.981776684 13 -0.698042597 0.564923958 14 -0.134630596 -0.698042597 15 -0.273434634 -0.134630596 16 -0.238333118 -0.273434634 17 0.071906358 -0.238333118 18 -0.759255959 0.071906358 19 -1.058018937 -0.759255959 20 0.408649665 -1.058018937 21 -1.774759780 0.408649665 22 -0.066220959 -1.774759780 23 -0.066220959 -0.066220959 24 -0.066220959 -0.066220959 25 -0.541571532 -0.066220959 26 -0.016442156 -0.541571532 27 0.492897168 -0.016442156 28 -0.066220959 0.492897168 29 0.420822564 -0.066220959 30 -0.720795680 0.420822564 31 -0.027651247 -0.720795680 32 -0.127059895 -0.027651247 33 0.933779041 -0.127059895 34 -0.066220959 0.933779041 35 -0.131837627 -0.066220959 36 1.274623359 -0.131837627 37 -0.066220959 1.274623359 38 0.022127555 -0.066220959 39 0.375250296 0.022127555 40 -0.774759780 0.375250296 41 -0.118792729 -0.774759780 42 -0.324409782 -0.118792729 43 1.536680656 -0.324409782 44 0.665726430 1.536680656 45 0.730343379 0.665726430 46 0.446735519 0.730343379 47 -0.200247264 0.446735519 48 -0.295308196 -0.200247264 49 0.002188678 -0.295308196 50 -0.521152705 0.002188678 51 0.092521957 -0.521152705 52 0.194723573 0.092521957 53 -0.200247264 0.194723573 54 0.670525400 -0.200247264 55 0.172668449 0.670525400 56 1.057229071 0.172668449 57 -0.200247264 1.057229071 58 -0.334273570 -0.200247264 59 0.068086406 -0.334273570 60 -0.252819035 0.068086406 61 0.650332041 -0.252819035 62 0.002188678 0.650332041 63 -0.552300673 0.002188678 64 -0.238529890 -0.552300673 65 -0.028135105 -0.238529890 66 -0.318435704 -0.028135105 67 0.413427398 -0.318435704 68 -0.613223897 0.413427398 69 0.038506989 -0.613223897 70 0.249956830 0.038506989 71 -1.187590508 0.249956830 72 0.882127172 -1.187590508 73 0.615666569 0.882127172 74 -0.216085131 0.615666569 75 0.060213409 -0.216085131 76 -0.406686943 0.060213409 77 -0.503485679 -0.406686943 78 -0.486684004 -0.503485679 79 -0.720598908 -0.486684004 80 0.397589531 -0.720598908 81 0.022127555 0.397589531 82 -0.352657699 0.022127555 83 -0.038711381 -0.352657699 84 0.015273957 -0.038711381 85 0.272688675 0.015273957 86 0.899838105 0.272688675 87 -0.375214009 0.899838105 88 0.375039248 -0.375214009 89 -0.050383092 0.375039248 90 0.252178600 -0.050383092 91 0.976449764 0.252178600 92 -0.061443226 0.976449764 93 0.306735135 -0.061443226 94 -0.031119443 0.306735135 95 0.811445684 -0.031119443 96 0.068482069 0.811445684 97 0.700787565 0.068482069 98 0.696619917 0.700787565 99 0.796959767 0.696619917 100 0.095314925 0.796959767 101 0.256850809 0.095314925 102 0.799752736 0.256850809 103 0.699914072 0.799752736 104 -0.369172287 0.699914072 105 0.515145156 -0.369172287 106 -0.115999761 0.515145156 107 0.140992717 -0.115999761 108 -0.184409398 0.140992717 109 -0.252819035 -0.184409398 110 -1.765775512 -0.252819035 111 0.256850809 -1.765775512 112 0.371718989 0.256850809 113 0.195400294 0.371718989 114 -0.027651247 0.195400294 115 0.757565871 -0.027651247 116 0.095314925 0.757565871 117 -0.189187131 0.095314925 118 -0.486622387 -0.189187131 119 0.313588734 -0.486622387 120 -0.107296552 0.313588734 121 -1.027651247 -0.107296552 122 0.163830086 -1.027651247 123 0.754074944 0.163830086 124 0.796959767 0.754074944 125 -1.039388102 0.796959767 126 0.956510887 -1.039388102 127 -0.184409398 0.956510887 128 0.402367264 -0.184409398 129 -1.341844271 0.402367264 130 -0.698042597 -1.341844271 131 0.145199252 -0.698042597 132 0.472519493 0.145199252 133 -1.467525879 0.472519493 134 -0.200247264 -1.467525879 135 -0.203040233 -0.200247264 136 0.408649665 -0.203040233 137 0.949616908 0.408649665 138 0.771046812 0.949616908 139 -0.042181071 0.771046812 140 0.033864411 -0.042181071 141 0.286796258 0.033864411 142 -0.066220959 0.286796258 143 -0.200247264 -0.066220959 144 0.881207271 -0.200247264 145 -0.663926126 0.881207271 146 -0.066220959 -0.663926126 147 0.245615140 -0.066220959 148 -0.134630596 0.245615140 149 -0.180308387 -0.134630596 150 0.512069570 -0.180308387 151 0.105891201 0.512069570 152 NA 0.105891201 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.932194653 -0.066220959 [2,] 0.776344169 -0.932194653 [3,] 0.558554218 0.776344169 [4,] -1.223171974 0.558554218 [5,] 0.056174016 -1.223171974 [6,] -0.782290101 0.056174016 [7,] -1.116479711 -0.782290101 [8,] 0.121289498 -1.116479711 [9,] -1.122260925 0.121289498 [10,] -0.062119948 -1.122260925 [11,] -0.981776684 -0.062119948 [12,] 0.564923958 -0.981776684 [13,] -0.698042597 0.564923958 [14,] -0.134630596 -0.698042597 [15,] -0.273434634 -0.134630596 [16,] -0.238333118 -0.273434634 [17,] 0.071906358 -0.238333118 [18,] -0.759255959 0.071906358 [19,] -1.058018937 -0.759255959 [20,] 0.408649665 -1.058018937 [21,] -1.774759780 0.408649665 [22,] -0.066220959 -1.774759780 [23,] -0.066220959 -0.066220959 [24,] -0.066220959 -0.066220959 [25,] -0.541571532 -0.066220959 [26,] -0.016442156 -0.541571532 [27,] 0.492897168 -0.016442156 [28,] -0.066220959 0.492897168 [29,] 0.420822564 -0.066220959 [30,] -0.720795680 0.420822564 [31,] -0.027651247 -0.720795680 [32,] -0.127059895 -0.027651247 [33,] 0.933779041 -0.127059895 [34,] -0.066220959 0.933779041 [35,] -0.131837627 -0.066220959 [36,] 1.274623359 -0.131837627 [37,] -0.066220959 1.274623359 [38,] 0.022127555 -0.066220959 [39,] 0.375250296 0.022127555 [40,] -0.774759780 0.375250296 [41,] -0.118792729 -0.774759780 [42,] -0.324409782 -0.118792729 [43,] 1.536680656 -0.324409782 [44,] 0.665726430 1.536680656 [45,] 0.730343379 0.665726430 [46,] 0.446735519 0.730343379 [47,] -0.200247264 0.446735519 [48,] -0.295308196 -0.200247264 [49,] 0.002188678 -0.295308196 [50,] -0.521152705 0.002188678 [51,] 0.092521957 -0.521152705 [52,] 0.194723573 0.092521957 [53,] -0.200247264 0.194723573 [54,] 0.670525400 -0.200247264 [55,] 0.172668449 0.670525400 [56,] 1.057229071 0.172668449 [57,] -0.200247264 1.057229071 [58,] -0.334273570 -0.200247264 [59,] 0.068086406 -0.334273570 [60,] -0.252819035 0.068086406 [61,] 0.650332041 -0.252819035 [62,] 0.002188678 0.650332041 [63,] -0.552300673 0.002188678 [64,] -0.238529890 -0.552300673 [65,] -0.028135105 -0.238529890 [66,] -0.318435704 -0.028135105 [67,] 0.413427398 -0.318435704 [68,] -0.613223897 0.413427398 [69,] 0.038506989 -0.613223897 [70,] 0.249956830 0.038506989 [71,] -1.187590508 0.249956830 [72,] 0.882127172 -1.187590508 [73,] 0.615666569 0.882127172 [74,] -0.216085131 0.615666569 [75,] 0.060213409 -0.216085131 [76,] -0.406686943 0.060213409 [77,] -0.503485679 -0.406686943 [78,] -0.486684004 -0.503485679 [79,] -0.720598908 -0.486684004 [80,] 0.397589531 -0.720598908 [81,] 0.022127555 0.397589531 [82,] -0.352657699 0.022127555 [83,] -0.038711381 -0.352657699 [84,] 0.015273957 -0.038711381 [85,] 0.272688675 0.015273957 [86,] 0.899838105 0.272688675 [87,] -0.375214009 0.899838105 [88,] 0.375039248 -0.375214009 [89,] -0.050383092 0.375039248 [90,] 0.252178600 -0.050383092 [91,] 0.976449764 0.252178600 [92,] -0.061443226 0.976449764 [93,] 0.306735135 -0.061443226 [94,] -0.031119443 0.306735135 [95,] 0.811445684 -0.031119443 [96,] 0.068482069 0.811445684 [97,] 0.700787565 0.068482069 [98,] 0.696619917 0.700787565 [99,] 0.796959767 0.696619917 [100,] 0.095314925 0.796959767 [101,] 0.256850809 0.095314925 [102,] 0.799752736 0.256850809 [103,] 0.699914072 0.799752736 [104,] -0.369172287 0.699914072 [105,] 0.515145156 -0.369172287 [106,] -0.115999761 0.515145156 [107,] 0.140992717 -0.115999761 [108,] -0.184409398 0.140992717 [109,] -0.252819035 -0.184409398 [110,] -1.765775512 -0.252819035 [111,] 0.256850809 -1.765775512 [112,] 0.371718989 0.256850809 [113,] 0.195400294 0.371718989 [114,] -0.027651247 0.195400294 [115,] 0.757565871 -0.027651247 [116,] 0.095314925 0.757565871 [117,] -0.189187131 0.095314925 [118,] -0.486622387 -0.189187131 [119,] 0.313588734 -0.486622387 [120,] -0.107296552 0.313588734 [121,] -1.027651247 -0.107296552 [122,] 0.163830086 -1.027651247 [123,] 0.754074944 0.163830086 [124,] 0.796959767 0.754074944 [125,] -1.039388102 0.796959767 [126,] 0.956510887 -1.039388102 [127,] -0.184409398 0.956510887 [128,] 0.402367264 -0.184409398 [129,] -1.341844271 0.402367264 [130,] -0.698042597 -1.341844271 [131,] 0.145199252 -0.698042597 [132,] 0.472519493 0.145199252 [133,] -1.467525879 0.472519493 [134,] -0.200247264 -1.467525879 [135,] -0.203040233 -0.200247264 [136,] 0.408649665 -0.203040233 [137,] 0.949616908 0.408649665 [138,] 0.771046812 0.949616908 [139,] -0.042181071 0.771046812 [140,] 0.033864411 -0.042181071 [141,] 0.286796258 0.033864411 [142,] -0.066220959 0.286796258 [143,] -0.200247264 -0.066220959 [144,] 0.881207271 -0.200247264 [145,] -0.663926126 0.881207271 [146,] -0.066220959 -0.663926126 [147,] 0.245615140 -0.066220959 [148,] -0.134630596 0.245615140 [149,] -0.180308387 -0.134630596 [150,] 0.512069570 -0.180308387 [151,] 0.105891201 0.512069570 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.932194653 -0.066220959 2 0.776344169 -0.932194653 3 0.558554218 0.776344169 4 -1.223171974 0.558554218 5 0.056174016 -1.223171974 6 -0.782290101 0.056174016 7 -1.116479711 -0.782290101 8 0.121289498 -1.116479711 9 -1.122260925 0.121289498 10 -0.062119948 -1.122260925 11 -0.981776684 -0.062119948 12 0.564923958 -0.981776684 13 -0.698042597 0.564923958 14 -0.134630596 -0.698042597 15 -0.273434634 -0.134630596 16 -0.238333118 -0.273434634 17 0.071906358 -0.238333118 18 -0.759255959 0.071906358 19 -1.058018937 -0.759255959 20 0.408649665 -1.058018937 21 -1.774759780 0.408649665 22 -0.066220959 -1.774759780 23 -0.066220959 -0.066220959 24 -0.066220959 -0.066220959 25 -0.541571532 -0.066220959 26 -0.016442156 -0.541571532 27 0.492897168 -0.016442156 28 -0.066220959 0.492897168 29 0.420822564 -0.066220959 30 -0.720795680 0.420822564 31 -0.027651247 -0.720795680 32 -0.127059895 -0.027651247 33 0.933779041 -0.127059895 34 -0.066220959 0.933779041 35 -0.131837627 -0.066220959 36 1.274623359 -0.131837627 37 -0.066220959 1.274623359 38 0.022127555 -0.066220959 39 0.375250296 0.022127555 40 -0.774759780 0.375250296 41 -0.118792729 -0.774759780 42 -0.324409782 -0.118792729 43 1.536680656 -0.324409782 44 0.665726430 1.536680656 45 0.730343379 0.665726430 46 0.446735519 0.730343379 47 -0.200247264 0.446735519 48 -0.295308196 -0.200247264 49 0.002188678 -0.295308196 50 -0.521152705 0.002188678 51 0.092521957 -0.521152705 52 0.194723573 0.092521957 53 -0.200247264 0.194723573 54 0.670525400 -0.200247264 55 0.172668449 0.670525400 56 1.057229071 0.172668449 57 -0.200247264 1.057229071 58 -0.334273570 -0.200247264 59 0.068086406 -0.334273570 60 -0.252819035 0.068086406 61 0.650332041 -0.252819035 62 0.002188678 0.650332041 63 -0.552300673 0.002188678 64 -0.238529890 -0.552300673 65 -0.028135105 -0.238529890 66 -0.318435704 -0.028135105 67 0.413427398 -0.318435704 68 -0.613223897 0.413427398 69 0.038506989 -0.613223897 70 0.249956830 0.038506989 71 -1.187590508 0.249956830 72 0.882127172 -1.187590508 73 0.615666569 0.882127172 74 -0.216085131 0.615666569 75 0.060213409 -0.216085131 76 -0.406686943 0.060213409 77 -0.503485679 -0.406686943 78 -0.486684004 -0.503485679 79 -0.720598908 -0.486684004 80 0.397589531 -0.720598908 81 0.022127555 0.397589531 82 -0.352657699 0.022127555 83 -0.038711381 -0.352657699 84 0.015273957 -0.038711381 85 0.272688675 0.015273957 86 0.899838105 0.272688675 87 -0.375214009 0.899838105 88 0.375039248 -0.375214009 89 -0.050383092 0.375039248 90 0.252178600 -0.050383092 91 0.976449764 0.252178600 92 -0.061443226 0.976449764 93 0.306735135 -0.061443226 94 -0.031119443 0.306735135 95 0.811445684 -0.031119443 96 0.068482069 0.811445684 97 0.700787565 0.068482069 98 0.696619917 0.700787565 99 0.796959767 0.696619917 100 0.095314925 0.796959767 101 0.256850809 0.095314925 102 0.799752736 0.256850809 103 0.699914072 0.799752736 104 -0.369172287 0.699914072 105 0.515145156 -0.369172287 106 -0.115999761 0.515145156 107 0.140992717 -0.115999761 108 -0.184409398 0.140992717 109 -0.252819035 -0.184409398 110 -1.765775512 -0.252819035 111 0.256850809 -1.765775512 112 0.371718989 0.256850809 113 0.195400294 0.371718989 114 -0.027651247 0.195400294 115 0.757565871 -0.027651247 116 0.095314925 0.757565871 117 -0.189187131 0.095314925 118 -0.486622387 -0.189187131 119 0.313588734 -0.486622387 120 -0.107296552 0.313588734 121 -1.027651247 -0.107296552 122 0.163830086 -1.027651247 123 0.754074944 0.163830086 124 0.796959767 0.754074944 125 -1.039388102 0.796959767 126 0.956510887 -1.039388102 127 -0.184409398 0.956510887 128 0.402367264 -0.184409398 129 -1.341844271 0.402367264 130 -0.698042597 -1.341844271 131 0.145199252 -0.698042597 132 0.472519493 0.145199252 133 -1.467525879 0.472519493 134 -0.200247264 -1.467525879 135 -0.203040233 -0.200247264 136 0.408649665 -0.203040233 137 0.949616908 0.408649665 138 0.771046812 0.949616908 139 -0.042181071 0.771046812 140 0.033864411 -0.042181071 141 0.286796258 0.033864411 142 -0.066220959 0.286796258 143 -0.200247264 -0.066220959 144 0.881207271 -0.200247264 145 -0.663926126 0.881207271 146 -0.066220959 -0.663926126 147 0.245615140 -0.066220959 148 -0.134630596 0.245615140 149 -0.180308387 -0.134630596 150 0.512069570 -0.180308387 151 0.105891201 0.512069570 > 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/rcomp/tmp/7l7pa1290269273.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/rcomp/tmp/8vhod1290269273.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/rcomp/tmp/9vhod1290269273.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/rcomp/tmp/10o8ng1290269273.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/11r8441290269273.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/rcomp/tmp/12dr2a1290269273.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/rcomp/tmp/1391001290269273.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/rcomp/tmp/14u1zo1290269273.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/rcomp/tmp/15ykxc1290269273.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/rcomp/tmp/1612wi1290269273.tab") + } > > try(system("convert tmp/1h7841290269273.ps tmp/1h7841290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/2h7841290269273.ps tmp/2h7841290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/3agpp1290269273.ps tmp/3agpp1290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/4agpp1290269273.ps tmp/4agpp1290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/5agpp1290269273.ps tmp/5agpp1290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/6l7pa1290269273.ps tmp/6l7pa1290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/7l7pa1290269273.ps tmp/7l7pa1290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/8vhod1290269273.ps tmp/8vhod1290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/9vhod1290269273.ps tmp/9vhod1290269273.png",intern=TRUE)) character(0) > try(system("convert tmp/10o8ng1290269273.ps tmp/10o8ng1290269273.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.610 2.150 7.734