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(4 + ,4 + ,5 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,5 + ,5 + ,4 + ,4 + ,5 + ,5 + ,4 + ,3 + ,3 + ,2 + ,3 + ,4 + ,4 + ,3 + ,2 + ,3 + ,2 + ,3 + ,2 + ,4 + ,3 + ,5 + ,4 + ,3 + ,3 + ,4 + ,5 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,2 + ,3 + ,4 + ,4 + ,2 + ,4 + ,2 + ,4 + ,4 + ,3 + ,4 + ,4 + ,5 + ,3 + ,4 + ,3 + ,2 + ,3 + ,2 + ,2 + ,3 + ,4 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,2 + ,3 + ,2 + ,4 + ,2 + ,3 + ,2 + ,5 + ,4 + ,2 + ,5 + ,5 + ,5 + ,4 + ,3 + ,4 + ,2 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,4 + ,4 + ,5 + ,4 + ,3 + ,2 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,2 + ,3 + ,2 + ,2 + ,2 + ,4 + ,2 + ,4 + ,2 + ,4 + ,4 + ,3 + ,4 + ,4 + ,3 + ,3 + ,2 + ,4 + ,4 + ,4 + ,3 + ,3 + ,2 + ,4 + ,4 + ,2 + ,3 + ,4 + ,4 + ,4 + ,2 + ,4 + ,4 +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,4 + ,3 + ,3 + ,4 + ,4 + ,2 + ,4 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,3 + ,5 + ,4 + ,2 + ,2 + ,2 + ,2 + ,4 + ,3 + ,3 + ,5 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,4 + ,4 + ,2 + ,4 + ,4 + ,2 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,3 + ,4 + ,2 + ,4 + ,3 + ,4 + ,4 + ,5 + ,3 + ,5 + ,5 + ,5 + ,5 + ,5) + ,dim=c(7 + ,152) + ,dimnames=list(c('y' + ,'x1' + ,'x2' + ,'x3' + ,'x4' + ,'x5' + ,'x6') + ,1:152)) > y <- array(NA,dim=c(7,152),dimnames=list(c('y','x1','x2','x3','x4','x5','x6'),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 = '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 x1 x2 x3 x4 x5 x6 t 1 4 4 5 4 4 4 4 1 2 4 4 4 4 3 4 4 2 3 5 5 4 4 5 5 4 3 4 3 3 2 3 4 4 3 4 5 2 3 2 3 2 4 3 5 6 5 4 3 3 4 5 4 6 7 4 3 3 3 3 4 4 7 8 2 3 4 4 2 4 2 8 9 4 4 3 4 4 5 3 9 10 4 3 2 3 2 2 3 10 11 4 3 2 4 4 4 4 11 12 2 3 2 4 2 3 2 12 13 5 4 2 5 5 5 4 13 14 3 4 2 3 3 4 4 14 15 4 3 4 4 4 4 4 15 16 4 3 3 4 4 5 4 16 17 3 2 3 3 3 3 3 17 18 4 4 4 4 4 4 4 18 19 2 3 2 2 2 4 2 19 20 4 2 4 4 3 4 4 20 21 3 3 2 4 4 4 3 21 22 3 2 4 4 2 3 4 22 23 4 4 2 4 4 4 4 23 24 4 4 3 4 4 4 4 24 25 4 4 4 4 4 4 4 25 26 4 3 3 4 3 4 3 26 27 5 4 4 4 4 4 4 27 28 3 4 3 2 4 4 4 28 29 1 4 4 4 4 4 4 29 30 4 2 4 4 4 3 4 30 31 4 2 4 4 4 4 4 31 32 3 4 3 2 4 4 4 32 33 3 2 4 4 4 3 4 33 34 4 5 4 4 5 4 4 34 35 4 4 4 4 4 4 4 35 36 4 4 4 4 4 4 5 36 37 3 2 3 3 5 4 4 37 38 4 2 4 4 4 4 4 38 39 3 3 3 3 4 4 4 39 40 4 3 4 3 4 4 3 40 41 3 4 4 3 3 3 4 41 42 4 4 4 3 4 4 2 42 43 3 2 3 2 3 2 2 43 44 2 4 2 2 5 2 4 44 45 3 4 4 4 5 4 4 45 46 4 4 4 2 4 4 5 46 47 4 4 4 4 5 5 4 47 48 3 2 4 4 4 4 4 48 49 3 3 4 3 4 3 4 49 50 4 2 4 4 4 4 5 50 51 4 2 4 4 4 4 3 51 52 3 4 3 3 4 3 2 52 53 2 4 2 1 4 4 4 53 54 4 4 4 4 4 4 4 54 55 4 3 4 4 4 3 2 55 56 3 4 4 2 4 3 2 56 57 2 5 2 2 4 2 4 57 58 4 4 4 4 4 4 4 58 59 3 4 4 4 4 4 4 59 60 3 4 4 3 4 4 3 60 61 4 4 4 3 4 4 2 61 62 3 2 3 1 4 3 4 62 63 4 4 4 4 4 4 5 63 64 3 4 4 2 4 4 4 64 65 4 3 4 4 4 4 5 65 66 4 4 5 5 5 5 4 66 67 4 2 4 3 4 4 3 67 68 3 2 3 3 4 3 3 68 69 3 2 3 2 3 2 4 69 70 3 4 4 4 4 4 3 70 71 4 4 3 2 4 2 2 71 72 3 3 3 2 2 2 4 72 73 2 2 2 2 4 2 3 73 74 4 2 4 4 5 4 5 74 75 4 2 4 5 4 4 5 75 76 4 5 4 4 5 5 4 76 77 3 4 2 2 3 2 5 77 78 5 4 4 5 4 5 4 78 79 3 2 4 2 4 4 3 79 80 2 2 3 3 3 3 3 80 81 3 4 3 4 4 3 4 81 82 3 4 3 3 4 4 4 82 83 4 4 4 2 4 4 3 83 84 4 4 3 3 4 3 4 84 85 3 2 3 4 4 4 3 85 86 2 2 2 1 4 2 3 86 87 4 4 4 2 5 4 3 87 88 4 3 4 2 4 3 2 88 89 3 2 2 3 4 2 5 89 90 4 2 4 3 4 4 3 90 91 3 4 3 2 4 4 4 91 92 2 4 2 2 5 4 4 92 93 3 3 4 4 4 3 3 93 94 3 4 3 3 4 3 3 94 95 3 3 3 3 3 2 4 95 96 4 3 3 4 4 3 4 96 97 4 4 5 4 4 3 3 97 98 4 4 4 2 4 2 3 98 99 3 4 2 2 5 4 4 99 100 4 4 4 4 5 4 2 100 101 4 3 3 3 4 3 4 101 102 3 4 2 2 4 2 4 102 103 4 2 4 4 5 4 4 103 104 3 3 4 3 5 4 5 104 105 4 4 3 3 4 5 5 105 106 4 3 4 4 5 5 5 106 107 3 3 4 3 4 4 4 107 108 3 2 4 4 4 3 4 108 109 3 2 4 3 4 4 3 109 110 3 2 4 3 4 4 2 110 111 3 2 4 3 2 3 2 111 112 2 4 2 2 4 2 4 112 113 4 2 4 2 5 5 2 113 114 2 3 3 1 4 3 3 114 115 3 4 3 2 4 4 4 115 116 3 3 4 3 4 3 4 116 117 3 3 3 3 4 3 4 117 118 4 4 4 3 4 5 4 118 119 4 3 3 3 3 4 3 119 120 3 2 3 2 4 3 4 120 121 4 3 4 4 4 4 3 121 122 3 2 3 2 3 4 4 122 123 3 3 4 3 4 4 4 123 124 3 4 3 3 5 4 4 124 125 4 3 4 4 5 4 2 125 126 2 3 2 3 3 4 5 126 127 4 4 3 3 5 4 5 127 128 3 2 4 3 4 4 3 128 129 3 2 3 4 4 2 3 129 130 4 3 4 4 3 5 3 130 131 4 3 3 3 3 4 4 131 132 4 3 4 4 4 4 3 132 133 3 5 1 5 5 4 2 133 134 2 4 2 2 2 1 5 134 135 4 4 4 4 4 4 4 135 136 2 4 4 4 4 4 2 136 137 3 3 3 3 4 4 4 137 138 4 4 4 3 5 4 3 138 139 3 3 4 4 4 2 2 139 140 3 2 2 3 4 4 3 140 141 3 4 4 2 4 4 3 141 142 3 4 4 4 4 3 4 142 143 4 4 4 4 4 4 4 143 144 3 2 4 4 4 4 4 144 145 3 4 4 3 5 4 2 145 146 2 2 2 4 3 3 5 146 147 2 4 4 4 4 4 4 147 148 3 3 3 4 4 2 4 148 149 4 2 4 4 4 4 3 149 150 3 3 3 3 4 4 3 150 151 4 2 4 3 4 4 5 151 152 3 5 5 5 5 5 4 152 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) x1 x2 x3 x4 x5 0.859015 0.004804 0.248974 0.147059 0.162154 0.163837 x6 t 0.050420 -0.003321 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.8717 -0.3818 0.0892 0.4368 1.4174 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.859015 0.411478 2.088 0.038592 * x1 0.004804 0.061118 0.079 0.937463 x2 0.248974 0.071657 3.475 0.000676 *** x3 0.147059 0.064610 2.276 0.024315 * x4 0.162154 0.082937 1.955 0.052503 . x5 0.163837 0.073467 2.230 0.027290 * x6 0.050420 0.061045 0.826 0.410197 t -0.003321 0.001240 -2.679 0.008234 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6306 on 144 degrees of freedom Multiple R-squared: 0.3425, Adjusted R-squared: 0.3105 F-statistic: 10.71 on 7 and 144 DF, p-value: 7.998e-11 > 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.17195222 0.343904435 0.828047782 [2,] 0.12260912 0.245218237 0.877390881 [3,] 0.08849758 0.176995153 0.911502424 [4,] 0.86412990 0.271740194 0.135870097 [5,] 0.81271636 0.374567286 0.187283643 [6,] 0.73954371 0.520912583 0.260456292 [7,] 0.65289157 0.694216851 0.347108425 [8,] 0.60224129 0.795517417 0.397758709 [9,] 0.52934674 0.941306528 0.470653264 [10,] 0.50818580 0.983628397 0.491814199 [11,] 0.47439030 0.948780599 0.525609701 [12,] 0.41264672 0.825293443 0.587353279 [13,] 0.35169007 0.703380138 0.648309931 [14,] 0.28854420 0.577088401 0.711455799 [15,] 0.22811910 0.456238207 0.771880896 [16,] 0.35717467 0.714349347 0.642825326 [17,] 0.40708073 0.814161463 0.592919269 [18,] 0.48965743 0.979314866 0.510342567 [19,] 0.99866161 0.002676785 0.001338392 [20,] 0.99799597 0.004008053 0.002004026 [21,] 0.99698290 0.006034203 0.003017101 [22,] 0.99543793 0.009124145 0.004562072 [23,] 0.99541972 0.009160564 0.004580282 [24,] 0.99333476 0.013330483 0.006665242 [25,] 0.99161288 0.016774243 0.008387121 [26,] 0.98791523 0.024169547 0.012084773 [27,] 0.98589517 0.028209669 0.014104835 [28,] 0.98346463 0.033070741 0.016535371 [29,] 0.97797352 0.044052965 0.022026483 [30,] 0.98754459 0.024910813 0.012455406 [31,] 0.98361465 0.032770709 0.016385354 [32,] 0.98982576 0.020348474 0.010174237 [33,] 0.98887567 0.022248654 0.011124327 [34,] 0.99315367 0.013692660 0.006846330 [35,] 0.99484384 0.010312314 0.005156157 [36,] 0.99413760 0.011724801 0.005862400 [37,] 0.99157322 0.016853569 0.008426784 [38,] 0.99165276 0.016694484 0.008347242 [39,] 0.98963708 0.020725832 0.010362916 [40,] 0.98627748 0.027445042 0.013722521 [41,] 0.98462068 0.030758650 0.015379325 [42,] 0.98028313 0.039433741 0.019716871 [43,] 0.98162609 0.036747814 0.018373907 [44,] 0.97745479 0.045090428 0.022545214 [45,] 0.97741647 0.045167058 0.022583529 [46,] 0.97181705 0.056365906 0.028182953 [47,] 0.97016574 0.059668528 0.029834264 [48,] 0.96320063 0.073598744 0.036799372 [49,] 0.96588617 0.068227668 0.034113834 [50,] 0.96393512 0.072129764 0.036064882 [51,] 0.96259294 0.074814115 0.037407058 [52,] 0.95548713 0.089025749 0.044512875 [53,] 0.94565088 0.108698237 0.054349119 [54,] 0.94078555 0.118428903 0.059214452 [55,] 0.92772720 0.144545601 0.072272801 [56,] 0.92210337 0.155793257 0.077896629 [57,] 0.91527034 0.169459326 0.084729663 [58,] 0.89644675 0.207106493 0.103553247 [59,] 0.88504362 0.229912753 0.114956377 [60,] 0.89586680 0.208266406 0.104133203 [61,] 0.94434686 0.111306285 0.055653142 [62,] 0.93931503 0.121369935 0.060684967 [63,] 0.93683759 0.126324811 0.063162406 [64,] 0.92043589 0.159128227 0.079564114 [65,] 0.90118018 0.197639636 0.098819818 [66,] 0.88033679 0.239326418 0.119663209 [67,] 0.86690382 0.266192351 0.133096175 [68,] 0.88911984 0.221760312 0.110880156 [69,] 0.87719839 0.245603227 0.122801613 [70,] 0.91717472 0.165650560 0.082825280 [71,] 0.90560052 0.188798952 0.094399476 [72,] 0.89471987 0.210560252 0.105280126 [73,] 0.89115626 0.217687470 0.108843735 [74,] 0.90107893 0.197842148 0.098921074 [75,] 0.89594350 0.208113007 0.104056504 [76,] 0.88922585 0.221548300 0.110774150 [77,] 0.87737433 0.245251347 0.122625674 [78,] 0.88846256 0.223074871 0.111537435 [79,] 0.86454774 0.270904523 0.135452262 [80,] 0.84781372 0.304372558 0.152186279 [81,] 0.82033632 0.359327365 0.179663683 [82,] 0.88410864 0.231782711 0.115891355 [83,] 0.88265229 0.234695424 0.117347712 [84,] 0.86121431 0.277571376 0.138785688 [85,] 0.83289305 0.334213892 0.167106946 [86,] 0.82933995 0.341320091 0.170660045 [87,] 0.79844909 0.403101812 0.201550906 [88,] 0.84999424 0.300011528 0.150005764 [89,] 0.81963992 0.360720156 0.180360078 [90,] 0.78956932 0.420861357 0.210430679 [91,] 0.82610538 0.347789231 0.173894615 [92,] 0.82104961 0.357900788 0.178950394 [93,] 0.79111240 0.417775200 0.208887600 [94,] 0.78671647 0.426567058 0.213283529 [95,] 0.77254610 0.454907804 0.227453902 [96,] 0.72996177 0.540076458 0.270038229 [97,] 0.70575745 0.588485109 0.294242554 [98,] 0.68071271 0.638574590 0.319287295 [99,] 0.66980237 0.660395261 0.330197631 [100,] 0.66389638 0.672207237 0.336103618 [101,] 0.61664147 0.766717066 0.383358533 [102,] 0.58589048 0.828219033 0.414109517 [103,] 0.54135511 0.917289780 0.458644890 [104,] 0.59034019 0.819319629 0.409659814 [105,] 0.53860518 0.922789641 0.461394820 [106,] 0.50822121 0.983557589 0.491778795 [107,] 0.45797414 0.915948270 0.542025865 [108,] 0.40718603 0.814372059 0.592813970 [109,] 0.44841047 0.896820931 0.551589534 [110,] 0.39998124 0.799962478 0.600018761 [111,] 0.35970416 0.719408313 0.640295844 [112,] 0.30657600 0.613152001 0.693423999 [113,] 0.30125437 0.602508748 0.698745626 [114,] 0.29251556 0.585031125 0.707484438 [115,] 0.23815096 0.476301918 0.761849041 [116,] 0.37056051 0.741121011 0.629439494 [117,] 0.31150691 0.623013812 0.688493094 [118,] 0.41256615 0.825132291 0.587433854 [119,] 0.40991342 0.819826847 0.590086576 [120,] 0.37849812 0.756996238 0.621501881 [121,] 0.44527496 0.890549912 0.554725044 [122,] 0.40386261 0.807725218 0.596137391 [123,] 0.41056490 0.821129797 0.589435101 [124,] 0.32845217 0.656904343 0.671547828 [125,] 0.43081872 0.861637439 0.569181280 [126,] 0.42622873 0.852457461 0.573771269 [127,] 0.33029339 0.660586787 0.669706607 [128,] 0.26626264 0.532525286 0.733737357 [129,] 0.18540188 0.370803763 0.814598119 [130,] 0.13436383 0.268727653 0.865636174 [131,] 0.08078695 0.161573892 0.919213054 > postscript(file="/var/www/html/rcomp/tmp/1o7731291380412.ps",horizontal=F,onefile=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/2o7731291380412.ps",horizontal=F,onefile=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/3zypo1291380412.ps",horizontal=F,onefile=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/4zypo1291380412.ps",horizontal=F,onefile=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/5zypo1291380412.ps",horizontal=F,onefile=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.213662840 0.200787367 0.711159559 -0.254492303 -0.926861982 1.284115410 7 8 9 10 11 12 0.618231501 -1.511485371 0.197440739 1.417418095 0.571277653 -0.836414549 13 14 15 16 17 18 1.100066451 -0.114348146 0.086614444 0.175073584 -0.129494045 0.091774930 19 20 21 22 23 24 -0.682883018 0.270179448 -0.345088135 -0.397186731 0.606330533 0.360677551 25 26 27 28 29 30 0.115024569 0.584698864 1.121667324 -0.331918454 -2.871689922 0.305075343 31 32 33 34 35 36 0.144560124 -0.318632945 -0.684960526 -0.022041154 0.148238341 0.101139277 37 38 39 40 41 42 -0.601632483 0.167809764 -0.437638903 0.367128556 -0.358783086 0.419388105 43 44 45 46 47 48 0.318178039 -0.864283342 -0.980702360 0.428471535 -0.137896201 -0.798976465 49 50 51 52 53 54 -0.489562895 0.157245849 0.261408107 -0.134587169 -0.852850424 0.211344506 55 56 57 58 59 60 0.484147006 -0.223216776 -0.663754613 0.224630015 -0.772048608 -0.571247547 61 62 63 64 65 66 0.482494271 0.101511499 0.190816460 -0.461323236 0.202262860 -0.470823638 67 68 69 70 71 72 0.461609385 -0.122258284 0.303692963 -0.685093019 1.239414835 0.471007921 73 74 75 76 77 78 -0.545781201 0.074804428 0.093221034 -0.046379911 0.519210606 0.980161718 79 80 81 82 83 84 -0.351474847 -0.920247287 -0.286167357 -0.299623332 0.652203370 0.870856018 85 86 87 88 89 90 -0.376690712 -0.355544055 0.503334406 0.887870938 0.259460709 0.538001058 91 92 93 94 95 96 -0.122671695 -1.032530431 -0.440061104 -0.045509771 0.238185879 0.768456946 97 98 99 100 101 102 0.319446400 1.029697218 -0.009280791 0.302814263 0.932123075 0.490511003 103 104 105 106 107 108 0.221544805 -0.683298661 0.562511305 0.012448254 -0.460759617 -0.435857242 109 110 111 112 113 114 -0.398892776 -0.345150958 0.146315958 -0.476275225 0.485881349 -0.680160096 115 116 117 118 119 120 -0.042958644 -0.267030627 -0.014734891 0.407135290 1.040646180 0.147092129 121 122 123 124 125 126 0.489100860 0.152052760 -0.407617583 -0.322279965 0.390652337 -0.787970703 127 128 129 130 131 132 0.637263726 -0.335786611 0.097123073 0.517311131 1.030082265 0.525636009 133 134 135 136 137 138 0.007479896 0.034520170 0.480376053 -1.415461688 -0.112143945 0.525665397 139 140 141 142 143 144 -0.073020720 0.202018632 -0.155156757 -0.332537711 0.506947070 -0.480124261 145 146 147 148 149 150 -0.400664523 -0.699962162 -1.479767421 0.105005152 0.586903066 -0.018545601 151 152 0.639764182 -1.189988851 > postscript(file="/var/www/html/rcomp/tmp/6spor1291380412.ps",horizontal=F,onefile=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.213662840 NA 1 0.200787367 -0.213662840 2 0.711159559 0.200787367 3 -0.254492303 0.711159559 4 -0.926861982 -0.254492303 5 1.284115410 -0.926861982 6 0.618231501 1.284115410 7 -1.511485371 0.618231501 8 0.197440739 -1.511485371 9 1.417418095 0.197440739 10 0.571277653 1.417418095 11 -0.836414549 0.571277653 12 1.100066451 -0.836414549 13 -0.114348146 1.100066451 14 0.086614444 -0.114348146 15 0.175073584 0.086614444 16 -0.129494045 0.175073584 17 0.091774930 -0.129494045 18 -0.682883018 0.091774930 19 0.270179448 -0.682883018 20 -0.345088135 0.270179448 21 -0.397186731 -0.345088135 22 0.606330533 -0.397186731 23 0.360677551 0.606330533 24 0.115024569 0.360677551 25 0.584698864 0.115024569 26 1.121667324 0.584698864 27 -0.331918454 1.121667324 28 -2.871689922 -0.331918454 29 0.305075343 -2.871689922 30 0.144560124 0.305075343 31 -0.318632945 0.144560124 32 -0.684960526 -0.318632945 33 -0.022041154 -0.684960526 34 0.148238341 -0.022041154 35 0.101139277 0.148238341 36 -0.601632483 0.101139277 37 0.167809764 -0.601632483 38 -0.437638903 0.167809764 39 0.367128556 -0.437638903 40 -0.358783086 0.367128556 41 0.419388105 -0.358783086 42 0.318178039 0.419388105 43 -0.864283342 0.318178039 44 -0.980702360 -0.864283342 45 0.428471535 -0.980702360 46 -0.137896201 0.428471535 47 -0.798976465 -0.137896201 48 -0.489562895 -0.798976465 49 0.157245849 -0.489562895 50 0.261408107 0.157245849 51 -0.134587169 0.261408107 52 -0.852850424 -0.134587169 53 0.211344506 -0.852850424 54 0.484147006 0.211344506 55 -0.223216776 0.484147006 56 -0.663754613 -0.223216776 57 0.224630015 -0.663754613 58 -0.772048608 0.224630015 59 -0.571247547 -0.772048608 60 0.482494271 -0.571247547 61 0.101511499 0.482494271 62 0.190816460 0.101511499 63 -0.461323236 0.190816460 64 0.202262860 -0.461323236 65 -0.470823638 0.202262860 66 0.461609385 -0.470823638 67 -0.122258284 0.461609385 68 0.303692963 -0.122258284 69 -0.685093019 0.303692963 70 1.239414835 -0.685093019 71 0.471007921 1.239414835 72 -0.545781201 0.471007921 73 0.074804428 -0.545781201 74 0.093221034 0.074804428 75 -0.046379911 0.093221034 76 0.519210606 -0.046379911 77 0.980161718 0.519210606 78 -0.351474847 0.980161718 79 -0.920247287 -0.351474847 80 -0.286167357 -0.920247287 81 -0.299623332 -0.286167357 82 0.652203370 -0.299623332 83 0.870856018 0.652203370 84 -0.376690712 0.870856018 85 -0.355544055 -0.376690712 86 0.503334406 -0.355544055 87 0.887870938 0.503334406 88 0.259460709 0.887870938 89 0.538001058 0.259460709 90 -0.122671695 0.538001058 91 -1.032530431 -0.122671695 92 -0.440061104 -1.032530431 93 -0.045509771 -0.440061104 94 0.238185879 -0.045509771 95 0.768456946 0.238185879 96 0.319446400 0.768456946 97 1.029697218 0.319446400 98 -0.009280791 1.029697218 99 0.302814263 -0.009280791 100 0.932123075 0.302814263 101 0.490511003 0.932123075 102 0.221544805 0.490511003 103 -0.683298661 0.221544805 104 0.562511305 -0.683298661 105 0.012448254 0.562511305 106 -0.460759617 0.012448254 107 -0.435857242 -0.460759617 108 -0.398892776 -0.435857242 109 -0.345150958 -0.398892776 110 0.146315958 -0.345150958 111 -0.476275225 0.146315958 112 0.485881349 -0.476275225 113 -0.680160096 0.485881349 114 -0.042958644 -0.680160096 115 -0.267030627 -0.042958644 116 -0.014734891 -0.267030627 117 0.407135290 -0.014734891 118 1.040646180 0.407135290 119 0.147092129 1.040646180 120 0.489100860 0.147092129 121 0.152052760 0.489100860 122 -0.407617583 0.152052760 123 -0.322279965 -0.407617583 124 0.390652337 -0.322279965 125 -0.787970703 0.390652337 126 0.637263726 -0.787970703 127 -0.335786611 0.637263726 128 0.097123073 -0.335786611 129 0.517311131 0.097123073 130 1.030082265 0.517311131 131 0.525636009 1.030082265 132 0.007479896 0.525636009 133 0.034520170 0.007479896 134 0.480376053 0.034520170 135 -1.415461688 0.480376053 136 -0.112143945 -1.415461688 137 0.525665397 -0.112143945 138 -0.073020720 0.525665397 139 0.202018632 -0.073020720 140 -0.155156757 0.202018632 141 -0.332537711 -0.155156757 142 0.506947070 -0.332537711 143 -0.480124261 0.506947070 144 -0.400664523 -0.480124261 145 -0.699962162 -0.400664523 146 -1.479767421 -0.699962162 147 0.105005152 -1.479767421 148 0.586903066 0.105005152 149 -0.018545601 0.586903066 150 0.639764182 -0.018545601 151 -1.189988851 0.639764182 152 NA -1.189988851 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.200787367 -0.213662840 [2,] 0.711159559 0.200787367 [3,] -0.254492303 0.711159559 [4,] -0.926861982 -0.254492303 [5,] 1.284115410 -0.926861982 [6,] 0.618231501 1.284115410 [7,] -1.511485371 0.618231501 [8,] 0.197440739 -1.511485371 [9,] 1.417418095 0.197440739 [10,] 0.571277653 1.417418095 [11,] -0.836414549 0.571277653 [12,] 1.100066451 -0.836414549 [13,] -0.114348146 1.100066451 [14,] 0.086614444 -0.114348146 [15,] 0.175073584 0.086614444 [16,] -0.129494045 0.175073584 [17,] 0.091774930 -0.129494045 [18,] -0.682883018 0.091774930 [19,] 0.270179448 -0.682883018 [20,] -0.345088135 0.270179448 [21,] -0.397186731 -0.345088135 [22,] 0.606330533 -0.397186731 [23,] 0.360677551 0.606330533 [24,] 0.115024569 0.360677551 [25,] 0.584698864 0.115024569 [26,] 1.121667324 0.584698864 [27,] -0.331918454 1.121667324 [28,] -2.871689922 -0.331918454 [29,] 0.305075343 -2.871689922 [30,] 0.144560124 0.305075343 [31,] -0.318632945 0.144560124 [32,] -0.684960526 -0.318632945 [33,] -0.022041154 -0.684960526 [34,] 0.148238341 -0.022041154 [35,] 0.101139277 0.148238341 [36,] -0.601632483 0.101139277 [37,] 0.167809764 -0.601632483 [38,] -0.437638903 0.167809764 [39,] 0.367128556 -0.437638903 [40,] -0.358783086 0.367128556 [41,] 0.419388105 -0.358783086 [42,] 0.318178039 0.419388105 [43,] -0.864283342 0.318178039 [44,] -0.980702360 -0.864283342 [45,] 0.428471535 -0.980702360 [46,] -0.137896201 0.428471535 [47,] -0.798976465 -0.137896201 [48,] -0.489562895 -0.798976465 [49,] 0.157245849 -0.489562895 [50,] 0.261408107 0.157245849 [51,] -0.134587169 0.261408107 [52,] -0.852850424 -0.134587169 [53,] 0.211344506 -0.852850424 [54,] 0.484147006 0.211344506 [55,] -0.223216776 0.484147006 [56,] -0.663754613 -0.223216776 [57,] 0.224630015 -0.663754613 [58,] -0.772048608 0.224630015 [59,] -0.571247547 -0.772048608 [60,] 0.482494271 -0.571247547 [61,] 0.101511499 0.482494271 [62,] 0.190816460 0.101511499 [63,] -0.461323236 0.190816460 [64,] 0.202262860 -0.461323236 [65,] -0.470823638 0.202262860 [66,] 0.461609385 -0.470823638 [67,] -0.122258284 0.461609385 [68,] 0.303692963 -0.122258284 [69,] -0.685093019 0.303692963 [70,] 1.239414835 -0.685093019 [71,] 0.471007921 1.239414835 [72,] -0.545781201 0.471007921 [73,] 0.074804428 -0.545781201 [74,] 0.093221034 0.074804428 [75,] -0.046379911 0.093221034 [76,] 0.519210606 -0.046379911 [77,] 0.980161718 0.519210606 [78,] -0.351474847 0.980161718 [79,] -0.920247287 -0.351474847 [80,] -0.286167357 -0.920247287 [81,] -0.299623332 -0.286167357 [82,] 0.652203370 -0.299623332 [83,] 0.870856018 0.652203370 [84,] -0.376690712 0.870856018 [85,] -0.355544055 -0.376690712 [86,] 0.503334406 -0.355544055 [87,] 0.887870938 0.503334406 [88,] 0.259460709 0.887870938 [89,] 0.538001058 0.259460709 [90,] -0.122671695 0.538001058 [91,] -1.032530431 -0.122671695 [92,] -0.440061104 -1.032530431 [93,] -0.045509771 -0.440061104 [94,] 0.238185879 -0.045509771 [95,] 0.768456946 0.238185879 [96,] 0.319446400 0.768456946 [97,] 1.029697218 0.319446400 [98,] -0.009280791 1.029697218 [99,] 0.302814263 -0.009280791 [100,] 0.932123075 0.302814263 [101,] 0.490511003 0.932123075 [102,] 0.221544805 0.490511003 [103,] -0.683298661 0.221544805 [104,] 0.562511305 -0.683298661 [105,] 0.012448254 0.562511305 [106,] -0.460759617 0.012448254 [107,] -0.435857242 -0.460759617 [108,] -0.398892776 -0.435857242 [109,] -0.345150958 -0.398892776 [110,] 0.146315958 -0.345150958 [111,] -0.476275225 0.146315958 [112,] 0.485881349 -0.476275225 [113,] -0.680160096 0.485881349 [114,] -0.042958644 -0.680160096 [115,] -0.267030627 -0.042958644 [116,] -0.014734891 -0.267030627 [117,] 0.407135290 -0.014734891 [118,] 1.040646180 0.407135290 [119,] 0.147092129 1.040646180 [120,] 0.489100860 0.147092129 [121,] 0.152052760 0.489100860 [122,] -0.407617583 0.152052760 [123,] -0.322279965 -0.407617583 [124,] 0.390652337 -0.322279965 [125,] -0.787970703 0.390652337 [126,] 0.637263726 -0.787970703 [127,] -0.335786611 0.637263726 [128,] 0.097123073 -0.335786611 [129,] 0.517311131 0.097123073 [130,] 1.030082265 0.517311131 [131,] 0.525636009 1.030082265 [132,] 0.007479896 0.525636009 [133,] 0.034520170 0.007479896 [134,] 0.480376053 0.034520170 [135,] -1.415461688 0.480376053 [136,] -0.112143945 -1.415461688 [137,] 0.525665397 -0.112143945 [138,] -0.073020720 0.525665397 [139,] 0.202018632 -0.073020720 [140,] -0.155156757 0.202018632 [141,] -0.332537711 -0.155156757 [142,] 0.506947070 -0.332537711 [143,] -0.480124261 0.506947070 [144,] -0.400664523 -0.480124261 [145,] -0.699962162 -0.400664523 [146,] -1.479767421 -0.699962162 [147,] 0.105005152 -1.479767421 [148,] 0.586903066 0.105005152 [149,] -0.018545601 0.586903066 [150,] 0.639764182 -0.018545601 [151,] -1.189988851 0.639764182 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.200787367 -0.213662840 2 0.711159559 0.200787367 3 -0.254492303 0.711159559 4 -0.926861982 -0.254492303 5 1.284115410 -0.926861982 6 0.618231501 1.284115410 7 -1.511485371 0.618231501 8 0.197440739 -1.511485371 9 1.417418095 0.197440739 10 0.571277653 1.417418095 11 -0.836414549 0.571277653 12 1.100066451 -0.836414549 13 -0.114348146 1.100066451 14 0.086614444 -0.114348146 15 0.175073584 0.086614444 16 -0.129494045 0.175073584 17 0.091774930 -0.129494045 18 -0.682883018 0.091774930 19 0.270179448 -0.682883018 20 -0.345088135 0.270179448 21 -0.397186731 -0.345088135 22 0.606330533 -0.397186731 23 0.360677551 0.606330533 24 0.115024569 0.360677551 25 0.584698864 0.115024569 26 1.121667324 0.584698864 27 -0.331918454 1.121667324 28 -2.871689922 -0.331918454 29 0.305075343 -2.871689922 30 0.144560124 0.305075343 31 -0.318632945 0.144560124 32 -0.684960526 -0.318632945 33 -0.022041154 -0.684960526 34 0.148238341 -0.022041154 35 0.101139277 0.148238341 36 -0.601632483 0.101139277 37 0.167809764 -0.601632483 38 -0.437638903 0.167809764 39 0.367128556 -0.437638903 40 -0.358783086 0.367128556 41 0.419388105 -0.358783086 42 0.318178039 0.419388105 43 -0.864283342 0.318178039 44 -0.980702360 -0.864283342 45 0.428471535 -0.980702360 46 -0.137896201 0.428471535 47 -0.798976465 -0.137896201 48 -0.489562895 -0.798976465 49 0.157245849 -0.489562895 50 0.261408107 0.157245849 51 -0.134587169 0.261408107 52 -0.852850424 -0.134587169 53 0.211344506 -0.852850424 54 0.484147006 0.211344506 55 -0.223216776 0.484147006 56 -0.663754613 -0.223216776 57 0.224630015 -0.663754613 58 -0.772048608 0.224630015 59 -0.571247547 -0.772048608 60 0.482494271 -0.571247547 61 0.101511499 0.482494271 62 0.190816460 0.101511499 63 -0.461323236 0.190816460 64 0.202262860 -0.461323236 65 -0.470823638 0.202262860 66 0.461609385 -0.470823638 67 -0.122258284 0.461609385 68 0.303692963 -0.122258284 69 -0.685093019 0.303692963 70 1.239414835 -0.685093019 71 0.471007921 1.239414835 72 -0.545781201 0.471007921 73 0.074804428 -0.545781201 74 0.093221034 0.074804428 75 -0.046379911 0.093221034 76 0.519210606 -0.046379911 77 0.980161718 0.519210606 78 -0.351474847 0.980161718 79 -0.920247287 -0.351474847 80 -0.286167357 -0.920247287 81 -0.299623332 -0.286167357 82 0.652203370 -0.299623332 83 0.870856018 0.652203370 84 -0.376690712 0.870856018 85 -0.355544055 -0.376690712 86 0.503334406 -0.355544055 87 0.887870938 0.503334406 88 0.259460709 0.887870938 89 0.538001058 0.259460709 90 -0.122671695 0.538001058 91 -1.032530431 -0.122671695 92 -0.440061104 -1.032530431 93 -0.045509771 -0.440061104 94 0.238185879 -0.045509771 95 0.768456946 0.238185879 96 0.319446400 0.768456946 97 1.029697218 0.319446400 98 -0.009280791 1.029697218 99 0.302814263 -0.009280791 100 0.932123075 0.302814263 101 0.490511003 0.932123075 102 0.221544805 0.490511003 103 -0.683298661 0.221544805 104 0.562511305 -0.683298661 105 0.012448254 0.562511305 106 -0.460759617 0.012448254 107 -0.435857242 -0.460759617 108 -0.398892776 -0.435857242 109 -0.345150958 -0.398892776 110 0.146315958 -0.345150958 111 -0.476275225 0.146315958 112 0.485881349 -0.476275225 113 -0.680160096 0.485881349 114 -0.042958644 -0.680160096 115 -0.267030627 -0.042958644 116 -0.014734891 -0.267030627 117 0.407135290 -0.014734891 118 1.040646180 0.407135290 119 0.147092129 1.040646180 120 0.489100860 0.147092129 121 0.152052760 0.489100860 122 -0.407617583 0.152052760 123 -0.322279965 -0.407617583 124 0.390652337 -0.322279965 125 -0.787970703 0.390652337 126 0.637263726 -0.787970703 127 -0.335786611 0.637263726 128 0.097123073 -0.335786611 129 0.517311131 0.097123073 130 1.030082265 0.517311131 131 0.525636009 1.030082265 132 0.007479896 0.525636009 133 0.034520170 0.007479896 134 0.480376053 0.034520170 135 -1.415461688 0.480376053 136 -0.112143945 -1.415461688 137 0.525665397 -0.112143945 138 -0.073020720 0.525665397 139 0.202018632 -0.073020720 140 -0.155156757 0.202018632 141 -0.332537711 -0.155156757 142 0.506947070 -0.332537711 143 -0.480124261 0.506947070 144 -0.400664523 -0.480124261 145 -0.699962162 -0.400664523 146 -1.479767421 -0.699962162 147 0.105005152 -1.479767421 148 0.586903066 0.105005152 149 -0.018545601 0.586903066 150 0.639764182 -0.018545601 151 -1.189988851 0.639764182 > 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/7kynt1291380412.ps",horizontal=F,onefile=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/8kynt1291380412.ps",horizontal=F,onefile=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/9kynt1291380412.ps",horizontal=F,onefile=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/10dqnf1291380412.ps",horizontal=F,onefile=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/11yql21291380412.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/122r1q1291380412.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/13gizz1291380412.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/141jg51291380412.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/15usxq1291380412.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/16qkvz1291380412.tab") + } > > try(system("convert tmp/1o7731291380412.ps tmp/1o7731291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/2o7731291380412.ps tmp/2o7731291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/3zypo1291380412.ps tmp/3zypo1291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/4zypo1291380412.ps tmp/4zypo1291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/5zypo1291380412.ps tmp/5zypo1291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/6spor1291380412.ps tmp/6spor1291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/7kynt1291380412.ps tmp/7kynt1291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/8kynt1291380412.ps tmp/8kynt1291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/9kynt1291380412.ps tmp/9kynt1291380412.png",intern=TRUE)) character(0) > try(system("convert tmp/10dqnf1291380412.ps tmp/10dqnf1291380412.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.082 1.760 14.491