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(26 + ,24 + ,14 + ,11 + ,12 + ,24 + ,23 + ,25 + ,11 + ,7 + ,8 + ,25 + ,25 + ,17 + ,6 + ,17 + ,8 + ,30 + ,23 + ,18 + ,12 + ,10 + ,8 + ,19 + ,19 + ,18 + ,8 + ,12 + ,9 + ,22 + ,29 + ,16 + ,10 + ,12 + ,7 + ,22 + ,25 + ,20 + ,10 + ,11 + ,4 + ,25 + ,21 + ,16 + ,11 + ,11 + ,11 + ,23 + ,22 + ,18 + ,16 + ,12 + ,7 + ,17 + ,25 + ,17 + ,11 + ,13 + ,7 + ,21 + ,24 + ,23 + ,13 + ,14 + ,12 + ,19 + ,18 + ,30 + ,12 + ,16 + ,10 + ,19 + ,22 + ,23 + ,8 + ,11 + ,10 + ,15 + ,15 + ,18 + ,12 + ,10 + ,8 + ,16 + ,22 + ,15 + ,11 + ,11 + ,8 + ,23 + ,28 + ,12 + ,4 + ,15 + ,4 + ,27 + ,20 + ,21 + ,9 + ,9 + ,9 + ,22 + ,12 + ,15 + ,8 + ,11 + ,8 + ,14 + ,24 + ,20 + ,8 + ,17 + ,7 + ,22 + ,20 + ,31 + ,14 + ,17 + ,11 + ,23 + ,21 + ,27 + ,15 + ,11 + ,9 + ,23 + ,20 + ,34 + ,16 + ,18 + ,11 + ,21 + ,21 + ,21 + ,9 + ,14 + ,13 + ,19 + ,23 + ,31 + ,14 + ,10 + ,8 + ,18 + ,28 + ,19 + ,11 + ,11 + ,8 + ,20 + ,24 + ,16 + ,8 + ,15 + ,9 + ,23 + ,24 + ,20 + ,9 + ,15 + ,6 + ,25 + ,24 + ,21 + ,9 + ,13 + ,9 + ,19 + ,23 + ,22 + ,9 + ,16 + ,9 + ,24 + ,23 + ,17 + ,9 + ,13 + ,6 + ,22 + ,29 + ,24 + ,10 + ,9 + ,6 + ,25 + ,24 + ,25 + ,16 + ,18 + ,16 + ,26 + ,18 + ,26 + ,11 + ,18 + ,5 + ,29 + ,25 + ,25 + ,8 + ,12 + ,7 + ,32 + ,21 + ,17 + ,9 + ,17 + ,9 + ,25 + ,26 + ,32 + ,16 + ,9 + ,6 + ,29 + ,22 + ,33 + ,11 + ,9 + ,6 + ,28 + ,22 + ,13 + ,16 + ,12 + ,5 + ,17 + ,22 + ,32 + ,12 + ,18 + ,12 + ,28 + ,23 + ,25 + ,12 + ,12 + ,7 + ,29 + ,30 + ,29 + ,14 + ,18 + ,10 + ,26 + ,23 + ,22 + ,9 + ,14 + ,9 + ,25 + ,17 + ,18 + ,10 + ,15 + ,8 + ,14 + ,23 + ,17 + ,9 + ,16 + ,5 + ,25 + ,23 + ,20 + ,10 + ,10 + ,8 + ,26 + ,25 + ,15 + ,12 + ,11 + ,8 + ,20 + ,24 + ,20 + ,14 + ,14 + ,10 + ,18 + ,24 + ,33 + ,14 + ,9 + ,6 + ,32 + ,23 + ,29 + ,10 + ,12 + ,8 + ,25 + ,21 + ,23 + ,14 + ,17 + ,7 + ,25 + ,24 + ,26 + ,16 + ,5 + ,4 + ,23 + ,24 + ,18 + ,9 + ,12 + ,8 + ,21 + ,28 + ,20 + ,10 + ,12 + ,8 + ,20 + ,16 + ,11 + ,6 + ,6 + ,4 + ,15 + ,20 + ,28 + ,8 + ,24 + ,20 + ,30 + ,29 + ,26 + ,13 + ,12 + ,8 + ,24 + ,27 + ,22 + ,10 + ,12 + ,8 + ,26 + ,22 + ,17 + ,8 + ,14 + ,6 + ,24 + ,28 + ,12 + ,7 + ,7 + ,4 + ,22 + ,16 + ,14 + ,15 + ,13 + ,8 + ,14 + ,25 + ,17 + ,9 + ,12 + ,9 + ,24 + ,24 + ,21 + ,10 + ,13 + ,6 + ,24 + ,28 + ,19 + ,12 + ,14 + ,7 + ,24 + ,24 + ,18 + ,13 + ,8 + ,9 + ,24 + ,23 + ,10 + ,10 + ,11 + ,5 + ,19 + ,30 + ,29 + ,11 + ,9 + ,5 + ,31 + ,24 + ,31 + ,8 + ,11 + ,8 + ,22 + ,21 + ,19 + ,9 + ,13 + ,8 + ,27 + ,25 + ,9 + ,13 + ,10 + ,6 + ,19 + ,25 + ,20 + ,11 + ,11 + ,8 + ,25 + ,22 + ,28 + ,8 + ,12 + ,7 + ,20 + ,23 + ,19 + ,9 + ,9 + ,7 + ,21 + ,26 + ,30 + ,9 + ,15 + ,9 + ,27 + ,23 + ,29 + ,15 + ,18 + ,11 + ,23 + ,25 + ,26 + ,9 + ,15 + ,6 + ,25 + ,21 + ,23 + ,10 + ,12 + ,8 + ,20 + ,25 + ,13 + ,14 + ,13 + ,6 + ,21 + ,24 + ,21 + ,12 + ,14 + ,9 + ,22 + ,29 + ,19 + ,12 + ,10 + ,8 + ,23 + ,22 + ,28 + ,11 + ,13 + ,6 + ,25 + ,27 + ,23 + ,14 + ,13 + ,10 + ,25 + ,26 + ,18 + ,6 + ,11 + ,8 + ,17 + ,22 + ,21 + ,12 + ,13 + ,8 + ,19 + ,24 + ,20 + ,8 + ,16 + ,10 + ,25 + ,27 + ,23 + ,14 + ,8 + ,5 + ,19 + ,24 + ,21 + ,11 + ,16 + ,7 + ,20 + ,24 + ,21 + ,10 + ,11 + ,5 + ,26 + ,29 + ,15 + ,14 + ,9 + ,8 + ,23 + ,22 + ,28 + ,12 + ,16 + ,14 + ,27 + ,21 + ,19 + ,10 + ,12 + ,7 + ,17 + ,24 + ,26 + ,14 + ,14 + ,8 + ,17 + ,24 + ,10 + ,5 + ,8 + ,6 + ,19 + ,23 + ,16 + ,11 + ,9 + ,5 + ,17 + ,20 + ,22 + ,10 + ,15 + ,6 + ,22 + ,27 + ,19 + ,9 + ,11 + ,10 + ,21 + ,26 + ,31 + ,10 + ,21 + ,12 + ,32 + ,25 + ,31 + ,16 + ,14 + ,9 + ,21 + ,21 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,19 + ,9 + ,12 + ,7 + ,18 + ,19 + ,22 + ,10 + ,13 + ,8 + ,18 + ,21 + ,23 + ,10 + ,15 + ,10 + ,23 + ,21 + ,15 + ,7 + ,12 + ,6 + ,19 + ,16 + ,20 + ,9 + ,19 + ,10 + ,20 + ,22 + ,18 + ,8 + ,15 + ,10 + ,21 + ,29 + ,23 + ,14 + ,11 + ,10 + ,20 + ,15 + ,25 + ,14 + ,11 + ,5 + ,17 + ,17 + ,21 + ,8 + ,10 + ,7 + ,18 + ,15 + ,24 + ,9 + ,13 + ,10 + ,19 + ,21 + ,25 + ,14 + ,15 + ,11 + ,22 + ,21 + ,17 + ,14 + ,12 + ,6 + ,15 + ,19 + ,13 + ,8 + ,12 + ,7 + ,14 + ,24 + ,28 + ,8 + ,16 + ,12 + ,18 + ,20 + ,21 + ,8 + ,9 + ,11 + ,24 + ,17 + ,25 + ,7 + ,18 + ,11 + ,35 + ,23 + ,9 + ,6 + ,8 + ,11 + ,29 + ,24 + ,16 + ,8 + ,13 + ,5 + ,21 + ,14 + ,19 + ,6 + ,17 + ,8 + ,25 + ,19 + ,17 + ,11 + ,9 + ,6 + ,20 + ,24 + ,25 + ,14 + ,15 + ,9 + ,22 + ,13 + ,20 + ,11 + ,8 + ,4 + ,13 + ,22 + ,29 + ,11 + ,7 + ,4 + ,26 + ,16 + ,14 + ,11 + ,12 + ,7 + ,17 + ,19 + ,22 + ,14 + ,14 + ,11 + ,25 + ,25 + ,15 + ,8 + ,6 + ,6 + ,20 + ,25 + ,19 + ,20 + ,8 + ,7 + ,19 + ,23 + ,20 + ,11 + ,17 + ,8 + ,21 + ,24 + ,15 + ,8 + ,10 + ,4 + ,22 + ,26 + ,20 + ,11 + ,11 + ,8 + ,24 + ,26 + ,18 + ,10 + ,14 + ,9 + ,21 + ,25 + ,33 + ,14 + ,11 + ,8 + ,26 + ,18 + ,22 + ,11 + ,13 + ,11 + ,24 + ,21 + ,16 + ,9 + ,12 + ,8 + ,16 + ,26 + ,17 + ,9 + ,11 + ,5 + ,23 + ,23 + ,16 + ,8 + ,9 + ,4 + ,18 + ,23 + ,21 + ,10 + ,12 + ,8 + ,16 + ,22 + ,26 + ,13 + ,20 + ,10 + ,26 + ,20 + ,18 + ,13 + ,12 + ,6 + ,19 + ,13 + ,18 + ,12 + ,13 + ,9 + ,21 + ,24 + ,17 + ,8 + ,12 + ,9 + ,21 + ,15 + ,22 + ,13 + ,12 + ,13 + ,22 + ,14 + ,30 + ,14 + ,9 + ,9 + ,23 + ,22 + ,30 + ,12 + ,15 + ,10 + ,29 + ,10 + ,24 + ,14 + ,24 + ,20 + ,21 + ,24 + ,21 + ,15 + ,7 + ,5 + ,21 + ,22 + ,21 + ,13 + ,17 + ,11 + ,23 + ,24 + ,29 + ,16 + ,11 + ,6 + ,27 + ,19 + ,31 + ,10 + ,17 + ,9 + ,25 + ,20 + ,20 + ,9 + ,11 + ,7 + ,21 + ,13 + ,16 + ,9 + ,12 + ,9 + ,10 + ,20 + ,22 + ,8 + ,14 + ,10 + ,20 + ,22 + ,20 + ,7 + ,11 + ,9 + ,26 + ,24 + ,28 + ,16 + ,16 + ,8 + ,24 + ,29 + ,38 + ,11 + ,21 + ,7 + ,29 + ,12 + ,22 + ,9 + ,14 + ,6 + ,19 + ,20 + ,20 + ,11 + ,20 + ,13 + ,24 + ,21 + ,17 + ,9 + ,13 + ,6 + ,19 + ,24 + ,28 + ,14 + ,11 + ,8 + ,24 + ,22 + ,22 + ,13 + ,15 + ,10 + ,22 + ,20 + ,31 + ,16 + ,19 + ,16 + ,17) + ,dim=c(6 + ,159) + ,dimnames=list(c('O' + ,'CM' + ,'D' + ,'PE' + ,'PC' + ,'PS') + ,1:159)) > y <- array(NA,dim=c(6,159),dimnames=list(c('O','CM','D','PE','PC','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 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 O CM D PE PC PS 1 26 24 14 11 12 24 2 23 25 11 7 8 25 3 25 17 6 17 8 30 4 23 18 12 10 8 19 5 19 18 8 12 9 22 6 29 16 10 12 7 22 7 25 20 10 11 4 25 8 21 16 11 11 11 23 9 22 18 16 12 7 17 10 25 17 11 13 7 21 11 24 23 13 14 12 19 12 18 30 12 16 10 19 13 22 23 8 11 10 15 14 15 18 12 10 8 16 15 22 15 11 11 8 23 16 28 12 4 15 4 27 17 20 21 9 9 9 22 18 12 15 8 11 8 14 19 24 20 8 17 7 22 20 20 31 14 17 11 23 21 21 27 15 11 9 23 22 20 34 16 18 11 21 23 21 21 9 14 13 19 24 23 31 14 10 8 18 25 28 19 11 11 8 20 26 24 16 8 15 9 23 27 24 20 9 15 6 25 28 24 21 9 13 9 19 29 23 22 9 16 9 24 30 23 17 9 13 6 22 31 29 24 10 9 6 25 32 24 25 16 18 16 26 33 18 26 11 18 5 29 34 25 25 8 12 7 32 35 21 17 9 17 9 25 36 26 32 16 9 6 29 37 22 33 11 9 6 28 38 22 13 16 12 5 17 39 22 32 12 18 12 28 40 23 25 12 12 7 29 41 30 29 14 18 10 26 42 23 22 9 14 9 25 43 17 18 10 15 8 14 44 23 17 9 16 5 25 45 23 20 10 10 8 26 46 25 15 12 11 8 20 47 24 20 14 14 10 18 48 24 33 14 9 6 32 49 23 29 10 12 8 25 50 21 23 14 17 7 25 51 24 26 16 5 4 23 52 24 18 9 12 8 21 53 28 20 10 12 8 20 54 16 11 6 6 4 15 55 20 28 8 24 20 30 56 29 26 13 12 8 24 57 27 22 10 12 8 26 58 22 17 8 14 6 24 59 28 12 7 7 4 22 60 16 14 15 13 8 14 61 25 17 9 12 9 24 62 24 21 10 13 6 24 63 28 19 12 14 7 24 64 24 18 13 8 9 24 65 23 10 10 11 5 19 66 30 29 11 9 5 31 67 24 31 8 11 8 22 68 21 19 9 13 8 27 69 25 9 13 10 6 19 70 25 20 11 11 8 25 71 22 28 8 12 7 20 72 23 19 9 9 7 21 73 26 30 9 15 9 27 74 23 29 15 18 11 23 75 25 26 9 15 6 25 76 21 23 10 12 8 20 77 25 13 14 13 6 21 78 24 21 12 14 9 22 79 29 19 12 10 8 23 80 22 28 11 13 6 25 81 27 23 14 13 10 25 82 26 18 6 11 8 17 83 22 21 12 13 8 19 84 24 20 8 16 10 25 85 27 23 14 8 5 19 86 24 21 11 16 7 20 87 24 21 10 11 5 26 88 29 15 14 9 8 23 89 22 28 12 16 14 27 90 21 19 10 12 7 17 91 24 26 14 14 8 17 92 24 10 5 8 6 19 93 23 16 11 9 5 17 94 20 22 10 15 6 22 95 27 19 9 11 10 21 96 26 31 10 21 12 32 97 25 31 16 14 9 21 98 21 29 13 18 12 21 99 21 19 9 12 7 18 100 19 22 10 13 8 18 101 21 23 10 15 10 23 102 21 15 7 12 6 19 103 16 20 9 19 10 20 104 22 18 8 15 10 21 105 29 23 14 11 10 20 106 15 25 14 11 5 17 107 17 21 8 10 7 18 108 15 24 9 13 10 19 109 21 25 14 15 11 22 110 21 17 14 12 6 15 111 19 13 8 12 7 14 112 24 28 8 16 12 18 113 20 21 8 9 11 24 114 17 25 7 18 11 35 115 23 9 6 8 11 29 116 24 16 8 13 5 21 117 14 19 6 17 8 25 118 19 17 11 9 6 20 119 24 25 14 15 9 22 120 13 20 11 8 4 13 121 22 29 11 7 4 26 122 16 14 11 12 7 17 123 19 22 14 14 11 25 124 25 15 8 6 6 20 125 25 19 20 8 7 19 126 23 20 11 17 8 21 127 24 15 8 10 4 22 128 26 20 11 11 8 24 129 26 18 10 14 9 21 130 25 33 14 11 8 26 131 18 22 11 13 11 24 132 21 16 9 12 8 16 133 26 17 9 11 5 23 134 23 16 8 9 4 18 135 23 21 10 12 8 16 136 22 26 13 20 10 26 137 20 18 13 12 6 19 138 13 18 12 13 9 21 139 24 17 8 12 9 21 140 15 22 13 12 13 22 141 14 30 14 9 9 23 142 22 30 12 15 10 29 143 10 24 14 24 20 21 144 24 21 15 7 5 21 145 22 21 13 17 11 23 146 24 29 16 11 6 27 147 19 31 10 17 9 25 148 20 20 9 11 7 21 149 13 16 9 12 9 10 150 20 22 8 14 10 20 151 22 20 7 11 9 26 152 24 28 16 16 8 24 153 29 38 11 21 7 29 154 12 22 9 14 6 19 155 20 20 11 20 13 24 156 21 17 9 13 6 19 157 24 28 14 11 8 24 158 22 22 13 15 10 22 159 20 31 16 19 16 17 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) CM D PE PC PS 16.16348 -0.07051 0.21596 -0.14974 -0.25441 0.42249 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -9.151 -1.732 0.268 2.226 7.176 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 16.16348 2.00169 8.075 1.87e-13 *** CM -0.07051 0.06307 -1.118 0.2653 D 0.21596 0.11300 1.911 0.0578 . PE -0.14974 0.10427 -1.436 0.1530 PC -0.25441 0.13043 -1.951 0.0529 . PS 0.42249 0.07566 5.584 1.05e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.5 on 153 degrees of freedom Multiple R-squared: 0.2219, Adjusted R-squared: 0.1964 F-statistic: 8.725 on 5 and 153 DF, p-value: 2.667e-07 > 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.725054620 0.549890761 0.2749454 [2,] 0.598321152 0.803357697 0.4016788 [3,] 0.488975852 0.977951703 0.5110241 [4,] 0.444478151 0.888956301 0.5555218 [5,] 0.452507565 0.905015131 0.5474924 [6,] 0.692944456 0.614111088 0.3070555 [7,] 0.624361546 0.751276909 0.3756385 [8,] 0.572340257 0.855319487 0.4276597 [9,] 0.506313500 0.987372999 0.4936865 [10,] 0.636441550 0.727116901 0.3635585 [11,] 0.561381672 0.877236656 0.4386183 [12,] 0.566462605 0.867074791 0.4335374 [13,] 0.518595053 0.962809894 0.4814049 [14,] 0.449441537 0.898883073 0.5505585 [15,] 0.390420051 0.780840103 0.6095799 [16,] 0.391051796 0.782103592 0.6089482 [17,] 0.534775206 0.930449589 0.4652248 [18,] 0.472150175 0.944300350 0.5278498 [19,] 0.408598229 0.817196457 0.5914018 [20,] 0.401847031 0.803694062 0.5981530 [21,] 0.340959710 0.681919419 0.6590403 [22,] 0.284307129 0.568614257 0.7156929 [23,] 0.308442850 0.616885699 0.6915572 [24,] 0.259940453 0.519880906 0.7400595 [25,] 0.484013787 0.968027574 0.5159862 [26,] 0.437627660 0.875255320 0.5623723 [27,] 0.402858138 0.805716276 0.5971419 [28,] 0.347214243 0.694428485 0.6527858 [29,] 0.324586176 0.649172351 0.6754138 [30,] 0.275314517 0.550629033 0.7246855 [31,] 0.230568769 0.461137538 0.7694312 [32,] 0.207289923 0.414579847 0.7927101 [33,] 0.358628734 0.717257468 0.6413713 [34,] 0.308567713 0.617135425 0.6914323 [35,] 0.276851864 0.553703729 0.7231481 [36,] 0.235041754 0.470083509 0.7649582 [37,] 0.202514049 0.405028098 0.7974860 [38,] 0.181691106 0.363382211 0.8183089 [39,] 0.169455912 0.338911824 0.8305441 [40,] 0.156496159 0.312992318 0.8435038 [41,] 0.127516697 0.255033394 0.8724833 [42,] 0.118033713 0.236067426 0.8819663 [43,] 0.097268725 0.194537449 0.9027313 [44,] 0.082293743 0.164587485 0.9177063 [45,] 0.137984838 0.275969677 0.8620152 [46,] 0.169490496 0.338980992 0.8305095 [47,] 0.161723148 0.323446295 0.8382769 [48,] 0.216949606 0.433899211 0.7830504 [49,] 0.207883830 0.415767660 0.7921162 [50,] 0.178223051 0.356446101 0.8217769 [51,] 0.188570918 0.377141836 0.8114291 [52,] 0.216660537 0.433321074 0.7833395 [53,] 0.190681473 0.381362947 0.8093185 [54,] 0.159950577 0.319901154 0.8400494 [55,] 0.174689230 0.349378460 0.8253108 [56,] 0.147164667 0.294329335 0.8528353 [57,] 0.121297065 0.242594131 0.8787029 [58,] 0.117576965 0.235153929 0.8824230 [59,] 0.107404081 0.214808162 0.8925959 [60,] 0.107636960 0.215273919 0.8923630 [61,] 0.091358325 0.182716650 0.9086417 [62,] 0.074493248 0.148986496 0.9255068 [63,] 0.060534898 0.121069796 0.9394651 [64,] 0.047799670 0.095599340 0.9522003 [65,] 0.044913726 0.089827453 0.9550863 [66,] 0.036026181 0.072052361 0.9639738 [67,] 0.030004954 0.060009907 0.9699950 [68,] 0.023041442 0.046082884 0.9769586 [69,] 0.018091398 0.036182796 0.9819086 [70,] 0.014485599 0.028971197 0.9855144 [71,] 0.021731879 0.043463758 0.9782681 [72,] 0.017338675 0.034677350 0.9826613 [73,] 0.016979064 0.033958128 0.9830209 [74,] 0.030488849 0.060977698 0.9695112 [75,] 0.023533425 0.047066850 0.9764666 [76,] 0.019662236 0.039324472 0.9803378 [77,] 0.021640658 0.043281316 0.9783593 [78,] 0.019253005 0.038506011 0.9807470 [79,] 0.014666251 0.029332502 0.9853337 [80,] 0.019233951 0.038467902 0.9807660 [81,] 0.015169624 0.030339249 0.9848304 [82,] 0.011373222 0.022746443 0.9886268 [83,] 0.011502186 0.023004371 0.9884978 [84,] 0.010064054 0.020128107 0.9899359 [85,] 0.007739522 0.015479044 0.9922605 [86,] 0.006416189 0.012832378 0.9935838 [87,] 0.011804411 0.023608823 0.9881956 [88,] 0.010745172 0.021490345 0.9892548 [89,] 0.010282772 0.020565544 0.9897172 [90,] 0.007902055 0.015804109 0.9920979 [91,] 0.005851696 0.011703391 0.9941483 [92,] 0.004498390 0.008996780 0.9955016 [93,] 0.003338836 0.006677672 0.9966612 [94,] 0.002385972 0.004771944 0.9976140 [95,] 0.002564316 0.005128632 0.9974357 [96,] 0.002018108 0.004036215 0.9979819 [97,] 0.008616270 0.017232540 0.9913837 [98,] 0.019316970 0.038633941 0.9806830 [99,] 0.019267220 0.038534440 0.9807328 [100,] 0.024395623 0.048791247 0.9756044 [101,] 0.018938821 0.037877642 0.9810612 [102,] 0.013924237 0.027848475 0.9860758 [103,] 0.010145940 0.020291880 0.9898541 [104,] 0.024832399 0.049664799 0.9751676 [105,] 0.022646378 0.045292757 0.9773536 [106,] 0.062671638 0.125343277 0.9373284 [107,] 0.053689923 0.107379847 0.9463101 [108,] 0.043825172 0.087650343 0.9561748 [109,] 0.127712254 0.255424509 0.8722877 [110,] 0.123183620 0.246367239 0.8768164 [111,] 0.110163603 0.220327206 0.8898364 [112,] 0.190173466 0.380346933 0.8098265 [113,] 0.182394483 0.364788967 0.8176055 [114,] 0.216779914 0.433559828 0.7832201 [115,] 0.210359256 0.420718513 0.7896407 [116,] 0.209304464 0.418608928 0.7906955 [117,] 0.193261851 0.386523701 0.8067381 [118,] 0.159394279 0.318788558 0.8406057 [119,] 0.126401762 0.252803523 0.8735982 [120,] 0.130910825 0.261821650 0.8690892 [121,] 0.185787054 0.371574108 0.8142129 [122,] 0.161991675 0.323983349 0.8380083 [123,] 0.143573171 0.287146342 0.8564268 [124,] 0.125769870 0.251539740 0.8742301 [125,] 0.116506942 0.233013884 0.8834931 [126,] 0.096492568 0.192985136 0.9035074 [127,] 0.130346055 0.260692109 0.8696539 [128,] 0.098735816 0.197471631 0.9012642 [129,] 0.073728387 0.147456773 0.9262716 [130,] 0.180287177 0.360574353 0.8197128 [131,] 0.250321999 0.500643997 0.7496780 [132,] 0.231691330 0.463382660 0.7683087 [133,] 0.470624131 0.941248262 0.5293759 [134,] 0.422400847 0.844801694 0.5775992 [135,] 0.728533458 0.542933083 0.2714665 [136,] 0.679249493 0.641501014 0.3207505 [137,] 0.579343024 0.841313952 0.4206570 [138,] 0.508302393 0.983395215 0.4916976 [139,] 0.558406818 0.883186363 0.4415932 [140,] 0.431110511 0.862221022 0.5688895 [141,] 0.338206148 0.676412296 0.6617939 [142,] 0.242095892 0.484191785 0.7579041 > postscript(file="/var/www/html/rcomp/tmp/1cyem1290503884.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/258e71290503884.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/358e71290503884.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/458e71290503884.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/5gzds1290503884.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 = 159 Frequency = 1 1 2 3 4 5 6 3.065700914 -1.255005586 0.645684928 1.019614177 -2.830115404 6.088120895 7 8 9 10 11 12 0.189723852 -1.682425132 0.045821274 2.514900796 3.772816268 -1.726988791 13 14 15 16 17 18 3.584524553 -5.712921078 -1.516168652 3.675390786 -2.283768451 -7.065893453 19 20 21 22 23 24 2.550790875 -1.374199457 -2.279472549 -0.599870564 1.750047484 1.926818709 25 26 27 28 29 30 6.033338224 2.055599605 0.513471930 3.582662059 0.989955673 0.269922195 31 32 33 34 35 36 4.681105093 1.925148379 -6.990525182 -1.070246151 -1.635343798 -0.740525566 37 38 39 40 41 42 -3.167725178 -0.815553381 -0.580057086 -2.666622691 7.112645177 0.267984542 43 44 45 46 47 48 -1.687316733 -0.802729223 -1.364861853 2.535335771 3.258990605 -3.505559136 49 50 51 52 53 54 -0.008295928 -2.800904200 -1.736447029 2.122001527 6.469550519 -5.104854379 55 56 57 58 59 60 0.090502186 5.554779758 3.075642094 -1.209352540 3.942019535 -4.348643353 61 62 63 64 65 66 2.038437245 0.491027508 4.322238236 -0.353859273 0.273959011 3.028356949 67 68 69 70 71 72 2.682369085 -3.192675990 1.660237069 0.991407515 1.211144428 0.488876740 73 74 75 76 77 78 3.136833749 1.418560597 1.936535127 -0.318917883 1.330566705 1.817057791 79 80 81 82 83 84 5.400171716 -1.653847333 3.363363023 6.310094043 0.680370099 1.896817677 85 86 87 88 89 90 3.877530328 2.668655499 -0.907842867 4.536467501 -0.230271860 0.412093735 91 92 93 94 95 96 3.595720058 2.158947290 1.026555500 -2.294002581 5.551592610 2.540624353 97 98 99 100 101 102 3.080810081 0.949868732 0.205565808 -1.394710477 -0.628336312 -0.321454924 103 104 105 106 107 108 -3.757477080 1.296008163 7.176321383 -6.687247786 -3.736935687 -4.951395347 109 110 111 112 113 114 -0.674257288 -0.002203115 -0.311584073 5.927141669 -2.403962634 -8.205657944 115 116 117 118 119 120 -2.080351068 1.583449236 -8.100852764 -3.915987716 1.816920720 -7.405601812 121 122 123 124 125 126 -3.413095687 -5.156419250 -4.302995072 2.141647859 0.808548260 1.579809155 127 128 129 130 131 132 0.386815135 2.413895763 4.459935083 0.837675228 -4.382367301 1.093421703 133 134 135 136 137 138 2.293540068 0.997537220 3.230014045 -0.583443218 -2.405685254 -9.121727000 139 140 141 142 143 144 2.521862311 -6.610230896 -9.151463511 -2.101612716 -7.684907638 -0.474168997 145 146 147 148 149 150 0.136655536 -1.807597786 -2.864156660 -2.141129845 -4.117237811 -0.149202898 151 152 153 154 155 156 -1.312828452 0.646885624 5.813647527 -8.960318955 -0.966376287 -0.462613060 157 158 159 0.330099061 0.075760439 2.300347252 > postscript(file="/var/www/html/rcomp/tmp/6gzds1290503884.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 3.065700914 NA 1 -1.255005586 3.065700914 2 0.645684928 -1.255005586 3 1.019614177 0.645684928 4 -2.830115404 1.019614177 5 6.088120895 -2.830115404 6 0.189723852 6.088120895 7 -1.682425132 0.189723852 8 0.045821274 -1.682425132 9 2.514900796 0.045821274 10 3.772816268 2.514900796 11 -1.726988791 3.772816268 12 3.584524553 -1.726988791 13 -5.712921078 3.584524553 14 -1.516168652 -5.712921078 15 3.675390786 -1.516168652 16 -2.283768451 3.675390786 17 -7.065893453 -2.283768451 18 2.550790875 -7.065893453 19 -1.374199457 2.550790875 20 -2.279472549 -1.374199457 21 -0.599870564 -2.279472549 22 1.750047484 -0.599870564 23 1.926818709 1.750047484 24 6.033338224 1.926818709 25 2.055599605 6.033338224 26 0.513471930 2.055599605 27 3.582662059 0.513471930 28 0.989955673 3.582662059 29 0.269922195 0.989955673 30 4.681105093 0.269922195 31 1.925148379 4.681105093 32 -6.990525182 1.925148379 33 -1.070246151 -6.990525182 34 -1.635343798 -1.070246151 35 -0.740525566 -1.635343798 36 -3.167725178 -0.740525566 37 -0.815553381 -3.167725178 38 -0.580057086 -0.815553381 39 -2.666622691 -0.580057086 40 7.112645177 -2.666622691 41 0.267984542 7.112645177 42 -1.687316733 0.267984542 43 -0.802729223 -1.687316733 44 -1.364861853 -0.802729223 45 2.535335771 -1.364861853 46 3.258990605 2.535335771 47 -3.505559136 3.258990605 48 -0.008295928 -3.505559136 49 -2.800904200 -0.008295928 50 -1.736447029 -2.800904200 51 2.122001527 -1.736447029 52 6.469550519 2.122001527 53 -5.104854379 6.469550519 54 0.090502186 -5.104854379 55 5.554779758 0.090502186 56 3.075642094 5.554779758 57 -1.209352540 3.075642094 58 3.942019535 -1.209352540 59 -4.348643353 3.942019535 60 2.038437245 -4.348643353 61 0.491027508 2.038437245 62 4.322238236 0.491027508 63 -0.353859273 4.322238236 64 0.273959011 -0.353859273 65 3.028356949 0.273959011 66 2.682369085 3.028356949 67 -3.192675990 2.682369085 68 1.660237069 -3.192675990 69 0.991407515 1.660237069 70 1.211144428 0.991407515 71 0.488876740 1.211144428 72 3.136833749 0.488876740 73 1.418560597 3.136833749 74 1.936535127 1.418560597 75 -0.318917883 1.936535127 76 1.330566705 -0.318917883 77 1.817057791 1.330566705 78 5.400171716 1.817057791 79 -1.653847333 5.400171716 80 3.363363023 -1.653847333 81 6.310094043 3.363363023 82 0.680370099 6.310094043 83 1.896817677 0.680370099 84 3.877530328 1.896817677 85 2.668655499 3.877530328 86 -0.907842867 2.668655499 87 4.536467501 -0.907842867 88 -0.230271860 4.536467501 89 0.412093735 -0.230271860 90 3.595720058 0.412093735 91 2.158947290 3.595720058 92 1.026555500 2.158947290 93 -2.294002581 1.026555500 94 5.551592610 -2.294002581 95 2.540624353 5.551592610 96 3.080810081 2.540624353 97 0.949868732 3.080810081 98 0.205565808 0.949868732 99 -1.394710477 0.205565808 100 -0.628336312 -1.394710477 101 -0.321454924 -0.628336312 102 -3.757477080 -0.321454924 103 1.296008163 -3.757477080 104 7.176321383 1.296008163 105 -6.687247786 7.176321383 106 -3.736935687 -6.687247786 107 -4.951395347 -3.736935687 108 -0.674257288 -4.951395347 109 -0.002203115 -0.674257288 110 -0.311584073 -0.002203115 111 5.927141669 -0.311584073 112 -2.403962634 5.927141669 113 -8.205657944 -2.403962634 114 -2.080351068 -8.205657944 115 1.583449236 -2.080351068 116 -8.100852764 1.583449236 117 -3.915987716 -8.100852764 118 1.816920720 -3.915987716 119 -7.405601812 1.816920720 120 -3.413095687 -7.405601812 121 -5.156419250 -3.413095687 122 -4.302995072 -5.156419250 123 2.141647859 -4.302995072 124 0.808548260 2.141647859 125 1.579809155 0.808548260 126 0.386815135 1.579809155 127 2.413895763 0.386815135 128 4.459935083 2.413895763 129 0.837675228 4.459935083 130 -4.382367301 0.837675228 131 1.093421703 -4.382367301 132 2.293540068 1.093421703 133 0.997537220 2.293540068 134 3.230014045 0.997537220 135 -0.583443218 3.230014045 136 -2.405685254 -0.583443218 137 -9.121727000 -2.405685254 138 2.521862311 -9.121727000 139 -6.610230896 2.521862311 140 -9.151463511 -6.610230896 141 -2.101612716 -9.151463511 142 -7.684907638 -2.101612716 143 -0.474168997 -7.684907638 144 0.136655536 -0.474168997 145 -1.807597786 0.136655536 146 -2.864156660 -1.807597786 147 -2.141129845 -2.864156660 148 -4.117237811 -2.141129845 149 -0.149202898 -4.117237811 150 -1.312828452 -0.149202898 151 0.646885624 -1.312828452 152 5.813647527 0.646885624 153 -8.960318955 5.813647527 154 -0.966376287 -8.960318955 155 -0.462613060 -0.966376287 156 0.330099061 -0.462613060 157 0.075760439 0.330099061 158 2.300347252 0.075760439 159 NA 2.300347252 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.255005586 3.065700914 [2,] 0.645684928 -1.255005586 [3,] 1.019614177 0.645684928 [4,] -2.830115404 1.019614177 [5,] 6.088120895 -2.830115404 [6,] 0.189723852 6.088120895 [7,] -1.682425132 0.189723852 [8,] 0.045821274 -1.682425132 [9,] 2.514900796 0.045821274 [10,] 3.772816268 2.514900796 [11,] -1.726988791 3.772816268 [12,] 3.584524553 -1.726988791 [13,] -5.712921078 3.584524553 [14,] -1.516168652 -5.712921078 [15,] 3.675390786 -1.516168652 [16,] -2.283768451 3.675390786 [17,] -7.065893453 -2.283768451 [18,] 2.550790875 -7.065893453 [19,] -1.374199457 2.550790875 [20,] -2.279472549 -1.374199457 [21,] -0.599870564 -2.279472549 [22,] 1.750047484 -0.599870564 [23,] 1.926818709 1.750047484 [24,] 6.033338224 1.926818709 [25,] 2.055599605 6.033338224 [26,] 0.513471930 2.055599605 [27,] 3.582662059 0.513471930 [28,] 0.989955673 3.582662059 [29,] 0.269922195 0.989955673 [30,] 4.681105093 0.269922195 [31,] 1.925148379 4.681105093 [32,] -6.990525182 1.925148379 [33,] -1.070246151 -6.990525182 [34,] -1.635343798 -1.070246151 [35,] -0.740525566 -1.635343798 [36,] -3.167725178 -0.740525566 [37,] -0.815553381 -3.167725178 [38,] -0.580057086 -0.815553381 [39,] -2.666622691 -0.580057086 [40,] 7.112645177 -2.666622691 [41,] 0.267984542 7.112645177 [42,] -1.687316733 0.267984542 [43,] -0.802729223 -1.687316733 [44,] -1.364861853 -0.802729223 [45,] 2.535335771 -1.364861853 [46,] 3.258990605 2.535335771 [47,] -3.505559136 3.258990605 [48,] -0.008295928 -3.505559136 [49,] -2.800904200 -0.008295928 [50,] -1.736447029 -2.800904200 [51,] 2.122001527 -1.736447029 [52,] 6.469550519 2.122001527 [53,] -5.104854379 6.469550519 [54,] 0.090502186 -5.104854379 [55,] 5.554779758 0.090502186 [56,] 3.075642094 5.554779758 [57,] -1.209352540 3.075642094 [58,] 3.942019535 -1.209352540 [59,] -4.348643353 3.942019535 [60,] 2.038437245 -4.348643353 [61,] 0.491027508 2.038437245 [62,] 4.322238236 0.491027508 [63,] -0.353859273 4.322238236 [64,] 0.273959011 -0.353859273 [65,] 3.028356949 0.273959011 [66,] 2.682369085 3.028356949 [67,] -3.192675990 2.682369085 [68,] 1.660237069 -3.192675990 [69,] 0.991407515 1.660237069 [70,] 1.211144428 0.991407515 [71,] 0.488876740 1.211144428 [72,] 3.136833749 0.488876740 [73,] 1.418560597 3.136833749 [74,] 1.936535127 1.418560597 [75,] -0.318917883 1.936535127 [76,] 1.330566705 -0.318917883 [77,] 1.817057791 1.330566705 [78,] 5.400171716 1.817057791 [79,] -1.653847333 5.400171716 [80,] 3.363363023 -1.653847333 [81,] 6.310094043 3.363363023 [82,] 0.680370099 6.310094043 [83,] 1.896817677 0.680370099 [84,] 3.877530328 1.896817677 [85,] 2.668655499 3.877530328 [86,] -0.907842867 2.668655499 [87,] 4.536467501 -0.907842867 [88,] -0.230271860 4.536467501 [89,] 0.412093735 -0.230271860 [90,] 3.595720058 0.412093735 [91,] 2.158947290 3.595720058 [92,] 1.026555500 2.158947290 [93,] -2.294002581 1.026555500 [94,] 5.551592610 -2.294002581 [95,] 2.540624353 5.551592610 [96,] 3.080810081 2.540624353 [97,] 0.949868732 3.080810081 [98,] 0.205565808 0.949868732 [99,] -1.394710477 0.205565808 [100,] -0.628336312 -1.394710477 [101,] -0.321454924 -0.628336312 [102,] -3.757477080 -0.321454924 [103,] 1.296008163 -3.757477080 [104,] 7.176321383 1.296008163 [105,] -6.687247786 7.176321383 [106,] -3.736935687 -6.687247786 [107,] -4.951395347 -3.736935687 [108,] -0.674257288 -4.951395347 [109,] -0.002203115 -0.674257288 [110,] -0.311584073 -0.002203115 [111,] 5.927141669 -0.311584073 [112,] -2.403962634 5.927141669 [113,] -8.205657944 -2.403962634 [114,] -2.080351068 -8.205657944 [115,] 1.583449236 -2.080351068 [116,] -8.100852764 1.583449236 [117,] -3.915987716 -8.100852764 [118,] 1.816920720 -3.915987716 [119,] -7.405601812 1.816920720 [120,] -3.413095687 -7.405601812 [121,] -5.156419250 -3.413095687 [122,] -4.302995072 -5.156419250 [123,] 2.141647859 -4.302995072 [124,] 0.808548260 2.141647859 [125,] 1.579809155 0.808548260 [126,] 0.386815135 1.579809155 [127,] 2.413895763 0.386815135 [128,] 4.459935083 2.413895763 [129,] 0.837675228 4.459935083 [130,] -4.382367301 0.837675228 [131,] 1.093421703 -4.382367301 [132,] 2.293540068 1.093421703 [133,] 0.997537220 2.293540068 [134,] 3.230014045 0.997537220 [135,] -0.583443218 3.230014045 [136,] -2.405685254 -0.583443218 [137,] -9.121727000 -2.405685254 [138,] 2.521862311 -9.121727000 [139,] -6.610230896 2.521862311 [140,] -9.151463511 -6.610230896 [141,] -2.101612716 -9.151463511 [142,] -7.684907638 -2.101612716 [143,] -0.474168997 -7.684907638 [144,] 0.136655536 -0.474168997 [145,] -1.807597786 0.136655536 [146,] -2.864156660 -1.807597786 [147,] -2.141129845 -2.864156660 [148,] -4.117237811 -2.141129845 [149,] -0.149202898 -4.117237811 [150,] -1.312828452 -0.149202898 [151,] 0.646885624 -1.312828452 [152,] 5.813647527 0.646885624 [153,] -8.960318955 5.813647527 [154,] -0.966376287 -8.960318955 [155,] -0.462613060 -0.966376287 [156,] 0.330099061 -0.462613060 [157,] 0.075760439 0.330099061 [158,] 2.300347252 0.075760439 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.255005586 3.065700914 2 0.645684928 -1.255005586 3 1.019614177 0.645684928 4 -2.830115404 1.019614177 5 6.088120895 -2.830115404 6 0.189723852 6.088120895 7 -1.682425132 0.189723852 8 0.045821274 -1.682425132 9 2.514900796 0.045821274 10 3.772816268 2.514900796 11 -1.726988791 3.772816268 12 3.584524553 -1.726988791 13 -5.712921078 3.584524553 14 -1.516168652 -5.712921078 15 3.675390786 -1.516168652 16 -2.283768451 3.675390786 17 -7.065893453 -2.283768451 18 2.550790875 -7.065893453 19 -1.374199457 2.550790875 20 -2.279472549 -1.374199457 21 -0.599870564 -2.279472549 22 1.750047484 -0.599870564 23 1.926818709 1.750047484 24 6.033338224 1.926818709 25 2.055599605 6.033338224 26 0.513471930 2.055599605 27 3.582662059 0.513471930 28 0.989955673 3.582662059 29 0.269922195 0.989955673 30 4.681105093 0.269922195 31 1.925148379 4.681105093 32 -6.990525182 1.925148379 33 -1.070246151 -6.990525182 34 -1.635343798 -1.070246151 35 -0.740525566 -1.635343798 36 -3.167725178 -0.740525566 37 -0.815553381 -3.167725178 38 -0.580057086 -0.815553381 39 -2.666622691 -0.580057086 40 7.112645177 -2.666622691 41 0.267984542 7.112645177 42 -1.687316733 0.267984542 43 -0.802729223 -1.687316733 44 -1.364861853 -0.802729223 45 2.535335771 -1.364861853 46 3.258990605 2.535335771 47 -3.505559136 3.258990605 48 -0.008295928 -3.505559136 49 -2.800904200 -0.008295928 50 -1.736447029 -2.800904200 51 2.122001527 -1.736447029 52 6.469550519 2.122001527 53 -5.104854379 6.469550519 54 0.090502186 -5.104854379 55 5.554779758 0.090502186 56 3.075642094 5.554779758 57 -1.209352540 3.075642094 58 3.942019535 -1.209352540 59 -4.348643353 3.942019535 60 2.038437245 -4.348643353 61 0.491027508 2.038437245 62 4.322238236 0.491027508 63 -0.353859273 4.322238236 64 0.273959011 -0.353859273 65 3.028356949 0.273959011 66 2.682369085 3.028356949 67 -3.192675990 2.682369085 68 1.660237069 -3.192675990 69 0.991407515 1.660237069 70 1.211144428 0.991407515 71 0.488876740 1.211144428 72 3.136833749 0.488876740 73 1.418560597 3.136833749 74 1.936535127 1.418560597 75 -0.318917883 1.936535127 76 1.330566705 -0.318917883 77 1.817057791 1.330566705 78 5.400171716 1.817057791 79 -1.653847333 5.400171716 80 3.363363023 -1.653847333 81 6.310094043 3.363363023 82 0.680370099 6.310094043 83 1.896817677 0.680370099 84 3.877530328 1.896817677 85 2.668655499 3.877530328 86 -0.907842867 2.668655499 87 4.536467501 -0.907842867 88 -0.230271860 4.536467501 89 0.412093735 -0.230271860 90 3.595720058 0.412093735 91 2.158947290 3.595720058 92 1.026555500 2.158947290 93 -2.294002581 1.026555500 94 5.551592610 -2.294002581 95 2.540624353 5.551592610 96 3.080810081 2.540624353 97 0.949868732 3.080810081 98 0.205565808 0.949868732 99 -1.394710477 0.205565808 100 -0.628336312 -1.394710477 101 -0.321454924 -0.628336312 102 -3.757477080 -0.321454924 103 1.296008163 -3.757477080 104 7.176321383 1.296008163 105 -6.687247786 7.176321383 106 -3.736935687 -6.687247786 107 -4.951395347 -3.736935687 108 -0.674257288 -4.951395347 109 -0.002203115 -0.674257288 110 -0.311584073 -0.002203115 111 5.927141669 -0.311584073 112 -2.403962634 5.927141669 113 -8.205657944 -2.403962634 114 -2.080351068 -8.205657944 115 1.583449236 -2.080351068 116 -8.100852764 1.583449236 117 -3.915987716 -8.100852764 118 1.816920720 -3.915987716 119 -7.405601812 1.816920720 120 -3.413095687 -7.405601812 121 -5.156419250 -3.413095687 122 -4.302995072 -5.156419250 123 2.141647859 -4.302995072 124 0.808548260 2.141647859 125 1.579809155 0.808548260 126 0.386815135 1.579809155 127 2.413895763 0.386815135 128 4.459935083 2.413895763 129 0.837675228 4.459935083 130 -4.382367301 0.837675228 131 1.093421703 -4.382367301 132 2.293540068 1.093421703 133 0.997537220 2.293540068 134 3.230014045 0.997537220 135 -0.583443218 3.230014045 136 -2.405685254 -0.583443218 137 -9.121727000 -2.405685254 138 2.521862311 -9.121727000 139 -6.610230896 2.521862311 140 -9.151463511 -6.610230896 141 -2.101612716 -9.151463511 142 -7.684907638 -2.101612716 143 -0.474168997 -7.684907638 144 0.136655536 -0.474168997 145 -1.807597786 0.136655536 146 -2.864156660 -1.807597786 147 -2.141129845 -2.864156660 148 -4.117237811 -2.141129845 149 -0.149202898 -4.117237811 150 -1.312828452 -0.149202898 151 0.646885624 -1.312828452 152 5.813647527 0.646885624 153 -8.960318955 5.813647527 154 -0.966376287 -8.960318955 155 -0.462613060 -0.966376287 156 0.330099061 -0.462613060 157 0.075760439 0.330099061 158 2.300347252 0.075760439 > 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/788uv1290503884.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/888uv1290503884.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/91hcg1290503884.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/101hcg1290503884.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/11xrr71290503884.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/1219qc1290503884.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/13xj631290503884.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/14ikmr1290503884.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/15lk3x1290503884.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/160u061290503884.tab") + } > > try(system("convert tmp/1cyem1290503884.ps tmp/1cyem1290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/258e71290503884.ps tmp/258e71290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/358e71290503884.ps tmp/358e71290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/458e71290503884.ps tmp/458e71290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/5gzds1290503884.ps tmp/5gzds1290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/6gzds1290503884.ps tmp/6gzds1290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/788uv1290503884.ps tmp/788uv1290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/888uv1290503884.ps tmp/888uv1290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/91hcg1290503884.ps tmp/91hcg1290503884.png",intern=TRUE)) character(0) > try(system("convert tmp/101hcg1290503884.ps tmp/101hcg1290503884.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.184 1.831 40.070