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(9 + ,5.5 + ,6 + ,5.33 + ,12 + ,9 + ,3.5 + ,4 + ,5.56 + ,11 + ,9 + ,8.5 + ,4 + ,3.78 + ,14 + ,9 + ,5 + ,4 + ,4.00 + ,12 + ,9 + ,6 + ,4.5 + ,4.00 + ,21 + ,9 + ,6 + ,3.5 + ,3.56 + ,12 + ,9 + ,5.5 + ,2 + ,4.44 + ,22 + ,9 + ,5.5 + ,5.5 + ,3.56 + ,11 + ,9 + ,6 + ,3.5 + ,4.00 + ,10 + ,9 + ,6.5 + ,3.5 + ,3.78 + ,13 + ,9 + ,7 + ,6 + ,5.11 + ,10 + ,9 + ,8 + ,5 + ,6.67 + ,8 + ,9 + ,5.5 + ,5 + ,5.11 + ,15 + ,9 + ,5 + ,4 + ,4.00 + ,14 + ,9 + ,5.5 + ,4 + ,3.33 + ,10 + ,9 + ,7.5 + ,2 + ,2.67 + ,14 + ,9 + ,4.5 + ,4.5 + ,4.67 + ,14 + ,9 + ,5.5 + ,4 + ,3.33 + ,11 + ,9 + ,8.5 + ,3.5 + ,4.44 + ,10 + ,9 + ,8.5 + ,5.5 + ,6.89 + ,13 + ,9 + ,5.5 + ,4.5 + ,6.00 + ,7 + ,9 + ,9 + ,5.5 + ,7.56 + ,14 + ,9 + ,7 + ,6.5 + ,4.67 + ,12 + ,9 + ,5 + ,4 + ,6.89 + ,14 + ,9 + ,5.5 + ,4 + ,4.22 + ,11 + ,9 + ,7.5 + ,4.5 + ,3.56 + ,9 + ,9 + ,7.5 + ,3 + ,4.44 + ,11 + ,9 + ,6.5 + ,4.5 + ,4.67 + ,15 + ,9 + ,8 + ,4.5 + ,4.89 + ,14 + ,9 + ,6.5 + ,3 + ,3.78 + ,13 + ,9 + ,4.5 + ,3 + ,5.33 + ,9 + ,9 + ,9 + ,8 + ,5.56 + ,15 + ,9 + ,9 + ,2.5 + ,5.78 + ,10 + ,9 + ,6 + ,3.5 + ,5.56 + ,11 + ,9 + ,8.5 + ,4.5 + ,3.78 + ,13 + ,9 + ,4.5 + ,3 + ,7.11 + ,8 + ,9 + ,4.5 + ,3 + ,7.33 + ,20 + ,9 + ,6 + ,2.5 + ,2.89 + ,12 + ,9 + ,9 + ,6 + ,7.11 + ,10 + ,9 + ,6 + ,3.5 + ,5.56 + ,10 + ,9 + ,9 + ,5 + ,6.44 + ,9 + ,9 + ,7 + ,4.5 + ,4.89 + ,14 + ,9 + ,7.5 + ,4 + ,4.00 + ,8 + ,9 + ,8 + ,2.5 + ,3.78 + ,14 + ,9 + ,5 + ,4 + ,4.44 + ,11 + ,9 + ,5.5 + ,4 + ,3.33 + ,13 + ,9 + ,7 + ,5 + ,4.44 + ,9 + ,9 + ,4.5 + ,3 + ,7.33 + ,11 + ,9 + ,6 + ,4 + ,6.44 + ,15 + ,9 + ,8.5 + ,3.5 + ,5.11 + ,11 + ,9 + ,2.5 + ,2 + ,5.78 + ,10 + ,9 + ,6 + ,4 + ,4.00 + ,14 + ,9 + ,6 + ,4 + ,4.44 + ,18 + ,10 + ,3 + ,2 + ,2.44 + ,14 + ,10 + ,12 + ,10 + ,6.22 + ,11 + ,10 + ,6 + ,4 + ,5.78 + ,12 + ,10 + ,6 + ,4 + ,4.89 + ,13 + ,10 + ,7 + ,3 + ,3.78 + ,9 + ,10 + ,3.5 + ,2 + ,2.67 + ,10 + ,10 + ,6.5 + ,4 + ,3.11 + ,15 + ,10 + ,6 + ,4.5 + ,3.78 + ,20 + ,10 + ,6.5 + ,3 + ,4.67 + ,12 + ,10 + ,7 + ,3.5 + ,4.22 + ,12 + ,10 + ,4 + ,4.5 + ,4.00 + ,14 + ,10 + ,5.5 + ,2.5 + ,2.22 + ,13 + ,10 + ,4.5 + ,2.5 + ,6.44 + ,11 + ,10 + ,5.5 + ,4 + ,6.89 + ,17 + ,10 + ,6.5 + ,4 + ,4.22 + ,12 + ,10 + ,5 + ,3 + ,2.00 + ,13 + ,10 + ,5.5 + ,4 + ,4.44 + ,14 + ,10 + ,6 + ,3.5 + ,6.22 + ,13 + ,10 + ,4.5 + ,3.5 + ,4.22 + ,15 + ,10 + ,7.5 + ,4.5 + ,6.67 + ,13 + ,10 + ,9 + ,5.5 + ,6.44 + ,10 + ,10 + ,7.5 + ,3 + ,5.78 + ,11 + ,10 + ,6 + ,4 + ,5.11 + ,19 + ,10 + ,6.5 + ,3 + ,2.89 + ,13 + ,10 + ,7 + ,4.5 + ,4.67 + ,17 + ,10 + ,5 + ,4 + ,4.22 + ,13 + ,10 + ,6.5 + ,3 + ,6.22 + ,9 + ,10 + ,6.5 + ,5 + ,5.11 + ,11 + ,10 + ,5.5 + ,4 + ,4.00 + ,10 + ,10 + ,6.5 + ,4 + ,4.67 + ,9 + ,10 + ,8 + ,5 + ,4.44 + ,12 + ,10 + ,4 + ,2.5 + ,5.11 + ,12 + ,10 + ,8 + ,3.5 + ,4.67 + ,13 + ,10 + ,5.5 + ,2.5 + ,4.67 + ,13 + ,10 + ,4.5 + ,4 + ,3.33 + ,12 + ,10 + ,8 + ,7 + ,6.22 + ,15 + ,10 + ,6 + ,3.5 + ,4.22 + ,22 + ,10 + ,7 + ,4 + ,5.78 + ,13 + ,10 + ,4 + ,3 + ,2.22 + ,15 + ,10 + ,4.5 + ,2.5 + ,3.56 + ,13 + ,10 + ,7.5 + ,3 + ,4.89 + ,15 + ,10 + ,5.5 + ,5 + ,4.22 + ,10 + ,10 + ,10.5 + ,6 + ,6.89 + ,11 + ,10 + ,7 + ,4.5 + ,6.89 + ,16 + ,10 + ,9 + ,6 + ,6.44 + ,11 + ,10 + ,6 + ,3.5 + ,4.22 + ,11 + ,10 + ,6.5 + ,4 + ,4.89 + ,10 + ,10 + ,7.5 + ,5 + ,5.11 + ,10 + ,10 + ,6 + ,3 + ,3.33 + ,16 + ,10 + ,9.5 + ,5 + ,4.44 + ,12 + ,10 + ,7.5 + ,5 + ,4.00 + ,11 + ,10 + ,5.5 + ,5 + ,5.11 + ,16 + ,10 + ,5.5 + ,2.5 + ,5.56 + ,19 + ,10 + ,5 + ,3.5 + ,4.67 + ,11 + ,10 + ,6.5 + ,5 + ,5.33 + ,16 + ,11 + ,7.5 + ,5.5 + ,5.56 + ,15 + ,11 + ,6 + ,3 + ,3.78 + ,24 + ,11 + ,6 + ,3.5 + ,2.89 + ,14 + ,11 + ,8 + ,6 + ,6.22 + ,15 + ,11 + ,4.5 + ,5.5 + ,4.67 + ,11 + ,11 + ,9 + ,5.5 + ,5.56 + ,15 + ,11 + ,4 + ,5.5 + ,2.00 + ,12 + ,11 + ,6.5 + ,2.5 + ,3.56 + ,10 + ,11 + ,8.5 + ,4 + ,4.22 + ,14 + ,11 + ,4.5 + ,3 + ,3.78 + ,13 + ,11 + ,7.5 + ,4.5 + ,5.56 + ,9 + ,11 + ,4 + ,2 + ,4.44 + ,15 + ,11 + ,3.5 + ,2 + ,6.44 + ,15 + ,11 + ,6 + ,3.5 + ,3.11 + ,14 + ,11 + ,7 + ,5.5 + ,4.89 + ,11 + ,11 + ,3 + ,3 + ,3.33 + ,8 + ,11 + ,4 + ,3.5 + ,4.22 + ,11 + ,11 + ,8.5 + ,4 + ,4.44 + ,11 + ,11 + ,5 + ,2 + ,3.33 + ,8 + ,11 + ,5.5 + ,4 + ,4.44 + ,10 + ,11 + ,7 + ,4.5 + ,4.00 + ,11 + ,11 + ,5.5 + ,4 + ,7.33 + ,13 + ,11 + ,6.5 + ,5.5 + ,4.89 + ,11 + ,11 + ,6 + ,4 + ,3.56 + ,20 + ,11 + ,5.5 + ,2.5 + ,3.78 + ,10 + ,11 + ,4.5 + ,2 + ,3.56 + ,15 + ,11 + ,6 + ,4 + ,4.67 + ,12 + ,11 + ,10 + ,5 + ,5.78 + ,14 + ,11 + ,6 + ,3 + ,4.00 + ,23 + ,11 + ,6.5 + ,4.5 + ,4.00 + ,14 + ,11 + ,6 + ,4.5 + ,3.78 + ,16 + ,11 + ,6 + ,6.5 + ,4.89 + ,11 + ,11 + ,4.5 + ,4.5 + ,6.67 + ,12 + ,11 + ,7.5 + ,5 + ,6.67 + ,10 + ,11 + ,12 + ,10 + ,5.33 + ,14 + ,11 + ,3.5 + ,2.5 + ,4.67 + ,12 + ,11 + ,8.5 + ,5.5 + ,4.67 + ,12 + ,11 + ,5.5 + ,3 + ,6.44 + ,11 + ,11 + ,8.5 + ,4.5 + ,6.89 + ,12 + ,11 + ,5.5 + ,3.5 + ,4.44 + ,13 + ,11 + ,6 + ,4.5 + ,3.56 + ,11 + ,11 + ,7 + ,5 + ,4.89 + ,19 + ,11 + ,5.5 + ,4.5 + ,4.44 + ,12 + ,11 + ,8 + ,4 + ,6.22 + ,17 + ,11 + ,10.5 + ,3.5 + ,8.44 + ,9 + ,11 + ,7 + ,3 + ,4.89 + ,12 + ,11 + ,10 + ,6.5 + ,4.44 + ,19 + ,11 + ,6.5 + ,3 + ,3.78 + ,18 + ,11 + ,5.5 + ,4 + ,6.22 + ,15 + ,11 + ,7.5 + ,5 + ,4.89 + ,14 + ,11 + ,9.5 + ,8 + ,6.89 + ,11) + ,dim=c(5 + ,159) + ,dimnames=list(c('Month' + ,'Expect' + ,'Criticism' + ,'Concerns' + ,'Depression') + ,1:159)) > y <- array(NA,dim=c(5,159),dimnames=list(c('Month','Expect','Criticism','Concerns','Depression'),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 = '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 Expect Criticism Concerns t 1 12 9 5.5 6.0 5.33 1 2 11 9 3.5 4.0 5.56 2 3 14 9 8.5 4.0 3.78 3 4 12 9 5.0 4.0 4.00 4 5 21 9 6.0 4.5 4.00 5 6 12 9 6.0 3.5 3.56 6 7 22 9 5.5 2.0 4.44 7 8 11 9 5.5 5.5 3.56 8 9 10 9 6.0 3.5 4.00 9 10 13 9 6.5 3.5 3.78 10 11 10 9 7.0 6.0 5.11 11 12 8 9 8.0 5.0 6.67 12 13 15 9 5.5 5.0 5.11 13 14 14 9 5.0 4.0 4.00 14 15 10 9 5.5 4.0 3.33 15 16 14 9 7.5 2.0 2.67 16 17 14 9 4.5 4.5 4.67 17 18 11 9 5.5 4.0 3.33 18 19 10 9 8.5 3.5 4.44 19 20 13 9 8.5 5.5 6.89 20 21 7 9 5.5 4.5 6.00 21 22 14 9 9.0 5.5 7.56 22 23 12 9 7.0 6.5 4.67 23 24 14 9 5.0 4.0 6.89 24 25 11 9 5.5 4.0 4.22 25 26 9 9 7.5 4.5 3.56 26 27 11 9 7.5 3.0 4.44 27 28 15 9 6.5 4.5 4.67 28 29 14 9 8.0 4.5 4.89 29 30 13 9 6.5 3.0 3.78 30 31 9 9 4.5 3.0 5.33 31 32 15 9 9.0 8.0 5.56 32 33 10 9 9.0 2.5 5.78 33 34 11 9 6.0 3.5 5.56 34 35 13 9 8.5 4.5 3.78 35 36 8 9 4.5 3.0 7.11 36 37 20 9 4.5 3.0 7.33 37 38 12 9 6.0 2.5 2.89 38 39 10 9 9.0 6.0 7.11 39 40 10 9 6.0 3.5 5.56 40 41 9 9 9.0 5.0 6.44 41 42 14 9 7.0 4.5 4.89 42 43 8 9 7.5 4.0 4.00 43 44 14 9 8.0 2.5 3.78 44 45 11 9 5.0 4.0 4.44 45 46 13 9 5.5 4.0 3.33 46 47 9 9 7.0 5.0 4.44 47 48 11 9 4.5 3.0 7.33 48 49 15 9 6.0 4.0 6.44 49 50 11 9 8.5 3.5 5.11 50 51 10 9 2.5 2.0 5.78 51 52 14 9 6.0 4.0 4.00 52 53 18 9 6.0 4.0 4.44 53 54 14 10 3.0 2.0 2.44 54 55 11 10 12.0 10.0 6.22 55 56 12 10 6.0 4.0 5.78 56 57 13 10 6.0 4.0 4.89 57 58 9 10 7.0 3.0 3.78 58 59 10 10 3.5 2.0 2.67 59 60 15 10 6.5 4.0 3.11 60 61 20 10 6.0 4.5 3.78 61 62 12 10 6.5 3.0 4.67 62 63 12 10 7.0 3.5 4.22 63 64 14 10 4.0 4.5 4.00 64 65 13 10 5.5 2.5 2.22 65 66 11 10 4.5 2.5 6.44 66 67 17 10 5.5 4.0 6.89 67 68 12 10 6.5 4.0 4.22 68 69 13 10 5.0 3.0 2.00 69 70 14 10 5.5 4.0 4.44 70 71 13 10 6.0 3.5 6.22 71 72 15 10 4.5 3.5 4.22 72 73 13 10 7.5 4.5 6.67 73 74 10 10 9.0 5.5 6.44 74 75 11 10 7.5 3.0 5.78 75 76 19 10 6.0 4.0 5.11 76 77 13 10 6.5 3.0 2.89 77 78 17 10 7.0 4.5 4.67 78 79 13 10 5.0 4.0 4.22 79 80 9 10 6.5 3.0 6.22 80 81 11 10 6.5 5.0 5.11 81 82 10 10 5.5 4.0 4.00 82 83 9 10 6.5 4.0 4.67 83 84 12 10 8.0 5.0 4.44 84 85 12 10 4.0 2.5 5.11 85 86 13 10 8.0 3.5 4.67 86 87 13 10 5.5 2.5 4.67 87 88 12 10 4.5 4.0 3.33 88 89 15 10 8.0 7.0 6.22 89 90 22 10 6.0 3.5 4.22 90 91 13 10 7.0 4.0 5.78 91 92 15 10 4.0 3.0 2.22 92 93 13 10 4.5 2.5 3.56 93 94 15 10 7.5 3.0 4.89 94 95 10 10 5.5 5.0 4.22 95 96 11 10 10.5 6.0 6.89 96 97 16 10 7.0 4.5 6.89 97 98 11 10 9.0 6.0 6.44 98 99 11 10 6.0 3.5 4.22 99 100 10 10 6.5 4.0 4.89 100 101 10 10 7.5 5.0 5.11 101 102 16 10 6.0 3.0 3.33 102 103 12 10 9.5 5.0 4.44 103 104 11 10 7.5 5.0 4.00 104 105 16 10 5.5 5.0 5.11 105 106 19 10 5.5 2.5 5.56 106 107 11 10 5.0 3.5 4.67 107 108 16 10 6.5 5.0 5.33 108 109 15 11 7.5 5.5 5.56 109 110 24 11 6.0 3.0 3.78 110 111 14 11 6.0 3.5 2.89 111 112 15 11 8.0 6.0 6.22 112 113 11 11 4.5 5.5 4.67 113 114 15 11 9.0 5.5 5.56 114 115 12 11 4.0 5.5 2.00 115 116 10 11 6.5 2.5 3.56 116 117 14 11 8.5 4.0 4.22 117 118 13 11 4.5 3.0 3.78 118 119 9 11 7.5 4.5 5.56 119 120 15 11 4.0 2.0 4.44 120 121 15 11 3.5 2.0 6.44 121 122 14 11 6.0 3.5 3.11 122 123 11 11 7.0 5.5 4.89 123 124 8 11 3.0 3.0 3.33 124 125 11 11 4.0 3.5 4.22 125 126 11 11 8.5 4.0 4.44 126 127 8 11 5.0 2.0 3.33 127 128 10 11 5.5 4.0 4.44 128 129 11 11 7.0 4.5 4.00 129 130 13 11 5.5 4.0 7.33 130 131 11 11 6.5 5.5 4.89 131 132 20 11 6.0 4.0 3.56 132 133 10 11 5.5 2.5 3.78 133 134 15 11 4.5 2.0 3.56 134 135 12 11 6.0 4.0 4.67 135 136 14 11 10.0 5.0 5.78 136 137 23 11 6.0 3.0 4.00 137 138 14 11 6.5 4.5 4.00 138 139 16 11 6.0 4.5 3.78 139 140 11 11 6.0 6.5 4.89 140 141 12 11 4.5 4.5 6.67 141 142 10 11 7.5 5.0 6.67 142 143 14 11 12.0 10.0 5.33 143 144 12 11 3.5 2.5 4.67 144 145 12 11 8.5 5.5 4.67 145 146 11 11 5.5 3.0 6.44 146 147 12 11 8.5 4.5 6.89 147 148 13 11 5.5 3.5 4.44 148 149 11 11 6.0 4.5 3.56 149 150 19 11 7.0 5.0 4.89 150 151 12 11 5.5 4.5 4.44 151 152 17 11 8.0 4.0 6.22 152 153 9 11 10.5 3.5 8.44 153 154 12 11 7.0 3.0 4.89 154 155 19 11 10.0 6.5 4.44 155 156 18 11 6.5 3.0 3.78 156 157 15 11 5.5 4.0 6.22 157 158 14 11 7.5 5.0 4.89 158 159 11 11 9.5 8.0 6.89 159 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Month Expect Criticism Concerns t 11.049289 0.288174 -0.008486 -0.050277 -0.224886 0.003821 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.8127 -2.1541 -0.5932 1.5255 10.4123 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 11.049289 8.673509 1.274 0.205 Month 0.288174 0.961714 0.300 0.765 Expect -0.008486 0.186079 -0.046 0.964 Criticism -0.050277 0.234592 -0.214 0.831 Concerns -0.224886 0.216168 -1.040 0.300 t 0.003821 0.016961 0.225 0.822 Residual standard error: 3.154 on 153 degrees of freedom Multiple R-squared: 0.02637, Adjusted R-squared: -0.005448 F-statistic: 0.8288 on 5 and 153 DF, p-value: 0.5311 > 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.99471235 0.01057530 0.00528765 [2,] 0.98813593 0.02372813 0.01186407 [3,] 0.97538040 0.04923919 0.02461960 [4,] 0.96379605 0.07240790 0.03620395 [5,] 0.97055746 0.05888508 0.02944254 [6,] 0.95080640 0.09838721 0.04919360 [7,] 0.94397887 0.11204226 0.05602113 [8,] 0.91761417 0.16477167 0.08238583 [9,] 0.89726659 0.20546682 0.10273341 [10,] 0.86137948 0.27724104 0.13862052 [11,] 0.82127730 0.35744539 0.17872270 [12,] 0.82500458 0.34999085 0.17499542 [13,] 0.84974204 0.30051593 0.15025796 [14,] 0.86045155 0.27909689 0.13954845 [15,] 0.84642382 0.30715235 0.15357618 [16,] 0.81726628 0.36546743 0.18273372 [17,] 0.77069238 0.45861524 0.22930762 [18,] 0.73732307 0.52535387 0.26267693 [19,] 0.68632759 0.62734482 0.31367241 [20,] 0.71409560 0.57180880 0.28590440 [21,] 0.69393525 0.61212951 0.30606475 [22,] 0.63774625 0.72450749 0.36225375 [23,] 0.63939675 0.72120650 0.36060325 [24,] 0.69443702 0.61112595 0.30556298 [25,] 0.66384954 0.67230092 0.33615046 [26,] 0.60936855 0.78126290 0.39063145 [27,] 0.55914427 0.88171146 0.44085573 [28,] 0.54250379 0.91499242 0.45749621 [29,] 0.83624951 0.32750098 0.16375049 [30,] 0.80005940 0.39988121 0.19994060 [31,] 0.76699234 0.46601532 0.23300766 [32,] 0.73671692 0.52656616 0.26328308 [33,] 0.71543662 0.56912676 0.28456338 [34,] 0.69682883 0.60634234 0.30317117 [35,] 0.71158032 0.57683936 0.28841968 [36,] 0.68664887 0.62670227 0.31335113 [37,] 0.64296842 0.71406317 0.35703158 [38,] 0.60369463 0.79261073 0.39630537 [39,] 0.58996523 0.82006953 0.41003477 [40,] 0.54208580 0.91582840 0.45791420 [41,] 0.55003640 0.89992720 0.44996360 [42,] 0.50731862 0.98536276 0.49268138 [43,] 0.48214135 0.96428271 0.51785865 [44,] 0.46050878 0.92101756 0.53949122 [45,] 0.57897123 0.84205753 0.42102877 [46,] 0.53026437 0.93947127 0.46973563 [47,] 0.48352016 0.96704032 0.51647984 [48,] 0.43565948 0.87131896 0.56434052 [49,] 0.38795210 0.77590419 0.61204790 [50,] 0.40498972 0.80997944 0.59501028 [51,] 0.39461009 0.78922018 0.60538991 [52,] 0.38129836 0.76259671 0.61870164 [53,] 0.57819015 0.84361970 0.42180985 [54,] 0.53370527 0.93258946 0.46629473 [55,] 0.48932945 0.97865889 0.51067055 [56,] 0.44640033 0.89280067 0.55359967 [57,] 0.40063710 0.80127420 0.59936290 [58,] 0.36435755 0.72871510 0.63564245 [59,] 0.41759279 0.83518558 0.58240721 [60,] 0.37556271 0.75112543 0.62443729 [61,] 0.33292668 0.66585336 0.66707332 [62,] 0.29574808 0.59149617 0.70425192 [63,] 0.25717047 0.51434094 0.74282953 [64,] 0.23441981 0.46883961 0.76558019 [65,] 0.20143239 0.40286478 0.79856761 [66,] 0.18519001 0.37038003 0.81480999 [67,] 0.16279407 0.32558814 0.83720593 [68,] 0.25879509 0.51759017 0.74120491 [69,] 0.22331368 0.44662735 0.77668632 [70,] 0.24795283 0.49590566 0.75204717 [71,] 0.21361933 0.42723866 0.78638067 [72,] 0.22126242 0.44252485 0.77873758 [73,] 0.19758161 0.39516321 0.80241839 [74,] 0.19493201 0.38986402 0.80506799 [75,] 0.21076823 0.42153647 0.78923177 [76,] 0.18204010 0.36408020 0.81795990 [77,] 0.15494124 0.30988247 0.84505876 [78,] 0.13121169 0.26242338 0.86878831 [79,] 0.10873056 0.21746112 0.89126944 [80,] 0.09161664 0.18323328 0.90838336 [81,] 0.08617332 0.17234664 0.91382668 [82,] 0.27770258 0.55540516 0.72229742 [83,] 0.23982413 0.47964825 0.76017587 [84,] 0.21014511 0.42029022 0.78985489 [85,] 0.17806574 0.35613148 0.82193426 [86,] 0.15896515 0.31793030 0.84103485 [87,] 0.15491992 0.30983983 0.84508008 [88,] 0.13366104 0.26732208 0.86633896 [89,] 0.14051693 0.28103385 0.85948307 [90,] 0.11992623 0.23985245 0.88007377 [91,] 0.10822267 0.21644534 0.89177733 [92,] 0.10785112 0.21570224 0.89214888 [93,] 0.10994881 0.21989761 0.89005119 [94,] 0.09777617 0.19555233 0.90222383 [95,] 0.09070906 0.18141813 0.90929094 [96,] 0.10089427 0.20178853 0.89910573 [97,] 0.08915290 0.17830580 0.91084710 [98,] 0.12264888 0.24529776 0.87735112 [99,] 0.12158898 0.24317796 0.87841102 [100,] 0.10556367 0.21112735 0.89443633 [101,] 0.09348760 0.18697520 0.90651240 [102,] 0.45982133 0.91964267 0.54017867 [103,] 0.41510479 0.83020958 0.58489521 [104,] 0.42544510 0.85089020 0.57455490 [105,] 0.39751751 0.79503501 0.60248249 [106,] 0.40379334 0.80758669 0.59620666 [107,] 0.36425445 0.72850891 0.63574555 [108,] 0.36850703 0.73701406 0.63149297 [109,] 0.32720750 0.65441500 0.67279250 [110,] 0.28571360 0.57142720 0.71428640 [111,] 0.28087993 0.56175985 0.71912007 [112,] 0.26965171 0.53930342 0.73034829 [113,] 0.34110092 0.68220184 0.65889908 [114,] 0.29741974 0.59483947 0.70258026 [115,] 0.25694631 0.51389261 0.74305369 [116,] 0.30430852 0.60861704 0.69569148 [117,] 0.26415170 0.52830340 0.73584830 [118,] 0.23326326 0.46652651 0.76673674 [119,] 0.35603054 0.71206108 0.64396946 [120,] 0.35307531 0.70615061 0.64692469 [121,] 0.35998982 0.71997964 0.64001018 [122,] 0.35877497 0.71754994 0.64122503 [123,] 0.31912314 0.63824628 0.68087686 [124,] 0.43194296 0.86388592 0.56805704 [125,] 0.52145202 0.95709596 0.47854798 [126,] 0.45695534 0.91391068 0.54304466 [127,] 0.41503373 0.83006746 0.58496627 [128,] 0.34961532 0.69923065 0.65038468 [129,] 0.77997870 0.44004261 0.22002130 [130,] 0.71742895 0.56514209 0.28257105 [131,] 0.69885044 0.60229913 0.30114956 [132,] 0.63364337 0.73271325 0.36635663 [133,] 0.59769047 0.80461905 0.40230953 [134,] 0.51462576 0.97074848 0.48537424 [135,] 0.42980512 0.85961024 0.57019488 [136,] 0.33913291 0.67826581 0.66086709 [137,] 0.27485471 0.54970942 0.72514529 [138,] 0.19646160 0.39292319 0.80353840 [139,] 0.13015438 0.26030875 0.86984562 [140,] 0.07959580 0.15919160 0.92040420 [141,] 0.15867508 0.31735016 0.84132492 [142,] 0.15399511 0.30799022 0.84600489 > postscript(file="/var/www/html/rcomp/tmp/1ivhz1290768265.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/2ivhz1290768265.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/3a4y21290768265.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/4a4y21290768265.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/5a4y21290768265.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 -0.09969808 -1.16932246 1.46899085 -0.51505799 8.51474549 -0.63830280 7 8 9 10 11 12 9.47611688 -1.54963483 -2.55081714 0.40012971 -2.17465752 -3.86944722 13 14 15 16 17 18 2.75469308 1.44672792 -2.70352398 1.06064859 1.60683267 -1.71498821 19 20 21 22 23 24 -2.46886536 1.17883815 -5.10086806 2.32611221 -0.29432581 2.05843465 25 26 27 28 29 30 -1.54158944 -3.65172439 -1.53306152 2.58176996 1.64015309 0.29856303 31 32 33 34 35 36 -3.37365771 2.96381841 -2.26705151 -1.29553005 0.37184426 -3.99246751 37 38 39 40 41 42 8.05318603 -0.96153856 -1.81491199 -2.31845851 -3.02350548 1.58198838 43 44 45 46 47 48 -4.64287696 1.23265440 -1.57278588 0.17801234 -3.51317892 -0.98884947 49 50 51 52 53 54 2.87018707 -1.43665535 -2.41613693 1.31000077 5.40512925 0.53734832 55 56 57 58 59 60 -1.13781018 -0.59316178 0.20286819 -4.09236738 -3.42579173 1.79534991 61 62 63 64 65 66 6.96309748 -0.91174759 -0.98738605 0.98413541 -0.50780764 -1.57109612 67 68 69 70 71 72 4.61018310 -0.98559780 -0.55167292 1.04774793 0.42332848 1.95700528 73 74 75 76 77 78 0.57989098 -2.41264765 -1.70331595 6.17973636 -0.36936598 4.10676855 79 80 81 82 83 84 -0.04036289 -3.63195950 -1.78485050 -3.09705886 -3.94172019 -0.93425882 85 86 87 88 89 90 -0.94704459 0.03440668 -0.04090770 -1.27914739 2.54748537 8.90094951 91 92 93 94 95 96 0.28157531 1.40142322 -0.32194612 2.02392866 -3.04698524 -1.35765181 97 98 99 100 101 102 3.53340891 -1.47922296 -2.13344317 -2.95720920 -2.85279228 2.62980549 103 104 105 106 107 108 -0.99413600 -2.11388007 3.11494930 6.08663415 -2.07130209 3.16144640 109 110 111 112 113 114 1.95479952 10.41225879 0.23342725 2.12114181 -2.28609392 1.94842207 115 116 117 118 119 120 -1.89842581 -3.68103990 0.55595179 -0.63104207 -4.13369156 1.45521975 121 122 123 124 125 126 1.89692734 0.24086670 -2.25361709 -5.76789886 -2.53794675 -2.42896595 127 128 129 130 131 132 -5.81266729 -3.46206795 -2.52697116 0.18021005 -2.28843155 6.32898985 133 134 135 136 137 138 -3.70501530 1.20806346 -1.43285081 0.89717391 9.35855569 0.43439297 139 140 141 142 143 144 2.37685342 -2.27679044 -0.99359817 -2.94682190 1.03758305 -1.56387496 145 146 147 148 149 150 -1.37443343 -2.13135811 -0.93310611 -0.56363462 -2.71083561 5.61806638 151 152 153 154 155 156 -1.52482186 3.86773147 -3.64076531 -1.49777324 5.59863526 4.24071718 157 158 159 1.82740844 0.59173830 -1.79450715 > postscript(file="/var/www/html/rcomp/tmp/63wyn1290768265.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 -0.09969808 NA 1 -1.16932246 -0.09969808 2 1.46899085 -1.16932246 3 -0.51505799 1.46899085 4 8.51474549 -0.51505799 5 -0.63830280 8.51474549 6 9.47611688 -0.63830280 7 -1.54963483 9.47611688 8 -2.55081714 -1.54963483 9 0.40012971 -2.55081714 10 -2.17465752 0.40012971 11 -3.86944722 -2.17465752 12 2.75469308 -3.86944722 13 1.44672792 2.75469308 14 -2.70352398 1.44672792 15 1.06064859 -2.70352398 16 1.60683267 1.06064859 17 -1.71498821 1.60683267 18 -2.46886536 -1.71498821 19 1.17883815 -2.46886536 20 -5.10086806 1.17883815 21 2.32611221 -5.10086806 22 -0.29432581 2.32611221 23 2.05843465 -0.29432581 24 -1.54158944 2.05843465 25 -3.65172439 -1.54158944 26 -1.53306152 -3.65172439 27 2.58176996 -1.53306152 28 1.64015309 2.58176996 29 0.29856303 1.64015309 30 -3.37365771 0.29856303 31 2.96381841 -3.37365771 32 -2.26705151 2.96381841 33 -1.29553005 -2.26705151 34 0.37184426 -1.29553005 35 -3.99246751 0.37184426 36 8.05318603 -3.99246751 37 -0.96153856 8.05318603 38 -1.81491199 -0.96153856 39 -2.31845851 -1.81491199 40 -3.02350548 -2.31845851 41 1.58198838 -3.02350548 42 -4.64287696 1.58198838 43 1.23265440 -4.64287696 44 -1.57278588 1.23265440 45 0.17801234 -1.57278588 46 -3.51317892 0.17801234 47 -0.98884947 -3.51317892 48 2.87018707 -0.98884947 49 -1.43665535 2.87018707 50 -2.41613693 -1.43665535 51 1.31000077 -2.41613693 52 5.40512925 1.31000077 53 0.53734832 5.40512925 54 -1.13781018 0.53734832 55 -0.59316178 -1.13781018 56 0.20286819 -0.59316178 57 -4.09236738 0.20286819 58 -3.42579173 -4.09236738 59 1.79534991 -3.42579173 60 6.96309748 1.79534991 61 -0.91174759 6.96309748 62 -0.98738605 -0.91174759 63 0.98413541 -0.98738605 64 -0.50780764 0.98413541 65 -1.57109612 -0.50780764 66 4.61018310 -1.57109612 67 -0.98559780 4.61018310 68 -0.55167292 -0.98559780 69 1.04774793 -0.55167292 70 0.42332848 1.04774793 71 1.95700528 0.42332848 72 0.57989098 1.95700528 73 -2.41264765 0.57989098 74 -1.70331595 -2.41264765 75 6.17973636 -1.70331595 76 -0.36936598 6.17973636 77 4.10676855 -0.36936598 78 -0.04036289 4.10676855 79 -3.63195950 -0.04036289 80 -1.78485050 -3.63195950 81 -3.09705886 -1.78485050 82 -3.94172019 -3.09705886 83 -0.93425882 -3.94172019 84 -0.94704459 -0.93425882 85 0.03440668 -0.94704459 86 -0.04090770 0.03440668 87 -1.27914739 -0.04090770 88 2.54748537 -1.27914739 89 8.90094951 2.54748537 90 0.28157531 8.90094951 91 1.40142322 0.28157531 92 -0.32194612 1.40142322 93 2.02392866 -0.32194612 94 -3.04698524 2.02392866 95 -1.35765181 -3.04698524 96 3.53340891 -1.35765181 97 -1.47922296 3.53340891 98 -2.13344317 -1.47922296 99 -2.95720920 -2.13344317 100 -2.85279228 -2.95720920 101 2.62980549 -2.85279228 102 -0.99413600 2.62980549 103 -2.11388007 -0.99413600 104 3.11494930 -2.11388007 105 6.08663415 3.11494930 106 -2.07130209 6.08663415 107 3.16144640 -2.07130209 108 1.95479952 3.16144640 109 10.41225879 1.95479952 110 0.23342725 10.41225879 111 2.12114181 0.23342725 112 -2.28609392 2.12114181 113 1.94842207 -2.28609392 114 -1.89842581 1.94842207 115 -3.68103990 -1.89842581 116 0.55595179 -3.68103990 117 -0.63104207 0.55595179 118 -4.13369156 -0.63104207 119 1.45521975 -4.13369156 120 1.89692734 1.45521975 121 0.24086670 1.89692734 122 -2.25361709 0.24086670 123 -5.76789886 -2.25361709 124 -2.53794675 -5.76789886 125 -2.42896595 -2.53794675 126 -5.81266729 -2.42896595 127 -3.46206795 -5.81266729 128 -2.52697116 -3.46206795 129 0.18021005 -2.52697116 130 -2.28843155 0.18021005 131 6.32898985 -2.28843155 132 -3.70501530 6.32898985 133 1.20806346 -3.70501530 134 -1.43285081 1.20806346 135 0.89717391 -1.43285081 136 9.35855569 0.89717391 137 0.43439297 9.35855569 138 2.37685342 0.43439297 139 -2.27679044 2.37685342 140 -0.99359817 -2.27679044 141 -2.94682190 -0.99359817 142 1.03758305 -2.94682190 143 -1.56387496 1.03758305 144 -1.37443343 -1.56387496 145 -2.13135811 -1.37443343 146 -0.93310611 -2.13135811 147 -0.56363462 -0.93310611 148 -2.71083561 -0.56363462 149 5.61806638 -2.71083561 150 -1.52482186 5.61806638 151 3.86773147 -1.52482186 152 -3.64076531 3.86773147 153 -1.49777324 -3.64076531 154 5.59863526 -1.49777324 155 4.24071718 5.59863526 156 1.82740844 4.24071718 157 0.59173830 1.82740844 158 -1.79450715 0.59173830 159 NA -1.79450715 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.16932246 -0.09969808 [2,] 1.46899085 -1.16932246 [3,] -0.51505799 1.46899085 [4,] 8.51474549 -0.51505799 [5,] -0.63830280 8.51474549 [6,] 9.47611688 -0.63830280 [7,] -1.54963483 9.47611688 [8,] -2.55081714 -1.54963483 [9,] 0.40012971 -2.55081714 [10,] -2.17465752 0.40012971 [11,] -3.86944722 -2.17465752 [12,] 2.75469308 -3.86944722 [13,] 1.44672792 2.75469308 [14,] -2.70352398 1.44672792 [15,] 1.06064859 -2.70352398 [16,] 1.60683267 1.06064859 [17,] -1.71498821 1.60683267 [18,] -2.46886536 -1.71498821 [19,] 1.17883815 -2.46886536 [20,] -5.10086806 1.17883815 [21,] 2.32611221 -5.10086806 [22,] -0.29432581 2.32611221 [23,] 2.05843465 -0.29432581 [24,] -1.54158944 2.05843465 [25,] -3.65172439 -1.54158944 [26,] -1.53306152 -3.65172439 [27,] 2.58176996 -1.53306152 [28,] 1.64015309 2.58176996 [29,] 0.29856303 1.64015309 [30,] -3.37365771 0.29856303 [31,] 2.96381841 -3.37365771 [32,] -2.26705151 2.96381841 [33,] -1.29553005 -2.26705151 [34,] 0.37184426 -1.29553005 [35,] -3.99246751 0.37184426 [36,] 8.05318603 -3.99246751 [37,] -0.96153856 8.05318603 [38,] -1.81491199 -0.96153856 [39,] -2.31845851 -1.81491199 [40,] -3.02350548 -2.31845851 [41,] 1.58198838 -3.02350548 [42,] -4.64287696 1.58198838 [43,] 1.23265440 -4.64287696 [44,] -1.57278588 1.23265440 [45,] 0.17801234 -1.57278588 [46,] -3.51317892 0.17801234 [47,] -0.98884947 -3.51317892 [48,] 2.87018707 -0.98884947 [49,] -1.43665535 2.87018707 [50,] -2.41613693 -1.43665535 [51,] 1.31000077 -2.41613693 [52,] 5.40512925 1.31000077 [53,] 0.53734832 5.40512925 [54,] -1.13781018 0.53734832 [55,] -0.59316178 -1.13781018 [56,] 0.20286819 -0.59316178 [57,] -4.09236738 0.20286819 [58,] -3.42579173 -4.09236738 [59,] 1.79534991 -3.42579173 [60,] 6.96309748 1.79534991 [61,] -0.91174759 6.96309748 [62,] -0.98738605 -0.91174759 [63,] 0.98413541 -0.98738605 [64,] -0.50780764 0.98413541 [65,] -1.57109612 -0.50780764 [66,] 4.61018310 -1.57109612 [67,] -0.98559780 4.61018310 [68,] -0.55167292 -0.98559780 [69,] 1.04774793 -0.55167292 [70,] 0.42332848 1.04774793 [71,] 1.95700528 0.42332848 [72,] 0.57989098 1.95700528 [73,] -2.41264765 0.57989098 [74,] -1.70331595 -2.41264765 [75,] 6.17973636 -1.70331595 [76,] -0.36936598 6.17973636 [77,] 4.10676855 -0.36936598 [78,] -0.04036289 4.10676855 [79,] -3.63195950 -0.04036289 [80,] -1.78485050 -3.63195950 [81,] -3.09705886 -1.78485050 [82,] -3.94172019 -3.09705886 [83,] -0.93425882 -3.94172019 [84,] -0.94704459 -0.93425882 [85,] 0.03440668 -0.94704459 [86,] -0.04090770 0.03440668 [87,] -1.27914739 -0.04090770 [88,] 2.54748537 -1.27914739 [89,] 8.90094951 2.54748537 [90,] 0.28157531 8.90094951 [91,] 1.40142322 0.28157531 [92,] -0.32194612 1.40142322 [93,] 2.02392866 -0.32194612 [94,] -3.04698524 2.02392866 [95,] -1.35765181 -3.04698524 [96,] 3.53340891 -1.35765181 [97,] -1.47922296 3.53340891 [98,] -2.13344317 -1.47922296 [99,] -2.95720920 -2.13344317 [100,] -2.85279228 -2.95720920 [101,] 2.62980549 -2.85279228 [102,] -0.99413600 2.62980549 [103,] -2.11388007 -0.99413600 [104,] 3.11494930 -2.11388007 [105,] 6.08663415 3.11494930 [106,] -2.07130209 6.08663415 [107,] 3.16144640 -2.07130209 [108,] 1.95479952 3.16144640 [109,] 10.41225879 1.95479952 [110,] 0.23342725 10.41225879 [111,] 2.12114181 0.23342725 [112,] -2.28609392 2.12114181 [113,] 1.94842207 -2.28609392 [114,] -1.89842581 1.94842207 [115,] -3.68103990 -1.89842581 [116,] 0.55595179 -3.68103990 [117,] -0.63104207 0.55595179 [118,] -4.13369156 -0.63104207 [119,] 1.45521975 -4.13369156 [120,] 1.89692734 1.45521975 [121,] 0.24086670 1.89692734 [122,] -2.25361709 0.24086670 [123,] -5.76789886 -2.25361709 [124,] -2.53794675 -5.76789886 [125,] -2.42896595 -2.53794675 [126,] -5.81266729 -2.42896595 [127,] -3.46206795 -5.81266729 [128,] -2.52697116 -3.46206795 [129,] 0.18021005 -2.52697116 [130,] -2.28843155 0.18021005 [131,] 6.32898985 -2.28843155 [132,] -3.70501530 6.32898985 [133,] 1.20806346 -3.70501530 [134,] -1.43285081 1.20806346 [135,] 0.89717391 -1.43285081 [136,] 9.35855569 0.89717391 [137,] 0.43439297 9.35855569 [138,] 2.37685342 0.43439297 [139,] -2.27679044 2.37685342 [140,] -0.99359817 -2.27679044 [141,] -2.94682190 -0.99359817 [142,] 1.03758305 -2.94682190 [143,] -1.56387496 1.03758305 [144,] -1.37443343 -1.56387496 [145,] -2.13135811 -1.37443343 [146,] -0.93310611 -2.13135811 [147,] -0.56363462 -0.93310611 [148,] -2.71083561 -0.56363462 [149,] 5.61806638 -2.71083561 [150,] -1.52482186 5.61806638 [151,] 3.86773147 -1.52482186 [152,] -3.64076531 3.86773147 [153,] -1.49777324 -3.64076531 [154,] 5.59863526 -1.49777324 [155,] 4.24071718 5.59863526 [156,] 1.82740844 4.24071718 [157,] 0.59173830 1.82740844 [158,] -1.79450715 0.59173830 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.16932246 -0.09969808 2 1.46899085 -1.16932246 3 -0.51505799 1.46899085 4 8.51474549 -0.51505799 5 -0.63830280 8.51474549 6 9.47611688 -0.63830280 7 -1.54963483 9.47611688 8 -2.55081714 -1.54963483 9 0.40012971 -2.55081714 10 -2.17465752 0.40012971 11 -3.86944722 -2.17465752 12 2.75469308 -3.86944722 13 1.44672792 2.75469308 14 -2.70352398 1.44672792 15 1.06064859 -2.70352398 16 1.60683267 1.06064859 17 -1.71498821 1.60683267 18 -2.46886536 -1.71498821 19 1.17883815 -2.46886536 20 -5.10086806 1.17883815 21 2.32611221 -5.10086806 22 -0.29432581 2.32611221 23 2.05843465 -0.29432581 24 -1.54158944 2.05843465 25 -3.65172439 -1.54158944 26 -1.53306152 -3.65172439 27 2.58176996 -1.53306152 28 1.64015309 2.58176996 29 0.29856303 1.64015309 30 -3.37365771 0.29856303 31 2.96381841 -3.37365771 32 -2.26705151 2.96381841 33 -1.29553005 -2.26705151 34 0.37184426 -1.29553005 35 -3.99246751 0.37184426 36 8.05318603 -3.99246751 37 -0.96153856 8.05318603 38 -1.81491199 -0.96153856 39 -2.31845851 -1.81491199 40 -3.02350548 -2.31845851 41 1.58198838 -3.02350548 42 -4.64287696 1.58198838 43 1.23265440 -4.64287696 44 -1.57278588 1.23265440 45 0.17801234 -1.57278588 46 -3.51317892 0.17801234 47 -0.98884947 -3.51317892 48 2.87018707 -0.98884947 49 -1.43665535 2.87018707 50 -2.41613693 -1.43665535 51 1.31000077 -2.41613693 52 5.40512925 1.31000077 53 0.53734832 5.40512925 54 -1.13781018 0.53734832 55 -0.59316178 -1.13781018 56 0.20286819 -0.59316178 57 -4.09236738 0.20286819 58 -3.42579173 -4.09236738 59 1.79534991 -3.42579173 60 6.96309748 1.79534991 61 -0.91174759 6.96309748 62 -0.98738605 -0.91174759 63 0.98413541 -0.98738605 64 -0.50780764 0.98413541 65 -1.57109612 -0.50780764 66 4.61018310 -1.57109612 67 -0.98559780 4.61018310 68 -0.55167292 -0.98559780 69 1.04774793 -0.55167292 70 0.42332848 1.04774793 71 1.95700528 0.42332848 72 0.57989098 1.95700528 73 -2.41264765 0.57989098 74 -1.70331595 -2.41264765 75 6.17973636 -1.70331595 76 -0.36936598 6.17973636 77 4.10676855 -0.36936598 78 -0.04036289 4.10676855 79 -3.63195950 -0.04036289 80 -1.78485050 -3.63195950 81 -3.09705886 -1.78485050 82 -3.94172019 -3.09705886 83 -0.93425882 -3.94172019 84 -0.94704459 -0.93425882 85 0.03440668 -0.94704459 86 -0.04090770 0.03440668 87 -1.27914739 -0.04090770 88 2.54748537 -1.27914739 89 8.90094951 2.54748537 90 0.28157531 8.90094951 91 1.40142322 0.28157531 92 -0.32194612 1.40142322 93 2.02392866 -0.32194612 94 -3.04698524 2.02392866 95 -1.35765181 -3.04698524 96 3.53340891 -1.35765181 97 -1.47922296 3.53340891 98 -2.13344317 -1.47922296 99 -2.95720920 -2.13344317 100 -2.85279228 -2.95720920 101 2.62980549 -2.85279228 102 -0.99413600 2.62980549 103 -2.11388007 -0.99413600 104 3.11494930 -2.11388007 105 6.08663415 3.11494930 106 -2.07130209 6.08663415 107 3.16144640 -2.07130209 108 1.95479952 3.16144640 109 10.41225879 1.95479952 110 0.23342725 10.41225879 111 2.12114181 0.23342725 112 -2.28609392 2.12114181 113 1.94842207 -2.28609392 114 -1.89842581 1.94842207 115 -3.68103990 -1.89842581 116 0.55595179 -3.68103990 117 -0.63104207 0.55595179 118 -4.13369156 -0.63104207 119 1.45521975 -4.13369156 120 1.89692734 1.45521975 121 0.24086670 1.89692734 122 -2.25361709 0.24086670 123 -5.76789886 -2.25361709 124 -2.53794675 -5.76789886 125 -2.42896595 -2.53794675 126 -5.81266729 -2.42896595 127 -3.46206795 -5.81266729 128 -2.52697116 -3.46206795 129 0.18021005 -2.52697116 130 -2.28843155 0.18021005 131 6.32898985 -2.28843155 132 -3.70501530 6.32898985 133 1.20806346 -3.70501530 134 -1.43285081 1.20806346 135 0.89717391 -1.43285081 136 9.35855569 0.89717391 137 0.43439297 9.35855569 138 2.37685342 0.43439297 139 -2.27679044 2.37685342 140 -0.99359817 -2.27679044 141 -2.94682190 -0.99359817 142 1.03758305 -2.94682190 143 -1.56387496 1.03758305 144 -1.37443343 -1.56387496 145 -2.13135811 -1.37443343 146 -0.93310611 -2.13135811 147 -0.56363462 -0.93310611 148 -2.71083561 -0.56363462 149 5.61806638 -2.71083561 150 -1.52482186 5.61806638 151 3.86773147 -1.52482186 152 -3.64076531 3.86773147 153 -1.49777324 -3.64076531 154 5.59863526 -1.49777324 155 4.24071718 5.59863526 156 1.82740844 4.24071718 157 0.59173830 1.82740844 158 -1.79450715 0.59173830 > 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/7e5f81290768265.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/8e5f81290768265.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/9e5f81290768265.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/107wwt1290768265.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/11axcz1290768265.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/12dxtm1290768265.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/13979d1290768265.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/14vp711290768265.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/15yq6p1290768265.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/161qmv1290768265.tab") + } > > try(system("convert tmp/1ivhz1290768265.ps tmp/1ivhz1290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/2ivhz1290768265.ps tmp/2ivhz1290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/3a4y21290768265.ps tmp/3a4y21290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/4a4y21290768265.ps tmp/4a4y21290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/5a4y21290768265.ps tmp/5a4y21290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/63wyn1290768265.ps tmp/63wyn1290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/7e5f81290768265.ps tmp/7e5f81290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/8e5f81290768265.ps tmp/8e5f81290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/9e5f81290768265.ps tmp/9e5f81290768265.png",intern=TRUE)) character(0) > try(system("convert tmp/107wwt1290768265.ps tmp/107wwt1290768265.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.936 1.741 8.840