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(41 + ,38 + ,14 + ,12 + ,39 + ,32 + ,18 + ,11 + ,30 + ,35 + ,11 + ,14 + ,31 + ,33 + ,12 + ,12 + ,34 + ,37 + ,16 + ,21 + ,35 + ,29 + ,18 + ,12 + ,39 + ,31 + ,14 + ,22 + ,34 + ,36 + ,14 + ,11 + ,36 + ,35 + ,15 + ,10 + ,37 + ,38 + ,15 + ,13 + ,38 + ,31 + ,17 + ,10 + ,36 + ,34 + ,19 + ,8 + ,38 + ,35 + ,10 + ,15 + ,39 + ,38 + ,16 + ,14 + ,33 + ,37 + ,18 + ,10 + ,32 + ,33 + ,14 + ,14 + ,36 + ,32 + ,14 + ,14 + ,38 + ,38 + ,17 + ,11 + ,39 + ,38 + ,14 + ,10 + ,32 + ,32 + ,16 + ,13 + ,32 + ,33 + ,18 + ,9.5 + ,31 + ,31 + ,11 + ,14 + ,39 + ,38 + ,14 + ,12 + ,37 + ,39 + ,12 + ,14 + ,39 + ,32 + ,17 + ,11 + ,41 + ,32 + ,9 + ,9 + ,36 + ,35 + ,16 + ,11 + ,33 + ,37 + ,14 + ,15 + ,33 + ,33 + ,15 + ,14 + ,34 + ,33 + ,11 + ,13 + ,31 + ,31 + ,16 + ,9 + ,27 + ,32 + ,13 + ,15 + ,37 + ,31 + ,17 + ,10 + ,34 + ,37 + ,15 + ,11 + ,34 + ,30 + ,14 + ,13 + ,32 + ,33 + ,16 + ,8 + ,29 + ,31 + ,9 + ,20 + ,36 + ,33 + ,15 + ,12 + ,29 + ,31 + ,17 + ,10 + ,35 + ,33 + ,13 + ,10 + ,37 + ,32 + ,15 + ,9 + ,34 + ,33 + ,16 + ,14 + ,38 + ,32 + ,16 + ,8 + ,35 + ,33 + ,12 + ,14 + ,38 + ,28 + ,15 + ,11 + ,37 + ,35 + ,11 + ,13 + ,38 + ,39 + ,15 + ,9 + ,33 + ,34 + ,15 + ,11 + ,36 + ,38 + ,17 + ,15 + ,38 + ,32 + ,13 + ,11 + ,32 + ,38 + ,16 + ,10 + ,32 + ,30 + ,14 + ,14 + ,32 + ,33 + ,11 + ,18 + ,34 + ,38 + ,12 + ,14 + ,32 + ,32 + ,12 + ,11 + ,37 + ,35 + ,15 + ,14.5 + ,39 + ,34 + ,16 + ,13 + ,29 + ,34 + ,15 + ,9 + ,37 + ,36 + ,12 + ,10 + ,35 + ,34 + ,12 + ,15 + ,30 + ,28 + ,8 + ,20 + ,38 + ,34 + ,13 + ,12 + ,34 + ,35 + ,11 + ,12 + ,31 + ,35 + ,14 + ,14 + ,34 + ,31 + ,15 + ,13 + ,35 + ,37 + ,10 + ,11 + ,36 + ,35 + ,11 + ,17 + ,30 + ,27 + ,12 + ,12 + ,39 + ,40 + ,15 + ,13 + ,35 + ,37 + ,15 + ,14 + ,38 + ,36 + ,14 + ,13 + ,31 + ,38 + ,16 + ,15 + ,34 + ,39 + ,15 + ,13 + ,38 + ,41 + ,15 + ,10 + ,34 + ,27 + ,13 + ,11 + ,39 + ,30 + ,12 + ,19 + ,37 + ,37 + ,17 + ,13 + ,34 + ,31 + ,13 + ,17 + ,28 + ,31 + ,15 + ,13 + ,37 + ,27 + ,13 + ,9 + ,33 + ,36 + ,15 + ,11 + ,35 + ,37 + ,15 + ,9 + ,37 + ,33 + ,16 + ,12 + ,32 + ,34 + ,15 + ,12 + ,33 + ,31 + ,14 + ,13 + ,38 + ,39 + ,15 + ,13 + ,33 + ,34 + ,14 + ,12 + ,29 + ,32 + ,13 + ,15 + ,33 + ,33 + ,7 + ,22 + ,31 + ,36 + ,17 + ,13 + ,36 + ,32 + ,13 + ,15 + ,35 + ,41 + ,15 + ,13 + ,32 + ,28 + ,14 + ,15 + ,29 + ,30 + ,13 + ,12.5 + ,39 + ,36 + ,16 + ,11 + ,37 + ,35 + ,12 + ,16 + ,35 + ,31 + ,14 + ,11 + ,37 + ,34 + ,17 + ,11 + ,32 + ,36 + ,15 + ,10 + ,38 + ,36 + ,17 + ,10 + ,37 + ,35 + ,12 + ,16 + ,36 + ,37 + ,16 + ,12 + ,32 + ,28 + ,11 + ,11 + ,33 + ,39 + ,15 + ,16 + ,40 + ,32 + ,9 + ,19 + ,38 + ,35 + ,16 + ,11 + ,41 + ,39 + ,15 + ,16 + ,36 + ,35 + ,10 + ,15 + ,43 + ,42 + ,10 + ,24 + ,30 + ,34 + ,15 + ,14 + ,31 + ,33 + ,11 + ,15 + ,32 + ,41 + ,13 + ,11 + ,32 + ,33 + ,14 + ,15 + ,37 + ,34 + ,18 + ,12 + ,37 + ,32 + ,16 + ,10 + ,33 + ,40 + ,14 + ,14 + ,34 + ,40 + ,14 + ,13 + ,33 + ,35 + ,14 + ,9 + ,38 + ,36 + ,14 + ,15 + ,33 + ,37 + ,12 + ,15 + ,31 + ,27 + ,14 + ,14 + ,38 + ,39 + ,15 + ,11 + ,37 + ,38 + ,15 + ,8 + ,36 + ,31 + ,15 + ,11 + ,31 + ,33 + ,13 + ,11 + ,39 + ,32 + ,17 + ,8 + ,44 + ,39 + ,17 + ,10 + ,33 + ,36 + ,19 + ,11 + ,35 + ,33 + ,15 + ,13 + ,32 + ,33 + ,13 + ,11 + ,28 + ,32 + ,9 + ,20 + ,40 + ,37 + ,15 + ,10 + ,27 + ,30 + ,15 + ,15 + ,37 + ,38 + ,15 + ,12 + ,32 + ,29 + ,16 + ,14 + ,28 + ,22 + ,11 + ,23 + ,34 + ,35 + ,14 + ,14 + ,30 + ,35 + ,11 + ,16 + ,35 + ,34 + ,15 + ,11 + ,31 + ,35 + ,13 + ,12 + ,32 + ,34 + ,15 + ,10 + ,30 + ,37 + ,16 + ,14 + ,30 + ,35 + ,14 + ,12 + ,31 + ,23 + ,15 + ,12 + ,40 + ,31 + ,16 + ,11 + ,32 + ,27 + ,16 + ,12 + ,36 + ,36 + ,11 + ,13 + ,32 + ,31 + ,12 + ,11 + ,35 + ,32 + ,9 + ,19 + ,38 + ,39 + ,16 + ,12 + ,42 + ,37 + ,13 + ,17 + ,34 + ,38 + ,16 + ,9 + ,35 + ,39 + ,12 + ,12 + ,38 + ,34 + ,9 + ,19 + ,33 + ,31 + ,13 + ,18 + ,36 + ,32 + ,13 + ,15 + ,32 + ,37 + ,14 + ,14 + ,33 + ,36 + ,19 + ,11 + ,34 + ,32 + ,13 + ,9 + ,32 + ,38 + ,12 + ,18 + ,34 + ,36 + ,13 + ,16 + ,27 + ,26 + ,10 + ,24 + ,31 + ,26 + ,14 + ,14 + ,38 + ,33 + ,16 + ,20 + ,34 + ,39 + ,10 + ,18 + ,24 + ,30 + ,11 + ,23 + ,30 + ,33 + ,14 + ,12 + ,26 + ,25 + ,12 + ,14 + ,34 + ,38 + ,9 + ,16 + ,27 + ,37 + ,9 + ,18 + ,37 + ,31 + ,11 + ,20 + ,36 + ,37 + ,16 + ,12 + ,41 + ,35 + ,9 + ,12 + ,29 + ,25 + ,13 + ,17 + ,36 + ,28 + ,16 + ,13 + ,32 + ,35 + ,13 + ,9 + ,37 + ,33 + ,9 + ,16 + ,30 + ,30 + ,12 + ,18 + ,31 + ,31 + ,16 + ,10 + ,38 + ,37 + ,11 + ,14 + ,36 + ,36 + ,14 + ,11 + ,35 + ,30 + ,13 + ,9 + ,31 + ,36 + ,15 + ,11 + ,38 + ,32 + ,14 + ,10 + ,22 + ,28 + ,16 + ,11 + ,32 + ,36 + ,13 + ,19 + ,36 + ,34 + ,14 + ,14 + ,39 + ,31 + ,15 + ,12 + ,28 + ,28 + ,13 + ,14 + ,32 + ,36 + ,11 + ,21 + ,32 + ,36 + ,11 + ,13 + ,38 + ,40 + ,14 + ,10 + ,32 + ,33 + ,15 + ,15 + ,35 + ,37 + ,11 + ,16 + ,32 + ,32 + ,15 + ,14 + ,37 + ,38 + ,12 + ,12 + ,34 + ,31 + ,14 + ,19 + ,33 + ,37 + ,14 + ,15 + ,33 + ,33 + ,8 + ,19 + ,26 + ,32 + ,13 + ,13 + ,30 + ,30 + ,9 + ,17 + ,24 + ,30 + ,15 + ,12 + ,34 + ,31 + ,17 + ,11 + ,34 + ,32 + ,13 + ,14 + ,33 + ,34 + ,15 + ,11 + ,34 + ,36 + ,15 + ,13 + ,35 + ,37 + ,14 + ,12 + ,35 + ,36 + ,16 + ,15 + ,36 + ,33 + ,13 + ,14 + ,34 + ,33 + ,16 + ,12 + ,34 + ,33 + ,9 + ,17 + ,41 + ,44 + ,16 + ,11 + ,32 + ,39 + ,11 + ,18 + ,30 + ,32 + ,10 + ,13 + ,35 + ,35 + ,11 + ,17 + ,28 + ,25 + ,15 + ,13 + ,33 + ,35 + ,17 + ,11 + ,39 + ,34 + ,14 + ,12 + ,36 + ,35 + ,8 + ,22 + ,36 + ,39 + ,15 + ,14 + ,35 + ,33 + ,11 + ,12 + ,38 + ,36 + ,16 + ,12 + ,33 + ,32 + ,10 + ,17 + ,31 + ,32 + ,15 + ,9 + ,34 + ,36 + ,9 + ,21 + ,32 + ,36 + ,16 + ,10 + ,31 + ,32 + ,19 + ,11 + ,33 + ,34 + ,12 + ,12 + ,34 + ,33 + ,8 + ,23 + ,34 + ,35 + ,11 + ,13 + ,34 + ,30 + ,14 + ,12 + ,33 + ,38 + ,9 + ,16 + ,32 + ,34 + ,15 + ,9 + ,41 + ,33 + ,13 + ,17 + ,34 + ,32 + ,16 + ,9 + ,36 + ,31 + ,11 + ,14 + ,37 + ,30 + ,12 + ,17 + ,36 + ,27 + ,13 + ,13 + ,29 + ,31 + ,10 + ,11 + ,37 + ,30 + ,11 + ,12 + ,27 + ,32 + ,12 + ,10 + ,35 + ,35 + ,8 + ,19 + ,28 + ,28 + ,12 + ,16 + ,35 + ,33 + ,12 + ,16 + ,37 + ,31 + ,15 + ,14 + ,29 + ,35 + ,11 + ,20 + ,32 + ,35 + ,13 + ,15 + ,36 + ,32 + ,14 + ,23 + ,19 + ,21 + ,10 + ,20 + ,21 + ,20 + ,12 + ,16 + ,31 + ,34 + ,15 + ,14 + ,33 + ,32 + ,13 + ,17 + ,36 + ,34 + ,13 + ,11 + ,33 + ,32 + ,13 + ,13 + ,37 + ,33 + ,12 + ,17 + ,34 + ,33 + ,12 + ,15 + ,35 + ,37 + ,9 + ,21 + ,31 + ,32 + ,9 + ,18 + ,37 + ,34 + ,15 + ,15 + ,35 + ,30 + ,10 + ,8 + ,27 + ,30 + ,14 + ,12 + ,34 + ,38 + ,15 + ,12 + ,40 + ,36 + ,7 + ,22 + ,29 + ,32 + ,14 + ,12) + ,dim=c(4 + ,264) + ,dimnames=list(c('connected' + ,'separated' + ,'happiness' + ,'depression') + ,1:264)) > y <- array(NA,dim=c(4,264),dimnames=list(c('connected','separated','happiness','depression'),1:264)) > 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 = '4' > #'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 depression connected separated happiness 1 12.0 41 38 14 2 11.0 39 32 18 3 14.0 30 35 11 4 12.0 31 33 12 5 21.0 34 37 16 6 12.0 35 29 18 7 22.0 39 31 14 8 11.0 34 36 14 9 10.0 36 35 15 10 13.0 37 38 15 11 10.0 38 31 17 12 8.0 36 34 19 13 15.0 38 35 10 14 14.0 39 38 16 15 10.0 33 37 18 16 14.0 32 33 14 17 14.0 36 32 14 18 11.0 38 38 17 19 10.0 39 38 14 20 13.0 32 32 16 21 9.5 32 33 18 22 14.0 31 31 11 23 12.0 39 38 14 24 14.0 37 39 12 25 11.0 39 32 17 26 9.0 41 32 9 27 11.0 36 35 16 28 15.0 33 37 14 29 14.0 33 33 15 30 13.0 34 33 11 31 9.0 31 31 16 32 15.0 27 32 13 33 10.0 37 31 17 34 11.0 34 37 15 35 13.0 34 30 14 36 8.0 32 33 16 37 20.0 29 31 9 38 12.0 36 33 15 39 10.0 29 31 17 40 10.0 35 33 13 41 9.0 37 32 15 42 14.0 34 33 16 43 8.0 38 32 16 44 14.0 35 33 12 45 11.0 38 28 15 46 13.0 37 35 11 47 9.0 38 39 15 48 11.0 33 34 15 49 15.0 36 38 17 50 11.0 38 32 13 51 10.0 32 38 16 52 14.0 32 30 14 53 18.0 32 33 11 54 14.0 34 38 12 55 11.0 32 32 12 56 14.5 37 35 15 57 13.0 39 34 16 58 9.0 29 34 15 59 10.0 37 36 12 60 15.0 35 34 12 61 20.0 30 28 8 62 12.0 38 34 13 63 12.0 34 35 11 64 14.0 31 35 14 65 13.0 34 31 15 66 11.0 35 37 10 67 17.0 36 35 11 68 12.0 30 27 12 69 13.0 39 40 15 70 14.0 35 37 15 71 13.0 38 36 14 72 15.0 31 38 16 73 13.0 34 39 15 74 10.0 38 41 15 75 11.0 34 27 13 76 19.0 39 30 12 77 13.0 37 37 17 78 17.0 34 31 13 79 13.0 28 31 15 80 9.0 37 27 13 81 11.0 33 36 15 82 9.0 35 37 15 83 12.0 37 33 16 84 12.0 32 34 15 85 13.0 33 31 14 86 13.0 38 39 15 87 12.0 33 34 14 88 15.0 29 32 13 89 22.0 33 33 7 90 13.0 31 36 17 91 15.0 36 32 13 92 13.0 35 41 15 93 15.0 32 28 14 94 12.5 29 30 13 95 11.0 39 36 16 96 16.0 37 35 12 97 11.0 35 31 14 98 11.0 37 34 17 99 10.0 32 36 15 100 10.0 38 36 17 101 16.0 37 35 12 102 12.0 36 37 16 103 11.0 32 28 11 104 16.0 33 39 15 105 19.0 40 32 9 106 11.0 38 35 16 107 16.0 41 39 15 108 15.0 36 35 10 109 24.0 43 42 10 110 14.0 30 34 15 111 15.0 31 33 11 112 11.0 32 41 13 113 15.0 32 33 14 114 12.0 37 34 18 115 10.0 37 32 16 116 14.0 33 40 14 117 13.0 34 40 14 118 9.0 33 35 14 119 15.0 38 36 14 120 15.0 33 37 12 121 14.0 31 27 14 122 11.0 38 39 15 123 8.0 37 38 15 124 11.0 36 31 15 125 11.0 31 33 13 126 8.0 39 32 17 127 10.0 44 39 17 128 11.0 33 36 19 129 13.0 35 33 15 130 11.0 32 33 13 131 20.0 28 32 9 132 10.0 40 37 15 133 15.0 27 30 15 134 12.0 37 38 15 135 14.0 32 29 16 136 23.0 28 22 11 137 14.0 34 35 14 138 16.0 30 35 11 139 11.0 35 34 15 140 12.0 31 35 13 141 10.0 32 34 15 142 14.0 30 37 16 143 12.0 30 35 14 144 12.0 31 23 15 145 11.0 40 31 16 146 12.0 32 27 16 147 13.0 36 36 11 148 11.0 32 31 12 149 19.0 35 32 9 150 12.0 38 39 16 151 17.0 42 37 13 152 9.0 34 38 16 153 12.0 35 39 12 154 19.0 38 34 9 155 18.0 33 31 13 156 15.0 36 32 13 157 14.0 32 37 14 158 11.0 33 36 19 159 9.0 34 32 13 160 18.0 32 38 12 161 16.0 34 36 13 162 24.0 27 26 10 163 14.0 31 26 14 164 20.0 38 33 16 165 18.0 34 39 10 166 23.0 24 30 11 167 12.0 30 33 14 168 14.0 26 25 12 169 16.0 34 38 9 170 18.0 27 37 9 171 20.0 37 31 11 172 12.0 36 37 16 173 12.0 41 35 9 174 17.0 29 25 13 175 13.0 36 28 16 176 9.0 32 35 13 177 16.0 37 33 9 178 18.0 30 30 12 179 10.0 31 31 16 180 14.0 38 37 11 181 11.0 36 36 14 182 9.0 35 30 13 183 11.0 31 36 15 184 10.0 38 32 14 185 11.0 22 28 16 186 19.0 32 36 13 187 14.0 36 34 14 188 12.0 39 31 15 189 14.0 28 28 13 190 21.0 32 36 11 191 13.0 32 36 11 192 10.0 38 40 14 193 15.0 32 33 15 194 16.0 35 37 11 195 14.0 32 32 15 196 12.0 37 38 12 197 19.0 34 31 14 198 15.0 33 37 14 199 19.0 33 33 8 200 13.0 26 32 13 201 17.0 30 30 9 202 12.0 24 30 15 203 11.0 34 31 17 204 14.0 34 32 13 205 11.0 33 34 15 206 13.0 34 36 15 207 12.0 35 37 14 208 15.0 35 36 16 209 14.0 36 33 13 210 12.0 34 33 16 211 17.0 34 33 9 212 11.0 41 44 16 213 18.0 32 39 11 214 13.0 30 32 10 215 17.0 35 35 11 216 13.0 28 25 15 217 11.0 33 35 17 218 12.0 39 34 14 219 22.0 36 35 8 220 14.0 36 39 15 221 12.0 35 33 11 222 12.0 38 36 16 223 17.0 33 32 10 224 9.0 31 32 15 225 21.0 34 36 9 226 10.0 32 36 16 227 11.0 31 32 19 228 12.0 33 34 12 229 23.0 34 33 8 230 13.0 34 35 11 231 12.0 34 30 14 232 16.0 33 38 9 233 9.0 32 34 15 234 17.0 41 33 13 235 9.0 34 32 16 236 14.0 36 31 11 237 17.0 37 30 12 238 13.0 36 27 13 239 11.0 29 31 10 240 12.0 37 30 11 241 10.0 27 32 12 242 19.0 35 35 8 243 16.0 28 28 12 244 16.0 35 33 12 245 14.0 37 31 15 246 20.0 29 35 11 247 15.0 32 35 13 248 23.0 36 32 14 249 20.0 19 21 10 250 16.0 21 20 12 251 14.0 31 34 15 252 17.0 33 32 13 253 11.0 36 34 13 254 13.0 33 32 13 255 17.0 37 33 12 256 15.0 34 33 12 257 21.0 35 37 9 258 18.0 31 32 9 259 15.0 37 34 15 260 8.0 35 30 10 261 12.0 27 30 14 262 12.0 34 38 15 263 22.0 40 36 7 264 12.0 29 32 14 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) connected separated happiness 26.45211 -0.05026 -0.01049 -0.79759 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -8.402 -1.727 0.037 1.646 9.859 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 26.45211 1.97710 13.379 <2e-16 *** connected -0.05026 0.05180 -0.970 0.333 separated -0.01049 0.05294 -0.198 0.843 happiness -0.79759 0.07051 -11.311 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.827 on 260 degrees of freedom Multiple R-squared: 0.3434, Adjusted R-squared: 0.3359 F-statistic: 45.34 on 3 and 260 DF, p-value: < 2.2e-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.999071399 0.001857202 0.0009286012 [2,] 0.998784182 0.002431636 0.0012158178 [3,] 0.998782886 0.002434229 0.0012171144 [4,] 0.997287022 0.005425957 0.0027129785 [5,] 0.996944657 0.006110687 0.0030553433 [6,] 0.996092298 0.007815404 0.0039077019 [7,] 0.993528239 0.012943522 0.0064717611 [8,] 0.989687817 0.020624366 0.0103121828 [9,] 0.983025337 0.033949327 0.0169746634 [10,] 0.973841444 0.052317113 0.0261585565 [11,] 0.960137533 0.079724935 0.0398624673 [12,] 0.943046200 0.113907600 0.0569537999 [13,] 0.945750140 0.108499721 0.0542498603 [14,] 0.924742503 0.150514995 0.0752574974 [15,] 0.903707832 0.192584335 0.0962921677 [16,] 0.876930478 0.246139043 0.1230695216 [17,] 0.845227628 0.309544744 0.1547723721 [18,] 0.803894182 0.392211635 0.1961058175 [19,] 0.767073628 0.465852743 0.2329263715 [20,] 0.901994050 0.196011901 0.0980059503 [21,] 0.877316965 0.245366071 0.1226830355 [22,] 0.858564725 0.282870550 0.1414352751 [23,] 0.829741514 0.340516972 0.1702584859 [24,] 0.798529586 0.402940828 0.2014704140 [25,] 0.809740456 0.380519089 0.1902595443 [26,] 0.777502601 0.444994799 0.2224973993 [27,] 0.743356536 0.513286929 0.2566434643 [28,] 0.712876559 0.574246882 0.2871234412 [29,] 0.665716317 0.668567367 0.3342836835 [30,] 0.712654758 0.574690484 0.2873452420 [31,] 0.767193386 0.465613228 0.2328066139 [32,] 0.726050380 0.547899240 0.2739496201 [33,] 0.698135227 0.603729546 0.3018647729 [34,] 0.713076654 0.573846691 0.2869233457 [35,] 0.714749779 0.570500443 0.2852502215 [36,] 0.698123498 0.603753005 0.3018765023 [37,] 0.708144070 0.583711860 0.2918559299 [38,] 0.666807337 0.666385325 0.3331926625 [39,] 0.623916090 0.752167821 0.3760839104 [40,] 0.588329043 0.823341914 0.4116709568 [41,] 0.594809398 0.810381204 0.4051906022 [42,] 0.559394099 0.881211801 0.4406059005 [43,] 0.597598087 0.804803826 0.4024019131 [44,] 0.570657178 0.858685643 0.4293428216 [45,] 0.554772837 0.890454325 0.4452271627 [46,] 0.517533662 0.964932676 0.4824663380 [47,] 0.535592378 0.928815243 0.4644076216 [48,] 0.491549759 0.983099519 0.5084502406 [49,] 0.503698311 0.992603379 0.4963016894 [50,] 0.495112063 0.990224126 0.5048879369 [51,] 0.469242528 0.938485057 0.5307574717 [52,] 0.502812247 0.994375505 0.4971877527 [53,] 0.536165951 0.927668098 0.4638340492 [54,] 0.503542011 0.992915978 0.4964579889 [55,] 0.529655935 0.940688130 0.4703440650 [56,] 0.494985248 0.989970496 0.5050147519 [57,] 0.491955366 0.983910732 0.5080446338 [58,] 0.454225016 0.908450032 0.5457749839 [59,] 0.415677965 0.831355929 0.5843220354 [60,] 0.463199754 0.926399509 0.5368002456 [61,] 0.463219970 0.926439940 0.5367800302 [62,] 0.455240580 0.910481160 0.5447594200 [63,] 0.422220911 0.844441822 0.5777790890 [64,] 0.398842308 0.797684616 0.6011576922 [65,] 0.361810312 0.723620623 0.6381896883 [66,] 0.365668155 0.731336309 0.6343318454 [67,] 0.329689302 0.659378603 0.6703106984 [68,] 0.314423851 0.628847703 0.6855761487 [69,] 0.305615381 0.611230761 0.6943846193 [70,] 0.412952783 0.825905565 0.5870472173 [71,] 0.395938951 0.791877903 0.6040610487 [72,] 0.416589917 0.833179834 0.5834100829 [73,] 0.379002024 0.758004047 0.6209979763 [74,] 0.433508642 0.867017284 0.5664913580 [75,] 0.405926882 0.811853764 0.5940731178 [76,] 0.420524127 0.841048253 0.5794758734 [77,] 0.384433491 0.768866983 0.6155665087 [78,] 0.349217598 0.698435195 0.6507824024 [79,] 0.314810417 0.629620833 0.6851895834 [80,] 0.285310418 0.570620836 0.7146895820 [81,] 0.258033084 0.516066169 0.7419669156 [82,] 0.233180504 0.466361008 0.7668194961 [83,] 0.289742558 0.579485116 0.7102574420 [84,] 0.270749650 0.541499301 0.7292503496 [85,] 0.249922471 0.499844942 0.7500775288 [86,] 0.222571366 0.445142731 0.7774286343 [87,] 0.207409034 0.414818068 0.7925909659 [88,] 0.189910347 0.379820695 0.8100896526 [89,] 0.165906721 0.331813441 0.8340932794 [90,] 0.154161134 0.308322267 0.8458388664 [91,] 0.143590066 0.287180131 0.8564099344 [92,] 0.123668017 0.247336034 0.8763319832 [93,] 0.120337361 0.240674722 0.8796626390 [94,] 0.103941142 0.207882284 0.8960588580 [95,] 0.095304146 0.190608292 0.9046958540 [96,] 0.080951895 0.161903790 0.9190481051 [97,] 0.101158176 0.202316352 0.8988418240 [98,] 0.111570335 0.223140671 0.8884296646 [99,] 0.116236943 0.232473886 0.8837630570 [100,] 0.099745077 0.199490153 0.9002549233 [101,] 0.116024881 0.232049762 0.8839751188 [102,] 0.101662454 0.203324907 0.8983375464 [103,] 0.269937267 0.539874535 0.7300627326 [104,] 0.250092177 0.500184355 0.7499078226 [105,] 0.223751730 0.447503461 0.7762482695 [106,] 0.230724419 0.461448839 0.7692755805 [107,] 0.216661085 0.433322169 0.7833389154 [108,] 0.204074762 0.408149524 0.7959252380 [109,] 0.186070712 0.372141424 0.8139292878 [110,] 0.164867174 0.329734347 0.8351328263 [111,] 0.144095247 0.288190494 0.8559047532 [112,] 0.169177023 0.338354045 0.8308229773 [113,] 0.157895110 0.315790220 0.8421048898 [114,] 0.137622209 0.275244418 0.8623777911 [115,] 0.122778526 0.245557052 0.8772214738 [116,] 0.109738611 0.219477221 0.8902613895 [117,] 0.134904632 0.269809263 0.8650953683 [118,] 0.120169261 0.240338521 0.8798307393 [119,] 0.121658981 0.243317962 0.8783410191 [120,] 0.120329053 0.240658107 0.8796709467 [121,] 0.104787353 0.209574707 0.8952126466 [122,] 0.094870950 0.189741899 0.9051290503 [123,] 0.081664289 0.163328577 0.9183357114 [124,] 0.082746503 0.165493006 0.9172534971 [125,] 0.085655869 0.171311737 0.9143441314 [126,] 0.080373480 0.160746959 0.9196265203 [127,] 0.077415222 0.154830444 0.9225847780 [128,] 0.065471150 0.130942301 0.9345288496 [129,] 0.062309067 0.124618134 0.9376909332 [130,] 0.150181066 0.300362133 0.8498189337 [131,] 0.132072410 0.264144821 0.8679275896 [132,] 0.114400890 0.228801779 0.8855991103 [133,] 0.101814910 0.203629820 0.8981850902 [134,] 0.094824796 0.189649591 0.9051752043 [135,] 0.091667328 0.183334656 0.9083326720 [136,] 0.085943531 0.171887062 0.9140564690 [137,] 0.075721499 0.151442998 0.9242785010 [138,] 0.064661554 0.129323108 0.9353384460 [139,] 0.054521296 0.109042593 0.9454787036 [140,] 0.045459782 0.090919564 0.9545402181 [141,] 0.043235145 0.086470289 0.9567648554 [142,] 0.050907750 0.101815499 0.9490922503 [143,] 0.046743950 0.093487900 0.9532560498 [144,] 0.038959447 0.077918894 0.9610405531 [145,] 0.042154289 0.084308579 0.9578457105 [146,] 0.040848928 0.081697856 0.9591510720 [147,] 0.040009112 0.080018223 0.9599908883 [148,] 0.036659552 0.073319105 0.9633404477 [149,] 0.043507944 0.087015888 0.9564920560 [150,] 0.036865952 0.073731905 0.9631340476 [151,] 0.030612470 0.061224941 0.9693875296 [152,] 0.026753866 0.053507731 0.9732461343 [153,] 0.040820324 0.081640648 0.9591796762 [154,] 0.042696397 0.085392794 0.9573036031 [155,] 0.038721824 0.077443647 0.9612781764 [156,] 0.098429965 0.196859929 0.9015700355 [157,] 0.084058415 0.168116831 0.9159415845 [158,] 0.251067439 0.502134877 0.7489325614 [159,] 0.231703230 0.463406459 0.7682967704 [160,] 0.382188852 0.764377704 0.6178111482 [161,] 0.355773940 0.711547881 0.6442260595 [162,] 0.328735324 0.657470648 0.6712646760 [163,] 0.301976737 0.603953474 0.6980232632 [164,] 0.271517756 0.543035513 0.7284822437 [165,] 0.315928396 0.631856792 0.6840716039 [166,] 0.284651485 0.569302969 0.7153485153 [167,] 0.354126891 0.708253783 0.6458731086 [168,] 0.351127775 0.702255551 0.6488722245 [169,] 0.326437358 0.652874716 0.6735626419 [170,] 0.405169630 0.810339260 0.5948303700 [171,] 0.376905586 0.753811172 0.6230944140 [172,] 0.380557881 0.761115762 0.6194421192 [173,] 0.357030765 0.714061529 0.6429692353 [174,] 0.334688935 0.669377869 0.6653110654 [175,] 0.321616020 0.643232041 0.6783839796 [176,] 0.397839674 0.795679347 0.6021603263 [177,] 0.372268859 0.744537718 0.6277311408 [178,] 0.384684227 0.769368454 0.6153157728 [179,] 0.353282435 0.706564870 0.6467175651 [180,] 0.422746492 0.845492985 0.5772535077 [181,] 0.387112607 0.774225214 0.6128873928 [182,] 0.352358737 0.704717475 0.6476412627 [183,] 0.316951116 0.633902233 0.6830488836 [184,] 0.406786653 0.813573307 0.5932133465 [185,] 0.401861774 0.803723549 0.5981382256 [186,] 0.416240025 0.832480050 0.5837599751 [187,] 0.406489109 0.812978218 0.5935108910 [188,] 0.368555601 0.737111203 0.6314443985 [189,] 0.341188151 0.682376303 0.6588118486 [190,] 0.347736963 0.695473926 0.6522630372 [191,] 0.464558862 0.929117725 0.5354411377 [192,] 0.437844191 0.875688382 0.5621558088 [193,] 0.399882874 0.799765749 0.6001171257 [194,] 0.365845244 0.731690488 0.6341547559 [195,] 0.328201668 0.656403335 0.6717983325 [196,] 0.293569448 0.587138895 0.7064305523 [197,] 0.258888354 0.517776708 0.7411116458 [198,] 0.225941418 0.451882836 0.7740585821 [199,] 0.202549445 0.405098890 0.7974505548 [200,] 0.174659867 0.349319734 0.8253401328 [201,] 0.154198574 0.308397149 0.8458014256 [202,] 0.162948149 0.325896299 0.8370518506 [203,] 0.137816771 0.275633542 0.8621832292 [204,] 0.115867933 0.231735866 0.8841320669 [205,] 0.096967460 0.193934919 0.9030325405 [206,] 0.081070278 0.162140555 0.9189297225 [207,] 0.073380882 0.146761764 0.9266191178 [208,] 0.081658952 0.163317905 0.9183410476 [209,] 0.067981382 0.135962764 0.9320186182 [210,] 0.055713339 0.111426677 0.9442866613 [211,] 0.044364271 0.088728542 0.9556357288 [212,] 0.036640543 0.073281087 0.9633594566 [213,] 0.039647501 0.079295001 0.9603524993 [214,] 0.033032058 0.066064116 0.9669679418 [215,] 0.039284443 0.078568886 0.9607155571 [216,] 0.030364753 0.060729506 0.9696352470 [217,] 0.023087268 0.046174537 0.9769127317 [218,] 0.024268422 0.048536844 0.9757315781 [219,] 0.026458683 0.052917367 0.9735413165 [220,] 0.021279197 0.042558395 0.9787208026 [221,] 0.017857302 0.035714605 0.9821426977 [222,] 0.017368174 0.034736347 0.9826318265 [223,] 0.025643077 0.051286153 0.9743569234 [224,] 0.024126993 0.048253987 0.9758730066 [225,] 0.018919955 0.037839911 0.9810800446 [226,] 0.014652381 0.029304761 0.9853476194 [227,] 0.017210485 0.034420969 0.9827895155 [228,] 0.015524044 0.031048088 0.9844759559 [229,] 0.015848080 0.031696159 0.9841519205 [230,] 0.012547085 0.025094171 0.9874529147 [231,] 0.009884221 0.019768441 0.9901157793 [232,] 0.007077742 0.014155483 0.9929222583 [233,] 0.016989842 0.033979684 0.9830101579 [234,] 0.023074343 0.046148686 0.9769256569 [235,] 0.050662743 0.101325485 0.9493372573 [236,] 0.036351747 0.072703494 0.9636482532 [237,] 0.025206799 0.050413598 0.9747932011 [238,] 0.017018924 0.034037848 0.9829810762 [239,] 0.011568217 0.023136435 0.9884317826 [240,] 0.011294067 0.022588134 0.9887059328 [241,] 0.006998655 0.013997310 0.9930013451 [242,] 0.184093449 0.368186897 0.8159065513 [243,] 0.173666509 0.347333018 0.8263334908 [244,] 0.281037513 0.562075026 0.7189624870 [245,] 0.216681702 0.433363404 0.7833182979 [246,] 0.282828727 0.565657454 0.7171712730 [247,] 0.288626697 0.577253394 0.7113733032 [248,] 0.201506132 0.403012264 0.7984938681 [249,] 0.190491021 0.380982042 0.8095089789 [250,] 0.119754351 0.239508702 0.8802456490 [251,] 0.064958415 0.129916830 0.9350415850 > postscript(file="/var/www/rcomp/tmp/18ofu1321634964.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/27n6t1321634964.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/3b29y1321634964.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/42l901321634964.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/5wuia1321634964.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 = 264 Frequency = 1 1 2 3 4 5 6 -0.826471265 1.200460168 -1.803621008 -2.976734734 9.406380790 1.967944055 7 8 9 10 11 12 8.999596403 -2.199294209 -2.311657349 0.770065701 -0.657884801 -1.131766048 13 14 15 16 17 18 -1.199100557 2.668188793 -0.048694798 0.668718387 0.859289572 0.415518822 19 20 21 22 23 24 -2.926999974 1.253420922 -0.640904080 -1.795301581 -0.926999974 -0.612231217 25 26 27 28 29 30 0.402865785 -7.877360573 -0.514062966 1.760927669 1.516577124 -2.623536054 31 32 33 34 35 36 -2.807329665 0.609316000 -0.708149156 -1.391213594 -0.262211600 -3.736092847 37 38 39 40 41 42 2.508980944 -0.332629813 -1.110263990 -3.978082934 -3.292851690 2.364435862 43 44 45 46 47 48 -3.444992953 -0.775677317 -1.284532264 -2.451770528 -3.169183713 -1.472936644 49 50 51 52 53 54 4.314990113 -2.837776103 -1.683661687 0.637259691 2.275935237 -0.773510512 55 56 57 58 59 60 -3.936956612 2.238607005 1.626243865 -3.673994061 -4.643689912 0.234808915 61 62 63 64 65 66 1.730192219 -1.816803639 -3.602563591 0.639426496 0.545869015 -5.328921156 67 68 69 70 71 72 1.497965118 -3.089916480 0.891566874 1.659050761 0.001763208 3.266073959 73 74 75 76 77 78 0.629758870 -2.148211249 -3.091264679 4.393921405 2.354768236 2.950680248 79 80 81 82 83 84 0.244282889 -4.940471616 -1.451964180 -3.340949239 0.515228925 -0.523200998 85 86 87 88 89 90 -0.301989723 0.830816287 -1.270531027 0.709844709 3.135822058 2.042695878 91 92 93 94 95 96 1.061695189 0.700995688 1.616287227 -1.811127755 -0.352783671 1.345823856 97 98 99 100 101 102 -2.201461014 0.323309540 -2.502228534 -0.605453642 1.345823856 0.506909498 103 104 105 106 107 108 -4.776495922 3.579494516 2.072375073 -0.413534257 3.981609350 -1.299629265 109 110 111 112 113 114 8.125624838 1.376270294 -0.774329117 -3.044986141 1.668718387 2.120903923 115 116 117 118 119 120 -1.495257307 0.792386365 -0.157349281 -4.260044795 2.001763208 0.165738902 121 122 123 124 125 126 0.555536641 -1.169183713 -4.229934299 -1.353602276 -3.179140351 -2.597134215 127 128 129 130 131 132 -0.272408820 1.738413353 0.617105833 -3.128875996 2.469202821 -2.089627468 133 134 135 136 137 138 2.183532303 -0.229934299 2.221962226 6.959529269 0.790219559 0.196378992 139 140 141 142 143 144 -1.372407935 -2.158167887 -2.523200998 2.205323373 -1.410837858 -0.688813903 145 146 147 148 149 150 -0.354950476 0.200989762 -2.491548650 -3.947442843 1.821053301 0.628410671 151 152 153 154 155 156 3.415712474 -2.583132978 -2.712759925 1.992818828 3.900415894 1.061695189 157 158 159 160 161 162 0.710663315 1.738413353 -5.038833520 3.125960780 2.003111408 7.153615459 163 164 165 166 167 168 0.545050409 8.565493279 1.641786954 6.842361707 -1.431810322 -1.311946361 169 170 171 172 173 174 -1.166293661 0.471369627 4.506284545 0.506909498 -4.845901877 2.636441085 175 176 177 178 179 180 1.412533411 -5.107903533 -1.067931758 2.941542216 -1.807329665 -1.380533710 181 182 183 184 185 186 -2.098765500 -5.009541629 -1.552492888 -3.040181719 -1.291167549 4.902582699 187 188 189 190 191 192 0.880262036 -0.202809214 -0.382364573 5.307393933 -2.692606067 -2.956291864 193 194 195 196 197 198 2.466312770 0.468673228 1.455826538 -2.622717449 5.748274632 1.760927669 199 200 201 202 203 204 0.933416442 -1.440948354 -0.451240934 -0.967260760 0.141057781 -0.038833520 205 206 207 208 209 210 -1.472936644 0.598300174 -1.138543623 3.446158912 0.072181421 0.364435862 211 212 213 214 215 216 -0.218724821 -0.168365107 2.338852629 -3.632674087 1.447700764 0.181365498 217 218 219 220 221 222 0.132738355 -0.968944901 4.105181968 1.730287579 -3.573271700 0.596951975 223 224 225 226 227 228 0.518118976 -3.594437816 3.812733875 -1.704634151 1.595939717 -2.865719793 229 230 231 232 233 234 4.983680796 -2.602563591 -1.262211600 -1.216558016 -3.523200998 3.323503192 235 236 237 238 239 240 -2.646050370 -1.543979810 2.293392696 -0.990735971 -5.693424673 -3.504201687 241 242 243 244 245 246 -5.188278383 1.054917614 0.820041044 1.224322683 1.696662078 4.146114638 247 248 249 250 251 252 0.892096467 9.859289572 2.699069465 0.384300708 1.426534648 2.910902126 253 254 255 256 257 258 -2.917332347 -1.089097874 2.324851392 0.174058329 3.873484461 0.619995884 259 260 261 262 263 264 2.728120774 -8.402324779 -1.614062080 -0.380727362 3.519131234 -1.492560908 > postscript(file="/var/www/rcomp/tmp/6l6xq1321634964.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 = 264 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.826471265 NA 1 1.200460168 -0.826471265 2 -1.803621008 1.200460168 3 -2.976734734 -1.803621008 4 9.406380790 -2.976734734 5 1.967944055 9.406380790 6 8.999596403 1.967944055 7 -2.199294209 8.999596403 8 -2.311657349 -2.199294209 9 0.770065701 -2.311657349 10 -0.657884801 0.770065701 11 -1.131766048 -0.657884801 12 -1.199100557 -1.131766048 13 2.668188793 -1.199100557 14 -0.048694798 2.668188793 15 0.668718387 -0.048694798 16 0.859289572 0.668718387 17 0.415518822 0.859289572 18 -2.926999974 0.415518822 19 1.253420922 -2.926999974 20 -0.640904080 1.253420922 21 -1.795301581 -0.640904080 22 -0.926999974 -1.795301581 23 -0.612231217 -0.926999974 24 0.402865785 -0.612231217 25 -7.877360573 0.402865785 26 -0.514062966 -7.877360573 27 1.760927669 -0.514062966 28 1.516577124 1.760927669 29 -2.623536054 1.516577124 30 -2.807329665 -2.623536054 31 0.609316000 -2.807329665 32 -0.708149156 0.609316000 33 -1.391213594 -0.708149156 34 -0.262211600 -1.391213594 35 -3.736092847 -0.262211600 36 2.508980944 -3.736092847 37 -0.332629813 2.508980944 38 -1.110263990 -0.332629813 39 -3.978082934 -1.110263990 40 -3.292851690 -3.978082934 41 2.364435862 -3.292851690 42 -3.444992953 2.364435862 43 -0.775677317 -3.444992953 44 -1.284532264 -0.775677317 45 -2.451770528 -1.284532264 46 -3.169183713 -2.451770528 47 -1.472936644 -3.169183713 48 4.314990113 -1.472936644 49 -2.837776103 4.314990113 50 -1.683661687 -2.837776103 51 0.637259691 -1.683661687 52 2.275935237 0.637259691 53 -0.773510512 2.275935237 54 -3.936956612 -0.773510512 55 2.238607005 -3.936956612 56 1.626243865 2.238607005 57 -3.673994061 1.626243865 58 -4.643689912 -3.673994061 59 0.234808915 -4.643689912 60 1.730192219 0.234808915 61 -1.816803639 1.730192219 62 -3.602563591 -1.816803639 63 0.639426496 -3.602563591 64 0.545869015 0.639426496 65 -5.328921156 0.545869015 66 1.497965118 -5.328921156 67 -3.089916480 1.497965118 68 0.891566874 -3.089916480 69 1.659050761 0.891566874 70 0.001763208 1.659050761 71 3.266073959 0.001763208 72 0.629758870 3.266073959 73 -2.148211249 0.629758870 74 -3.091264679 -2.148211249 75 4.393921405 -3.091264679 76 2.354768236 4.393921405 77 2.950680248 2.354768236 78 0.244282889 2.950680248 79 -4.940471616 0.244282889 80 -1.451964180 -4.940471616 81 -3.340949239 -1.451964180 82 0.515228925 -3.340949239 83 -0.523200998 0.515228925 84 -0.301989723 -0.523200998 85 0.830816287 -0.301989723 86 -1.270531027 0.830816287 87 0.709844709 -1.270531027 88 3.135822058 0.709844709 89 2.042695878 3.135822058 90 1.061695189 2.042695878 91 0.700995688 1.061695189 92 1.616287227 0.700995688 93 -1.811127755 1.616287227 94 -0.352783671 -1.811127755 95 1.345823856 -0.352783671 96 -2.201461014 1.345823856 97 0.323309540 -2.201461014 98 -2.502228534 0.323309540 99 -0.605453642 -2.502228534 100 1.345823856 -0.605453642 101 0.506909498 1.345823856 102 -4.776495922 0.506909498 103 3.579494516 -4.776495922 104 2.072375073 3.579494516 105 -0.413534257 2.072375073 106 3.981609350 -0.413534257 107 -1.299629265 3.981609350 108 8.125624838 -1.299629265 109 1.376270294 8.125624838 110 -0.774329117 1.376270294 111 -3.044986141 -0.774329117 112 1.668718387 -3.044986141 113 2.120903923 1.668718387 114 -1.495257307 2.120903923 115 0.792386365 -1.495257307 116 -0.157349281 0.792386365 117 -4.260044795 -0.157349281 118 2.001763208 -4.260044795 119 0.165738902 2.001763208 120 0.555536641 0.165738902 121 -1.169183713 0.555536641 122 -4.229934299 -1.169183713 123 -1.353602276 -4.229934299 124 -3.179140351 -1.353602276 125 -2.597134215 -3.179140351 126 -0.272408820 -2.597134215 127 1.738413353 -0.272408820 128 0.617105833 1.738413353 129 -3.128875996 0.617105833 130 2.469202821 -3.128875996 131 -2.089627468 2.469202821 132 2.183532303 -2.089627468 133 -0.229934299 2.183532303 134 2.221962226 -0.229934299 135 6.959529269 2.221962226 136 0.790219559 6.959529269 137 0.196378992 0.790219559 138 -1.372407935 0.196378992 139 -2.158167887 -1.372407935 140 -2.523200998 -2.158167887 141 2.205323373 -2.523200998 142 -1.410837858 2.205323373 143 -0.688813903 -1.410837858 144 -0.354950476 -0.688813903 145 0.200989762 -0.354950476 146 -2.491548650 0.200989762 147 -3.947442843 -2.491548650 148 1.821053301 -3.947442843 149 0.628410671 1.821053301 150 3.415712474 0.628410671 151 -2.583132978 3.415712474 152 -2.712759925 -2.583132978 153 1.992818828 -2.712759925 154 3.900415894 1.992818828 155 1.061695189 3.900415894 156 0.710663315 1.061695189 157 1.738413353 0.710663315 158 -5.038833520 1.738413353 159 3.125960780 -5.038833520 160 2.003111408 3.125960780 161 7.153615459 2.003111408 162 0.545050409 7.153615459 163 8.565493279 0.545050409 164 1.641786954 8.565493279 165 6.842361707 1.641786954 166 -1.431810322 6.842361707 167 -1.311946361 -1.431810322 168 -1.166293661 -1.311946361 169 0.471369627 -1.166293661 170 4.506284545 0.471369627 171 0.506909498 4.506284545 172 -4.845901877 0.506909498 173 2.636441085 -4.845901877 174 1.412533411 2.636441085 175 -5.107903533 1.412533411 176 -1.067931758 -5.107903533 177 2.941542216 -1.067931758 178 -1.807329665 2.941542216 179 -1.380533710 -1.807329665 180 -2.098765500 -1.380533710 181 -5.009541629 -2.098765500 182 -1.552492888 -5.009541629 183 -3.040181719 -1.552492888 184 -1.291167549 -3.040181719 185 4.902582699 -1.291167549 186 0.880262036 4.902582699 187 -0.202809214 0.880262036 188 -0.382364573 -0.202809214 189 5.307393933 -0.382364573 190 -2.692606067 5.307393933 191 -2.956291864 -2.692606067 192 2.466312770 -2.956291864 193 0.468673228 2.466312770 194 1.455826538 0.468673228 195 -2.622717449 1.455826538 196 5.748274632 -2.622717449 197 1.760927669 5.748274632 198 0.933416442 1.760927669 199 -1.440948354 0.933416442 200 -0.451240934 -1.440948354 201 -0.967260760 -0.451240934 202 0.141057781 -0.967260760 203 -0.038833520 0.141057781 204 -1.472936644 -0.038833520 205 0.598300174 -1.472936644 206 -1.138543623 0.598300174 207 3.446158912 -1.138543623 208 0.072181421 3.446158912 209 0.364435862 0.072181421 210 -0.218724821 0.364435862 211 -0.168365107 -0.218724821 212 2.338852629 -0.168365107 213 -3.632674087 2.338852629 214 1.447700764 -3.632674087 215 0.181365498 1.447700764 216 0.132738355 0.181365498 217 -0.968944901 0.132738355 218 4.105181968 -0.968944901 219 1.730287579 4.105181968 220 -3.573271700 1.730287579 221 0.596951975 -3.573271700 222 0.518118976 0.596951975 223 -3.594437816 0.518118976 224 3.812733875 -3.594437816 225 -1.704634151 3.812733875 226 1.595939717 -1.704634151 227 -2.865719793 1.595939717 228 4.983680796 -2.865719793 229 -2.602563591 4.983680796 230 -1.262211600 -2.602563591 231 -1.216558016 -1.262211600 232 -3.523200998 -1.216558016 233 3.323503192 -3.523200998 234 -2.646050370 3.323503192 235 -1.543979810 -2.646050370 236 2.293392696 -1.543979810 237 -0.990735971 2.293392696 238 -5.693424673 -0.990735971 239 -3.504201687 -5.693424673 240 -5.188278383 -3.504201687 241 1.054917614 -5.188278383 242 0.820041044 1.054917614 243 1.224322683 0.820041044 244 1.696662078 1.224322683 245 4.146114638 1.696662078 246 0.892096467 4.146114638 247 9.859289572 0.892096467 248 2.699069465 9.859289572 249 0.384300708 2.699069465 250 1.426534648 0.384300708 251 2.910902126 1.426534648 252 -2.917332347 2.910902126 253 -1.089097874 -2.917332347 254 2.324851392 -1.089097874 255 0.174058329 2.324851392 256 3.873484461 0.174058329 257 0.619995884 3.873484461 258 2.728120774 0.619995884 259 -8.402324779 2.728120774 260 -1.614062080 -8.402324779 261 -0.380727362 -1.614062080 262 3.519131234 -0.380727362 263 -1.492560908 3.519131234 264 NA -1.492560908 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.200460168 -0.826471265 [2,] -1.803621008 1.200460168 [3,] -2.976734734 -1.803621008 [4,] 9.406380790 -2.976734734 [5,] 1.967944055 9.406380790 [6,] 8.999596403 1.967944055 [7,] -2.199294209 8.999596403 [8,] -2.311657349 -2.199294209 [9,] 0.770065701 -2.311657349 [10,] -0.657884801 0.770065701 [11,] -1.131766048 -0.657884801 [12,] -1.199100557 -1.131766048 [13,] 2.668188793 -1.199100557 [14,] -0.048694798 2.668188793 [15,] 0.668718387 -0.048694798 [16,] 0.859289572 0.668718387 [17,] 0.415518822 0.859289572 [18,] -2.926999974 0.415518822 [19,] 1.253420922 -2.926999974 [20,] -0.640904080 1.253420922 [21,] -1.795301581 -0.640904080 [22,] -0.926999974 -1.795301581 [23,] -0.612231217 -0.926999974 [24,] 0.402865785 -0.612231217 [25,] -7.877360573 0.402865785 [26,] -0.514062966 -7.877360573 [27,] 1.760927669 -0.514062966 [28,] 1.516577124 1.760927669 [29,] -2.623536054 1.516577124 [30,] -2.807329665 -2.623536054 [31,] 0.609316000 -2.807329665 [32,] -0.708149156 0.609316000 [33,] -1.391213594 -0.708149156 [34,] -0.262211600 -1.391213594 [35,] -3.736092847 -0.262211600 [36,] 2.508980944 -3.736092847 [37,] -0.332629813 2.508980944 [38,] -1.110263990 -0.332629813 [39,] -3.978082934 -1.110263990 [40,] -3.292851690 -3.978082934 [41,] 2.364435862 -3.292851690 [42,] -3.444992953 2.364435862 [43,] -0.775677317 -3.444992953 [44,] -1.284532264 -0.775677317 [45,] -2.451770528 -1.284532264 [46,] -3.169183713 -2.451770528 [47,] -1.472936644 -3.169183713 [48,] 4.314990113 -1.472936644 [49,] -2.837776103 4.314990113 [50,] -1.683661687 -2.837776103 [51,] 0.637259691 -1.683661687 [52,] 2.275935237 0.637259691 [53,] -0.773510512 2.275935237 [54,] -3.936956612 -0.773510512 [55,] 2.238607005 -3.936956612 [56,] 1.626243865 2.238607005 [57,] -3.673994061 1.626243865 [58,] -4.643689912 -3.673994061 [59,] 0.234808915 -4.643689912 [60,] 1.730192219 0.234808915 [61,] -1.816803639 1.730192219 [62,] -3.602563591 -1.816803639 [63,] 0.639426496 -3.602563591 [64,] 0.545869015 0.639426496 [65,] -5.328921156 0.545869015 [66,] 1.497965118 -5.328921156 [67,] -3.089916480 1.497965118 [68,] 0.891566874 -3.089916480 [69,] 1.659050761 0.891566874 [70,] 0.001763208 1.659050761 [71,] 3.266073959 0.001763208 [72,] 0.629758870 3.266073959 [73,] -2.148211249 0.629758870 [74,] -3.091264679 -2.148211249 [75,] 4.393921405 -3.091264679 [76,] 2.354768236 4.393921405 [77,] 2.950680248 2.354768236 [78,] 0.244282889 2.950680248 [79,] -4.940471616 0.244282889 [80,] -1.451964180 -4.940471616 [81,] -3.340949239 -1.451964180 [82,] 0.515228925 -3.340949239 [83,] -0.523200998 0.515228925 [84,] -0.301989723 -0.523200998 [85,] 0.830816287 -0.301989723 [86,] -1.270531027 0.830816287 [87,] 0.709844709 -1.270531027 [88,] 3.135822058 0.709844709 [89,] 2.042695878 3.135822058 [90,] 1.061695189 2.042695878 [91,] 0.700995688 1.061695189 [92,] 1.616287227 0.700995688 [93,] -1.811127755 1.616287227 [94,] -0.352783671 -1.811127755 [95,] 1.345823856 -0.352783671 [96,] -2.201461014 1.345823856 [97,] 0.323309540 -2.201461014 [98,] -2.502228534 0.323309540 [99,] -0.605453642 -2.502228534 [100,] 1.345823856 -0.605453642 [101,] 0.506909498 1.345823856 [102,] -4.776495922 0.506909498 [103,] 3.579494516 -4.776495922 [104,] 2.072375073 3.579494516 [105,] -0.413534257 2.072375073 [106,] 3.981609350 -0.413534257 [107,] -1.299629265 3.981609350 [108,] 8.125624838 -1.299629265 [109,] 1.376270294 8.125624838 [110,] -0.774329117 1.376270294 [111,] -3.044986141 -0.774329117 [112,] 1.668718387 -3.044986141 [113,] 2.120903923 1.668718387 [114,] -1.495257307 2.120903923 [115,] 0.792386365 -1.495257307 [116,] -0.157349281 0.792386365 [117,] -4.260044795 -0.157349281 [118,] 2.001763208 -4.260044795 [119,] 0.165738902 2.001763208 [120,] 0.555536641 0.165738902 [121,] -1.169183713 0.555536641 [122,] -4.229934299 -1.169183713 [123,] -1.353602276 -4.229934299 [124,] -3.179140351 -1.353602276 [125,] -2.597134215 -3.179140351 [126,] -0.272408820 -2.597134215 [127,] 1.738413353 -0.272408820 [128,] 0.617105833 1.738413353 [129,] -3.128875996 0.617105833 [130,] 2.469202821 -3.128875996 [131,] -2.089627468 2.469202821 [132,] 2.183532303 -2.089627468 [133,] -0.229934299 2.183532303 [134,] 2.221962226 -0.229934299 [135,] 6.959529269 2.221962226 [136,] 0.790219559 6.959529269 [137,] 0.196378992 0.790219559 [138,] -1.372407935 0.196378992 [139,] -2.158167887 -1.372407935 [140,] -2.523200998 -2.158167887 [141,] 2.205323373 -2.523200998 [142,] -1.410837858 2.205323373 [143,] -0.688813903 -1.410837858 [144,] -0.354950476 -0.688813903 [145,] 0.200989762 -0.354950476 [146,] -2.491548650 0.200989762 [147,] -3.947442843 -2.491548650 [148,] 1.821053301 -3.947442843 [149,] 0.628410671 1.821053301 [150,] 3.415712474 0.628410671 [151,] -2.583132978 3.415712474 [152,] -2.712759925 -2.583132978 [153,] 1.992818828 -2.712759925 [154,] 3.900415894 1.992818828 [155,] 1.061695189 3.900415894 [156,] 0.710663315 1.061695189 [157,] 1.738413353 0.710663315 [158,] -5.038833520 1.738413353 [159,] 3.125960780 -5.038833520 [160,] 2.003111408 3.125960780 [161,] 7.153615459 2.003111408 [162,] 0.545050409 7.153615459 [163,] 8.565493279 0.545050409 [164,] 1.641786954 8.565493279 [165,] 6.842361707 1.641786954 [166,] -1.431810322 6.842361707 [167,] -1.311946361 -1.431810322 [168,] -1.166293661 -1.311946361 [169,] 0.471369627 -1.166293661 [170,] 4.506284545 0.471369627 [171,] 0.506909498 4.506284545 [172,] -4.845901877 0.506909498 [173,] 2.636441085 -4.845901877 [174,] 1.412533411 2.636441085 [175,] -5.107903533 1.412533411 [176,] -1.067931758 -5.107903533 [177,] 2.941542216 -1.067931758 [178,] -1.807329665 2.941542216 [179,] -1.380533710 -1.807329665 [180,] -2.098765500 -1.380533710 [181,] -5.009541629 -2.098765500 [182,] -1.552492888 -5.009541629 [183,] -3.040181719 -1.552492888 [184,] -1.291167549 -3.040181719 [185,] 4.902582699 -1.291167549 [186,] 0.880262036 4.902582699 [187,] -0.202809214 0.880262036 [188,] -0.382364573 -0.202809214 [189,] 5.307393933 -0.382364573 [190,] -2.692606067 5.307393933 [191,] -2.956291864 -2.692606067 [192,] 2.466312770 -2.956291864 [193,] 0.468673228 2.466312770 [194,] 1.455826538 0.468673228 [195,] -2.622717449 1.455826538 [196,] 5.748274632 -2.622717449 [197,] 1.760927669 5.748274632 [198,] 0.933416442 1.760927669 [199,] -1.440948354 0.933416442 [200,] -0.451240934 -1.440948354 [201,] -0.967260760 -0.451240934 [202,] 0.141057781 -0.967260760 [203,] -0.038833520 0.141057781 [204,] -1.472936644 -0.038833520 [205,] 0.598300174 -1.472936644 [206,] -1.138543623 0.598300174 [207,] 3.446158912 -1.138543623 [208,] 0.072181421 3.446158912 [209,] 0.364435862 0.072181421 [210,] -0.218724821 0.364435862 [211,] -0.168365107 -0.218724821 [212,] 2.338852629 -0.168365107 [213,] -3.632674087 2.338852629 [214,] 1.447700764 -3.632674087 [215,] 0.181365498 1.447700764 [216,] 0.132738355 0.181365498 [217,] -0.968944901 0.132738355 [218,] 4.105181968 -0.968944901 [219,] 1.730287579 4.105181968 [220,] -3.573271700 1.730287579 [221,] 0.596951975 -3.573271700 [222,] 0.518118976 0.596951975 [223,] -3.594437816 0.518118976 [224,] 3.812733875 -3.594437816 [225,] -1.704634151 3.812733875 [226,] 1.595939717 -1.704634151 [227,] -2.865719793 1.595939717 [228,] 4.983680796 -2.865719793 [229,] -2.602563591 4.983680796 [230,] -1.262211600 -2.602563591 [231,] -1.216558016 -1.262211600 [232,] -3.523200998 -1.216558016 [233,] 3.323503192 -3.523200998 [234,] -2.646050370 3.323503192 [235,] -1.543979810 -2.646050370 [236,] 2.293392696 -1.543979810 [237,] -0.990735971 2.293392696 [238,] -5.693424673 -0.990735971 [239,] -3.504201687 -5.693424673 [240,] -5.188278383 -3.504201687 [241,] 1.054917614 -5.188278383 [242,] 0.820041044 1.054917614 [243,] 1.224322683 0.820041044 [244,] 1.696662078 1.224322683 [245,] 4.146114638 1.696662078 [246,] 0.892096467 4.146114638 [247,] 9.859289572 0.892096467 [248,] 2.699069465 9.859289572 [249,] 0.384300708 2.699069465 [250,] 1.426534648 0.384300708 [251,] 2.910902126 1.426534648 [252,] -2.917332347 2.910902126 [253,] -1.089097874 -2.917332347 [254,] 2.324851392 -1.089097874 [255,] 0.174058329 2.324851392 [256,] 3.873484461 0.174058329 [257,] 0.619995884 3.873484461 [258,] 2.728120774 0.619995884 [259,] -8.402324779 2.728120774 [260,] -1.614062080 -8.402324779 [261,] -0.380727362 -1.614062080 [262,] 3.519131234 -0.380727362 [263,] -1.492560908 3.519131234 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.200460168 -0.826471265 2 -1.803621008 1.200460168 3 -2.976734734 -1.803621008 4 9.406380790 -2.976734734 5 1.967944055 9.406380790 6 8.999596403 1.967944055 7 -2.199294209 8.999596403 8 -2.311657349 -2.199294209 9 0.770065701 -2.311657349 10 -0.657884801 0.770065701 11 -1.131766048 -0.657884801 12 -1.199100557 -1.131766048 13 2.668188793 -1.199100557 14 -0.048694798 2.668188793 15 0.668718387 -0.048694798 16 0.859289572 0.668718387 17 0.415518822 0.859289572 18 -2.926999974 0.415518822 19 1.253420922 -2.926999974 20 -0.640904080 1.253420922 21 -1.795301581 -0.640904080 22 -0.926999974 -1.795301581 23 -0.612231217 -0.926999974 24 0.402865785 -0.612231217 25 -7.877360573 0.402865785 26 -0.514062966 -7.877360573 27 1.760927669 -0.514062966 28 1.516577124 1.760927669 29 -2.623536054 1.516577124 30 -2.807329665 -2.623536054 31 0.609316000 -2.807329665 32 -0.708149156 0.609316000 33 -1.391213594 -0.708149156 34 -0.262211600 -1.391213594 35 -3.736092847 -0.262211600 36 2.508980944 -3.736092847 37 -0.332629813 2.508980944 38 -1.110263990 -0.332629813 39 -3.978082934 -1.110263990 40 -3.292851690 -3.978082934 41 2.364435862 -3.292851690 42 -3.444992953 2.364435862 43 -0.775677317 -3.444992953 44 -1.284532264 -0.775677317 45 -2.451770528 -1.284532264 46 -3.169183713 -2.451770528 47 -1.472936644 -3.169183713 48 4.314990113 -1.472936644 49 -2.837776103 4.314990113 50 -1.683661687 -2.837776103 51 0.637259691 -1.683661687 52 2.275935237 0.637259691 53 -0.773510512 2.275935237 54 -3.936956612 -0.773510512 55 2.238607005 -3.936956612 56 1.626243865 2.238607005 57 -3.673994061 1.626243865 58 -4.643689912 -3.673994061 59 0.234808915 -4.643689912 60 1.730192219 0.234808915 61 -1.816803639 1.730192219 62 -3.602563591 -1.816803639 63 0.639426496 -3.602563591 64 0.545869015 0.639426496 65 -5.328921156 0.545869015 66 1.497965118 -5.328921156 67 -3.089916480 1.497965118 68 0.891566874 -3.089916480 69 1.659050761 0.891566874 70 0.001763208 1.659050761 71 3.266073959 0.001763208 72 0.629758870 3.266073959 73 -2.148211249 0.629758870 74 -3.091264679 -2.148211249 75 4.393921405 -3.091264679 76 2.354768236 4.393921405 77 2.950680248 2.354768236 78 0.244282889 2.950680248 79 -4.940471616 0.244282889 80 -1.451964180 -4.940471616 81 -3.340949239 -1.451964180 82 0.515228925 -3.340949239 83 -0.523200998 0.515228925 84 -0.301989723 -0.523200998 85 0.830816287 -0.301989723 86 -1.270531027 0.830816287 87 0.709844709 -1.270531027 88 3.135822058 0.709844709 89 2.042695878 3.135822058 90 1.061695189 2.042695878 91 0.700995688 1.061695189 92 1.616287227 0.700995688 93 -1.811127755 1.616287227 94 -0.352783671 -1.811127755 95 1.345823856 -0.352783671 96 -2.201461014 1.345823856 97 0.323309540 -2.201461014 98 -2.502228534 0.323309540 99 -0.605453642 -2.502228534 100 1.345823856 -0.605453642 101 0.506909498 1.345823856 102 -4.776495922 0.506909498 103 3.579494516 -4.776495922 104 2.072375073 3.579494516 105 -0.413534257 2.072375073 106 3.981609350 -0.413534257 107 -1.299629265 3.981609350 108 8.125624838 -1.299629265 109 1.376270294 8.125624838 110 -0.774329117 1.376270294 111 -3.044986141 -0.774329117 112 1.668718387 -3.044986141 113 2.120903923 1.668718387 114 -1.495257307 2.120903923 115 0.792386365 -1.495257307 116 -0.157349281 0.792386365 117 -4.260044795 -0.157349281 118 2.001763208 -4.260044795 119 0.165738902 2.001763208 120 0.555536641 0.165738902 121 -1.169183713 0.555536641 122 -4.229934299 -1.169183713 123 -1.353602276 -4.229934299 124 -3.179140351 -1.353602276 125 -2.597134215 -3.179140351 126 -0.272408820 -2.597134215 127 1.738413353 -0.272408820 128 0.617105833 1.738413353 129 -3.128875996 0.617105833 130 2.469202821 -3.128875996 131 -2.089627468 2.469202821 132 2.183532303 -2.089627468 133 -0.229934299 2.183532303 134 2.221962226 -0.229934299 135 6.959529269 2.221962226 136 0.790219559 6.959529269 137 0.196378992 0.790219559 138 -1.372407935 0.196378992 139 -2.158167887 -1.372407935 140 -2.523200998 -2.158167887 141 2.205323373 -2.523200998 142 -1.410837858 2.205323373 143 -0.688813903 -1.410837858 144 -0.354950476 -0.688813903 145 0.200989762 -0.354950476 146 -2.491548650 0.200989762 147 -3.947442843 -2.491548650 148 1.821053301 -3.947442843 149 0.628410671 1.821053301 150 3.415712474 0.628410671 151 -2.583132978 3.415712474 152 -2.712759925 -2.583132978 153 1.992818828 -2.712759925 154 3.900415894 1.992818828 155 1.061695189 3.900415894 156 0.710663315 1.061695189 157 1.738413353 0.710663315 158 -5.038833520 1.738413353 159 3.125960780 -5.038833520 160 2.003111408 3.125960780 161 7.153615459 2.003111408 162 0.545050409 7.153615459 163 8.565493279 0.545050409 164 1.641786954 8.565493279 165 6.842361707 1.641786954 166 -1.431810322 6.842361707 167 -1.311946361 -1.431810322 168 -1.166293661 -1.311946361 169 0.471369627 -1.166293661 170 4.506284545 0.471369627 171 0.506909498 4.506284545 172 -4.845901877 0.506909498 173 2.636441085 -4.845901877 174 1.412533411 2.636441085 175 -5.107903533 1.412533411 176 -1.067931758 -5.107903533 177 2.941542216 -1.067931758 178 -1.807329665 2.941542216 179 -1.380533710 -1.807329665 180 -2.098765500 -1.380533710 181 -5.009541629 -2.098765500 182 -1.552492888 -5.009541629 183 -3.040181719 -1.552492888 184 -1.291167549 -3.040181719 185 4.902582699 -1.291167549 186 0.880262036 4.902582699 187 -0.202809214 0.880262036 188 -0.382364573 -0.202809214 189 5.307393933 -0.382364573 190 -2.692606067 5.307393933 191 -2.956291864 -2.692606067 192 2.466312770 -2.956291864 193 0.468673228 2.466312770 194 1.455826538 0.468673228 195 -2.622717449 1.455826538 196 5.748274632 -2.622717449 197 1.760927669 5.748274632 198 0.933416442 1.760927669 199 -1.440948354 0.933416442 200 -0.451240934 -1.440948354 201 -0.967260760 -0.451240934 202 0.141057781 -0.967260760 203 -0.038833520 0.141057781 204 -1.472936644 -0.038833520 205 0.598300174 -1.472936644 206 -1.138543623 0.598300174 207 3.446158912 -1.138543623 208 0.072181421 3.446158912 209 0.364435862 0.072181421 210 -0.218724821 0.364435862 211 -0.168365107 -0.218724821 212 2.338852629 -0.168365107 213 -3.632674087 2.338852629 214 1.447700764 -3.632674087 215 0.181365498 1.447700764 216 0.132738355 0.181365498 217 -0.968944901 0.132738355 218 4.105181968 -0.968944901 219 1.730287579 4.105181968 220 -3.573271700 1.730287579 221 0.596951975 -3.573271700 222 0.518118976 0.596951975 223 -3.594437816 0.518118976 224 3.812733875 -3.594437816 225 -1.704634151 3.812733875 226 1.595939717 -1.704634151 227 -2.865719793 1.595939717 228 4.983680796 -2.865719793 229 -2.602563591 4.983680796 230 -1.262211600 -2.602563591 231 -1.216558016 -1.262211600 232 -3.523200998 -1.216558016 233 3.323503192 -3.523200998 234 -2.646050370 3.323503192 235 -1.543979810 -2.646050370 236 2.293392696 -1.543979810 237 -0.990735971 2.293392696 238 -5.693424673 -0.990735971 239 -3.504201687 -5.693424673 240 -5.188278383 -3.504201687 241 1.054917614 -5.188278383 242 0.820041044 1.054917614 243 1.224322683 0.820041044 244 1.696662078 1.224322683 245 4.146114638 1.696662078 246 0.892096467 4.146114638 247 9.859289572 0.892096467 248 2.699069465 9.859289572 249 0.384300708 2.699069465 250 1.426534648 0.384300708 251 2.910902126 1.426534648 252 -2.917332347 2.910902126 253 -1.089097874 -2.917332347 254 2.324851392 -1.089097874 255 0.174058329 2.324851392 256 3.873484461 0.174058329 257 0.619995884 3.873484461 258 2.728120774 0.619995884 259 -8.402324779 2.728120774 260 -1.614062080 -8.402324779 261 -0.380727362 -1.614062080 262 3.519131234 -0.380727362 263 -1.492560908 3.519131234 > 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/7h2wo1321634964.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/8loft1321634964.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/9dvok1321634964.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/10ivet1321634964.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/11xnsz1321634964.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/1281051321634964.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/13vifh1321634964.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/14oc761321634964.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/15f4u01321634964.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/16tau61321634964.tab") + } > > try(system("convert tmp/18ofu1321634964.ps tmp/18ofu1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/27n6t1321634964.ps tmp/27n6t1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/3b29y1321634964.ps tmp/3b29y1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/42l901321634964.ps tmp/42l901321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/5wuia1321634964.ps tmp/5wuia1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/6l6xq1321634964.ps tmp/6l6xq1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/7h2wo1321634964.ps tmp/7h2wo1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/8loft1321634964.ps tmp/8loft1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/9dvok1321634964.ps tmp/9dvok1321634964.png",intern=TRUE)) character(0) > try(system("convert tmp/10ivet1321634964.ps tmp/10ivet1321634964.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.420 0.330 7.738