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(7.6 + ,2.16 + ,7.6 + ,2.23 + ,7.8 + ,2.40 + ,8.0 + ,2.84 + ,8.0 + ,2.77 + ,8.0 + ,2.93 + ,7.9 + ,2.91 + ,7.9 + ,2.69 + ,8.0 + ,2.38 + ,8.5 + ,2.58 + ,9.2 + ,3.19 + ,9.4 + ,2.82 + ,9.5 + ,2.72 + ,9.5 + ,2.53 + ,9.6 + ,2.70 + ,9.7 + ,2.42 + ,9.7 + ,2.50 + ,9.6 + ,2.31 + ,9.5 + ,2.41 + ,9.4 + ,2.56 + ,9.3 + ,2.76 + ,9.6 + ,2.71 + ,10.2 + ,2.44 + ,10.2 + ,2.46 + ,10.1 + ,2.12 + ,9.9 + ,1.99 + ,9.8 + ,1.86 + ,9.8 + ,1.88 + ,9.7 + ,1.82 + ,9.5 + ,1.74 + ,9.3 + ,1.71 + ,9.1 + ,1.38 + ,9.0 + ,1.27 + ,9.5 + ,1.19 + ,10.0 + ,1.28 + ,10.2 + ,1.19 + ,10.1 + ,1.22 + ,10.0 + ,1.47 + ,9.9 + ,1.46 + ,10.0 + ,1.96 + ,9.9 + ,1.88 + ,9.7 + ,2.03 + ,9.5 + ,2.04 + ,9.2 + ,1.90 + ,9.0 + ,1.80 + ,9.3 + ,1.92 + ,9.8 + ,1.92 + ,9.8 + ,1.97 + ,9.6 + ,2.46 + ,9.4 + ,2.36 + ,9.3 + ,2.53 + ,9.2 + ,2.31 + ,9.2 + ,1.98 + ,9.0 + ,1.46 + ,8.8 + ,1.26 + ,8.7 + ,1.58 + ,8.7 + ,1.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+ ,8.4 + ,1.79 + ,8.4 + ,1.80 + ,8.4 + ,1.58 + ,8.4 + ,1.86 + ,8.6 + ,1.74 + ,8.9 + ,1.59 + ,8.8 + ,1.26 + ,8.3 + ,1.13 + ,7.5 + ,1.92 + ,7.2 + ,2.61 + ,7.4 + ,2.26 + ,8.8 + ,2.41 + ,9.3 + ,2.26 + ,9.3 + ,2.03 + ,8.7 + ,2.86 + ,8.2 + ,2.55 + ,8.3 + ,2.27 + ,8.5 + ,2.26 + ,8.6 + ,2.57 + ,8.5 + ,3.07 + ,8.2 + ,2.76 + ,8.1 + ,2.51 + ,7.9 + ,2.87 + ,8.6 + ,3.14 + ,8.7 + ,3.11 + ,8.7 + ,3.16 + ,8.5 + ,2.47 + ,8.4 + ,2.57 + ,8.5 + ,2.89 + ,8.7 + ,2.63 + ,8.7 + ,2.38 + ,8.6 + ,1.69 + ,8.5 + ,1.96 + ,8.3 + ,2.19 + ,8.0 + ,1.87 + ,8.2 + ,1.6 + ,8.1 + ,1.63 + ,8.1 + ,1.22) + ,dim=c(2 + ,168) + ,dimnames=list(c('Y' + ,'X') + ,1:168)) > y <- array(NA,dim=c(2,168),dimnames=list(c('Y','X'),1:168)) > 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 = 'Include Monthly 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 7.6 2.16 1 0 0 0 0 0 0 0 0 0 0 1 2 7.6 2.23 0 1 0 0 0 0 0 0 0 0 0 2 3 7.8 2.40 0 0 1 0 0 0 0 0 0 0 0 3 4 8.0 2.84 0 0 0 1 0 0 0 0 0 0 0 4 5 8.0 2.77 0 0 0 0 1 0 0 0 0 0 0 5 6 8.0 2.93 0 0 0 0 0 1 0 0 0 0 0 6 7 7.9 2.91 0 0 0 0 0 0 1 0 0 0 0 7 8 7.9 2.69 0 0 0 0 0 0 0 1 0 0 0 8 9 8.0 2.38 0 0 0 0 0 0 0 0 1 0 0 9 10 8.5 2.58 0 0 0 0 0 0 0 0 0 1 0 10 11 9.2 3.19 0 0 0 0 0 0 0 0 0 0 1 11 12 9.4 2.82 0 0 0 0 0 0 0 0 0 0 0 12 13 9.5 2.72 1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 0 0 0 0 103 104 6.3 3.14 0 0 0 0 0 0 0 1 0 0 0 104 105 6.0 2.93 0 0 0 0 0 0 0 0 1 0 0 105 106 6.2 2.65 0 0 0 0 0 0 0 0 0 1 0 106 107 6.4 2.67 0 0 0 0 0 0 0 0 0 0 1 107 108 6.8 2.26 0 0 0 0 0 0 0 0 0 0 0 108 109 7.5 2.35 1 0 0 0 0 0 0 0 0 0 0 109 110 7.5 2.13 0 1 0 0 0 0 0 0 0 0 0 110 111 7.6 2.18 0 0 1 0 0 0 0 0 0 0 0 111 112 7.6 2.90 0 0 0 1 0 0 0 0 0 0 0 112 113 7.4 2.63 0 0 0 0 1 0 0 0 0 0 0 113 114 7.3 2.67 0 0 0 0 0 1 0 0 0 0 0 114 115 7.1 1.81 0 0 0 0 0 0 1 0 0 0 0 115 116 6.9 1.33 0 0 0 0 0 0 0 1 0 0 0 116 117 6.8 0.88 0 0 0 0 0 0 0 0 1 0 0 117 118 7.5 1.28 0 0 0 0 0 0 0 0 0 1 0 118 119 7.6 1.26 0 0 0 0 0 0 0 0 0 0 1 119 120 7.8 1.26 0 0 0 0 0 0 0 0 0 0 0 120 121 8.0 1.29 1 0 0 0 0 0 0 0 0 0 0 121 122 8.1 1.10 0 1 0 0 0 0 0 0 0 0 0 122 123 8.2 1.37 0 0 1 0 0 0 0 0 0 0 0 123 124 8.3 1.21 0 0 0 1 0 0 0 0 0 0 0 124 125 8.2 1.74 0 0 0 0 1 0 0 0 0 0 0 125 126 8.0 1.76 0 0 0 0 0 1 0 0 0 0 0 126 127 7.9 1.48 0 0 0 0 0 0 1 0 0 0 0 127 128 7.6 1.04 0 0 0 0 0 0 0 1 0 0 0 128 129 7.6 1.62 0 0 0 0 0 0 0 0 1 0 0 129 130 8.3 1.49 0 0 0 0 0 0 0 0 0 1 0 130 131 8.4 1.79 0 0 0 0 0 0 0 0 0 0 1 131 132 8.4 1.80 0 0 0 0 0 0 0 0 0 0 0 132 133 8.4 1.58 1 0 0 0 0 0 0 0 0 0 0 133 134 8.4 1.86 0 1 0 0 0 0 0 0 0 0 0 134 135 8.6 1.74 0 0 1 0 0 0 0 0 0 0 0 135 136 8.9 1.59 0 0 0 1 0 0 0 0 0 0 0 136 137 8.8 1.26 0 0 0 0 1 0 0 0 0 0 0 137 138 8.3 1.13 0 0 0 0 0 1 0 0 0 0 0 138 139 7.5 1.92 0 0 0 0 0 0 1 0 0 0 0 139 140 7.2 2.61 0 0 0 0 0 0 0 1 0 0 0 140 141 7.4 2.26 0 0 0 0 0 0 0 0 1 0 0 141 142 8.8 2.41 0 0 0 0 0 0 0 0 0 1 0 142 143 9.3 2.26 0 0 0 0 0 0 0 0 0 0 1 143 144 9.3 2.03 0 0 0 0 0 0 0 0 0 0 0 144 145 8.7 2.86 1 0 0 0 0 0 0 0 0 0 0 145 146 8.2 2.55 0 1 0 0 0 0 0 0 0 0 0 146 147 8.3 2.27 0 0 1 0 0 0 0 0 0 0 0 147 148 8.5 2.26 0 0 0 1 0 0 0 0 0 0 0 148 149 8.6 2.57 0 0 0 0 1 0 0 0 0 0 0 149 150 8.5 3.07 0 0 0 0 0 1 0 0 0 0 0 150 151 8.2 2.76 0 0 0 0 0 0 1 0 0 0 0 151 152 8.1 2.51 0 0 0 0 0 0 0 1 0 0 0 152 153 7.9 2.87 0 0 0 0 0 0 0 0 1 0 0 153 154 8.6 3.14 0 0 0 0 0 0 0 0 0 1 0 154 155 8.7 3.11 0 0 0 0 0 0 0 0 0 0 1 155 156 8.7 3.16 0 0 0 0 0 0 0 0 0 0 0 156 157 8.5 2.47 1 0 0 0 0 0 0 0 0 0 0 157 158 8.4 2.57 0 1 0 0 0 0 0 0 0 0 0 158 159 8.5 2.89 0 0 1 0 0 0 0 0 0 0 0 159 160 8.7 2.63 0 0 0 1 0 0 0 0 0 0 0 160 161 8.7 2.38 0 0 0 0 1 0 0 0 0 0 0 161 162 8.6 1.69 0 0 0 0 0 1 0 0 0 0 0 162 163 8.5 1.96 0 0 0 0 0 0 1 0 0 0 0 163 164 8.3 2.19 0 0 0 0 0 0 0 1 0 0 0 164 165 8.0 1.87 0 0 0 0 0 0 0 0 1 0 0 165 166 8.2 1.60 0 0 0 0 0 0 0 0 0 1 0 166 167 8.1 1.63 0 0 0 0 0 0 0 0 0 0 1 167 168 8.1 1.22 0 0 0 0 0 0 0 0 0 0 0 168 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 10.553735 -0.432711 -0.204465 -0.352280 -0.323755 -0.270643 M5 M6 M7 M8 M9 M10 -0.343972 -0.500510 -0.657733 -0.826083 -0.926680 -0.428237 M11 t -0.045076 -0.009603 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.1663 -0.6186 0.1931 0.6600 1.3121 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10.553735 0.330496 31.933 < 2e-16 *** X -0.432711 0.100677 -4.298 3.04e-05 *** M1 -0.204465 0.333939 -0.612 0.54125 M2 -0.352280 0.333861 -1.055 0.29300 M3 -0.323755 0.333813 -0.970 0.33363 M4 -0.270643 0.333752 -0.811 0.41867 M5 -0.343972 0.333711 -1.031 0.30427 M6 -0.500510 0.333670 -1.500 0.13566 M7 -0.657733 0.333662 -1.971 0.05049 . M8 -0.826083 0.333637 -2.476 0.01437 * M9 -0.926680 0.333592 -2.778 0.00615 ** M10 -0.428237 0.333572 -1.284 0.20114 M11 -0.045076 0.333578 -0.135 0.89269 t -0.009603 0.001408 -6.822 1.93e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.8825 on 154 degrees of freedom Multiple R-squared: 0.3482, Adjusted R-squared: 0.2932 F-statistic: 6.33 on 13 and 154 DF, p-value: 1.735e-09 > 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,] 5.973275e-05 1.194655e-04 9.999403e-01 [2,] 2.288855e-06 4.577710e-06 9.999977e-01 [3,] 1.203853e-07 2.407705e-07 9.999999e-01 [4,] 1.028740e-06 2.057481e-06 9.999990e-01 [5,] 1.929435e-05 3.858870e-05 9.999807e-01 [6,] 4.986421e-05 9.972842e-05 9.999501e-01 [7,] 4.181743e-05 8.363486e-05 9.999582e-01 [8,] 6.986527e-05 1.397305e-04 9.999301e-01 [9,] 8.668969e-05 1.733794e-04 9.999133e-01 [10,] 1.095222e-04 2.190443e-04 9.998905e-01 [11,] 1.107551e-04 2.215101e-04 9.998892e-01 [12,] 9.675505e-05 1.935101e-04 9.999032e-01 [13,] 6.900576e-05 1.380115e-04 9.999310e-01 [14,] 4.814952e-05 9.629903e-05 9.999519e-01 [15,] 2.950307e-05 5.900614e-05 9.999705e-01 [16,] 1.245316e-05 2.490632e-05 9.999875e-01 [17,] 5.097799e-06 1.019560e-05 9.999949e-01 [18,] 1.830984e-06 3.661967e-06 9.999982e-01 [19,] 6.462671e-07 1.292534e-06 9.999994e-01 [20,] 2.272729e-07 4.545457e-07 9.999998e-01 [21,] 1.255944e-07 2.511887e-07 9.999999e-01 [22,] 2.295754e-07 4.591508e-07 9.999998e-01 [23,] 3.715508e-07 7.431016e-07 9.999996e-01 [24,] 2.313826e-06 4.627651e-06 9.999977e-01 [25,] 6.039882e-06 1.207976e-05 9.999940e-01 [26,] 2.041914e-05 4.083829e-05 9.999796e-01 [27,] 4.651900e-05 9.303800e-05 9.999535e-01 [28,] 1.094489e-04 2.188977e-04 9.998906e-01 [29,] 2.430438e-04 4.860876e-04 9.997570e-01 [30,] 5.355407e-04 1.071081e-03 9.994645e-01 [31,] 1.011178e-03 2.022357e-03 9.989888e-01 [32,] 2.092800e-03 4.185600e-03 9.979072e-01 [33,] 3.260784e-03 6.521569e-03 9.967392e-01 [34,] 4.329930e-03 8.659861e-03 9.956701e-01 [35,] 5.527457e-03 1.105491e-02 9.944725e-01 [36,] 7.555234e-03 1.511047e-02 9.924448e-01 [37,] 9.225595e-03 1.845119e-02 9.907744e-01 [38,] 1.153824e-02 2.307647e-02 9.884618e-01 [39,] 1.405363e-02 2.810726e-02 9.859464e-01 [40,] 1.540862e-02 3.081724e-02 9.845914e-01 [41,] 1.634755e-02 3.269510e-02 9.836524e-01 [42,] 1.708956e-02 3.417912e-02 9.829104e-01 [43,] 2.043163e-02 4.086327e-02 9.795684e-01 [44,] 2.437521e-02 4.875042e-02 9.756248e-01 [45,] 2.341086e-02 4.682172e-02 9.765891e-01 [46,] 2.398392e-02 4.796784e-02 9.760161e-01 [47,] 2.361858e-02 4.723715e-02 9.763814e-01 [48,] 2.130788e-02 4.261575e-02 9.786921e-01 [49,] 1.991708e-02 3.983415e-02 9.800829e-01 [50,] 1.991702e-02 3.983405e-02 9.800830e-01 [51,] 2.441977e-02 4.883954e-02 9.755802e-01 [52,] 3.714947e-02 7.429893e-02 9.628505e-01 [53,] 5.496996e-02 1.099399e-01 9.450300e-01 [54,] 6.228980e-02 1.245796e-01 9.377102e-01 [55,] 7.207341e-02 1.441468e-01 9.279266e-01 [56,] 1.036945e-01 2.073889e-01 8.963055e-01 [57,] 1.248414e-01 2.496829e-01 8.751586e-01 [58,] 1.391561e-01 2.783122e-01 8.608439e-01 [59,] 1.547941e-01 3.095882e-01 8.452059e-01 [60,] 1.906855e-01 3.813710e-01 8.093145e-01 [61,] 2.433638e-01 4.867276e-01 7.566362e-01 [62,] 3.451920e-01 6.903840e-01 6.548080e-01 [63,] 4.837807e-01 9.675614e-01 5.162193e-01 [64,] 6.305620e-01 7.388760e-01 3.694380e-01 [65,] 7.778416e-01 4.443167e-01 2.221584e-01 [66,] 8.622814e-01 2.754373e-01 1.377186e-01 [67,] 9.508683e-01 9.826338e-02 4.913169e-02 [68,] 9.885741e-01 2.285189e-02 1.142594e-02 [69,] 9.956118e-01 8.776353e-03 4.388177e-03 [70,] 9.982803e-01 3.439370e-03 1.719685e-03 [71,] 9.992301e-01 1.539761e-03 7.698806e-04 [72,] 9.995919e-01 8.161229e-04 4.080614e-04 [73,] 9.997515e-01 4.970919e-04 2.485459e-04 [74,] 9.998207e-01 3.585549e-04 1.792774e-04 [75,] 9.998644e-01 2.712999e-04 1.356500e-04 [76,] 9.998819e-01 2.361754e-04 1.180877e-04 [77,] 9.998617e-01 2.765574e-04 1.382787e-04 [78,] 9.998036e-01 3.927519e-04 1.963759e-04 [79,] 9.997979e-01 4.042935e-04 2.021467e-04 [80,] 9.997530e-01 4.939279e-04 2.469639e-04 [81,] 9.996113e-01 7.774767e-04 3.887384e-04 [82,] 9.993898e-01 1.220330e-03 6.101650e-04 [83,] 9.992800e-01 1.439968e-03 7.199841e-04 [84,] 9.996752e-01 6.496866e-04 3.248433e-04 [85,] 9.999109e-01 1.782981e-04 8.914903e-05 [86,] 9.999704e-01 5.915872e-05 2.957936e-05 [87,] 9.999586e-01 8.277197e-05 4.138598e-05 [88,] 9.999317e-01 1.365629e-04 6.828147e-05 [89,] 9.999066e-01 1.868611e-04 9.343054e-05 [90,] 9.999690e-01 6.191161e-05 3.095581e-05 [91,] 9.999941e-01 1.188346e-05 5.941730e-06 [92,] 9.999979e-01 4.199716e-06 2.099858e-06 [93,] 9.999968e-01 6.373949e-06 3.186975e-06 [94,] 9.999946e-01 1.082750e-05 5.413751e-06 [95,] 9.999916e-01 1.681837e-05 8.409186e-06 [96,] 9.999931e-01 1.370306e-05 6.851531e-06 [97,] 9.999962e-01 7.665683e-06 3.832841e-06 [98,] 9.999980e-01 4.017934e-06 2.008967e-06 [99,] 9.999979e-01 4.152986e-06 2.076493e-06 [100,] 9.999976e-01 4.850433e-06 2.425216e-06 [101,] 9.999973e-01 5.447576e-06 2.723788e-06 [102,] 9.999976e-01 4.843740e-06 2.421870e-06 [103,] 9.999985e-01 2.929654e-06 1.464827e-06 [104,] 9.999987e-01 2.668443e-06 1.334222e-06 [105,] 9.999977e-01 4.596513e-06 2.298257e-06 [106,] 9.999951e-01 9.739444e-06 4.869722e-06 [107,] 9.999906e-01 1.878537e-05 9.392686e-06 [108,] 9.999831e-01 3.370426e-05 1.685213e-05 [109,] 9.999797e-01 4.064831e-05 2.032416e-05 [110,] 9.999748e-01 5.043984e-05 2.521992e-05 [111,] 9.999520e-01 9.596569e-05 4.798285e-05 [112,] 9.999030e-01 1.940124e-04 9.700620e-05 [113,] 9.998264e-01 3.471482e-04 1.735741e-04 [114,] 9.997127e-01 5.745426e-04 2.872713e-04 [115,] 9.995483e-01 9.034039e-04 4.517020e-04 [116,] 9.993121e-01 1.375887e-03 6.879434e-04 [117,] 9.988328e-01 2.334366e-03 1.167183e-03 [118,] 9.981995e-01 3.601026e-03 1.800513e-03 [119,] 9.974632e-01 5.073616e-03 2.536808e-03 [120,] 9.969514e-01 6.097156e-03 3.048578e-03 [121,] 9.958790e-01 8.242020e-03 4.121010e-03 [122,] 9.926366e-01 1.472679e-02 7.363397e-03 [123,] 9.938478e-01 1.230434e-02 6.152168e-03 [124,] 9.988573e-01 2.285478e-03 1.142739e-03 [125,] 9.995073e-01 9.853718e-04 4.926859e-04 [126,] 9.991076e-01 1.784865e-03 8.924323e-04 [127,] 9.995649e-01 8.701193e-04 4.350597e-04 [128,] 9.999951e-01 9.752845e-06 4.876423e-06 [129,] 9.999887e-01 2.266312e-05 1.133156e-05 [130,] 9.999475e-01 1.050187e-04 5.250934e-05 [131,] 9.998337e-01 3.326917e-04 1.663459e-04 [132,] 9.995563e-01 8.873661e-04 4.436831e-04 [133,] 9.988847e-01 2.230601e-03 1.115300e-03 [134,] 9.982827e-01 3.434558e-03 1.717279e-03 [135,] 9.952407e-01 9.518563e-03 4.759281e-03 > postscript(file="/var/www/html/rcomp/tmp/1m0es1258726599.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/23t0n1258726599.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/3sqmq1258726599.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/4xzg11258726599.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/5t5861258726599.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 = 168 Frequency = 1 1 2 3 4 5 6 -1.80501063 -1.61730297 -1.36266401 -1.01578054 -0.96313774 -0.72776380 7 8 9 10 11 12 -0.66959160 -0.58683473 -0.51077550 -0.41307243 0.17732314 0.18174682 13 14 15 16 17 18 0.45254422 0.52774705 0.68238600 0.61771761 0.73526705 0.71919217 19 20 21 22 23 24 0.82928968 0.97214958 1.06889138 0.85841672 0.96802668 0.94120763 25 26 27 28 29 30 0.90815440 0.80931989 0.63414556 0.59929045 0.55626036 0.48778368 31 32 33 34 35 36 0.44162877 0.27678744 0.23938885 0.21593286 0.38131875 0.50690150 37 38 39 40 41 42 0.63395131 0.79954694 0.67629793 0.94914406 0.89745975 0.92850658 43 44 45 46 47 48 0.89966011 0.71703385 0.58396237 0.44704857 0.57349048 0.55965275 49 50 51 52 53 54 0.78574959 0.69989640 0.65453535 0.41582961 0.35596758 0.09709809 55 56 57 58 59 60 -0.02261767 0.19380309 0.37323645 0.34930398 0.55843745 0.52344066 61 62 63 64 65 66 0.39904166 0.40838487 0.27263102 0.01324271 0.13464278 0.32194203 67 68 69 70 71 72 0.60079680 0.73019889 0.62356655 0.19240933 0.16355179 0.39250867 73 74 75 76 77 78 0.32388559 -0.03985556 -0.15445036 -0.04218376 -0.04626986 0.12804806 79 80 81 82 83 84 0.06891182 -0.09592951 -0.22900099 -0.55678409 -0.61783734 -0.83215156 85 86 87 88 89 90 -0.87048487 -0.91354345 -0.85505388 -1.16346985 -1.31130353 -1.41102296 91 92 93 94 95 96 -1.43939294 -1.50951436 -1.24401531 -1.21554598 -1.05016009 -1.07793213 97 98 99 100 101 102 -1.13262089 -1.11895057 -1.60182614 -2.07082164 -2.16625352 -2.06934708 103 104 105 106 107 108 -1.39962302 -1.07022093 -1.35089060 -1.76088877 -1.92579265 -1.73867740 109 110 111 112 113 114 -0.78566493 -0.72344343 -0.62072979 -0.35268726 -0.58658664 -0.50313801 115 116 117 118 119 120 -0.90844298 -1.13819095 -1.32271125 -0.93846600 -1.22067831 -1.05615158 121 122 123 124 125 126 -0.62910177 -0.45389894 -0.25598889 -0.26873198 -0.05646262 -0.08166821 127 128 129 130 131 132 -0.13600085 -0.44844038 -0.08726844 0.06764003 -0.07610478 -0.10725095 133 134 135 136 137 138 0.01162114 0.29019810 0.41935088 0.61093491 0.45107288 0.06096065 139 140 141 142 143 144 -0.23037131 -0.05384750 0.10490329 1.08097081 1.14250609 1.00750930 145 146 147 148 149 150 0.98072785 0.50400537 0.46392441 0.61608796 0.93316092 1.21565657 151 152 153 154 155 156 0.94834260 0.91811814 0.98409369 1.31208652 1.02554710 1.01170937 157 158 159 160 161 162 0.72720733 0.82789632 1.04744191 1.09142774 1.06618258 0.83375224 163 164 165 166 167 168 1.01741060 1.09488738 0.76661950 0.36094844 -0.09962832 -0.31251307 > postscript(file="/var/www/html/rcomp/tmp/6fwii1258726599.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 = 168 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.80501063 NA 1 -1.61730297 -1.80501063 2 -1.36266401 -1.61730297 3 -1.01578054 -1.36266401 4 -0.96313774 -1.01578054 5 -0.72776380 -0.96313774 6 -0.66959160 -0.72776380 7 -0.58683473 -0.66959160 8 -0.51077550 -0.58683473 9 -0.41307243 -0.51077550 10 0.17732314 -0.41307243 11 0.18174682 0.17732314 12 0.45254422 0.18174682 13 0.52774705 0.45254422 14 0.68238600 0.52774705 15 0.61771761 0.68238600 16 0.73526705 0.61771761 17 0.71919217 0.73526705 18 0.82928968 0.71919217 19 0.97214958 0.82928968 20 1.06889138 0.97214958 21 0.85841672 1.06889138 22 0.96802668 0.85841672 23 0.94120763 0.96802668 24 0.90815440 0.94120763 25 0.80931989 0.90815440 26 0.63414556 0.80931989 27 0.59929045 0.63414556 28 0.55626036 0.59929045 29 0.48778368 0.55626036 30 0.44162877 0.48778368 31 0.27678744 0.44162877 32 0.23938885 0.27678744 33 0.21593286 0.23938885 34 0.38131875 0.21593286 35 0.50690150 0.38131875 36 0.63395131 0.50690150 37 0.79954694 0.63395131 38 0.67629793 0.79954694 39 0.94914406 0.67629793 40 0.89745975 0.94914406 41 0.92850658 0.89745975 42 0.89966011 0.92850658 43 0.71703385 0.89966011 44 0.58396237 0.71703385 45 0.44704857 0.58396237 46 0.57349048 0.44704857 47 0.55965275 0.57349048 48 0.78574959 0.55965275 49 0.69989640 0.78574959 50 0.65453535 0.69989640 51 0.41582961 0.65453535 52 0.35596758 0.41582961 53 0.09709809 0.35596758 54 -0.02261767 0.09709809 55 0.19380309 -0.02261767 56 0.37323645 0.19380309 57 0.34930398 0.37323645 58 0.55843745 0.34930398 59 0.52344066 0.55843745 60 0.39904166 0.52344066 61 0.40838487 0.39904166 62 0.27263102 0.40838487 63 0.01324271 0.27263102 64 0.13464278 0.01324271 65 0.32194203 0.13464278 66 0.60079680 0.32194203 67 0.73019889 0.60079680 68 0.62356655 0.73019889 69 0.19240933 0.62356655 70 0.16355179 0.19240933 71 0.39250867 0.16355179 72 0.32388559 0.39250867 73 -0.03985556 0.32388559 74 -0.15445036 -0.03985556 75 -0.04218376 -0.15445036 76 -0.04626986 -0.04218376 77 0.12804806 -0.04626986 78 0.06891182 0.12804806 79 -0.09592951 0.06891182 80 -0.22900099 -0.09592951 81 -0.55678409 -0.22900099 82 -0.61783734 -0.55678409 83 -0.83215156 -0.61783734 84 -0.87048487 -0.83215156 85 -0.91354345 -0.87048487 86 -0.85505388 -0.91354345 87 -1.16346985 -0.85505388 88 -1.31130353 -1.16346985 89 -1.41102296 -1.31130353 90 -1.43939294 -1.41102296 91 -1.50951436 -1.43939294 92 -1.24401531 -1.50951436 93 -1.21554598 -1.24401531 94 -1.05016009 -1.21554598 95 -1.07793213 -1.05016009 96 -1.13262089 -1.07793213 97 -1.11895057 -1.13262089 98 -1.60182614 -1.11895057 99 -2.07082164 -1.60182614 100 -2.16625352 -2.07082164 101 -2.06934708 -2.16625352 102 -1.39962302 -2.06934708 103 -1.07022093 -1.39962302 104 -1.35089060 -1.07022093 105 -1.76088877 -1.35089060 106 -1.92579265 -1.76088877 107 -1.73867740 -1.92579265 108 -0.78566493 -1.73867740 109 -0.72344343 -0.78566493 110 -0.62072979 -0.72344343 111 -0.35268726 -0.62072979 112 -0.58658664 -0.35268726 113 -0.50313801 -0.58658664 114 -0.90844298 -0.50313801 115 -1.13819095 -0.90844298 116 -1.32271125 -1.13819095 117 -0.93846600 -1.32271125 118 -1.22067831 -0.93846600 119 -1.05615158 -1.22067831 120 -0.62910177 -1.05615158 121 -0.45389894 -0.62910177 122 -0.25598889 -0.45389894 123 -0.26873198 -0.25598889 124 -0.05646262 -0.26873198 125 -0.08166821 -0.05646262 126 -0.13600085 -0.08166821 127 -0.44844038 -0.13600085 128 -0.08726844 -0.44844038 129 0.06764003 -0.08726844 130 -0.07610478 0.06764003 131 -0.10725095 -0.07610478 132 0.01162114 -0.10725095 133 0.29019810 0.01162114 134 0.41935088 0.29019810 135 0.61093491 0.41935088 136 0.45107288 0.61093491 137 0.06096065 0.45107288 138 -0.23037131 0.06096065 139 -0.05384750 -0.23037131 140 0.10490329 -0.05384750 141 1.08097081 0.10490329 142 1.14250609 1.08097081 143 1.00750930 1.14250609 144 0.98072785 1.00750930 145 0.50400537 0.98072785 146 0.46392441 0.50400537 147 0.61608796 0.46392441 148 0.93316092 0.61608796 149 1.21565657 0.93316092 150 0.94834260 1.21565657 151 0.91811814 0.94834260 152 0.98409369 0.91811814 153 1.31208652 0.98409369 154 1.02554710 1.31208652 155 1.01170937 1.02554710 156 0.72720733 1.01170937 157 0.82789632 0.72720733 158 1.04744191 0.82789632 159 1.09142774 1.04744191 160 1.06618258 1.09142774 161 0.83375224 1.06618258 162 1.01741060 0.83375224 163 1.09488738 1.01741060 164 0.76661950 1.09488738 165 0.36094844 0.76661950 166 -0.09962832 0.36094844 167 -0.31251307 -0.09962832 168 NA -0.31251307 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.61730297 -1.80501063 [2,] -1.36266401 -1.61730297 [3,] -1.01578054 -1.36266401 [4,] -0.96313774 -1.01578054 [5,] -0.72776380 -0.96313774 [6,] -0.66959160 -0.72776380 [7,] -0.58683473 -0.66959160 [8,] -0.51077550 -0.58683473 [9,] -0.41307243 -0.51077550 [10,] 0.17732314 -0.41307243 [11,] 0.18174682 0.17732314 [12,] 0.45254422 0.18174682 [13,] 0.52774705 0.45254422 [14,] 0.68238600 0.52774705 [15,] 0.61771761 0.68238600 [16,] 0.73526705 0.61771761 [17,] 0.71919217 0.73526705 [18,] 0.82928968 0.71919217 [19,] 0.97214958 0.82928968 [20,] 1.06889138 0.97214958 [21,] 0.85841672 1.06889138 [22,] 0.96802668 0.85841672 [23,] 0.94120763 0.96802668 [24,] 0.90815440 0.94120763 [25,] 0.80931989 0.90815440 [26,] 0.63414556 0.80931989 [27,] 0.59929045 0.63414556 [28,] 0.55626036 0.59929045 [29,] 0.48778368 0.55626036 [30,] 0.44162877 0.48778368 [31,] 0.27678744 0.44162877 [32,] 0.23938885 0.27678744 [33,] 0.21593286 0.23938885 [34,] 0.38131875 0.21593286 [35,] 0.50690150 0.38131875 [36,] 0.63395131 0.50690150 [37,] 0.79954694 0.63395131 [38,] 0.67629793 0.79954694 [39,] 0.94914406 0.67629793 [40,] 0.89745975 0.94914406 [41,] 0.92850658 0.89745975 [42,] 0.89966011 0.92850658 [43,] 0.71703385 0.89966011 [44,] 0.58396237 0.71703385 [45,] 0.44704857 0.58396237 [46,] 0.57349048 0.44704857 [47,] 0.55965275 0.57349048 [48,] 0.78574959 0.55965275 [49,] 0.69989640 0.78574959 [50,] 0.65453535 0.69989640 [51,] 0.41582961 0.65453535 [52,] 0.35596758 0.41582961 [53,] 0.09709809 0.35596758 [54,] -0.02261767 0.09709809 [55,] 0.19380309 -0.02261767 [56,] 0.37323645 0.19380309 [57,] 0.34930398 0.37323645 [58,] 0.55843745 0.34930398 [59,] 0.52344066 0.55843745 [60,] 0.39904166 0.52344066 [61,] 0.40838487 0.39904166 [62,] 0.27263102 0.40838487 [63,] 0.01324271 0.27263102 [64,] 0.13464278 0.01324271 [65,] 0.32194203 0.13464278 [66,] 0.60079680 0.32194203 [67,] 0.73019889 0.60079680 [68,] 0.62356655 0.73019889 [69,] 0.19240933 0.62356655 [70,] 0.16355179 0.19240933 [71,] 0.39250867 0.16355179 [72,] 0.32388559 0.39250867 [73,] -0.03985556 0.32388559 [74,] -0.15445036 -0.03985556 [75,] -0.04218376 -0.15445036 [76,] -0.04626986 -0.04218376 [77,] 0.12804806 -0.04626986 [78,] 0.06891182 0.12804806 [79,] -0.09592951 0.06891182 [80,] -0.22900099 -0.09592951 [81,] -0.55678409 -0.22900099 [82,] -0.61783734 -0.55678409 [83,] -0.83215156 -0.61783734 [84,] -0.87048487 -0.83215156 [85,] -0.91354345 -0.87048487 [86,] -0.85505388 -0.91354345 [87,] -1.16346985 -0.85505388 [88,] -1.31130353 -1.16346985 [89,] -1.41102296 -1.31130353 [90,] -1.43939294 -1.41102296 [91,] -1.50951436 -1.43939294 [92,] -1.24401531 -1.50951436 [93,] -1.21554598 -1.24401531 [94,] -1.05016009 -1.21554598 [95,] -1.07793213 -1.05016009 [96,] -1.13262089 -1.07793213 [97,] -1.11895057 -1.13262089 [98,] -1.60182614 -1.11895057 [99,] -2.07082164 -1.60182614 [100,] -2.16625352 -2.07082164 [101,] -2.06934708 -2.16625352 [102,] -1.39962302 -2.06934708 [103,] -1.07022093 -1.39962302 [104,] -1.35089060 -1.07022093 [105,] -1.76088877 -1.35089060 [106,] -1.92579265 -1.76088877 [107,] -1.73867740 -1.92579265 [108,] -0.78566493 -1.73867740 [109,] -0.72344343 -0.78566493 [110,] -0.62072979 -0.72344343 [111,] -0.35268726 -0.62072979 [112,] -0.58658664 -0.35268726 [113,] -0.50313801 -0.58658664 [114,] -0.90844298 -0.50313801 [115,] -1.13819095 -0.90844298 [116,] -1.32271125 -1.13819095 [117,] -0.93846600 -1.32271125 [118,] -1.22067831 -0.93846600 [119,] -1.05615158 -1.22067831 [120,] -0.62910177 -1.05615158 [121,] -0.45389894 -0.62910177 [122,] -0.25598889 -0.45389894 [123,] -0.26873198 -0.25598889 [124,] -0.05646262 -0.26873198 [125,] -0.08166821 -0.05646262 [126,] -0.13600085 -0.08166821 [127,] -0.44844038 -0.13600085 [128,] -0.08726844 -0.44844038 [129,] 0.06764003 -0.08726844 [130,] -0.07610478 0.06764003 [131,] -0.10725095 -0.07610478 [132,] 0.01162114 -0.10725095 [133,] 0.29019810 0.01162114 [134,] 0.41935088 0.29019810 [135,] 0.61093491 0.41935088 [136,] 0.45107288 0.61093491 [137,] 0.06096065 0.45107288 [138,] -0.23037131 0.06096065 [139,] -0.05384750 -0.23037131 [140,] 0.10490329 -0.05384750 [141,] 1.08097081 0.10490329 [142,] 1.14250609 1.08097081 [143,] 1.00750930 1.14250609 [144,] 0.98072785 1.00750930 [145,] 0.50400537 0.98072785 [146,] 0.46392441 0.50400537 [147,] 0.61608796 0.46392441 [148,] 0.93316092 0.61608796 [149,] 1.21565657 0.93316092 [150,] 0.94834260 1.21565657 [151,] 0.91811814 0.94834260 [152,] 0.98409369 0.91811814 [153,] 1.31208652 0.98409369 [154,] 1.02554710 1.31208652 [155,] 1.01170937 1.02554710 [156,] 0.72720733 1.01170937 [157,] 0.82789632 0.72720733 [158,] 1.04744191 0.82789632 [159,] 1.09142774 1.04744191 [160,] 1.06618258 1.09142774 [161,] 0.83375224 1.06618258 [162,] 1.01741060 0.83375224 [163,] 1.09488738 1.01741060 [164,] 0.76661950 1.09488738 [165,] 0.36094844 0.76661950 [166,] -0.09962832 0.36094844 [167,] -0.31251307 -0.09962832 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.61730297 -1.80501063 2 -1.36266401 -1.61730297 3 -1.01578054 -1.36266401 4 -0.96313774 -1.01578054 5 -0.72776380 -0.96313774 6 -0.66959160 -0.72776380 7 -0.58683473 -0.66959160 8 -0.51077550 -0.58683473 9 -0.41307243 -0.51077550 10 0.17732314 -0.41307243 11 0.18174682 0.17732314 12 0.45254422 0.18174682 13 0.52774705 0.45254422 14 0.68238600 0.52774705 15 0.61771761 0.68238600 16 0.73526705 0.61771761 17 0.71919217 0.73526705 18 0.82928968 0.71919217 19 0.97214958 0.82928968 20 1.06889138 0.97214958 21 0.85841672 1.06889138 22 0.96802668 0.85841672 23 0.94120763 0.96802668 24 0.90815440 0.94120763 25 0.80931989 0.90815440 26 0.63414556 0.80931989 27 0.59929045 0.63414556 28 0.55626036 0.59929045 29 0.48778368 0.55626036 30 0.44162877 0.48778368 31 0.27678744 0.44162877 32 0.23938885 0.27678744 33 0.21593286 0.23938885 34 0.38131875 0.21593286 35 0.50690150 0.38131875 36 0.63395131 0.50690150 37 0.79954694 0.63395131 38 0.67629793 0.79954694 39 0.94914406 0.67629793 40 0.89745975 0.94914406 41 0.92850658 0.89745975 42 0.89966011 0.92850658 43 0.71703385 0.89966011 44 0.58396237 0.71703385 45 0.44704857 0.58396237 46 0.57349048 0.44704857 47 0.55965275 0.57349048 48 0.78574959 0.55965275 49 0.69989640 0.78574959 50 0.65453535 0.69989640 51 0.41582961 0.65453535 52 0.35596758 0.41582961 53 0.09709809 0.35596758 54 -0.02261767 0.09709809 55 0.19380309 -0.02261767 56 0.37323645 0.19380309 57 0.34930398 0.37323645 58 0.55843745 0.34930398 59 0.52344066 0.55843745 60 0.39904166 0.52344066 61 0.40838487 0.39904166 62 0.27263102 0.40838487 63 0.01324271 0.27263102 64 0.13464278 0.01324271 65 0.32194203 0.13464278 66 0.60079680 0.32194203 67 0.73019889 0.60079680 68 0.62356655 0.73019889 69 0.19240933 0.62356655 70 0.16355179 0.19240933 71 0.39250867 0.16355179 72 0.32388559 0.39250867 73 -0.03985556 0.32388559 74 -0.15445036 -0.03985556 75 -0.04218376 -0.15445036 76 -0.04626986 -0.04218376 77 0.12804806 -0.04626986 78 0.06891182 0.12804806 79 -0.09592951 0.06891182 80 -0.22900099 -0.09592951 81 -0.55678409 -0.22900099 82 -0.61783734 -0.55678409 83 -0.83215156 -0.61783734 84 -0.87048487 -0.83215156 85 -0.91354345 -0.87048487 86 -0.85505388 -0.91354345 87 -1.16346985 -0.85505388 88 -1.31130353 -1.16346985 89 -1.41102296 -1.31130353 90 -1.43939294 -1.41102296 91 -1.50951436 -1.43939294 92 -1.24401531 -1.50951436 93 -1.21554598 -1.24401531 94 -1.05016009 -1.21554598 95 -1.07793213 -1.05016009 96 -1.13262089 -1.07793213 97 -1.11895057 -1.13262089 98 -1.60182614 -1.11895057 99 -2.07082164 -1.60182614 100 -2.16625352 -2.07082164 101 -2.06934708 -2.16625352 102 -1.39962302 -2.06934708 103 -1.07022093 -1.39962302 104 -1.35089060 -1.07022093 105 -1.76088877 -1.35089060 106 -1.92579265 -1.76088877 107 -1.73867740 -1.92579265 108 -0.78566493 -1.73867740 109 -0.72344343 -0.78566493 110 -0.62072979 -0.72344343 111 -0.35268726 -0.62072979 112 -0.58658664 -0.35268726 113 -0.50313801 -0.58658664 114 -0.90844298 -0.50313801 115 -1.13819095 -0.90844298 116 -1.32271125 -1.13819095 117 -0.93846600 -1.32271125 118 -1.22067831 -0.93846600 119 -1.05615158 -1.22067831 120 -0.62910177 -1.05615158 121 -0.45389894 -0.62910177 122 -0.25598889 -0.45389894 123 -0.26873198 -0.25598889 124 -0.05646262 -0.26873198 125 -0.08166821 -0.05646262 126 -0.13600085 -0.08166821 127 -0.44844038 -0.13600085 128 -0.08726844 -0.44844038 129 0.06764003 -0.08726844 130 -0.07610478 0.06764003 131 -0.10725095 -0.07610478 132 0.01162114 -0.10725095 133 0.29019810 0.01162114 134 0.41935088 0.29019810 135 0.61093491 0.41935088 136 0.45107288 0.61093491 137 0.06096065 0.45107288 138 -0.23037131 0.06096065 139 -0.05384750 -0.23037131 140 0.10490329 -0.05384750 141 1.08097081 0.10490329 142 1.14250609 1.08097081 143 1.00750930 1.14250609 144 0.98072785 1.00750930 145 0.50400537 0.98072785 146 0.46392441 0.50400537 147 0.61608796 0.46392441 148 0.93316092 0.61608796 149 1.21565657 0.93316092 150 0.94834260 1.21565657 151 0.91811814 0.94834260 152 0.98409369 0.91811814 153 1.31208652 0.98409369 154 1.02554710 1.31208652 155 1.01170937 1.02554710 156 0.72720733 1.01170937 157 0.82789632 0.72720733 158 1.04744191 0.82789632 159 1.09142774 1.04744191 160 1.06618258 1.09142774 161 0.83375224 1.06618258 162 1.01741060 0.83375224 163 1.09488738 1.01741060 164 0.76661950 1.09488738 165 0.36094844 0.76661950 166 -0.09962832 0.36094844 167 -0.31251307 -0.09962832 > 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/7t3qh1258726599.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/8e8231258726599.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/9sto31258726599.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/10wv0g1258726599.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/11l6z51258726599.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/12w9871258726599.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/13p4zs1258726599.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/14n14j1258726599.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/15xs2c1258726599.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/167psm1258726599.tab") + } > system("convert tmp/1m0es1258726599.ps tmp/1m0es1258726599.png") > system("convert tmp/23t0n1258726599.ps tmp/23t0n1258726599.png") > system("convert tmp/3sqmq1258726599.ps tmp/3sqmq1258726599.png") > system("convert tmp/4xzg11258726599.ps tmp/4xzg11258726599.png") > system("convert tmp/5t5861258726599.ps tmp/5t5861258726599.png") > system("convert tmp/6fwii1258726599.ps tmp/6fwii1258726599.png") > system("convert tmp/7t3qh1258726599.ps tmp/7t3qh1258726599.png") > system("convert tmp/8e8231258726599.ps tmp/8e8231258726599.png") > system("convert tmp/9sto31258726599.ps tmp/9sto31258726599.png") > system("convert tmp/10wv0g1258726599.ps tmp/10wv0g1258726599.png") > > > proc.time() user system elapsed 4.268 1.658 4.767