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(11 + ,14 + ,11 + ,12 + ,12 + ,11 + ,11 + ,7 + ,8 + ,11 + ,11 + ,6 + ,17 + ,8 + ,14 + ,11 + ,12 + ,10 + ,8 + ,12 + ,11 + ,8 + ,12 + ,9 + ,21 + ,11 + ,10 + ,12 + ,7 + ,12 + ,11 + ,10 + ,11 + ,4 + ,22 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,16 + ,12 + ,7 + ,10 + ,11 + ,11 + ,13 + ,7 + ,13 + ,11 + ,13 + ,14 + ,12 + ,10 + ,11 + ,12 + ,16 + ,10 + ,8 + ,11 + ,8 + ,11 + ,10 + ,15 + ,11 + ,12 + ,10 + ,8 + ,14 + ,11 + ,11 + ,11 + ,8 + ,10 + ,11 + ,4 + ,15 + ,4 + ,14 + ,11 + ,9 + ,9 + ,9 + ,14 + ,11 + ,8 + ,11 + ,8 + ,11 + ,11 + ,8 + ,17 + ,7 + ,10 + ,11 + ,14 + ,17 + ,11 + ,13 + ,11 + ,15 + ,11 + ,9 + ,7 + ,11 + ,16 + ,18 + ,11 + ,14 + ,11 + ,9 + ,14 + ,13 + ,12 + ,11 + ,14 + ,10 + ,8 + ,14 + ,11 + ,11 + ,11 + ,8 + ,11 + ,11 + ,8 + ,15 + ,9 + ,9 + ,11 + ,9 + ,15 + ,6 + ,11 + ,11 + ,9 + ,13 + ,9 + ,15 + ,11 + ,9 + ,16 + ,9 + ,14 + ,11 + ,9 + ,13 + ,6 + ,13 + ,11 + ,10 + ,9 + ,6 + ,9 + ,11 + ,16 + ,18 + ,16 + ,15 + ,11 + ,11 + ,18 + ,5 + ,10 + ,11 + ,8 + ,12 + ,7 + ,11 + ,11 + ,9 + ,17 + ,9 + ,13 + ,11 + ,16 + ,9 + ,6 + ,8 + ,11 + ,11 + ,9 + ,6 + ,20 + ,11 + ,16 + ,12 + ,5 + ,12 + ,11 + ,12 + ,18 + ,12 + ,10 + ,11 + ,12 + ,12 + ,7 + ,10 + ,11 + ,14 + ,18 + ,10 + ,9 + ,11 + ,9 + ,14 + ,9 + ,14 + ,11 + ,10 + ,15 + ,8 + ,8 + ,11 + ,9 + ,16 + ,5 + ,14 + ,11 + ,10 + ,10 + ,8 + ,11 + ,11 + ,12 + ,11 + ,8 + ,13 + ,11 + ,14 + ,14 + ,10 + ,9 + ,11 + ,14 + ,9 + ,6 + ,11 + ,11 + ,10 + ,12 + ,8 + ,15 + ,11 + ,14 + ,17 + ,7 + ,11 + ,11 + ,16 + ,5 + ,4 + ,10 + ,11 + ,9 + ,12 + ,8 + ,14 + ,11 + ,10 + ,12 + ,8 + ,18 + ,11 + ,6 + ,6 + ,4 + ,14 + ,11 + ,8 + ,24 + ,20 + ,11 + ,11 + ,13 + ,12 + ,8 + ,12 + ,11 + ,10 + ,12 + ,8 + ,13 + ,11 + ,8 + ,14 + ,6 + ,9 + ,11 + ,7 + ,7 + ,4 + ,10 + ,11 + ,15 + ,13 + ,8 + ,15 + ,11 + ,9 + ,12 + ,9 + ,20 + ,11 + ,10 + ,13 + ,6 + ,12 + ,11 + ,12 + ,14 + ,7 + ,12 + ,11 + ,13 + ,8 + ,9 + ,14 + ,11 + ,10 + ,11 + ,5 + ,13 + ,11 + ,11 + ,9 + ,5 + ,11 + ,11 + ,8 + ,11 + ,8 + ,17 + ,11 + ,9 + ,13 + ,8 + ,12 + ,11 + ,13 + ,10 + ,6 + ,13 + ,11 + ,11 + ,11 + ,8 + ,14 + ,11 + ,8 + ,12 + ,7 + ,13 + ,11 + ,9 + ,9 + ,7 + ,15 + ,11 + ,9 + ,15 + ,9 + ,13 + ,11 + ,15 + ,18 + ,11 + ,10 + ,11 + ,9 + ,15 + ,6 + ,11 + ,11 + ,10 + ,12 + ,8 + ,19 + ,11 + ,14 + ,13 + ,6 + ,13 + ,11 + ,12 + ,14 + ,9 + ,17 + ,11 + ,12 + ,10 + ,8 + ,13 + ,11 + ,11 + ,13 + ,6 + ,9 + ,11 + ,14 + ,13 + ,10 + ,11 + ,11 + ,6 + ,11 + ,8 + ,10 + ,11 + ,12 + ,13 + ,8 + ,9 + ,11 + ,8 + ,16 + ,10 + ,12 + ,11 + ,14 + ,8 + ,5 + ,12 + ,11 + ,11 + ,16 + ,7 + ,13 + ,11 + ,10 + ,11 + ,5 + ,13 + ,11 + ,14 + ,9 + ,8 + ,12 + ,11 + ,12 + ,16 + ,14 + ,15 + ,11 + ,10 + ,12 + ,7 + ,22 + ,11 + ,14 + ,14 + ,8 + ,13 + ,11 + ,5 + ,8 + ,6 + ,15 + ,11 + ,11 + ,9 + ,5 + ,13 + ,11 + ,10 + ,15 + ,6 + ,15 + ,11 + ,9 + ,11 + ,10 + ,10 + ,11 + ,10 + ,21 + ,12 + ,11 + ,11 + ,16 + ,14 + ,9 + ,16 + ,11 + ,13 + ,18 + ,12 + ,11 + ,11 + ,9 + ,12 + ,7 + ,11 + ,11 + ,10 + ,13 + ,8 + ,10 + ,11 + ,10 + ,15 + ,10 + ,10 + ,11 + ,7 + ,12 + ,6 + ,16 + ,11 + ,9 + ,19 + ,10 + ,12 + ,11 + ,8 + ,15 + ,10 + ,11 + ,11 + ,14 + ,11 + ,10 + ,16 + ,11 + ,14 + ,11 + ,5 + ,19 + ,11 + ,8 + ,10 + ,7 + ,11 + ,11 + ,9 + ,13 + ,10 + ,16 + ,11 + ,14 + ,15 + ,11 + ,15 + ,11 + ,14 + ,12 + ,6 + ,24 + ,11 + ,8 + ,12 + ,7 + ,14 + ,11 + ,8 + ,16 + ,12 + ,15 + ,11 + ,8 + ,9 + ,11 + ,11 + ,11 + ,7 + ,18 + ,11 + ,15 + ,11 + ,6 + ,8 + ,11 + ,12 + ,11 + ,8 + ,13 + ,5 + ,10 + ,11 + ,6 + ,17 + ,8 + ,14 + ,11 + ,11 + ,9 + ,6 + ,13 + ,11 + ,14 + ,15 + ,9 + ,9 + ,11 + ,11 + ,8 + ,4 + ,15 + ,11 + ,11 + ,7 + ,4 + ,15 + ,11 + ,11 + ,12 + ,7 + ,14 + ,11 + ,14 + ,14 + ,11 + ,11 + ,11 + ,8 + ,6 + ,6 + ,8 + ,11 + ,20 + ,8 + ,7 + ,11 + ,11 + ,11 + ,17 + ,8 + ,11 + ,11 + ,8 + ,10 + ,4 + ,8 + ,11 + ,11 + ,11 + ,8 + ,10 + ,11 + ,10 + ,14 + ,9 + ,11 + ,11 + ,14 + ,11 + ,8 + ,13 + ,11 + ,11 + ,13 + ,11 + ,11 + ,11 + ,9 + ,12 + ,8 + ,20 + ,11 + ,9 + ,11 + ,5 + ,10 + ,11 + ,8 + ,9 + ,4 + ,15 + ,11 + ,10 + ,12 + ,8 + ,12 + ,11 + ,13 + ,20 + ,10 + ,14 + ,11 + ,13 + ,12 + ,6 + ,23 + ,11 + ,12 + ,13 + ,9 + ,14 + ,11 + ,8 + ,12 + ,9 + ,16 + ,11 + ,13 + ,12 + ,13 + ,11 + ,11 + ,14 + ,9 + ,9 + ,12 + ,11 + ,12 + ,15 + ,10 + ,10 + ,11 + ,14 + ,24 + ,20 + ,14 + ,11 + ,15 + ,7 + ,5 + ,12 + ,11 + ,13 + ,17 + ,11 + ,12 + ,11 + ,16 + ,11 + ,6 + ,11 + ,11 + ,9 + ,17 + ,9 + ,12 + ,11 + ,9 + ,11 + ,7 + ,13 + ,11 + ,9 + ,12 + ,9 + ,11 + ,11 + ,8 + ,14 + ,10 + ,19 + ,11 + ,7 + ,11 + ,9 + ,12 + ,11 + ,16 + ,16 + ,8 + ,17 + ,11 + ,11 + ,21 + ,7 + ,9 + ,11 + ,9 + ,14 + ,6 + ,12 + ,11 + ,11 + ,20 + ,13 + ,19 + ,11 + ,9 + ,13 + ,6 + ,18 + ,11 + ,14 + ,11 + ,8 + ,15 + ,11 + ,13 + ,15 + ,10 + ,14 + ,11 + ,16 + ,19 + ,16 + ,11 + ,11 + ,9 + ,11 + ,18 + ,11 + ,16) + ,dim=c(5 + ,162) + ,dimnames=list(c('Month' + ,'Doubts' + ,'Expectations' + ,'Criticism' + ,'Depression') + ,1:162)) > y <- array(NA,dim=c(5,162),dimnames=list(c('Month','Doubts','Expectations','Criticism','Depression'),1:162)) > 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 = '5' > #'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 Depression Month Doubts Expectations Criticism t 1 12 11 14 11 12 1 2 11 11 11 7 8 2 3 14 11 6 17 8 3 4 12 11 12 10 8 4 5 21 11 8 12 9 5 6 12 11 10 12 7 6 7 22 11 10 11 4 7 8 11 11 11 11 11 8 9 10 11 16 12 7 9 10 13 11 11 13 7 10 11 10 11 13 14 12 11 12 8 11 12 16 10 12 13 15 11 8 11 10 13 14 14 11 12 10 8 14 15 10 11 11 11 8 15 16 14 11 4 15 4 16 17 14 11 9 9 9 17 18 11 11 8 11 8 18 19 10 11 8 17 7 19 20 13 11 14 17 11 20 21 7 11 15 11 9 21 22 14 11 16 18 11 22 23 12 11 9 14 13 23 24 14 11 14 10 8 24 25 11 11 11 11 8 25 26 9 11 8 15 9 26 27 11 11 9 15 6 27 28 15 11 9 13 9 28 29 14 11 9 16 9 29 30 13 11 9 13 6 30 31 9 11 10 9 6 31 32 15 11 16 18 16 32 33 10 11 11 18 5 33 34 11 11 8 12 7 34 35 13 11 9 17 9 35 36 8 11 16 9 6 36 37 20 11 11 9 6 37 38 12 11 16 12 5 38 39 10 11 12 18 12 39 40 10 11 12 12 7 40 41 9 11 14 18 10 41 42 14 11 9 14 9 42 43 8 11 10 15 8 43 44 14 11 9 16 5 44 45 11 11 10 10 8 45 46 13 11 12 11 8 46 47 9 11 14 14 10 47 48 11 11 14 9 6 48 49 15 11 10 12 8 49 50 11 11 14 17 7 50 51 10 11 16 5 4 51 52 14 11 9 12 8 52 53 18 11 10 12 8 53 54 14 11 6 6 4 54 55 11 11 8 24 20 55 56 12 11 13 12 8 56 57 13 11 10 12 8 57 58 9 11 8 14 6 58 59 10 11 7 7 4 59 60 15 11 15 13 8 60 61 20 11 9 12 9 61 62 12 11 10 13 6 62 63 12 11 12 14 7 63 64 14 11 13 8 9 64 65 13 11 10 11 5 65 66 11 11 11 9 5 66 67 17 11 8 11 8 67 68 12 11 9 13 8 68 69 13 11 13 10 6 69 70 14 11 11 11 8 70 71 13 11 8 12 7 71 72 15 11 9 9 7 72 73 13 11 9 15 9 73 74 10 11 15 18 11 74 75 11 11 9 15 6 75 76 19 11 10 12 8 76 77 13 11 14 13 6 77 78 17 11 12 14 9 78 79 13 11 12 10 8 79 80 9 11 11 13 6 80 81 11 11 14 13 10 81 82 10 11 6 11 8 82 83 9 11 12 13 8 83 84 12 11 8 16 10 84 85 12 11 14 8 5 85 86 13 11 11 16 7 86 87 13 11 10 11 5 87 88 12 11 14 9 8 88 89 15 11 12 16 14 89 90 22 11 10 12 7 90 91 13 11 14 14 8 91 92 15 11 5 8 6 92 93 13 11 11 9 5 93 94 15 11 10 15 6 94 95 10 11 9 11 10 95 96 11 11 10 21 12 96 97 16 11 16 14 9 97 98 11 11 13 18 12 98 99 11 11 9 12 7 99 100 10 11 10 13 8 100 101 10 11 10 15 10 101 102 16 11 7 12 6 102 103 12 11 9 19 10 103 104 11 11 8 15 10 104 105 16 11 14 11 10 105 106 19 11 14 11 5 106 107 11 11 8 10 7 107 108 16 11 9 13 10 108 109 15 11 14 15 11 109 110 24 11 14 12 6 110 111 14 11 8 12 7 111 112 15 11 8 16 12 112 113 11 11 8 9 11 113 114 15 11 7 18 11 114 115 12 11 6 8 11 115 116 10 11 8 13 5 116 117 14 11 6 17 8 117 118 13 11 11 9 6 118 119 9 11 14 15 9 119 120 15 11 11 8 4 120 121 15 11 11 7 4 121 122 14 11 11 12 7 122 123 11 11 14 14 11 123 124 8 11 8 6 6 124 125 11 11 20 8 7 125 126 11 11 11 17 8 126 127 8 11 8 10 4 127 128 10 11 11 11 8 128 129 11 11 10 14 9 129 130 13 11 14 11 8 130 131 11 11 11 13 11 131 132 20 11 9 12 8 132 133 10 11 9 11 5 133 134 15 11 8 9 4 134 135 12 11 10 12 8 135 136 14 11 13 20 10 136 137 23 11 13 12 6 137 138 14 11 12 13 9 138 139 16 11 8 12 9 139 140 11 11 13 12 13 140 141 12 11 14 9 9 141 142 10 11 12 15 10 142 143 14 11 14 24 20 143 144 12 11 15 7 5 144 145 12 11 13 17 11 145 146 11 11 16 11 6 146 147 12 11 9 17 9 147 148 13 11 9 11 7 148 149 11 11 9 12 9 149 150 19 11 8 14 10 150 151 12 11 7 11 9 151 152 17 11 16 16 8 152 153 9 11 11 21 7 153 154 12 11 9 14 6 154 155 19 11 11 20 13 155 156 18 11 9 13 6 156 157 15 11 14 11 8 157 158 14 11 13 15 10 158 159 11 11 16 19 16 159 160 11 11 9 11 18 160 161 12 16 11 14 11 161 162 8 12 11 11 7 162 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Month Doubts Expectations Criticism 18.729464 -0.457083 -0.078015 -0.013447 -0.047892 t 0.007117 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.6553 -2.0699 -0.4099 1.4382 11.0565 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 18.729464 7.033314 2.663 0.00856 ** Month -0.457083 0.631823 -0.723 0.47050 Doubts -0.078015 0.090654 -0.861 0.39079 Expectations -0.013447 0.088020 -0.153 0.87877 Criticism -0.047892 0.108905 -0.440 0.66072 t 0.007117 0.005404 1.317 0.18974 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.162 on 156 degrees of freedom Multiple R-squared: 0.01985, Adjusted R-squared: -0.01157 F-statistic: 0.6317 on 5 and 156 DF, p-value: 0.6758 > 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.97961805 0.04076390 0.02038195 [2,] 0.95973601 0.08052798 0.04026399 [3,] 0.92513428 0.14973144 0.07486572 [4,] 0.90478677 0.19042645 0.09521323 [5,] 0.85281192 0.29437615 0.14718808 [6,] 0.78907386 0.42185227 0.21092614 [7,] 0.78487010 0.43025979 0.21512990 [8,] 0.79595862 0.40808275 0.20404138 [9,] 0.73191424 0.53617152 0.26808576 [10,] 0.69040612 0.61918776 0.30959388 [11,] 0.62391462 0.75217076 0.37608538 [12,] 0.74981740 0.50036521 0.25018260 [13,] 0.73025027 0.53949946 0.26974973 [14,] 0.82057307 0.35885386 0.17942693 [15,] 0.77501230 0.44997540 0.22498770 [16,] 0.76353810 0.47292380 0.23646190 [17,] 0.71217119 0.57565762 0.28782881 [18,] 0.70170848 0.59658304 0.29829152 [19,] 0.64839285 0.70321430 0.35160715 [20,] 0.65503278 0.68993444 0.34496722 [21,] 0.62339881 0.75320238 0.37660119 [22,] 0.56250677 0.87498646 0.43749323 [23,] 0.55892284 0.88215431 0.44107716 [24,] 0.64116566 0.71766868 0.35883434 [25,] 0.60059587 0.79880826 0.39940413 [26,] 0.54723962 0.90552076 0.45276038 [27,] 0.49433932 0.98867864 0.50566068 [28,] 0.46519610 0.93039220 0.53480390 [29,] 0.77211151 0.45577699 0.22788849 [30,] 0.73343410 0.53313181 0.26656590 [31,] 0.69765960 0.60468081 0.30234040 [32,] 0.66457441 0.67085119 0.33542559 [33,] 0.63683902 0.72632197 0.36316098 [34,] 0.60108268 0.79783464 0.39891732 [35,] 0.62664647 0.74670707 0.37335353 [36,] 0.59559697 0.80880606 0.40440303 [37,] 0.55035855 0.89928290 0.44964145 [38,] 0.50922805 0.98154391 0.49077195 [39,] 0.48566955 0.97133909 0.51433045 [40,] 0.44046456 0.88092911 0.55953544 [41,] 0.43320481 0.86640962 0.56679519 [42,] 0.39230270 0.78460540 0.60769730 [43,] 0.36279577 0.72559155 0.63720423 [44,] 0.32764888 0.65529777 0.67235112 [45,] 0.42512384 0.85024768 0.57487616 [46,] 0.37911404 0.75822807 0.62088596 [47,] 0.33829631 0.67659262 0.66170369 [48,] 0.29701164 0.59402328 0.70298836 [49,] 0.25645104 0.51290208 0.74354896 [50,] 0.27729766 0.55459531 0.72270234 [51,] 0.28207431 0.56414862 0.71792569 [52,] 0.29846296 0.59692593 0.70153704 [53,] 0.48912782 0.97825563 0.51087218 [54,] 0.44439371 0.88878741 0.55560629 [55,] 0.40066297 0.80132594 0.59933703 [56,] 0.36352227 0.72704454 0.63647773 [57,] 0.32018634 0.64037268 0.67981366 [58,] 0.29354635 0.58709270 0.70645365 [59,] 0.30934738 0.61869476 0.69065262 [60,] 0.27298745 0.54597491 0.72701255 [61,] 0.23706576 0.47413152 0.76293424 [62,] 0.20632351 0.41264703 0.79367649 [63,] 0.17473141 0.34946281 0.82526859 [64,] 0.15416439 0.30832879 0.84583561 [65,] 0.12792250 0.25584499 0.87207750 [66,] 0.11583335 0.23166670 0.88416665 [67,] 0.10275414 0.20550829 0.89724586 [68,] 0.16750080 0.33500161 0.83249920 [69,] 0.14318296 0.28636593 0.85681704 [70,] 0.16503036 0.33006072 0.83496964 [71,] 0.13813371 0.27626742 0.86186629 [72,] 0.15434351 0.30868703 0.84565649 [73,] 0.13537257 0.27074515 0.86462743 [74,] 0.14747349 0.29494699 0.85252651 [75,] 0.16200493 0.32400985 0.83799507 [76,] 0.13854304 0.27708608 0.86145696 [77,] 0.11823337 0.23646674 0.88176663 [78,] 0.09961350 0.19922701 0.90038650 [79,] 0.08161615 0.16323231 0.91838385 [80,] 0.06763421 0.13526842 0.93236579 [81,] 0.06000985 0.12001969 0.93999015 [82,] 0.21266559 0.42533118 0.78733441 [83,] 0.18250013 0.36500025 0.81749987 [84,] 0.16331049 0.32662097 0.83668951 [85,] 0.13640797 0.27281593 0.86359203 [86,] 0.11962643 0.23925287 0.88037357 [87,] 0.12204109 0.24408218 0.87795891 [88,] 0.10867956 0.21735912 0.89132044 [89,] 0.10928060 0.21856120 0.89071940 [90,] 0.09706496 0.19412993 0.90293504 [91,] 0.08882426 0.17764852 0.91117574 [92,] 0.09138830 0.18277661 0.90861170 [93,] 0.09447779 0.18895557 0.90552221 [94,] 0.08511859 0.17023717 0.91488141 [95,] 0.07340355 0.14680710 0.92659645 [96,] 0.06835269 0.13670538 0.93164731 [97,] 0.06389610 0.12779220 0.93610390 [98,] 0.09799520 0.19599040 0.90200480 [99,] 0.09033555 0.18067111 0.90966445 [100,] 0.08304521 0.16609042 0.91695479 [101,] 0.07111103 0.14222206 0.92888897 [102,] 0.43108646 0.86217293 0.56891354 [103,] 0.38862343 0.77724686 0.61137657 [104,] 0.36362786 0.72725572 0.63637214 [105,] 0.33482930 0.66965861 0.66517070 [106,] 0.30955751 0.61911502 0.69044249 [107,] 0.27485227 0.54970454 0.72514773 [108,] 0.27115662 0.54231325 0.72884338 [109,] 0.23271998 0.46543995 0.76728002 [110,] 0.19795477 0.39590954 0.80204523 [111,] 0.20473750 0.40947500 0.79526250 [112,] 0.18697884 0.37395768 0.81302116 [113,] 0.17641520 0.35283040 0.82358480 [114,] 0.15208686 0.30417372 0.84791314 [115,] 0.12634789 0.25269578 0.87365211 [116,] 0.15099455 0.30198909 0.84900545 [117,] 0.12377864 0.24755728 0.87622136 [118,] 0.10764123 0.21528246 0.89235877 [119,] 0.15744789 0.31489578 0.84255211 [120,] 0.15724861 0.31449722 0.84275139 [121,] 0.14911711 0.29823423 0.85088289 [122,] 0.11836359 0.23672718 0.88163641 [123,] 0.11089727 0.22179454 0.88910273 [124,] 0.18460564 0.36921127 0.81539436 [125,] 0.20825996 0.41651992 0.79174004 [126,] 0.16741858 0.33483717 0.83258142 [127,] 0.14577949 0.29155899 0.85422051 [128,] 0.11612895 0.23225790 0.88387105 [129,] 0.48899626 0.97799253 0.51100374 [130,] 0.42696519 0.85393038 0.57303481 [131,] 0.41987257 0.83974515 0.58012743 [132,] 0.35661188 0.71322377 0.64338812 [133,] 0.29031495 0.58062989 0.70968505 [134,] 0.27420044 0.54840088 0.72579956 [135,] 0.21426163 0.42852325 0.78573837 [136,] 0.16039186 0.32078372 0.83960814 [137,] 0.12395644 0.24791287 0.87604356 [138,] 0.10902173 0.21804347 0.89097827 [139,] 0.09351072 0.18702143 0.90648928 [140,] 0.06770458 0.13540916 0.93229542 [141,] 0.10314532 0.20629063 0.89685468 [142,] 0.09407980 0.18815960 0.90592020 [143,] 0.10539307 0.21078614 0.89460693 [144,] 0.06170720 0.12341440 0.93829280 [145,] 0.20799461 0.41598922 0.79200539 > postscript(file="/var/www/html/rcomp/tmp/18urb1290547640.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/28urb1290547640.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/30mqe1290547640.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/40mqe1290547640.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/50mqe1290547640.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 = 162 Frequency = 1 1 2 3 4 5 6 0.106168215 -1.380350974 1.356932271 -0.276228612 8.479382145 -0.467489813 7 8 9 10 11 12 9.368269371 -1.225588892 -2.020753418 0.595503184 -2.002677058 -4.156698320 13 14 15 16 17 18 2.456888559 1.652598606 -2.419085972 0.889915258 1.431647297 -1.674481921 19 20 21 22 23 24 -2.648806815 1.003732313 -5.101838778 2.158974570 -0.352251172 1.737455233 25 26 27 28 29 30 -1.490258755 -3.629738484 -1.702517190 2.407146855 1.440371791 0.249236165 31 32 33 34 35 36 -3.733656027 3.327262010 -2.596741280 -1.822803013 0.411115526 -4.301154189 37 38 39 40 41 42 7.301655008 -0.322938576 -2.226185934 -2.553447863 -3.180175170 1.320952364 43 44 45 46 47 48 -4.642594849 1.142044440 -1.724066429 0.438293107 -3.276668458 -1.542590938 49 50 51 52 53 54 2.274359268 -1.401354212 -2.557487071 1.174992728 5.245890155 0.654461451 55 56 57 58 59 60 -1.188300422 -0.541417566 0.217421042 -4.014614925 -3.289662830 2.599590136 61 62 63 64 65 66 7.158829268 -0.900502033 -0.690250453 1.395746634 0.003359278 -1.952638105 67 68 69 70 71 72 3.976771445 -0.925436319 0.243378919 1.189463725 -0.086142307 1.944412905 73 74 75 76 77 78 0.113764144 -2.289138603 -2.044146546 6.082192755 0.304797612 4.298774462 79 80 81 82 83 84 0.189975521 -3.950598337 -1.532103323 -3.286017138 -3.798151378 -0.981201172 85 86 87 88 89 90 -0.867269682 0.094932253 -0.153220843 -0.731497979 2.486839433 8.934658816 91 92 93 94 95 96 0.314387211 1.428669072 -0.144804617 1.898639873 -3.048713552 -1.747557989 97 98 99 100 101 102 3.475604995 -1.568090645 -2.207411393 -3.075174518 -2.959612898 2.567315318 103 104 105 106 107 108 -0.998072540 -2.136994142 3.270187190 6.023609690 -2.369259133 2.885656641 109 110 111 112 113 114 2.343399740 11.056480026 0.629166563 1.915299126 -2.233842030 1.802052630 115 116 117 118 119 120 -1.417553401 -3.488756512 0.545562552 -0.274844529 -3.823557131 1.601689421 121 122 123 124 125 126 1.581124738 0.784920617 -1.769689560 -5.591934527 -1.588088494 -2.128419428 127 128 129 130 131 132 -5.655280831 -3.223338413 -2.220236137 -0.003528855 -2.074119305 6.605610469 133 134 135 136 137 138 -3.558630347 1.281450816 -1.337726661 1.092563502 9.786298809 0.858290363 139 140 141 142 143 144 2.525666861 -1.899808716 -1.060821681 -3.095391896 1.653467322 -1.222621798 145 146 147 148 149 150 -0.963942172 -2.057159986 -1.386019636 -0.569605431 -2.467491216 5.522163655 151 152 153 154 155 156 -1.651202587 4.063157457 -4.314688365 -1.619858931 5.944981939 4.352459108 157 158 159 160 161 162 1.804304633 0.868746357 -1.563184921 -2.128200282 1.011226898 -5.056134488 > postscript(file="/var/www/html/rcomp/tmp/6tdpz1290547640.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 = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 0.106168215 NA 1 -1.380350974 0.106168215 2 1.356932271 -1.380350974 3 -0.276228612 1.356932271 4 8.479382145 -0.276228612 5 -0.467489813 8.479382145 6 9.368269371 -0.467489813 7 -1.225588892 9.368269371 8 -2.020753418 -1.225588892 9 0.595503184 -2.020753418 10 -2.002677058 0.595503184 11 -4.156698320 -2.002677058 12 2.456888559 -4.156698320 13 1.652598606 2.456888559 14 -2.419085972 1.652598606 15 0.889915258 -2.419085972 16 1.431647297 0.889915258 17 -1.674481921 1.431647297 18 -2.648806815 -1.674481921 19 1.003732313 -2.648806815 20 -5.101838778 1.003732313 21 2.158974570 -5.101838778 22 -0.352251172 2.158974570 23 1.737455233 -0.352251172 24 -1.490258755 1.737455233 25 -3.629738484 -1.490258755 26 -1.702517190 -3.629738484 27 2.407146855 -1.702517190 28 1.440371791 2.407146855 29 0.249236165 1.440371791 30 -3.733656027 0.249236165 31 3.327262010 -3.733656027 32 -2.596741280 3.327262010 33 -1.822803013 -2.596741280 34 0.411115526 -1.822803013 35 -4.301154189 0.411115526 36 7.301655008 -4.301154189 37 -0.322938576 7.301655008 38 -2.226185934 -0.322938576 39 -2.553447863 -2.226185934 40 -3.180175170 -2.553447863 41 1.320952364 -3.180175170 42 -4.642594849 1.320952364 43 1.142044440 -4.642594849 44 -1.724066429 1.142044440 45 0.438293107 -1.724066429 46 -3.276668458 0.438293107 47 -1.542590938 -3.276668458 48 2.274359268 -1.542590938 49 -1.401354212 2.274359268 50 -2.557487071 -1.401354212 51 1.174992728 -2.557487071 52 5.245890155 1.174992728 53 0.654461451 5.245890155 54 -1.188300422 0.654461451 55 -0.541417566 -1.188300422 56 0.217421042 -0.541417566 57 -4.014614925 0.217421042 58 -3.289662830 -4.014614925 59 2.599590136 -3.289662830 60 7.158829268 2.599590136 61 -0.900502033 7.158829268 62 -0.690250453 -0.900502033 63 1.395746634 -0.690250453 64 0.003359278 1.395746634 65 -1.952638105 0.003359278 66 3.976771445 -1.952638105 67 -0.925436319 3.976771445 68 0.243378919 -0.925436319 69 1.189463725 0.243378919 70 -0.086142307 1.189463725 71 1.944412905 -0.086142307 72 0.113764144 1.944412905 73 -2.289138603 0.113764144 74 -2.044146546 -2.289138603 75 6.082192755 -2.044146546 76 0.304797612 6.082192755 77 4.298774462 0.304797612 78 0.189975521 4.298774462 79 -3.950598337 0.189975521 80 -1.532103323 -3.950598337 81 -3.286017138 -1.532103323 82 -3.798151378 -3.286017138 83 -0.981201172 -3.798151378 84 -0.867269682 -0.981201172 85 0.094932253 -0.867269682 86 -0.153220843 0.094932253 87 -0.731497979 -0.153220843 88 2.486839433 -0.731497979 89 8.934658816 2.486839433 90 0.314387211 8.934658816 91 1.428669072 0.314387211 92 -0.144804617 1.428669072 93 1.898639873 -0.144804617 94 -3.048713552 1.898639873 95 -1.747557989 -3.048713552 96 3.475604995 -1.747557989 97 -1.568090645 3.475604995 98 -2.207411393 -1.568090645 99 -3.075174518 -2.207411393 100 -2.959612898 -3.075174518 101 2.567315318 -2.959612898 102 -0.998072540 2.567315318 103 -2.136994142 -0.998072540 104 3.270187190 -2.136994142 105 6.023609690 3.270187190 106 -2.369259133 6.023609690 107 2.885656641 -2.369259133 108 2.343399740 2.885656641 109 11.056480026 2.343399740 110 0.629166563 11.056480026 111 1.915299126 0.629166563 112 -2.233842030 1.915299126 113 1.802052630 -2.233842030 114 -1.417553401 1.802052630 115 -3.488756512 -1.417553401 116 0.545562552 -3.488756512 117 -0.274844529 0.545562552 118 -3.823557131 -0.274844529 119 1.601689421 -3.823557131 120 1.581124738 1.601689421 121 0.784920617 1.581124738 122 -1.769689560 0.784920617 123 -5.591934527 -1.769689560 124 -1.588088494 -5.591934527 125 -2.128419428 -1.588088494 126 -5.655280831 -2.128419428 127 -3.223338413 -5.655280831 128 -2.220236137 -3.223338413 129 -0.003528855 -2.220236137 130 -2.074119305 -0.003528855 131 6.605610469 -2.074119305 132 -3.558630347 6.605610469 133 1.281450816 -3.558630347 134 -1.337726661 1.281450816 135 1.092563502 -1.337726661 136 9.786298809 1.092563502 137 0.858290363 9.786298809 138 2.525666861 0.858290363 139 -1.899808716 2.525666861 140 -1.060821681 -1.899808716 141 -3.095391896 -1.060821681 142 1.653467322 -3.095391896 143 -1.222621798 1.653467322 144 -0.963942172 -1.222621798 145 -2.057159986 -0.963942172 146 -1.386019636 -2.057159986 147 -0.569605431 -1.386019636 148 -2.467491216 -0.569605431 149 5.522163655 -2.467491216 150 -1.651202587 5.522163655 151 4.063157457 -1.651202587 152 -4.314688365 4.063157457 153 -1.619858931 -4.314688365 154 5.944981939 -1.619858931 155 4.352459108 5.944981939 156 1.804304633 4.352459108 157 0.868746357 1.804304633 158 -1.563184921 0.868746357 159 -2.128200282 -1.563184921 160 1.011226898 -2.128200282 161 -5.056134488 1.011226898 162 NA -5.056134488 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.380350974 0.106168215 [2,] 1.356932271 -1.380350974 [3,] -0.276228612 1.356932271 [4,] 8.479382145 -0.276228612 [5,] -0.467489813 8.479382145 [6,] 9.368269371 -0.467489813 [7,] -1.225588892 9.368269371 [8,] -2.020753418 -1.225588892 [9,] 0.595503184 -2.020753418 [10,] -2.002677058 0.595503184 [11,] -4.156698320 -2.002677058 [12,] 2.456888559 -4.156698320 [13,] 1.652598606 2.456888559 [14,] -2.419085972 1.652598606 [15,] 0.889915258 -2.419085972 [16,] 1.431647297 0.889915258 [17,] -1.674481921 1.431647297 [18,] -2.648806815 -1.674481921 [19,] 1.003732313 -2.648806815 [20,] -5.101838778 1.003732313 [21,] 2.158974570 -5.101838778 [22,] -0.352251172 2.158974570 [23,] 1.737455233 -0.352251172 [24,] -1.490258755 1.737455233 [25,] -3.629738484 -1.490258755 [26,] -1.702517190 -3.629738484 [27,] 2.407146855 -1.702517190 [28,] 1.440371791 2.407146855 [29,] 0.249236165 1.440371791 [30,] -3.733656027 0.249236165 [31,] 3.327262010 -3.733656027 [32,] -2.596741280 3.327262010 [33,] -1.822803013 -2.596741280 [34,] 0.411115526 -1.822803013 [35,] -4.301154189 0.411115526 [36,] 7.301655008 -4.301154189 [37,] -0.322938576 7.301655008 [38,] -2.226185934 -0.322938576 [39,] -2.553447863 -2.226185934 [40,] -3.180175170 -2.553447863 [41,] 1.320952364 -3.180175170 [42,] -4.642594849 1.320952364 [43,] 1.142044440 -4.642594849 [44,] -1.724066429 1.142044440 [45,] 0.438293107 -1.724066429 [46,] -3.276668458 0.438293107 [47,] -1.542590938 -3.276668458 [48,] 2.274359268 -1.542590938 [49,] -1.401354212 2.274359268 [50,] -2.557487071 -1.401354212 [51,] 1.174992728 -2.557487071 [52,] 5.245890155 1.174992728 [53,] 0.654461451 5.245890155 [54,] -1.188300422 0.654461451 [55,] -0.541417566 -1.188300422 [56,] 0.217421042 -0.541417566 [57,] -4.014614925 0.217421042 [58,] -3.289662830 -4.014614925 [59,] 2.599590136 -3.289662830 [60,] 7.158829268 2.599590136 [61,] -0.900502033 7.158829268 [62,] -0.690250453 -0.900502033 [63,] 1.395746634 -0.690250453 [64,] 0.003359278 1.395746634 [65,] -1.952638105 0.003359278 [66,] 3.976771445 -1.952638105 [67,] -0.925436319 3.976771445 [68,] 0.243378919 -0.925436319 [69,] 1.189463725 0.243378919 [70,] -0.086142307 1.189463725 [71,] 1.944412905 -0.086142307 [72,] 0.113764144 1.944412905 [73,] -2.289138603 0.113764144 [74,] -2.044146546 -2.289138603 [75,] 6.082192755 -2.044146546 [76,] 0.304797612 6.082192755 [77,] 4.298774462 0.304797612 [78,] 0.189975521 4.298774462 [79,] -3.950598337 0.189975521 [80,] -1.532103323 -3.950598337 [81,] -3.286017138 -1.532103323 [82,] -3.798151378 -3.286017138 [83,] -0.981201172 -3.798151378 [84,] -0.867269682 -0.981201172 [85,] 0.094932253 -0.867269682 [86,] -0.153220843 0.094932253 [87,] -0.731497979 -0.153220843 [88,] 2.486839433 -0.731497979 [89,] 8.934658816 2.486839433 [90,] 0.314387211 8.934658816 [91,] 1.428669072 0.314387211 [92,] -0.144804617 1.428669072 [93,] 1.898639873 -0.144804617 [94,] -3.048713552 1.898639873 [95,] -1.747557989 -3.048713552 [96,] 3.475604995 -1.747557989 [97,] -1.568090645 3.475604995 [98,] -2.207411393 -1.568090645 [99,] -3.075174518 -2.207411393 [100,] -2.959612898 -3.075174518 [101,] 2.567315318 -2.959612898 [102,] -0.998072540 2.567315318 [103,] -2.136994142 -0.998072540 [104,] 3.270187190 -2.136994142 [105,] 6.023609690 3.270187190 [106,] -2.369259133 6.023609690 [107,] 2.885656641 -2.369259133 [108,] 2.343399740 2.885656641 [109,] 11.056480026 2.343399740 [110,] 0.629166563 11.056480026 [111,] 1.915299126 0.629166563 [112,] -2.233842030 1.915299126 [113,] 1.802052630 -2.233842030 [114,] -1.417553401 1.802052630 [115,] -3.488756512 -1.417553401 [116,] 0.545562552 -3.488756512 [117,] -0.274844529 0.545562552 [118,] -3.823557131 -0.274844529 [119,] 1.601689421 -3.823557131 [120,] 1.581124738 1.601689421 [121,] 0.784920617 1.581124738 [122,] -1.769689560 0.784920617 [123,] -5.591934527 -1.769689560 [124,] -1.588088494 -5.591934527 [125,] -2.128419428 -1.588088494 [126,] -5.655280831 -2.128419428 [127,] -3.223338413 -5.655280831 [128,] -2.220236137 -3.223338413 [129,] -0.003528855 -2.220236137 [130,] -2.074119305 -0.003528855 [131,] 6.605610469 -2.074119305 [132,] -3.558630347 6.605610469 [133,] 1.281450816 -3.558630347 [134,] -1.337726661 1.281450816 [135,] 1.092563502 -1.337726661 [136,] 9.786298809 1.092563502 [137,] 0.858290363 9.786298809 [138,] 2.525666861 0.858290363 [139,] -1.899808716 2.525666861 [140,] -1.060821681 -1.899808716 [141,] -3.095391896 -1.060821681 [142,] 1.653467322 -3.095391896 [143,] -1.222621798 1.653467322 [144,] -0.963942172 -1.222621798 [145,] -2.057159986 -0.963942172 [146,] -1.386019636 -2.057159986 [147,] -0.569605431 -1.386019636 [148,] -2.467491216 -0.569605431 [149,] 5.522163655 -2.467491216 [150,] -1.651202587 5.522163655 [151,] 4.063157457 -1.651202587 [152,] -4.314688365 4.063157457 [153,] -1.619858931 -4.314688365 [154,] 5.944981939 -1.619858931 [155,] 4.352459108 5.944981939 [156,] 1.804304633 4.352459108 [157,] 0.868746357 1.804304633 [158,] -1.563184921 0.868746357 [159,] -2.128200282 -1.563184921 [160,] 1.011226898 -2.128200282 [161,] -5.056134488 1.011226898 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.380350974 0.106168215 2 1.356932271 -1.380350974 3 -0.276228612 1.356932271 4 8.479382145 -0.276228612 5 -0.467489813 8.479382145 6 9.368269371 -0.467489813 7 -1.225588892 9.368269371 8 -2.020753418 -1.225588892 9 0.595503184 -2.020753418 10 -2.002677058 0.595503184 11 -4.156698320 -2.002677058 12 2.456888559 -4.156698320 13 1.652598606 2.456888559 14 -2.419085972 1.652598606 15 0.889915258 -2.419085972 16 1.431647297 0.889915258 17 -1.674481921 1.431647297 18 -2.648806815 -1.674481921 19 1.003732313 -2.648806815 20 -5.101838778 1.003732313 21 2.158974570 -5.101838778 22 -0.352251172 2.158974570 23 1.737455233 -0.352251172 24 -1.490258755 1.737455233 25 -3.629738484 -1.490258755 26 -1.702517190 -3.629738484 27 2.407146855 -1.702517190 28 1.440371791 2.407146855 29 0.249236165 1.440371791 30 -3.733656027 0.249236165 31 3.327262010 -3.733656027 32 -2.596741280 3.327262010 33 -1.822803013 -2.596741280 34 0.411115526 -1.822803013 35 -4.301154189 0.411115526 36 7.301655008 -4.301154189 37 -0.322938576 7.301655008 38 -2.226185934 -0.322938576 39 -2.553447863 -2.226185934 40 -3.180175170 -2.553447863 41 1.320952364 -3.180175170 42 -4.642594849 1.320952364 43 1.142044440 -4.642594849 44 -1.724066429 1.142044440 45 0.438293107 -1.724066429 46 -3.276668458 0.438293107 47 -1.542590938 -3.276668458 48 2.274359268 -1.542590938 49 -1.401354212 2.274359268 50 -2.557487071 -1.401354212 51 1.174992728 -2.557487071 52 5.245890155 1.174992728 53 0.654461451 5.245890155 54 -1.188300422 0.654461451 55 -0.541417566 -1.188300422 56 0.217421042 -0.541417566 57 -4.014614925 0.217421042 58 -3.289662830 -4.014614925 59 2.599590136 -3.289662830 60 7.158829268 2.599590136 61 -0.900502033 7.158829268 62 -0.690250453 -0.900502033 63 1.395746634 -0.690250453 64 0.003359278 1.395746634 65 -1.952638105 0.003359278 66 3.976771445 -1.952638105 67 -0.925436319 3.976771445 68 0.243378919 -0.925436319 69 1.189463725 0.243378919 70 -0.086142307 1.189463725 71 1.944412905 -0.086142307 72 0.113764144 1.944412905 73 -2.289138603 0.113764144 74 -2.044146546 -2.289138603 75 6.082192755 -2.044146546 76 0.304797612 6.082192755 77 4.298774462 0.304797612 78 0.189975521 4.298774462 79 -3.950598337 0.189975521 80 -1.532103323 -3.950598337 81 -3.286017138 -1.532103323 82 -3.798151378 -3.286017138 83 -0.981201172 -3.798151378 84 -0.867269682 -0.981201172 85 0.094932253 -0.867269682 86 -0.153220843 0.094932253 87 -0.731497979 -0.153220843 88 2.486839433 -0.731497979 89 8.934658816 2.486839433 90 0.314387211 8.934658816 91 1.428669072 0.314387211 92 -0.144804617 1.428669072 93 1.898639873 -0.144804617 94 -3.048713552 1.898639873 95 -1.747557989 -3.048713552 96 3.475604995 -1.747557989 97 -1.568090645 3.475604995 98 -2.207411393 -1.568090645 99 -3.075174518 -2.207411393 100 -2.959612898 -3.075174518 101 2.567315318 -2.959612898 102 -0.998072540 2.567315318 103 -2.136994142 -0.998072540 104 3.270187190 -2.136994142 105 6.023609690 3.270187190 106 -2.369259133 6.023609690 107 2.885656641 -2.369259133 108 2.343399740 2.885656641 109 11.056480026 2.343399740 110 0.629166563 11.056480026 111 1.915299126 0.629166563 112 -2.233842030 1.915299126 113 1.802052630 -2.233842030 114 -1.417553401 1.802052630 115 -3.488756512 -1.417553401 116 0.545562552 -3.488756512 117 -0.274844529 0.545562552 118 -3.823557131 -0.274844529 119 1.601689421 -3.823557131 120 1.581124738 1.601689421 121 0.784920617 1.581124738 122 -1.769689560 0.784920617 123 -5.591934527 -1.769689560 124 -1.588088494 -5.591934527 125 -2.128419428 -1.588088494 126 -5.655280831 -2.128419428 127 -3.223338413 -5.655280831 128 -2.220236137 -3.223338413 129 -0.003528855 -2.220236137 130 -2.074119305 -0.003528855 131 6.605610469 -2.074119305 132 -3.558630347 6.605610469 133 1.281450816 -3.558630347 134 -1.337726661 1.281450816 135 1.092563502 -1.337726661 136 9.786298809 1.092563502 137 0.858290363 9.786298809 138 2.525666861 0.858290363 139 -1.899808716 2.525666861 140 -1.060821681 -1.899808716 141 -3.095391896 -1.060821681 142 1.653467322 -3.095391896 143 -1.222621798 1.653467322 144 -0.963942172 -1.222621798 145 -2.057159986 -0.963942172 146 -1.386019636 -2.057159986 147 -0.569605431 -1.386019636 148 -2.467491216 -0.569605431 149 5.522163655 -2.467491216 150 -1.651202587 5.522163655 151 4.063157457 -1.651202587 152 -4.314688365 4.063157457 153 -1.619858931 -4.314688365 154 5.944981939 -1.619858931 155 4.352459108 5.944981939 156 1.804304633 4.352459108 157 0.868746357 1.804304633 158 -1.563184921 0.868746357 159 -2.128200282 -1.563184921 160 1.011226898 -2.128200282 161 -5.056134488 1.011226898 > 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/7m4pk1290547640.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/8m4pk1290547640.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/9m4pk1290547640.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') Warning messages: 1: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced 2: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10wv6n1290547640.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/11ienb1290547640.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/123wlg1290547640.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/13hoj71290547640.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/14lphd1290547640.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/1567gj1290547640.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/16r8wp1290547640.tab") + } > > try(system("convert tmp/18urb1290547640.ps tmp/18urb1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/28urb1290547640.ps tmp/28urb1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/30mqe1290547640.ps tmp/30mqe1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/40mqe1290547640.ps tmp/40mqe1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/50mqe1290547640.ps tmp/50mqe1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/6tdpz1290547640.ps tmp/6tdpz1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/7m4pk1290547640.ps tmp/7m4pk1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/8m4pk1290547640.ps tmp/8m4pk1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/9m4pk1290547640.ps tmp/9m4pk1290547640.png",intern=TRUE)) character(0) > try(system("convert tmp/10wv6n1290547640.ps tmp/10wv6n1290547640.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.113 1.737 9.351