R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(25 + ,11 + ,7 + ,8 + ,23 + ,25 + ,17 + ,6 + ,17 + ,8 + ,25 + ,30 + ,18 + ,8 + ,12 + ,9 + ,19 + ,22 + ,16 + ,10 + ,12 + ,7 + ,29 + ,22 + ,20 + ,10 + ,11 + ,4 + ,25 + ,25 + ,16 + ,11 + ,11 + ,11 + ,21 + ,23 + ,18 + ,16 + ,12 + ,7 + ,22 + ,17 + ,17 + ,11 + ,13 + ,7 + ,25 + ,21 + ,30 + ,12 + ,16 + ,10 + ,18 + ,19 + ,23 + ,8 + ,11 + ,10 + ,22 + ,15 + ,18 + ,12 + ,10 + ,8 + ,15 + ,16 + ,21 + ,9 + ,9 + ,9 + ,20 + ,22 + ,31 + ,14 + ,17 + ,11 + ,20 + ,23 + ,27 + ,15 + ,11 + ,9 + ,21 + ,23 + ,21 + ,9 + ,14 + ,13 + ,21 + ,19 + ,16 + ,8 + ,15 + ,9 + ,24 + ,23 + ,20 + ,9 + ,15 + ,6 + ,24 + ,25 + ,17 + ,9 + ,13 + ,6 + ,23 + ,22 + ,25 + ,16 + ,18 + ,16 + ,24 + ,26 + ,26 + ,11 + ,18 + ,5 + ,18 + ,29 + ,25 + ,8 + ,12 + ,7 + ,25 + ,32 + ,17 + ,9 + ,17 + ,9 + ,21 + ,25 + ,32 + ,12 + ,18 + ,12 + ,22 + ,28 + ,22 + ,9 + ,14 + ,9 + ,23 + ,25 + ,17 + ,9 + ,16 + ,5 + ,23 + ,25 + ,20 + ,14 + ,14 + ,10 + ,24 + ,18 + ,29 + ,10 + ,12 + ,8 + ,23 + ,25 + ,23 + ,14 + ,17 + ,7 + ,21 + ,25 + ,20 + ,10 + ,12 + ,8 + ,28 + ,20 + ,11 + ,6 + ,6 + ,4 + ,16 + ,15 + ,26 + ,13 + ,12 + ,8 + ,29 + ,24 + ,22 + ,10 + ,12 + ,8 + ,27 + ,26 + ,14 + ,15 + ,13 + ,8 + ,16 + ,14 + ,19 + ,12 + ,14 + ,7 + ,28 + ,24 + ,20 + ,11 + ,11 + ,8 + ,25 + ,25 + ,28 + ,8 + ,12 + ,7 + ,22 + ,20 + ,19 + ,9 + ,9 + ,7 + ,23 + ,21 + ,30 + ,9 + ,15 + ,9 + ,26 + ,27 + ,29 + ,15 + ,18 + ,11 + ,23 + ,23 + ,26 + ,9 + ,15 + ,6 + ,25 + ,25 + ,23 + ,10 + ,12 + ,8 + ,21 + ,20 + ,21 + ,12 + ,14 + ,9 + ,24 + ,22 + ,28 + ,11 + ,13 + ,6 + ,22 + ,25 + ,23 + ,14 + ,13 + ,10 + ,27 + ,25 + ,18 + ,6 + ,11 + ,8 + ,26 + ,17 + ,20 + ,8 + ,16 + ,10 + ,24 + ,25 + ,21 + ,10 + ,11 + ,5 + ,24 + ,26 + ,28 + ,12 + ,16 + ,14 + ,22 + ,27 + ,10 + ,5 + ,8 + ,6 + ,24 + ,19 + ,22 + ,10 + ,15 + ,6 + ,20 + ,22 + ,31 + ,10 + ,21 + ,12 + ,26 + ,32 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,22 + ,10 + ,13 + ,8 + ,19 + ,18 + ,23 + ,10 + ,15 + ,10 + ,21 + ,23 + ,20 + ,9 + ,19 + ,10 + ,16 + ,20 + ,18 + ,8 + ,15 + ,10 + ,22 + ,21 + ,25 + ,14 + ,11 + ,5 + ,15 + ,17 + ,21 + ,8 + ,10 + ,7 + ,17 + ,18 + ,24 + ,9 + ,13 + ,10 + ,15 + ,19 + ,25 + ,14 + ,15 + ,11 + ,21 + ,22 + ,13 + ,8 + ,12 + ,7 + ,19 + ,14 + ,28 + ,8 + ,16 + ,12 + ,24 + ,18 + ,25 + ,7 + ,18 + ,11 + ,17 + ,35 + ,9 + ,6 + ,8 + ,11 + ,23 + ,29 + ,16 + ,8 + ,13 + ,5 + ,24 + ,21 + ,19 + ,6 + ,17 + ,8 + ,14 + ,25 + ,29 + ,11 + ,7 + ,4 + ,22 + ,26 + ,14 + ,11 + ,12 + ,7 + ,16 + ,17 + ,22 + ,14 + ,14 + ,11 + ,19 + ,25 + ,15 + ,8 + ,6 + ,6 + ,25 + ,20 + ,15 + ,8 + ,10 + ,4 + ,24 + ,22 + ,20 + ,11 + ,11 + ,8 + ,26 + ,24 + ,18 + ,10 + ,14 + ,9 + ,26 + ,21 + ,33 + ,14 + ,11 + ,8 + ,25 + ,26 + ,22 + ,11 + ,13 + ,11 + ,18 + ,24 + ,16 + ,9 + ,12 + ,8 + ,21 + ,16 + ,16 + ,8 + ,9 + ,4 + ,23 + ,18 + ,18 + ,13 + ,12 + ,6 + ,20 + ,19 + ,18 + ,12 + ,13 + ,9 + ,13 + ,21 + ,22 + ,13 + ,12 + ,13 + ,15 + ,22 + ,30 + ,14 + ,9 + ,9 + ,14 + ,23 + ,30 + ,12 + ,15 + ,10 + ,22 + ,29 + ,24 + ,14 + ,24 + ,20 + ,10 + ,21 + ,21 + ,13 + ,17 + ,11 + ,22 + ,23 + ,29 + ,16 + ,11 + ,6 + ,24 + ,27 + ,31 + ,9 + ,17 + ,9 + ,19 + ,25 + ,20 + ,9 + ,11 + ,7 + ,20 + ,21 + ,16 + ,9 + ,12 + ,9 + ,13 + ,10 + ,22 + ,8 + ,14 + ,10 + ,20 + ,20 + ,20 + ,7 + ,11 + ,9 + ,22 + ,26 + ,28 + ,16 + ,16 + ,8 + ,24 + ,24 + ,38 + ,11 + ,21 + ,7 + ,29 + ,29 + ,22 + ,9 + ,14 + ,6 + ,12 + ,19 + ,20 + ,11 + ,20 + ,13 + ,20 + ,24 + ,17 + ,9 + ,13 + ,6 + ,21 + ,19 + ,22 + ,13 + ,15 + ,10 + ,22 + ,22 + ,31 + ,16 + ,19 + ,16 + ,20 + ,17 + ,24 + ,14 + ,11 + ,12 + ,26 + ,24 + ,18 + ,12 + ,10 + ,8 + ,23 + ,19 + ,23 + ,13 + ,14 + ,12 + ,24 + ,19 + ,15 + ,11 + ,11 + ,8 + ,22 + ,23 + ,12 + ,4 + ,15 + ,4 + ,28 + ,27 + ,15 + ,8 + ,11 + ,8 + ,12 + ,14 + ,20 + ,8 + ,17 + ,7 + ,24 + ,22 + ,34 + ,16 + ,18 + ,11 + ,20 + ,21 + ,31 + ,14 + ,10 + ,8 + ,23 + ,18 + ,19 + ,11 + ,11 + ,8 + ,28 + ,20 + ,21 + ,9 + ,13 + ,9 + ,24 + ,19 + ,22 + ,9 + ,16 + ,9 + ,23 + ,24 + ,24 + ,10 + ,9 + ,6 + ,29 + ,25 + ,32 + ,16 + ,9 + ,6 + ,26 + ,29 + ,33 + ,11 + ,9 + ,6 + ,22 + ,28 + ,13 + ,16 + ,12 + ,5 + ,22 + ,17 + ,25 + ,12 + ,12 + ,7 + ,23 + ,29 + ,29 + ,14 + ,18 + ,10 + ,30 + ,26 + ,18 + ,10 + ,15 + ,8 + ,17 + ,14 + ,20 + ,10 + ,10 + ,8 + ,23 + ,26 + ,15 + ,12 + ,11 + ,8 + ,25 + ,20 + ,33 + ,14 + ,9 + ,6 + ,24 + ,32 + ,26 + ,16 + ,5 + ,4 + ,24 + ,23 + ,18 + ,9 + ,12 + ,8 + ,24 + ,21 + ,28 + ,8 + ,24 + ,20 + ,20 + ,30 + ,17 + ,8 + ,14 + ,6 + ,22 + ,24 + ,12 + ,7 + ,7 + ,4 + ,28 + ,22 + ,17 + ,9 + ,12 + ,9 + ,25 + ,24 + ,21 + ,10 + ,13 + ,6 + ,24 + ,24 + ,18 + ,13 + ,8 + ,9 + ,24 + ,24 + ,10 + ,10 + ,11 + ,5 + ,23 + ,19 + ,29 + ,11 + ,9 + ,5 + ,30 + ,31 + ,31 + ,8 + ,11 + ,8 + ,24 + ,22 + ,19 + ,9 + ,13 + ,8 + ,21 + ,27 + ,9 + ,13 + ,10 + ,6 + ,25 + ,19 + ,13 + ,14 + ,13 + ,6 + ,25 + ,21 + ,19 + ,12 + ,10 + ,8 + ,29 + ,23 + ,21 + ,12 + ,13 + ,8 + ,22 + ,19 + ,23 + ,14 + ,8 + ,5 + ,27 + ,19 + ,21 + ,11 + ,16 + ,7 + ,24 + ,20 + ,15 + ,14 + ,9 + ,8 + ,29 + ,23 + ,19 + ,10 + ,12 + ,7 + ,21 + ,17 + ,26 + ,14 + ,14 + ,8 + ,24 + ,17 + ,16 + ,11 + ,9 + ,5 + ,23 + ,17 + ,19 + ,9 + ,11 + ,10 + ,27 + ,21 + ,31 + ,16 + ,14 + ,9 + ,25 + ,21 + ,19 + ,9 + ,12 + ,7 + ,21 + ,18 + ,15 + ,7 + ,12 + ,6 + ,21 + ,19 + ,23 + ,14 + ,11 + ,10 + ,29 + ,20 + ,17 + ,14 + ,12 + ,6 + ,21 + ,15 + ,21 + ,8 + ,9 + ,11 + ,20 + ,24 + ,17 + ,11 + ,9 + ,6 + ,19 + ,20 + ,25 + ,14 + ,15 + ,9 + ,24 + ,22 + ,20 + ,11 + ,8 + ,4 + ,13 + ,13 + ,19 + ,20 + ,8 + ,7 + ,25 + ,19 + ,20 + ,11 + ,17 + ,8 + ,23 + ,21 + ,17 + ,9 + ,11 + ,5 + ,26 + ,23 + ,21 + ,10 + ,12 + ,8 + ,23 + ,16 + ,26 + ,13 + ,20 + ,10 + ,22 + ,26 + ,17 + ,8 + ,12 + ,9 + ,24 + ,21 + ,21 + ,15 + ,7 + ,5 + ,24 + ,21 + ,28 + ,14 + ,11 + ,8 + ,24 + ,24) + ,dim=c(6 + ,159) + ,dimnames=list(c('CM' + ,'D' + ,'PE' + ,'PC' + ,'O' + ,'PS') + ,1:159)) > y <- array(NA,dim=c(6,159),dimnames=list(c('CM','D','PE','PC','O','PS'),1:159)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > 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 CM D PE PC O PS 1 25 11 7 8 23 25 2 17 6 17 8 25 30 3 18 8 12 9 19 22 4 16 10 12 7 29 22 5 20 10 11 4 25 25 6 16 11 11 11 21 23 7 18 16 12 7 22 17 8 17 11 13 7 25 21 9 30 12 16 10 18 19 10 23 8 11 10 22 15 11 18 12 10 8 15 16 12 21 9 9 9 20 22 13 31 14 17 11 20 23 14 27 15 11 9 21 23 15 21 9 14 13 21 19 16 16 8 15 9 24 23 17 20 9 15 6 24 25 18 17 9 13 6 23 22 19 25 16 18 16 24 26 20 26 11 18 5 18 29 21 25 8 12 7 25 32 22 17 9 17 9 21 25 23 32 12 18 12 22 28 24 22 9 14 9 23 25 25 17 9 16 5 23 25 26 20 14 14 10 24 18 27 29 10 12 8 23 25 28 23 14 17 7 21 25 29 20 10 12 8 28 20 30 11 6 6 4 16 15 31 26 13 12 8 29 24 32 22 10 12 8 27 26 33 14 15 13 8 16 14 34 19 12 14 7 28 24 35 20 11 11 8 25 25 36 28 8 12 7 22 20 37 19 9 9 7 23 21 38 30 9 15 9 26 27 39 29 15 18 11 23 23 40 26 9 15 6 25 25 41 23 10 12 8 21 20 42 21 12 14 9 24 22 43 28 11 13 6 22 25 44 23 14 13 10 27 25 45 18 6 11 8 26 17 46 20 8 16 10 24 25 47 21 10 11 5 24 26 48 28 12 16 14 22 27 49 10 5 8 6 24 19 50 22 10 15 6 20 22 51 31 10 21 12 26 32 52 29 13 18 12 21 21 53 22 10 13 8 19 18 54 23 10 15 10 21 23 55 20 9 19 10 16 20 56 18 8 15 10 22 21 57 25 14 11 5 15 17 58 21 8 10 7 17 18 59 24 9 13 10 15 19 60 25 14 15 11 21 22 61 13 8 12 7 19 14 62 28 8 16 12 24 18 63 25 7 18 11 17 35 64 9 6 8 11 23 29 65 16 8 13 5 24 21 66 19 6 17 8 14 25 67 29 11 7 4 22 26 68 14 11 12 7 16 17 69 22 14 14 11 19 25 70 15 8 6 6 25 20 71 15 8 10 4 24 22 72 20 11 11 8 26 24 73 18 10 14 9 26 21 74 33 14 11 8 25 26 75 22 11 13 11 18 24 76 16 9 12 8 21 16 77 16 8 9 4 23 18 78 18 13 12 6 20 19 79 18 12 13 9 13 21 80 22 13 12 13 15 22 81 30 14 9 9 14 23 82 30 12 15 10 22 29 83 24 14 24 20 10 21 84 21 13 17 11 22 23 85 29 16 11 6 24 27 86 31 9 17 9 19 25 87 20 9 11 7 20 21 88 16 9 12 9 13 10 89 22 8 14 10 20 20 90 20 7 11 9 22 26 91 28 16 16 8 24 24 92 38 11 21 7 29 29 93 22 9 14 6 12 19 94 20 11 20 13 20 24 95 17 9 13 6 21 19 96 22 13 15 10 22 22 97 31 16 19 16 20 17 98 24 14 11 12 26 24 99 18 12 10 8 23 19 100 23 13 14 12 24 19 101 15 11 11 8 22 23 102 12 4 15 4 28 27 103 15 8 11 8 12 14 104 20 8 17 7 24 22 105 34 16 18 11 20 21 106 31 14 10 8 23 18 107 19 11 11 8 28 20 108 21 9 13 9 24 19 109 22 9 16 9 23 24 110 24 10 9 6 29 25 111 32 16 9 6 26 29 112 33 11 9 6 22 28 113 13 16 12 5 22 17 114 25 12 12 7 23 29 115 29 14 18 10 30 26 116 18 10 15 8 17 14 117 20 10 10 8 23 26 118 15 12 11 8 25 20 119 33 14 9 6 24 32 120 26 16 5 4 24 23 121 18 9 12 8 24 21 122 28 8 24 20 20 30 123 17 8 14 6 22 24 124 12 7 7 4 28 22 125 17 9 12 9 25 24 126 21 10 13 6 24 24 127 18 13 8 9 24 24 128 10 10 11 5 23 19 129 29 11 9 5 30 31 130 31 8 11 8 24 22 131 19 9 13 8 21 27 132 9 13 10 6 25 19 133 13 14 13 6 25 21 134 19 12 10 8 29 23 135 21 12 13 8 22 19 136 23 14 8 5 27 19 137 21 11 16 7 24 20 138 15 14 9 8 29 23 139 19 10 12 7 21 17 140 26 14 14 8 24 17 141 16 11 9 5 23 17 142 19 9 11 10 27 21 143 31 16 14 9 25 21 144 19 9 12 7 21 18 145 15 7 12 6 21 19 146 23 14 11 10 29 20 147 17 14 12 6 21 15 148 21 8 9 11 20 24 149 17 11 9 6 19 20 150 25 14 15 9 24 22 151 20 11 8 4 13 13 152 19 20 8 7 25 19 153 20 11 17 8 23 21 154 17 9 11 5 26 23 155 21 10 12 8 23 16 156 26 13 20 10 22 26 157 17 8 12 9 24 21 158 21 15 7 5 24 21 159 28 14 11 8 24 24 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) D PE PC O PS -1.9716 0.8101 0.2513 0.1885 -0.1157 0.5661 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -11.7273 -2.4896 -0.3354 2.7482 12.5424 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.97156 3.05291 -0.646 0.5194 D 0.81012 0.13033 6.216 4.63e-09 *** PE 0.25125 0.13276 1.893 0.0603 . PC 0.18852 0.16826 1.120 0.2643 O -0.11572 0.10302 -1.123 0.2631 PS 0.56606 0.09581 5.908 2.17e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.478 on 153 degrees of freedom Multiple R-squared: 0.4072, Adjusted R-squared: 0.3878 F-statistic: 21.02 on 5 and 153 DF, p-value: 5.863e-16 > 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.88674240 0.22651520 0.11325760 [2,] 0.84747659 0.30504683 0.15252341 [3,] 0.86900624 0.26198752 0.13099376 [4,] 0.79574823 0.40850354 0.20425177 [5,] 0.82472208 0.35055585 0.17527792 [6,] 0.76892216 0.46215568 0.23107784 [7,] 0.70304026 0.59391949 0.29695974 [8,] 0.65962384 0.68075232 0.34037616 [9,] 0.58082518 0.83834964 0.41917482 [10,] 0.49718291 0.99436582 0.50281709 [11,] 0.47987231 0.95974461 0.52012769 [12,] 0.40204297 0.80408594 0.59795703 [13,] 0.39584443 0.79168886 0.60415557 [14,] 0.41844812 0.83689625 0.58155188 [15,] 0.47365316 0.94730631 0.52634684 [16,] 0.40411470 0.80822941 0.59588530 [17,] 0.36394444 0.72788887 0.63605556 [18,] 0.30275734 0.60551468 0.69724266 [19,] 0.42356033 0.84712066 0.57643967 [20,] 0.37422826 0.74845651 0.62577174 [21,] 0.34494847 0.68989694 0.65505153 [22,] 0.31490556 0.62981112 0.68509444 [23,] 0.30547286 0.61094571 0.69452714 [24,] 0.25272001 0.50544002 0.74727999 [25,] 0.31287434 0.62574868 0.68712566 [26,] 0.27715796 0.55431592 0.72284204 [27,] 0.24257529 0.48515057 0.75742471 [28,] 0.50160099 0.99679802 0.49839901 [29,] 0.44453253 0.88906505 0.55546747 [30,] 0.53051024 0.93897952 0.46948976 [31,] 0.50305306 0.99389389 0.49694694 [32,] 0.52187093 0.95625813 0.47812907 [33,] 0.49451727 0.98903455 0.50548273 [34,] 0.44508813 0.89017626 0.55491187 [35,] 0.47407096 0.94814191 0.52592904 [36,] 0.43287848 0.86575695 0.56712152 [37,] 0.40690099 0.81380198 0.59309901 [38,] 0.37130862 0.74261723 0.62869138 [39,] 0.32326959 0.64653918 0.67673041 [40,] 0.27809439 0.55618877 0.72190561 [41,] 0.28088983 0.56177966 0.71911017 [42,] 0.24210683 0.48421366 0.75789317 [43,] 0.21184868 0.42369736 0.78815132 [44,] 0.20569185 0.41138370 0.79430815 [45,] 0.18396473 0.36792946 0.81603527 [46,] 0.15236058 0.30472116 0.84763942 [47,] 0.13128592 0.26257183 0.86871408 [48,] 0.11267202 0.22534403 0.88732798 [49,] 0.11190798 0.22381597 0.88809202 [50,] 0.10487126 0.20974251 0.89512874 [51,] 0.09707690 0.19415381 0.90292310 [52,] 0.07758583 0.15517166 0.92241417 [53,] 0.06527728 0.13055455 0.93472272 [54,] 0.13565847 0.27131695 0.86434153 [55,] 0.12860370 0.25720741 0.87139630 [56,] 0.33248187 0.66496374 0.66751813 [57,] 0.29927187 0.59854374 0.70072813 [58,] 0.27227739 0.54455478 0.72772261 [59,] 0.36757680 0.73515360 0.63242320 [60,] 0.38805009 0.77610017 0.61194991 [61,] 0.39373448 0.78746896 0.60626552 [62,] 0.35042166 0.70084332 0.64957834 [63,] 0.32043543 0.64087087 0.67956457 [64,] 0.28483845 0.56967690 0.71516155 [65,] 0.25724077 0.51448153 0.74275923 [66,] 0.33492245 0.66984491 0.66507755 [67,] 0.29957819 0.59915638 0.70042181 [68,] 0.26236691 0.52473383 0.73763309 [69,] 0.22725944 0.45451888 0.77274056 [70,] 0.21070312 0.42140624 0.78929688 [71,] 0.22112612 0.44225223 0.77887388 [72,] 0.19992041 0.39984081 0.80007959 [73,] 0.21243391 0.42486781 0.78756609 [74,] 0.19146549 0.38293098 0.80853451 [75,] 0.22484902 0.44969804 0.77515098 [76,] 0.22844979 0.45689958 0.77155021 [77,] 0.19666029 0.39332057 0.80333971 [78,] 0.25766626 0.51533251 0.74233374 [79,] 0.22262738 0.44525477 0.77737262 [80,] 0.19459344 0.38918687 0.80540656 [81,] 0.17759149 0.35518299 0.82240851 [82,] 0.14877898 0.29755796 0.85122102 [83,] 0.12344004 0.24688008 0.87655996 [84,] 0.30358648 0.60717296 0.69641352 [85,] 0.27441353 0.54882706 0.72558647 [86,] 0.30502017 0.61004034 0.69497983 [87,] 0.26760484 0.53520968 0.73239516 [88,] 0.24057690 0.48115380 0.75942310 [89,] 0.23497986 0.46995972 0.76502014 [90,] 0.20423834 0.40847668 0.79576166 [91,] 0.17811832 0.35623663 0.82188168 [92,] 0.14851627 0.29703253 0.85148373 [93,] 0.18997312 0.37994624 0.81002688 [94,] 0.19751458 0.39502917 0.80248542 [95,] 0.16735604 0.33471208 0.83264396 [96,] 0.14007051 0.28014103 0.85992949 [97,] 0.17217352 0.34434704 0.82782648 [98,] 0.32657329 0.65314658 0.67342671 [99,] 0.28512556 0.57025111 0.71487444 [100,] 0.26381743 0.52763485 0.73618257 [101,] 0.22422023 0.44844046 0.77577977 [102,] 0.21242735 0.42485470 0.78757265 [103,] 0.20155882 0.40311764 0.79844118 [104,] 0.31888570 0.63777139 0.68111430 [105,] 0.44324875 0.88649750 0.55675125 [106,] 0.39341895 0.78683791 0.60658105 [107,] 0.37022930 0.74045859 0.62977070 [108,] 0.32197451 0.64394901 0.67802549 [109,] 0.28715543 0.57431087 0.71284457 [110,] 0.29527429 0.59054858 0.70472571 [111,] 0.31569896 0.63139792 0.68430104 [112,] 0.31196258 0.62392516 0.68803742 [113,] 0.26610284 0.53220568 0.73389716 [114,] 0.24536551 0.49073103 0.75463449 [115,] 0.21667749 0.43335497 0.78332251 [116,] 0.18941644 0.37883288 0.81058356 [117,] 0.18129013 0.36258025 0.81870987 [118,] 0.14580262 0.29160525 0.85419738 [119,] 0.15092756 0.30185511 0.84907244 [120,] 0.21149653 0.42299306 0.78850347 [121,] 0.34882543 0.69765086 0.65117457 [122,] 0.78600776 0.42798447 0.21399224 [123,] 0.74294757 0.51410485 0.25705243 [124,] 0.91883229 0.16233543 0.08116771 [125,] 0.97555929 0.04888143 0.02444071 [126,] 0.96301159 0.07397682 0.03698841 [127,] 0.94515687 0.10968626 0.05484313 [128,] 0.96210337 0.07579325 0.03789663 [129,] 0.94178516 0.11642968 0.05821484 [130,] 0.96298062 0.07403875 0.03701938 [131,] 0.94145451 0.11709098 0.05854549 [132,] 0.93914615 0.12170769 0.06085385 [133,] 0.90588992 0.18822016 0.09411008 [134,] 0.85977552 0.28044896 0.14022448 [135,] 0.93750746 0.12498508 0.06249254 [136,] 0.89858814 0.20282371 0.10141186 [137,] 0.85515631 0.28968739 0.14484369 [138,] 0.80560010 0.38879981 0.19439990 [139,] 0.74749607 0.50500785 0.25250393 [140,] 0.63520967 0.72958066 0.36479033 [141,] 0.64155719 0.71688561 0.35844281 [142,] 0.50979089 0.98041822 0.49020911 > postscript(file="/var/www/rcomp/tmp/1x5vj1292918923.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/rcomp/tmp/2x5vj1292918923.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/rcomp/tmp/38edm1292918923.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/rcomp/tmp/48edm1292918923.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/rcomp/tmp/58edm1292918923.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 = 159 Frequency = 1 1 2 3 4 5 6 3.30317248 -5.75762753 -1.47592131 -3.56194532 -0.90620471 -6.36670620 7 8 9 10 11 12 -4.40239954 -3.52013359 7.67252311 7.89642341 -1.09187945 1.58343372 13 14 15 16 17 18 4.57967991 1.76983335 1.38700368 -4.21715322 -1.59385095 -2.50886805 19 20 21 22 23 24 -5.46973622 -0.73791368 0.93478062 -6.00907079 4.16126995 -0.02387250 25 26 27 28 29 30 -4.77230448 -2.18484145 6.85702899 -3.68265576 1.26594676 -0.79025918 31 32 33 34 35 36 2.68703270 -0.24616086 -7.02816544 -3.93254992 -2.47040444 10.38040215 37 38 39 40 41 42 0.87369237 6.93990050 1.86545801 4.52186780 3.45591557 -1.64033287 43 44 45 46 47 48 5.05696974 -2.54888532 4.22445539 -1.78905525 -0.77650707 0.85280436 49 50 51 52 53 54 -3.19818879 0.83134401 2.22637389 4.19788038 3.10535412 0.62692272 55 56 57 58 59 60 -1.44836644 -1.50497988 4.03610951 4.43644527 4.50950124 -0.23602934 61 62 63 64 65 66 -1.57036519 9.79636083 -3.14063607 -11.72727421 -1.82844117 -2.20020963 67 68 69 70 71 72 7.37546414 -5.04608941 -4.91440766 -0.57640121 -2.45222637 -1.78862089 73 74 75 76 77 78 -2.22258154 7.53315720 -1.78243444 -0.46970066 0.94756774 -3.14707429 79 80 81 82 83 84 -5.09592061 -2.74349408 5.27243388 2.72600355 -5.90082233 -4.37875809 85 86 87 88 89 90 1.60816222 7.75949173 1.02402894 1.81241949 3.08090105 -0.33164622 91 92 93 94 95 96 0.67305104 11.40419406 2.66516664 -5.68680977 -1.04211109 -2.12166727 97 98 99 100 101 102 4.91071853 -0.97306965 -1.86432396 0.68218064 -6.68543104 -5.83544542 103 104 105 106 107 108 -0.31766159 0.22344200 6.84030690 10.08149182 -0.29292415 2.73948872 109 110 111 112 113 114 0.03968511 3.68213985 4.20997728 9.36378971 -9.02536193 -0.83896049 115 116 117 118 119 120 1.97593809 0.63566868 -2.20652862 -5.45020489 4.90059439 2.75698069 121 122 123 124 125 126 -0.95286850 -0.97747114 -3.19784550 -3.42546609 -3.72386300 -0.33540345 127 128 129 130 131 132 -5.07506540 -7.92977211 4.77986400 12.54244481 -3.94766720 -11.06597338 133 134 135 136 137 138 -9.76198833 -2.43427076 0.26619649 3.04636559 0.17645168 -7.80326620 139 140 141 142 143 144 1.34262882 4.75826097 -1.10525980 0.26850372 5.80095262 1.58668852 145 146 147 148 149 150 -1.17060845 1.01538343 -2.57722082 0.88439100 -2.45484801 0.48816450 151 152 153 154 155 156 4.44158444 -6.42285660 -1.94510428 -2.03675063 3.95161231 -1.64219453 157 158 159 -1.33126279 -0.99179118 3.54956808 > postscript(file="/var/www/rcomp/tmp/6i5c61292918923.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 3.30317248 NA 1 -5.75762753 3.30317248 2 -1.47592131 -5.75762753 3 -3.56194532 -1.47592131 4 -0.90620471 -3.56194532 5 -6.36670620 -0.90620471 6 -4.40239954 -6.36670620 7 -3.52013359 -4.40239954 8 7.67252311 -3.52013359 9 7.89642341 7.67252311 10 -1.09187945 7.89642341 11 1.58343372 -1.09187945 12 4.57967991 1.58343372 13 1.76983335 4.57967991 14 1.38700368 1.76983335 15 -4.21715322 1.38700368 16 -1.59385095 -4.21715322 17 -2.50886805 -1.59385095 18 -5.46973622 -2.50886805 19 -0.73791368 -5.46973622 20 0.93478062 -0.73791368 21 -6.00907079 0.93478062 22 4.16126995 -6.00907079 23 -0.02387250 4.16126995 24 -4.77230448 -0.02387250 25 -2.18484145 -4.77230448 26 6.85702899 -2.18484145 27 -3.68265576 6.85702899 28 1.26594676 -3.68265576 29 -0.79025918 1.26594676 30 2.68703270 -0.79025918 31 -0.24616086 2.68703270 32 -7.02816544 -0.24616086 33 -3.93254992 -7.02816544 34 -2.47040444 -3.93254992 35 10.38040215 -2.47040444 36 0.87369237 10.38040215 37 6.93990050 0.87369237 38 1.86545801 6.93990050 39 4.52186780 1.86545801 40 3.45591557 4.52186780 41 -1.64033287 3.45591557 42 5.05696974 -1.64033287 43 -2.54888532 5.05696974 44 4.22445539 -2.54888532 45 -1.78905525 4.22445539 46 -0.77650707 -1.78905525 47 0.85280436 -0.77650707 48 -3.19818879 0.85280436 49 0.83134401 -3.19818879 50 2.22637389 0.83134401 51 4.19788038 2.22637389 52 3.10535412 4.19788038 53 0.62692272 3.10535412 54 -1.44836644 0.62692272 55 -1.50497988 -1.44836644 56 4.03610951 -1.50497988 57 4.43644527 4.03610951 58 4.50950124 4.43644527 59 -0.23602934 4.50950124 60 -1.57036519 -0.23602934 61 9.79636083 -1.57036519 62 -3.14063607 9.79636083 63 -11.72727421 -3.14063607 64 -1.82844117 -11.72727421 65 -2.20020963 -1.82844117 66 7.37546414 -2.20020963 67 -5.04608941 7.37546414 68 -4.91440766 -5.04608941 69 -0.57640121 -4.91440766 70 -2.45222637 -0.57640121 71 -1.78862089 -2.45222637 72 -2.22258154 -1.78862089 73 7.53315720 -2.22258154 74 -1.78243444 7.53315720 75 -0.46970066 -1.78243444 76 0.94756774 -0.46970066 77 -3.14707429 0.94756774 78 -5.09592061 -3.14707429 79 -2.74349408 -5.09592061 80 5.27243388 -2.74349408 81 2.72600355 5.27243388 82 -5.90082233 2.72600355 83 -4.37875809 -5.90082233 84 1.60816222 -4.37875809 85 7.75949173 1.60816222 86 1.02402894 7.75949173 87 1.81241949 1.02402894 88 3.08090105 1.81241949 89 -0.33164622 3.08090105 90 0.67305104 -0.33164622 91 11.40419406 0.67305104 92 2.66516664 11.40419406 93 -5.68680977 2.66516664 94 -1.04211109 -5.68680977 95 -2.12166727 -1.04211109 96 4.91071853 -2.12166727 97 -0.97306965 4.91071853 98 -1.86432396 -0.97306965 99 0.68218064 -1.86432396 100 -6.68543104 0.68218064 101 -5.83544542 -6.68543104 102 -0.31766159 -5.83544542 103 0.22344200 -0.31766159 104 6.84030690 0.22344200 105 10.08149182 6.84030690 106 -0.29292415 10.08149182 107 2.73948872 -0.29292415 108 0.03968511 2.73948872 109 3.68213985 0.03968511 110 4.20997728 3.68213985 111 9.36378971 4.20997728 112 -9.02536193 9.36378971 113 -0.83896049 -9.02536193 114 1.97593809 -0.83896049 115 0.63566868 1.97593809 116 -2.20652862 0.63566868 117 -5.45020489 -2.20652862 118 4.90059439 -5.45020489 119 2.75698069 4.90059439 120 -0.95286850 2.75698069 121 -0.97747114 -0.95286850 122 -3.19784550 -0.97747114 123 -3.42546609 -3.19784550 124 -3.72386300 -3.42546609 125 -0.33540345 -3.72386300 126 -5.07506540 -0.33540345 127 -7.92977211 -5.07506540 128 4.77986400 -7.92977211 129 12.54244481 4.77986400 130 -3.94766720 12.54244481 131 -11.06597338 -3.94766720 132 -9.76198833 -11.06597338 133 -2.43427076 -9.76198833 134 0.26619649 -2.43427076 135 3.04636559 0.26619649 136 0.17645168 3.04636559 137 -7.80326620 0.17645168 138 1.34262882 -7.80326620 139 4.75826097 1.34262882 140 -1.10525980 4.75826097 141 0.26850372 -1.10525980 142 5.80095262 0.26850372 143 1.58668852 5.80095262 144 -1.17060845 1.58668852 145 1.01538343 -1.17060845 146 -2.57722082 1.01538343 147 0.88439100 -2.57722082 148 -2.45484801 0.88439100 149 0.48816450 -2.45484801 150 4.44158444 0.48816450 151 -6.42285660 4.44158444 152 -1.94510428 -6.42285660 153 -2.03675063 -1.94510428 154 3.95161231 -2.03675063 155 -1.64219453 3.95161231 156 -1.33126279 -1.64219453 157 -0.99179118 -1.33126279 158 3.54956808 -0.99179118 159 NA 3.54956808 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -5.75762753 3.30317248 [2,] -1.47592131 -5.75762753 [3,] -3.56194532 -1.47592131 [4,] -0.90620471 -3.56194532 [5,] -6.36670620 -0.90620471 [6,] -4.40239954 -6.36670620 [7,] -3.52013359 -4.40239954 [8,] 7.67252311 -3.52013359 [9,] 7.89642341 7.67252311 [10,] -1.09187945 7.89642341 [11,] 1.58343372 -1.09187945 [12,] 4.57967991 1.58343372 [13,] 1.76983335 4.57967991 [14,] 1.38700368 1.76983335 [15,] -4.21715322 1.38700368 [16,] -1.59385095 -4.21715322 [17,] -2.50886805 -1.59385095 [18,] -5.46973622 -2.50886805 [19,] -0.73791368 -5.46973622 [20,] 0.93478062 -0.73791368 [21,] -6.00907079 0.93478062 [22,] 4.16126995 -6.00907079 [23,] -0.02387250 4.16126995 [24,] -4.77230448 -0.02387250 [25,] -2.18484145 -4.77230448 [26,] 6.85702899 -2.18484145 [27,] -3.68265576 6.85702899 [28,] 1.26594676 -3.68265576 [29,] -0.79025918 1.26594676 [30,] 2.68703270 -0.79025918 [31,] -0.24616086 2.68703270 [32,] -7.02816544 -0.24616086 [33,] -3.93254992 -7.02816544 [34,] -2.47040444 -3.93254992 [35,] 10.38040215 -2.47040444 [36,] 0.87369237 10.38040215 [37,] 6.93990050 0.87369237 [38,] 1.86545801 6.93990050 [39,] 4.52186780 1.86545801 [40,] 3.45591557 4.52186780 [41,] -1.64033287 3.45591557 [42,] 5.05696974 -1.64033287 [43,] -2.54888532 5.05696974 [44,] 4.22445539 -2.54888532 [45,] -1.78905525 4.22445539 [46,] -0.77650707 -1.78905525 [47,] 0.85280436 -0.77650707 [48,] -3.19818879 0.85280436 [49,] 0.83134401 -3.19818879 [50,] 2.22637389 0.83134401 [51,] 4.19788038 2.22637389 [52,] 3.10535412 4.19788038 [53,] 0.62692272 3.10535412 [54,] -1.44836644 0.62692272 [55,] -1.50497988 -1.44836644 [56,] 4.03610951 -1.50497988 [57,] 4.43644527 4.03610951 [58,] 4.50950124 4.43644527 [59,] -0.23602934 4.50950124 [60,] -1.57036519 -0.23602934 [61,] 9.79636083 -1.57036519 [62,] -3.14063607 9.79636083 [63,] -11.72727421 -3.14063607 [64,] -1.82844117 -11.72727421 [65,] -2.20020963 -1.82844117 [66,] 7.37546414 -2.20020963 [67,] -5.04608941 7.37546414 [68,] -4.91440766 -5.04608941 [69,] -0.57640121 -4.91440766 [70,] -2.45222637 -0.57640121 [71,] -1.78862089 -2.45222637 [72,] -2.22258154 -1.78862089 [73,] 7.53315720 -2.22258154 [74,] -1.78243444 7.53315720 [75,] -0.46970066 -1.78243444 [76,] 0.94756774 -0.46970066 [77,] -3.14707429 0.94756774 [78,] -5.09592061 -3.14707429 [79,] -2.74349408 -5.09592061 [80,] 5.27243388 -2.74349408 [81,] 2.72600355 5.27243388 [82,] -5.90082233 2.72600355 [83,] -4.37875809 -5.90082233 [84,] 1.60816222 -4.37875809 [85,] 7.75949173 1.60816222 [86,] 1.02402894 7.75949173 [87,] 1.81241949 1.02402894 [88,] 3.08090105 1.81241949 [89,] -0.33164622 3.08090105 [90,] 0.67305104 -0.33164622 [91,] 11.40419406 0.67305104 [92,] 2.66516664 11.40419406 [93,] -5.68680977 2.66516664 [94,] -1.04211109 -5.68680977 [95,] -2.12166727 -1.04211109 [96,] 4.91071853 -2.12166727 [97,] -0.97306965 4.91071853 [98,] -1.86432396 -0.97306965 [99,] 0.68218064 -1.86432396 [100,] -6.68543104 0.68218064 [101,] -5.83544542 -6.68543104 [102,] -0.31766159 -5.83544542 [103,] 0.22344200 -0.31766159 [104,] 6.84030690 0.22344200 [105,] 10.08149182 6.84030690 [106,] -0.29292415 10.08149182 [107,] 2.73948872 -0.29292415 [108,] 0.03968511 2.73948872 [109,] 3.68213985 0.03968511 [110,] 4.20997728 3.68213985 [111,] 9.36378971 4.20997728 [112,] -9.02536193 9.36378971 [113,] -0.83896049 -9.02536193 [114,] 1.97593809 -0.83896049 [115,] 0.63566868 1.97593809 [116,] -2.20652862 0.63566868 [117,] -5.45020489 -2.20652862 [118,] 4.90059439 -5.45020489 [119,] 2.75698069 4.90059439 [120,] -0.95286850 2.75698069 [121,] -0.97747114 -0.95286850 [122,] -3.19784550 -0.97747114 [123,] -3.42546609 -3.19784550 [124,] -3.72386300 -3.42546609 [125,] -0.33540345 -3.72386300 [126,] -5.07506540 -0.33540345 [127,] -7.92977211 -5.07506540 [128,] 4.77986400 -7.92977211 [129,] 12.54244481 4.77986400 [130,] -3.94766720 12.54244481 [131,] -11.06597338 -3.94766720 [132,] -9.76198833 -11.06597338 [133,] -2.43427076 -9.76198833 [134,] 0.26619649 -2.43427076 [135,] 3.04636559 0.26619649 [136,] 0.17645168 3.04636559 [137,] -7.80326620 0.17645168 [138,] 1.34262882 -7.80326620 [139,] 4.75826097 1.34262882 [140,] -1.10525980 4.75826097 [141,] 0.26850372 -1.10525980 [142,] 5.80095262 0.26850372 [143,] 1.58668852 5.80095262 [144,] -1.17060845 1.58668852 [145,] 1.01538343 -1.17060845 [146,] -2.57722082 1.01538343 [147,] 0.88439100 -2.57722082 [148,] -2.45484801 0.88439100 [149,] 0.48816450 -2.45484801 [150,] 4.44158444 0.48816450 [151,] -6.42285660 4.44158444 [152,] -1.94510428 -6.42285660 [153,] -2.03675063 -1.94510428 [154,] 3.95161231 -2.03675063 [155,] -1.64219453 3.95161231 [156,] -1.33126279 -1.64219453 [157,] -0.99179118 -1.33126279 [158,] 3.54956808 -0.99179118 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -5.75762753 3.30317248 2 -1.47592131 -5.75762753 3 -3.56194532 -1.47592131 4 -0.90620471 -3.56194532 5 -6.36670620 -0.90620471 6 -4.40239954 -6.36670620 7 -3.52013359 -4.40239954 8 7.67252311 -3.52013359 9 7.89642341 7.67252311 10 -1.09187945 7.89642341 11 1.58343372 -1.09187945 12 4.57967991 1.58343372 13 1.76983335 4.57967991 14 1.38700368 1.76983335 15 -4.21715322 1.38700368 16 -1.59385095 -4.21715322 17 -2.50886805 -1.59385095 18 -5.46973622 -2.50886805 19 -0.73791368 -5.46973622 20 0.93478062 -0.73791368 21 -6.00907079 0.93478062 22 4.16126995 -6.00907079 23 -0.02387250 4.16126995 24 -4.77230448 -0.02387250 25 -2.18484145 -4.77230448 26 6.85702899 -2.18484145 27 -3.68265576 6.85702899 28 1.26594676 -3.68265576 29 -0.79025918 1.26594676 30 2.68703270 -0.79025918 31 -0.24616086 2.68703270 32 -7.02816544 -0.24616086 33 -3.93254992 -7.02816544 34 -2.47040444 -3.93254992 35 10.38040215 -2.47040444 36 0.87369237 10.38040215 37 6.93990050 0.87369237 38 1.86545801 6.93990050 39 4.52186780 1.86545801 40 3.45591557 4.52186780 41 -1.64033287 3.45591557 42 5.05696974 -1.64033287 43 -2.54888532 5.05696974 44 4.22445539 -2.54888532 45 -1.78905525 4.22445539 46 -0.77650707 -1.78905525 47 0.85280436 -0.77650707 48 -3.19818879 0.85280436 49 0.83134401 -3.19818879 50 2.22637389 0.83134401 51 4.19788038 2.22637389 52 3.10535412 4.19788038 53 0.62692272 3.10535412 54 -1.44836644 0.62692272 55 -1.50497988 -1.44836644 56 4.03610951 -1.50497988 57 4.43644527 4.03610951 58 4.50950124 4.43644527 59 -0.23602934 4.50950124 60 -1.57036519 -0.23602934 61 9.79636083 -1.57036519 62 -3.14063607 9.79636083 63 -11.72727421 -3.14063607 64 -1.82844117 -11.72727421 65 -2.20020963 -1.82844117 66 7.37546414 -2.20020963 67 -5.04608941 7.37546414 68 -4.91440766 -5.04608941 69 -0.57640121 -4.91440766 70 -2.45222637 -0.57640121 71 -1.78862089 -2.45222637 72 -2.22258154 -1.78862089 73 7.53315720 -2.22258154 74 -1.78243444 7.53315720 75 -0.46970066 -1.78243444 76 0.94756774 -0.46970066 77 -3.14707429 0.94756774 78 -5.09592061 -3.14707429 79 -2.74349408 -5.09592061 80 5.27243388 -2.74349408 81 2.72600355 5.27243388 82 -5.90082233 2.72600355 83 -4.37875809 -5.90082233 84 1.60816222 -4.37875809 85 7.75949173 1.60816222 86 1.02402894 7.75949173 87 1.81241949 1.02402894 88 3.08090105 1.81241949 89 -0.33164622 3.08090105 90 0.67305104 -0.33164622 91 11.40419406 0.67305104 92 2.66516664 11.40419406 93 -5.68680977 2.66516664 94 -1.04211109 -5.68680977 95 -2.12166727 -1.04211109 96 4.91071853 -2.12166727 97 -0.97306965 4.91071853 98 -1.86432396 -0.97306965 99 0.68218064 -1.86432396 100 -6.68543104 0.68218064 101 -5.83544542 -6.68543104 102 -0.31766159 -5.83544542 103 0.22344200 -0.31766159 104 6.84030690 0.22344200 105 10.08149182 6.84030690 106 -0.29292415 10.08149182 107 2.73948872 -0.29292415 108 0.03968511 2.73948872 109 3.68213985 0.03968511 110 4.20997728 3.68213985 111 9.36378971 4.20997728 112 -9.02536193 9.36378971 113 -0.83896049 -9.02536193 114 1.97593809 -0.83896049 115 0.63566868 1.97593809 116 -2.20652862 0.63566868 117 -5.45020489 -2.20652862 118 4.90059439 -5.45020489 119 2.75698069 4.90059439 120 -0.95286850 2.75698069 121 -0.97747114 -0.95286850 122 -3.19784550 -0.97747114 123 -3.42546609 -3.19784550 124 -3.72386300 -3.42546609 125 -0.33540345 -3.72386300 126 -5.07506540 -0.33540345 127 -7.92977211 -5.07506540 128 4.77986400 -7.92977211 129 12.54244481 4.77986400 130 -3.94766720 12.54244481 131 -11.06597338 -3.94766720 132 -9.76198833 -11.06597338 133 -2.43427076 -9.76198833 134 0.26619649 -2.43427076 135 3.04636559 0.26619649 136 0.17645168 3.04636559 137 -7.80326620 0.17645168 138 1.34262882 -7.80326620 139 4.75826097 1.34262882 140 -1.10525980 4.75826097 141 0.26850372 -1.10525980 142 5.80095262 0.26850372 143 1.58668852 5.80095262 144 -1.17060845 1.58668852 145 1.01538343 -1.17060845 146 -2.57722082 1.01538343 147 0.88439100 -2.57722082 148 -2.45484801 0.88439100 149 0.48816450 -2.45484801 150 4.44158444 0.48816450 151 -6.42285660 4.44158444 152 -1.94510428 -6.42285660 153 -2.03675063 -1.94510428 154 3.95161231 -2.03675063 155 -1.64219453 3.95161231 156 -1.33126279 -1.64219453 157 -0.99179118 -1.33126279 158 3.54956808 -0.99179118 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/7twt91292918923.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/rcomp/tmp/8twt91292918923.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/rcomp/tmp/9twt91292918923.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/rcomp/tmp/1046su1292918923.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/1176r01292918923.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/12s6761292918923.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/137gnx1292918923.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/14sh431292918923.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/15vz2r1292918923.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/16z0jf1292918923.tab") + } > > try(system("convert tmp/1x5vj1292918923.ps tmp/1x5vj1292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/2x5vj1292918923.ps tmp/2x5vj1292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/38edm1292918923.ps tmp/38edm1292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/48edm1292918923.ps tmp/48edm1292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/58edm1292918923.ps tmp/58edm1292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/6i5c61292918923.ps tmp/6i5c61292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/7twt91292918923.ps tmp/7twt91292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/8twt91292918923.ps tmp/8twt91292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/9twt91292918923.ps tmp/9twt91292918923.png",intern=TRUE)) character(0) > try(system("convert tmp/1046su1292918923.ps tmp/1046su1292918923.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.600 0.860 5.433