R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(46402 + ,1 + ,45329 + ,1 + ,42185 + ,1 + ,49341 + ,0 + ,50472 + ,0 + ,33020 + ,0 + ,29567 + ,0 + ,22870 + ,0 + ,25730 + ,0 + ,32609 + ,0 + ,23536 + ,0 + ,15135 + ,0 + ,36776 + ,0 + ,29982 + ,0 + ,38062 + ,0 + ,34226 + ,0 + ,24906 + ,0 + ,30233 + ,0 + ,27405 + ,0 + ,20784 + ,0 + ,22886 + ,0 + ,25425 + ,0 + ,20838 + ,0 + ,15655 + ,0 + ,37158 + ,1 + ,36364 + ,1 + ,43213 + ,1 + ,31635 + ,0 + ,30113 + ,0 + ,29985 + ,0 + ,20919 + ,0 + ,19429 + ,0 + ,21427 + ,0 + ,26064 + ,0 + ,20109 + ,0 + ,15369 + ,0 + ,35466 + ,0 + ,25954 + ,0 + ,33504 + ,0 + ,28115 + ,0 + ,28501 + ,0 + ,28618 + ,0 + ,21434 + ,0 + ,20177 + ,0 + ,21484 + ,0 + ,25642 + ,0 + ,23515 + ,0 + ,12941 + ,0 + ,36190 + ,1 + ,37785 + ,1 + ,38407 + ,1 + ,33326 + ,0 + ,30304 + ,0 + ,27576 + ,0 + ,27048 + ,0 + ,17291 + ,0 + ,21018 + ,0 + ,26792 + ,0 + ,19426 + ,0 + ,13927 + ,0 + ,35647 + ,0 + ,31746 + ,0 + ,31277 + ,0 + ,31583 + ,0 + ,25607 + ,0 + ,28151 + ,0 + ,24947 + ,0 + ,18077 + ,0 + ,23429 + ,0 + ,26313 + ,0 + ,18862 + ,0 + ,14753 + ,0 + ,36409 + ,1 + ,33163 + ,1 + ,34122 + ,1 + ,35225 + ,0 + ,28249 + ,0 + ,30374 + ,0 + ,26311 + ,0 + ,22069 + ,0 + ,23651 + ,0 + ,28628 + ,0 + ,23187 + ,0 + ,14727 + ,0 + ,43080 + ,0 + ,32519 + ,0 + ,39657 + ,0 + ,33614 + ,0 + ,28671 + ,0 + ,34243 + ,0 + ,27336 + ,0 + ,22916 + ,0 + ,24537 + ,0 + ,26128 + ,0 + ,22602 + ,0 + ,15744 + ,0 + ,41086 + ,1 + ,39690 + ,1 + ,43129 + ,1 + ,37863 + ,0 + ,35953 + ,0 + ,29133 + ,0 + ,24693 + ,0 + ,22205 + ,0 + ,21725 + ,0 + ,27192 + ,0 + ,21790 + ,0 + ,13253 + ,0 + ,37702 + ,0 + ,30364 + ,0 + ,32609 + ,0 + ,30212 + ,0 + ,29965 + ,0 + ,28352 + ,0 + ,25814 + ,0 + ,22414 + ,0 + ,20506 + ,0 + ,28806 + ,0 + ,22228 + ,0 + ,13971 + ,0 + ,36845 + ,1 + ,35338 + ,1 + ,35022 + ,1 + ,34777 + ,0 + ,26887 + ,0 + ,23970 + ,0 + ,22780 + ,0 + ,17351 + ,0 + ,21382 + ,0 + ,24561 + ,0 + ,17409 + ,0 + ,11514 + ,0 + ,31514 + ,0 + ,27071 + ,0 + ,29462 + ,0 + ,26105 + ,0 + ,22397 + ,0 + ,23843 + ,0 + ,21705 + ,0 + ,18089 + ,0 + ,20764 + ,0 + ,25316 + ,0 + ,17704 + ,0 + ,15548 + ,0 + ,28029 + ,1 + ,29383 + ,1 + ,36438 + ,1 + ,32034 + ,0 + ,22679 + ,0 + ,24319 + ,0 + ,18004 + ,0 + ,17537 + ,0 + ,20366 + ,0 + ,22782 + ,0 + ,19169 + ,0 + ,13807 + ,0 + ,29743 + ,0 + ,25591 + ,0 + ,29096 + ,0 + ,26482 + ,0 + ,22405 + ,0 + ,27044 + ,0 + ,17970 + ,0 + ,18730 + ,0 + ,19684 + ,0 + ,19785 + ,0 + ,18479 + ,0 + ,10698 + ,0 + ,31956 + ,1 + ,29506 + ,1 + ,34506 + ,1 + ,27165 + ,0 + ,26736 + ,0 + ,23691 + ,0 + ,18157 + ,0 + ,17328 + ,0 + ,18205 + ,0 + ,20995 + ,0 + ,17382 + ,0 + ,9367 + ,0 + ,31124 + ,0 + ,26551 + ,0 + ,30651 + ,0 + ,25859 + ,0 + ,25100 + ,0 + ,25778 + ,0 + ,20418 + ,0 + ,18688 + ,0 + ,20424 + ,0 + ,24776 + ,0 + ,19814 + ,0 + ,12738 + ,0) + ,dim=c(2 + ,192) + ,dimnames=list(c('X' + ,'Y') + ,1:192)) > y <- array(NA,dim=c(2,192),dimnames=list(c('X','Y'),1:192)) > 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 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x X Y M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 46402 1 1 0 0 0 0 0 0 0 0 0 0 1 2 45329 1 0 1 0 0 0 0 0 0 0 0 0 2 3 42185 1 0 0 1 0 0 0 0 0 0 0 0 3 4 49341 0 0 0 0 1 0 0 0 0 0 0 0 4 5 50472 0 0 0 0 0 1 0 0 0 0 0 0 5 6 33020 0 0 0 0 0 0 1 0 0 0 0 0 6 7 29567 0 0 0 0 0 0 0 1 0 0 0 0 7 8 22870 0 0 0 0 0 0 0 0 1 0 0 0 8 9 25730 0 0 0 0 0 0 0 0 0 1 0 0 9 10 32609 0 0 0 0 0 0 0 0 0 0 1 0 10 11 23536 0 0 0 0 0 0 0 0 0 0 0 1 11 12 15135 0 0 0 0 0 0 0 0 0 0 0 0 12 13 36776 0 1 0 0 0 0 0 0 0 0 0 0 13 14 29982 0 0 1 0 0 0 0 0 0 0 0 0 14 15 38062 0 0 0 1 0 0 0 0 0 0 0 0 15 16 34226 0 0 0 0 1 0 0 0 0 0 0 0 16 17 24906 0 0 0 0 0 1 0 0 0 0 0 0 17 18 30233 0 0 0 0 0 0 1 0 0 0 0 0 18 19 27405 0 0 0 0 0 0 0 1 0 0 0 0 19 20 20784 0 0 0 0 0 0 0 0 1 0 0 0 20 21 22886 0 0 0 0 0 0 0 0 0 1 0 0 21 22 25425 0 0 0 0 0 0 0 0 0 0 1 0 22 23 20838 0 0 0 0 0 0 0 0 0 0 0 1 23 24 15655 0 0 0 0 0 0 0 0 0 0 0 0 24 25 37158 1 1 0 0 0 0 0 0 0 0 0 0 25 26 36364 1 0 1 0 0 0 0 0 0 0 0 0 26 27 43213 1 0 0 1 0 0 0 0 0 0 0 0 27 28 31635 0 0 0 0 1 0 0 0 0 0 0 0 28 29 30113 0 0 0 0 0 1 0 0 0 0 0 0 29 30 29985 0 0 0 0 0 0 1 0 0 0 0 0 30 31 20919 0 0 0 0 0 0 0 1 0 0 0 0 31 32 19429 0 0 0 0 0 0 0 0 1 0 0 0 32 33 21427 0 0 0 0 0 0 0 0 0 1 0 0 33 34 26064 0 0 0 0 0 0 0 0 0 0 1 0 34 35 20109 0 0 0 0 0 0 0 0 0 0 0 1 35 36 15369 0 0 0 0 0 0 0 0 0 0 0 0 36 37 35466 0 1 0 0 0 0 0 0 0 0 0 0 37 38 25954 0 0 1 0 0 0 0 0 0 0 0 0 38 39 33504 0 0 0 1 0 0 0 0 0 0 0 0 39 40 28115 0 0 0 0 1 0 0 0 0 0 0 0 40 41 28501 0 0 0 0 0 1 0 0 0 0 0 0 41 42 28618 0 0 0 0 0 0 1 0 0 0 0 0 42 43 21434 0 0 0 0 0 0 0 1 0 0 0 0 43 44 20177 0 0 0 0 0 0 0 0 1 0 0 0 44 45 21484 0 0 0 0 0 0 0 0 0 1 0 0 45 46 25642 0 0 0 0 0 0 0 0 0 0 1 0 46 47 23515 0 0 0 0 0 0 0 0 0 0 0 1 47 48 12941 0 0 0 0 0 0 0 0 0 0 0 0 48 49 36190 1 1 0 0 0 0 0 0 0 0 0 0 49 50 37785 1 0 1 0 0 0 0 0 0 0 0 0 50 51 38407 1 0 0 1 0 0 0 0 0 0 0 0 51 52 33326 0 0 0 0 1 0 0 0 0 0 0 0 52 53 30304 0 0 0 0 0 1 0 0 0 0 0 0 53 54 27576 0 0 0 0 0 0 1 0 0 0 0 0 54 55 27048 0 0 0 0 0 0 0 1 0 0 0 0 55 56 17291 0 0 0 0 0 0 0 0 1 0 0 0 56 57 21018 0 0 0 0 0 0 0 0 0 1 0 0 57 58 26792 0 0 0 0 0 0 0 0 0 0 1 0 58 59 19426 0 0 0 0 0 0 0 0 0 0 0 1 59 60 13927 0 0 0 0 0 0 0 0 0 0 0 0 60 61 35647 0 1 0 0 0 0 0 0 0 0 0 0 61 62 31746 0 0 1 0 0 0 0 0 0 0 0 0 62 63 31277 0 0 0 1 0 0 0 0 0 0 0 0 63 64 31583 0 0 0 0 1 0 0 0 0 0 0 0 64 65 25607 0 0 0 0 0 1 0 0 0 0 0 0 65 66 28151 0 0 0 0 0 0 1 0 0 0 0 0 66 67 24947 0 0 0 0 0 0 0 1 0 0 0 0 67 68 18077 0 0 0 0 0 0 0 0 1 0 0 0 68 69 23429 0 0 0 0 0 0 0 0 0 1 0 0 69 70 26313 0 0 0 0 0 0 0 0 0 0 1 0 70 71 18862 0 0 0 0 0 0 0 0 0 0 0 1 71 72 14753 0 0 0 0 0 0 0 0 0 0 0 0 72 73 36409 1 1 0 0 0 0 0 0 0 0 0 0 73 74 33163 1 0 1 0 0 0 0 0 0 0 0 0 74 75 34122 1 0 0 1 0 0 0 0 0 0 0 0 75 76 35225 0 0 0 0 1 0 0 0 0 0 0 0 76 77 28249 0 0 0 0 0 1 0 0 0 0 0 0 77 78 30374 0 0 0 0 0 0 1 0 0 0 0 0 78 79 26311 0 0 0 0 0 0 0 1 0 0 0 0 79 80 22069 0 0 0 0 0 0 0 0 1 0 0 0 80 81 23651 0 0 0 0 0 0 0 0 0 1 0 0 81 82 28628 0 0 0 0 0 0 0 0 0 0 1 0 82 83 23187 0 0 0 0 0 0 0 0 0 0 0 1 83 84 14727 0 0 0 0 0 0 0 0 0 0 0 0 84 85 43080 0 1 0 0 0 0 0 0 0 0 0 0 85 86 32519 0 0 1 0 0 0 0 0 0 0 0 0 86 87 39657 0 0 0 1 0 0 0 0 0 0 0 0 87 88 33614 0 0 0 0 1 0 0 0 0 0 0 0 88 89 28671 0 0 0 0 0 1 0 0 0 0 0 0 89 90 34243 0 0 0 0 0 0 1 0 0 0 0 0 90 91 27336 0 0 0 0 0 0 0 1 0 0 0 0 91 92 22916 0 0 0 0 0 0 0 0 1 0 0 0 92 93 24537 0 0 0 0 0 0 0 0 0 1 0 0 93 94 26128 0 0 0 0 0 0 0 0 0 0 1 0 94 95 22602 0 0 0 0 0 0 0 0 0 0 0 1 95 96 15744 0 0 0 0 0 0 0 0 0 0 0 0 96 97 41086 1 1 0 0 0 0 0 0 0 0 0 0 97 98 39690 1 0 1 0 0 0 0 0 0 0 0 0 98 99 43129 1 0 0 1 0 0 0 0 0 0 0 0 99 100 37863 0 0 0 0 1 0 0 0 0 0 0 0 100 101 35953 0 0 0 0 0 1 0 0 0 0 0 0 101 102 29133 0 0 0 0 0 0 1 0 0 0 0 0 102 103 24693 0 0 0 0 0 0 0 1 0 0 0 0 103 104 22205 0 0 0 0 0 0 0 0 1 0 0 0 104 105 21725 0 0 0 0 0 0 0 0 0 1 0 0 105 106 27192 0 0 0 0 0 0 0 0 0 0 1 0 106 107 21790 0 0 0 0 0 0 0 0 0 0 0 1 107 108 13253 0 0 0 0 0 0 0 0 0 0 0 0 108 109 37702 0 1 0 0 0 0 0 0 0 0 0 0 109 110 30364 0 0 1 0 0 0 0 0 0 0 0 0 110 111 32609 0 0 0 1 0 0 0 0 0 0 0 0 111 112 30212 0 0 0 0 1 0 0 0 0 0 0 0 112 113 29965 0 0 0 0 0 1 0 0 0 0 0 0 113 114 28352 0 0 0 0 0 0 1 0 0 0 0 0 114 115 25814 0 0 0 0 0 0 0 1 0 0 0 0 115 116 22414 0 0 0 0 0 0 0 0 1 0 0 0 116 117 20506 0 0 0 0 0 0 0 0 0 1 0 0 117 118 28806 0 0 0 0 0 0 0 0 0 0 1 0 118 119 22228 0 0 0 0 0 0 0 0 0 0 0 1 119 120 13971 0 0 0 0 0 0 0 0 0 0 0 0 120 121 36845 1 1 0 0 0 0 0 0 0 0 0 0 121 122 35338 1 0 1 0 0 0 0 0 0 0 0 0 122 123 35022 1 0 0 1 0 0 0 0 0 0 0 0 123 124 34777 0 0 0 0 1 0 0 0 0 0 0 0 124 125 26887 0 0 0 0 0 1 0 0 0 0 0 0 125 126 23970 0 0 0 0 0 0 1 0 0 0 0 0 126 127 22780 0 0 0 0 0 0 0 1 0 0 0 0 127 128 17351 0 0 0 0 0 0 0 0 1 0 0 0 128 129 21382 0 0 0 0 0 0 0 0 0 1 0 0 129 130 24561 0 0 0 0 0 0 0 0 0 0 1 0 130 131 17409 0 0 0 0 0 0 0 0 0 0 0 1 131 132 11514 0 0 0 0 0 0 0 0 0 0 0 0 132 133 31514 0 1 0 0 0 0 0 0 0 0 0 0 133 134 27071 0 0 1 0 0 0 0 0 0 0 0 0 134 135 29462 0 0 0 1 0 0 0 0 0 0 0 0 135 136 26105 0 0 0 0 1 0 0 0 0 0 0 0 136 137 22397 0 0 0 0 0 1 0 0 0 0 0 0 137 138 23843 0 0 0 0 0 0 1 0 0 0 0 0 138 139 21705 0 0 0 0 0 0 0 1 0 0 0 0 139 140 18089 0 0 0 0 0 0 0 0 1 0 0 0 140 141 20764 0 0 0 0 0 0 0 0 0 1 0 0 141 142 25316 0 0 0 0 0 0 0 0 0 0 1 0 142 143 17704 0 0 0 0 0 0 0 0 0 0 0 1 143 144 15548 0 0 0 0 0 0 0 0 0 0 0 0 144 145 28029 1 1 0 0 0 0 0 0 0 0 0 0 145 146 29383 1 0 1 0 0 0 0 0 0 0 0 0 146 147 36438 1 0 0 1 0 0 0 0 0 0 0 0 147 148 32034 0 0 0 0 1 0 0 0 0 0 0 0 148 149 22679 0 0 0 0 0 1 0 0 0 0 0 0 149 150 24319 0 0 0 0 0 0 1 0 0 0 0 0 150 151 18004 0 0 0 0 0 0 0 1 0 0 0 0 151 152 17537 0 0 0 0 0 0 0 0 1 0 0 0 152 153 20366 0 0 0 0 0 0 0 0 0 1 0 0 153 154 22782 0 0 0 0 0 0 0 0 0 0 1 0 154 155 19169 0 0 0 0 0 0 0 0 0 0 0 1 155 156 13807 0 0 0 0 0 0 0 0 0 0 0 0 156 157 29743 0 1 0 0 0 0 0 0 0 0 0 0 157 158 25591 0 0 1 0 0 0 0 0 0 0 0 0 158 159 29096 0 0 0 1 0 0 0 0 0 0 0 0 159 160 26482 0 0 0 0 1 0 0 0 0 0 0 0 160 161 22405 0 0 0 0 0 1 0 0 0 0 0 0 161 162 27044 0 0 0 0 0 0 1 0 0 0 0 0 162 163 17970 0 0 0 0 0 0 0 1 0 0 0 0 163 164 18730 0 0 0 0 0 0 0 0 1 0 0 0 164 165 19684 0 0 0 0 0 0 0 0 0 1 0 0 165 166 19785 0 0 0 0 0 0 0 0 0 0 1 0 166 167 18479 0 0 0 0 0 0 0 0 0 0 0 1 167 168 10698 0 0 0 0 0 0 0 0 0 0 0 0 168 169 31956 1 1 0 0 0 0 0 0 0 0 0 0 169 170 29506 1 0 1 0 0 0 0 0 0 0 0 0 170 171 34506 1 0 0 1 0 0 0 0 0 0 0 0 171 172 27165 0 0 0 0 1 0 0 0 0 0 0 0 172 173 26736 0 0 0 0 0 1 0 0 0 0 0 0 173 174 23691 0 0 0 0 0 0 1 0 0 0 0 0 174 175 18157 0 0 0 0 0 0 0 1 0 0 0 0 175 176 17328 0 0 0 0 0 0 0 0 1 0 0 0 176 177 18205 0 0 0 0 0 0 0 0 0 1 0 0 177 178 20995 0 0 0 0 0 0 0 0 0 0 1 0 178 179 17382 0 0 0 0 0 0 0 0 0 0 0 1 179 180 9367 0 0 0 0 0 0 0 0 0 0 0 0 180 181 31124 0 1 0 0 0 0 0 0 0 0 0 0 181 182 26551 0 0 1 0 0 0 0 0 0 0 0 0 182 183 30651 0 0 0 1 0 0 0 0 0 0 0 0 183 184 25859 0 0 0 0 1 0 0 0 0 0 0 0 184 185 25100 0 0 0 0 0 1 0 0 0 0 0 0 185 186 25778 0 0 0 0 0 0 1 0 0 0 0 0 186 187 20418 0 0 0 0 0 0 0 1 0 0 0 0 187 188 18688 0 0 0 0 0 0 0 0 1 0 0 0 188 189 20424 0 0 0 0 0 0 0 0 0 1 0 0 189 190 24776 0 0 0 0 0 0 0 0 0 0 1 0 190 191 19814 0 0 0 0 0 0 0 0 0 0 0 1 191 192 12738 0 0 0 0 0 0 0 0 0 0 0 0 192 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Y M1 M2 M3 M4 17757.32 4210.07 19705.80 16071.18 19548.74 18332.46 M5 M6 M7 M8 M9 M10 14708.70 14085.08 9511.01 5891.26 7885.01 11962.07 M11 t 6641.63 -39.81 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7871.7 -2070.6 -186.1 1616.9 18205.0 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 17757.317 923.252 19.233 < 2e-16 *** Y 4210.071 942.146 4.469 1.40e-05 *** M1 19705.804 1244.689 15.832 < 2e-16 *** M2 16071.176 1244.624 12.912 < 2e-16 *** M3 19548.736 1244.573 15.707 < 2e-16 *** M4 18332.457 1152.693 15.904 < 2e-16 *** M5 14708.704 1152.575 12.762 < 2e-16 *** M6 14085.077 1152.473 12.222 < 2e-16 *** M7 9511.012 1152.387 8.253 3.35e-14 *** M8 5891.260 1152.316 5.113 8.16e-07 *** M9 7885.007 1152.261 6.843 1.20e-10 *** M10 11962.067 1152.221 10.382 < 2e-16 *** M11 6641.627 1152.198 5.764 3.55e-08 *** t -39.810 4.258 -9.350 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3259 on 178 degrees of freedom Multiple R-squared: 0.8362, Adjusted R-squared: 0.8243 F-statistic: 69.91 on 13 and 178 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.9551236 8.975284e-02 4.487642e-02 [2,] 0.9997058 5.883765e-04 2.941883e-04 [3,] 0.9999636 7.276360e-05 3.638180e-05 [4,] 0.9999836 3.289588e-05 1.644794e-05 [5,] 0.9999830 3.392272e-05 1.696136e-05 [6,] 0.9999623 7.542761e-05 3.771381e-05 [7,] 0.9999551 8.976261e-05 4.488131e-05 [8,] 0.9999723 5.533959e-05 2.766980e-05 [9,] 0.9999570 8.602625e-05 4.301312e-05 [10,] 0.9999501 9.981689e-05 4.990845e-05 [11,] 0.9999799 4.016861e-05 2.008430e-05 [12,] 0.9999698 6.040670e-05 3.020335e-05 [13,] 0.9999398 1.203471e-04 6.017357e-05 [14,] 0.9999417 1.165744e-04 5.828722e-05 [15,] 0.9999162 1.675639e-04 8.378196e-05 [16,] 0.9999064 1.872213e-04 9.361066e-05 [17,] 0.9998800 2.399176e-04 1.199588e-04 [18,] 0.9998342 3.316218e-04 1.658109e-04 [19,] 0.9998059 3.882637e-04 1.941318e-04 [20,] 0.9998234 3.532037e-04 1.766018e-04 [21,] 0.9998746 2.507391e-04 1.253696e-04 [22,] 0.9998876 2.248224e-04 1.124112e-04 [23,] 0.9998444 3.111526e-04 1.555763e-04 [24,] 0.9998895 2.210652e-04 1.105326e-04 [25,] 0.9998198 3.603495e-04 1.801747e-04 [26,] 0.9998008 3.984389e-04 1.992195e-04 [27,] 0.9997771 4.457272e-04 2.228636e-04 [28,] 0.9998154 3.692123e-04 1.846062e-04 [29,] 0.9998119 3.762681e-04 1.881341e-04 [30,] 0.9997816 4.367970e-04 2.183985e-04 [31,] 0.9998815 2.370664e-04 1.185332e-04 [32,] 0.9998662 2.676344e-04 1.338172e-04 [33,] 0.9998231 3.537652e-04 1.768826e-04 [34,] 0.9998729 2.541082e-04 1.270541e-04 [35,] 0.9998026 3.948999e-04 1.974499e-04 [36,] 0.9997391 5.218726e-04 2.609363e-04 [37,] 0.9996227 7.546309e-04 3.773155e-04 [38,] 0.9995358 9.284730e-04 4.642365e-04 [39,] 0.9997291 5.417645e-04 2.708823e-04 [40,] 0.9997616 4.768528e-04 2.384264e-04 [41,] 0.9997488 5.024684e-04 2.512342e-04 [42,] 0.9997168 5.664103e-04 2.832051e-04 [43,] 0.9996918 6.164895e-04 3.082448e-04 [44,] 0.9996731 6.537060e-04 3.268530e-04 [45,] 0.9997476 5.047447e-04 2.523723e-04 [46,] 0.9997473 5.054710e-04 2.527355e-04 [47,] 0.9997755 4.490000e-04 2.245000e-04 [48,] 0.9997117 5.766995e-04 2.883497e-04 [49,] 0.9997705 4.590335e-04 2.295167e-04 [50,] 0.9997340 5.319246e-04 2.659623e-04 [51,] 0.9996996 6.008584e-04 3.004292e-04 [52,] 0.9997798 4.404963e-04 2.202482e-04 [53,] 0.9997922 4.156111e-04 2.078055e-04 [54,] 0.9997631 4.738028e-04 2.369014e-04 [55,] 0.9998122 3.755520e-04 1.877760e-04 [56,] 0.9998104 3.792428e-04 1.896214e-04 [57,] 0.9997841 4.318065e-04 2.159033e-04 [58,] 0.9997376 5.248619e-04 2.624310e-04 [59,] 0.9998608 2.783421e-04 1.391710e-04 [60,] 0.9998557 2.886225e-04 1.443113e-04 [61,] 0.9998201 3.598681e-04 1.799340e-04 [62,] 0.9998145 3.709399e-04 1.854699e-04 [63,] 0.9998088 3.823070e-04 1.911535e-04 [64,] 0.9998464 3.071287e-04 1.535644e-04 [65,] 0.9998380 3.240346e-04 1.620173e-04 [66,] 0.9998251 3.498146e-04 1.749073e-04 [67,] 0.9998266 3.467130e-04 1.733565e-04 [68,] 0.9998104 3.791841e-04 1.895921e-04 [69,] 0.9999913 1.730672e-05 8.653358e-06 [70,] 0.9999883 2.341269e-05 1.170634e-05 [71,] 0.9999948 1.039566e-05 5.197829e-06 [72,] 0.9999916 1.685572e-05 8.427858e-06 [73,] 0.9999874 2.526627e-05 1.263313e-05 [74,] 0.9999949 1.021850e-05 5.109251e-06 [75,] 0.9999945 1.097250e-05 5.486251e-06 [76,] 0.9999934 1.322370e-05 6.611852e-06 [77,] 0.9999909 1.828793e-05 9.143967e-06 [78,] 0.9999866 2.682691e-05 1.341346e-05 [79,] 0.9999806 3.887529e-05 1.943764e-05 [80,] 0.9999717 5.654365e-05 2.827182e-05 [81,] 0.9999686 6.272833e-05 3.136417e-05 [82,] 0.9999854 2.918690e-05 1.459345e-05 [83,] 0.9999945 1.104597e-05 5.522984e-06 [84,] 0.9999984 3.273121e-06 1.636560e-06 [85,] 0.9999999 1.385404e-07 6.927019e-08 [86,] 0.9999999 2.342958e-07 1.171479e-07 [87,] 0.9999998 3.809482e-07 1.904741e-07 [88,] 0.9999997 5.825134e-07 2.912567e-07 [89,] 0.9999995 1.019298e-06 5.096491e-07 [90,] 0.9999991 1.732110e-06 8.660548e-07 [91,] 0.9999985 2.980888e-06 1.490444e-06 [92,] 0.9999977 4.584478e-06 2.292239e-06 [93,] 0.9999993 1.452261e-06 7.261307e-07 [94,] 0.9999988 2.385697e-06 1.192849e-06 [95,] 0.9999980 4.069404e-06 2.034702e-06 [96,] 0.9999970 6.034355e-06 3.017177e-06 [97,] 0.9999974 5.159735e-06 2.579868e-06 [98,] 0.9999962 7.589449e-06 3.794724e-06 [99,] 0.9999976 4.757106e-06 2.378553e-06 [100,] 0.9999977 4.688981e-06 2.344490e-06 [101,] 0.9999961 7.725506e-06 3.862753e-06 [102,] 0.9999979 4.172125e-06 2.086062e-06 [103,] 0.9999977 4.693139e-06 2.346569e-06 [104,] 0.9999959 8.262834e-06 4.131417e-06 [105,] 0.9999965 6.948378e-06 3.474189e-06 [106,] 0.9999988 2.445951e-06 1.222975e-06 [107,] 0.9999981 3.779740e-06 1.889870e-06 [108,] 0.9999999 2.436739e-07 1.218369e-07 [109,] 0.9999999 2.319988e-07 1.159994e-07 [110,] 0.9999998 3.245189e-07 1.622595e-07 [111,] 0.9999999 2.462831e-07 1.231416e-07 [112,] 0.9999998 4.489338e-07 2.244669e-07 [113,] 0.9999996 7.684819e-07 3.842410e-07 [114,] 0.9999994 1.148235e-06 5.741177e-07 [115,] 0.9999990 1.906699e-06 9.533496e-07 [116,] 0.9999983 3.375425e-06 1.687713e-06 [117,] 0.9999982 3.518972e-06 1.759486e-06 [118,] 0.9999970 5.993221e-06 2.996611e-06 [119,] 0.9999958 8.356195e-06 4.178098e-06 [120,] 0.9999957 8.665375e-06 4.332687e-06 [121,] 0.9999956 8.837592e-06 4.418796e-06 [122,] 0.9999936 1.281963e-05 6.409815e-06 [123,] 0.9999934 1.323222e-05 6.616111e-06 [124,] 0.9999871 2.577250e-05 1.288625e-05 [125,] 0.9999769 4.610290e-05 2.305145e-05 [126,] 0.9999803 3.946979e-05 1.973490e-05 [127,] 0.9999648 7.049578e-05 3.524789e-05 [128,] 0.9999842 3.160919e-05 1.580459e-05 [129,] 0.9999981 3.863698e-06 1.931849e-06 [130,] 0.9999962 7.584418e-06 3.792209e-06 [131,] 0.9999963 7.306216e-06 3.653108e-06 [132,] 0.9999999 1.917796e-07 9.588980e-08 [133,] 0.9999998 3.061668e-07 1.530834e-07 [134,] 0.9999996 7.197560e-07 3.598780e-07 [135,] 0.9999992 1.611831e-06 8.059155e-07 [136,] 0.9999980 3.957047e-06 1.978524e-06 [137,] 0.9999964 7.229425e-06 3.614712e-06 [138,] 0.9999938 1.238913e-05 6.194564e-06 [139,] 0.9999887 2.266563e-05 1.133281e-05 [140,] 0.9999974 5.175932e-06 2.587966e-06 [141,] 0.9999940 1.192073e-05 5.960363e-06 [142,] 0.9999853 2.948445e-05 1.474223e-05 [143,] 0.9999661 6.775281e-05 3.387641e-05 [144,] 0.9999315 1.369610e-04 6.848048e-05 [145,] 0.9999293 1.414950e-04 7.074749e-05 [146,] 0.9999661 6.780235e-05 3.390118e-05 [147,] 0.9999109 1.782832e-04 8.914159e-05 [148,] 0.9998803 2.393888e-04 1.196944e-04 [149,] 0.9998331 3.337133e-04 1.668566e-04 [150,] 0.9996802 6.395927e-04 3.197964e-04 [151,] 0.9994256 1.148822e-03 5.744110e-04 [152,] 0.9990759 1.848107e-03 9.240535e-04 [153,] 0.9985708 2.858302e-03 1.429151e-03 [154,] 0.9961937 7.612646e-03 3.806323e-03 [155,] 0.9897942 2.041170e-02 1.020585e-02 [156,] 0.9912611 1.747780e-02 8.738902e-03 [157,] 0.9993517 1.296565e-03 6.482823e-04 [158,] 0.9966814 6.637278e-03 3.318639e-03 [159,] 0.9833823 3.323545e-02 1.661773e-02 > postscript(file="/var/www/html/rcomp/tmp/18dku1229182492.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/2p9xh1229182492.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/353yv1229182492.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/40dex1229182492.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/5n0e31229182492.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 = 192 Frequency = 1 1 2 3 4 5 6 4768.618854 7370.056354 788.306354 13410.466630 18205.029130 1416.466630 7 8 9 10 11 12 2577.341630 -460.095870 445.966630 3287.716630 -425.033370 -2144.595870 13 14 15 16 17 18 -169.589479 -3289.151979 1353.098021 -1226.812254 -6883.249754 -892.812254 19 20 21 22 23 24 893.062746 -2068.374754 -1920.312254 -3418.562254 -2645.312254 -1146.874754 25 26 27 28 29 30 -3519.938913 -639.501413 2771.748587 -3340.091138 -1198.528638 -663.091138 31 32 33 34 35 36 -5115.216138 -2945.653638 -2901.591138 -2301.841138 -2896.591138 -955.153638 37 38 39 40 41 42 -524.147247 -6361.709747 -2249.459747 -6382.370022 -2332.807522 -1552.370022 43 44 45 46 47 48 -4122.495022 -1719.932522 -2366.870022 -2246.120022 987.129978 -2905.432522 49 50 51 52 53 54 -3532.496681 1736.940819 -1078.809181 -693.648906 -52.086406 -2116.648906 55 56 57 58 59 60 1969.226094 -4128.211406 -2355.148906 -618.398906 -2624.148906 -1441.711406 61 62 63 64 65 66 612.294985 385.732485 -3521.017515 -1958.927790 -4271.365290 -1063.927790 67 68 69 70 71 72 345.947210 -2864.490290 533.572210 -619.677790 -2710.427790 -137.990290 73 74 75 76 77 78 -2358.054449 -1929.616949 -4408.366949 2160.793326 -1151.644174 1636.793326 79 80 81 82 83 84 2187.668326 1605.230826 1233.293326 2173.043326 2092.293326 313.730826 85 86 87 88 89 90 9000.737217 2114.174717 5814.424717 1027.514442 -251.923058 5983.514442 91 92 93 94 95 96 3690.389442 2929.951942 2597.014442 150.764442 1985.014442 1808.451942 97 98 99 100 101 102 3274.387783 5552.825283 5554.075283 5754.235558 7507.798058 1351.235558 103 104 105 106 107 108 1525.110558 2696.673058 262.735558 1692.485558 1650.735558 -204.826942 109 110 111 112 113 114 4578.179449 914.616949 -278.133051 -1419.043326 1997.519174 1047.956674 115 116 117 118 119 120 3123.831674 3383.394174 -478.543326 3784.206674 2566.456674 990.894174 121 122 123 124 125 126 -11.169985 2156.267515 -1597.482485 3623.677790 -602.759710 -2856.322210 127 128 129 130 131 132 567.552790 -1201.884710 875.177790 16.927790 -1774.822210 -988.384710 133 134 135 136 137 138 -654.378319 -1422.940819 -2469.690819 -4570.601094 -4615.038594 -2505.601094 139 140 141 142 143 144 -29.726094 13.836406 734.898906 1249.648906 -1002.101094 3523.336406 145 146 147 148 149 150 -7871.727753 -2843.290253 773.959747 1836.120022 -3855.317478 -1551.879978 151 152 153 154 155 156 -3253.004978 -60.442478 814.620022 -806.629978 940.620022 2260.057522 157 158 159 160 161 162 -1469.936087 -1947.498587 -1880.248587 -3238.158862 -3651.596362 1650.841138 163 164 165 166 167 168 -2809.283862 1610.278638 610.341138 -3325.908862 728.341138 -371.221362 169 170 171 172 173 174 -2989.285521 -1764.848021 -202.598021 -2077.437746 1157.124754 -1224.437746 175 176 177 178 179 180 -2144.562746 685.999754 -390.937746 -1638.187746 109.062254 -1224.500246 181 182 183 184 185 186 866.506146 -32.056354 630.193646 -2905.716630 -1.154130 1340.283370 187 188 189 190 191 192 594.158370 2523.720870 2305.783370 2620.533370 3018.783370 2624.220870 > postscript(file="/var/www/html/rcomp/tmp/6ohiw1229182492.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 = 192 Frequency = 1 lag(myerror, k = 1) myerror 0 4768.618854 NA 1 7370.056354 4768.618854 2 788.306354 7370.056354 3 13410.466630 788.306354 4 18205.029130 13410.466630 5 1416.466630 18205.029130 6 2577.341630 1416.466630 7 -460.095870 2577.341630 8 445.966630 -460.095870 9 3287.716630 445.966630 10 -425.033370 3287.716630 11 -2144.595870 -425.033370 12 -169.589479 -2144.595870 13 -3289.151979 -169.589479 14 1353.098021 -3289.151979 15 -1226.812254 1353.098021 16 -6883.249754 -1226.812254 17 -892.812254 -6883.249754 18 893.062746 -892.812254 19 -2068.374754 893.062746 20 -1920.312254 -2068.374754 21 -3418.562254 -1920.312254 22 -2645.312254 -3418.562254 23 -1146.874754 -2645.312254 24 -3519.938913 -1146.874754 25 -639.501413 -3519.938913 26 2771.748587 -639.501413 27 -3340.091138 2771.748587 28 -1198.528638 -3340.091138 29 -663.091138 -1198.528638 30 -5115.216138 -663.091138 31 -2945.653638 -5115.216138 32 -2901.591138 -2945.653638 33 -2301.841138 -2901.591138 34 -2896.591138 -2301.841138 35 -955.153638 -2896.591138 36 -524.147247 -955.153638 37 -6361.709747 -524.147247 38 -2249.459747 -6361.709747 39 -6382.370022 -2249.459747 40 -2332.807522 -6382.370022 41 -1552.370022 -2332.807522 42 -4122.495022 -1552.370022 43 -1719.932522 -4122.495022 44 -2366.870022 -1719.932522 45 -2246.120022 -2366.870022 46 987.129978 -2246.120022 47 -2905.432522 987.129978 48 -3532.496681 -2905.432522 49 1736.940819 -3532.496681 50 -1078.809181 1736.940819 51 -693.648906 -1078.809181 52 -52.086406 -693.648906 53 -2116.648906 -52.086406 54 1969.226094 -2116.648906 55 -4128.211406 1969.226094 56 -2355.148906 -4128.211406 57 -618.398906 -2355.148906 58 -2624.148906 -618.398906 59 -1441.711406 -2624.148906 60 612.294985 -1441.711406 61 385.732485 612.294985 62 -3521.017515 385.732485 63 -1958.927790 -3521.017515 64 -4271.365290 -1958.927790 65 -1063.927790 -4271.365290 66 345.947210 -1063.927790 67 -2864.490290 345.947210 68 533.572210 -2864.490290 69 -619.677790 533.572210 70 -2710.427790 -619.677790 71 -137.990290 -2710.427790 72 -2358.054449 -137.990290 73 -1929.616949 -2358.054449 74 -4408.366949 -1929.616949 75 2160.793326 -4408.366949 76 -1151.644174 2160.793326 77 1636.793326 -1151.644174 78 2187.668326 1636.793326 79 1605.230826 2187.668326 80 1233.293326 1605.230826 81 2173.043326 1233.293326 82 2092.293326 2173.043326 83 313.730826 2092.293326 84 9000.737217 313.730826 85 2114.174717 9000.737217 86 5814.424717 2114.174717 87 1027.514442 5814.424717 88 -251.923058 1027.514442 89 5983.514442 -251.923058 90 3690.389442 5983.514442 91 2929.951942 3690.389442 92 2597.014442 2929.951942 93 150.764442 2597.014442 94 1985.014442 150.764442 95 1808.451942 1985.014442 96 3274.387783 1808.451942 97 5552.825283 3274.387783 98 5554.075283 5552.825283 99 5754.235558 5554.075283 100 7507.798058 5754.235558 101 1351.235558 7507.798058 102 1525.110558 1351.235558 103 2696.673058 1525.110558 104 262.735558 2696.673058 105 1692.485558 262.735558 106 1650.735558 1692.485558 107 -204.826942 1650.735558 108 4578.179449 -204.826942 109 914.616949 4578.179449 110 -278.133051 914.616949 111 -1419.043326 -278.133051 112 1997.519174 -1419.043326 113 1047.956674 1997.519174 114 3123.831674 1047.956674 115 3383.394174 3123.831674 116 -478.543326 3383.394174 117 3784.206674 -478.543326 118 2566.456674 3784.206674 119 990.894174 2566.456674 120 -11.169985 990.894174 121 2156.267515 -11.169985 122 -1597.482485 2156.267515 123 3623.677790 -1597.482485 124 -602.759710 3623.677790 125 -2856.322210 -602.759710 126 567.552790 -2856.322210 127 -1201.884710 567.552790 128 875.177790 -1201.884710 129 16.927790 875.177790 130 -1774.822210 16.927790 131 -988.384710 -1774.822210 132 -654.378319 -988.384710 133 -1422.940819 -654.378319 134 -2469.690819 -1422.940819 135 -4570.601094 -2469.690819 136 -4615.038594 -4570.601094 137 -2505.601094 -4615.038594 138 -29.726094 -2505.601094 139 13.836406 -29.726094 140 734.898906 13.836406 141 1249.648906 734.898906 142 -1002.101094 1249.648906 143 3523.336406 -1002.101094 144 -7871.727753 3523.336406 145 -2843.290253 -7871.727753 146 773.959747 -2843.290253 147 1836.120022 773.959747 148 -3855.317478 1836.120022 149 -1551.879978 -3855.317478 150 -3253.004978 -1551.879978 151 -60.442478 -3253.004978 152 814.620022 -60.442478 153 -806.629978 814.620022 154 940.620022 -806.629978 155 2260.057522 940.620022 156 -1469.936087 2260.057522 157 -1947.498587 -1469.936087 158 -1880.248587 -1947.498587 159 -3238.158862 -1880.248587 160 -3651.596362 -3238.158862 161 1650.841138 -3651.596362 162 -2809.283862 1650.841138 163 1610.278638 -2809.283862 164 610.341138 1610.278638 165 -3325.908862 610.341138 166 728.341138 -3325.908862 167 -371.221362 728.341138 168 -2989.285521 -371.221362 169 -1764.848021 -2989.285521 170 -202.598021 -1764.848021 171 -2077.437746 -202.598021 172 1157.124754 -2077.437746 173 -1224.437746 1157.124754 174 -2144.562746 -1224.437746 175 685.999754 -2144.562746 176 -390.937746 685.999754 177 -1638.187746 -390.937746 178 109.062254 -1638.187746 179 -1224.500246 109.062254 180 866.506146 -1224.500246 181 -32.056354 866.506146 182 630.193646 -32.056354 183 -2905.716630 630.193646 184 -1.154130 -2905.716630 185 1340.283370 -1.154130 186 594.158370 1340.283370 187 2523.720870 594.158370 188 2305.783370 2523.720870 189 2620.533370 2305.783370 190 3018.783370 2620.533370 191 2624.220870 3018.783370 192 NA 2624.220870 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 7370.056354 4768.618854 [2,] 788.306354 7370.056354 [3,] 13410.466630 788.306354 [4,] 18205.029130 13410.466630 [5,] 1416.466630 18205.029130 [6,] 2577.341630 1416.466630 [7,] -460.095870 2577.341630 [8,] 445.966630 -460.095870 [9,] 3287.716630 445.966630 [10,] -425.033370 3287.716630 [11,] -2144.595870 -425.033370 [12,] -169.589479 -2144.595870 [13,] -3289.151979 -169.589479 [14,] 1353.098021 -3289.151979 [15,] -1226.812254 1353.098021 [16,] -6883.249754 -1226.812254 [17,] -892.812254 -6883.249754 [18,] 893.062746 -892.812254 [19,] -2068.374754 893.062746 [20,] -1920.312254 -2068.374754 [21,] -3418.562254 -1920.312254 [22,] -2645.312254 -3418.562254 [23,] -1146.874754 -2645.312254 [24,] -3519.938913 -1146.874754 [25,] -639.501413 -3519.938913 [26,] 2771.748587 -639.501413 [27,] -3340.091138 2771.748587 [28,] -1198.528638 -3340.091138 [29,] -663.091138 -1198.528638 [30,] -5115.216138 -663.091138 [31,] -2945.653638 -5115.216138 [32,] -2901.591138 -2945.653638 [33,] -2301.841138 -2901.591138 [34,] -2896.591138 -2301.841138 [35,] -955.153638 -2896.591138 [36,] -524.147247 -955.153638 [37,] -6361.709747 -524.147247 [38,] -2249.459747 -6361.709747 [39,] -6382.370022 -2249.459747 [40,] -2332.807522 -6382.370022 [41,] -1552.370022 -2332.807522 [42,] -4122.495022 -1552.370022 [43,] -1719.932522 -4122.495022 [44,] -2366.870022 -1719.932522 [45,] -2246.120022 -2366.870022 [46,] 987.129978 -2246.120022 [47,] -2905.432522 987.129978 [48,] -3532.496681 -2905.432522 [49,] 1736.940819 -3532.496681 [50,] -1078.809181 1736.940819 [51,] -693.648906 -1078.809181 [52,] -52.086406 -693.648906 [53,] -2116.648906 -52.086406 [54,] 1969.226094 -2116.648906 [55,] -4128.211406 1969.226094 [56,] -2355.148906 -4128.211406 [57,] -618.398906 -2355.148906 [58,] -2624.148906 -618.398906 [59,] -1441.711406 -2624.148906 [60,] 612.294985 -1441.711406 [61,] 385.732485 612.294985 [62,] -3521.017515 385.732485 [63,] -1958.927790 -3521.017515 [64,] -4271.365290 -1958.927790 [65,] -1063.927790 -4271.365290 [66,] 345.947210 -1063.927790 [67,] -2864.490290 345.947210 [68,] 533.572210 -2864.490290 [69,] -619.677790 533.572210 [70,] -2710.427790 -619.677790 [71,] -137.990290 -2710.427790 [72,] -2358.054449 -137.990290 [73,] -1929.616949 -2358.054449 [74,] -4408.366949 -1929.616949 [75,] 2160.793326 -4408.366949 [76,] -1151.644174 2160.793326 [77,] 1636.793326 -1151.644174 [78,] 2187.668326 1636.793326 [79,] 1605.230826 2187.668326 [80,] 1233.293326 1605.230826 [81,] 2173.043326 1233.293326 [82,] 2092.293326 2173.043326 [83,] 313.730826 2092.293326 [84,] 9000.737217 313.730826 [85,] 2114.174717 9000.737217 [86,] 5814.424717 2114.174717 [87,] 1027.514442 5814.424717 [88,] -251.923058 1027.514442 [89,] 5983.514442 -251.923058 [90,] 3690.389442 5983.514442 [91,] 2929.951942 3690.389442 [92,] 2597.014442 2929.951942 [93,] 150.764442 2597.014442 [94,] 1985.014442 150.764442 [95,] 1808.451942 1985.014442 [96,] 3274.387783 1808.451942 [97,] 5552.825283 3274.387783 [98,] 5554.075283 5552.825283 [99,] 5754.235558 5554.075283 [100,] 7507.798058 5754.235558 [101,] 1351.235558 7507.798058 [102,] 1525.110558 1351.235558 [103,] 2696.673058 1525.110558 [104,] 262.735558 2696.673058 [105,] 1692.485558 262.735558 [106,] 1650.735558 1692.485558 [107,] -204.826942 1650.735558 [108,] 4578.179449 -204.826942 [109,] 914.616949 4578.179449 [110,] -278.133051 914.616949 [111,] -1419.043326 -278.133051 [112,] 1997.519174 -1419.043326 [113,] 1047.956674 1997.519174 [114,] 3123.831674 1047.956674 [115,] 3383.394174 3123.831674 [116,] -478.543326 3383.394174 [117,] 3784.206674 -478.543326 [118,] 2566.456674 3784.206674 [119,] 990.894174 2566.456674 [120,] -11.169985 990.894174 [121,] 2156.267515 -11.169985 [122,] -1597.482485 2156.267515 [123,] 3623.677790 -1597.482485 [124,] -602.759710 3623.677790 [125,] -2856.322210 -602.759710 [126,] 567.552790 -2856.322210 [127,] -1201.884710 567.552790 [128,] 875.177790 -1201.884710 [129,] 16.927790 875.177790 [130,] -1774.822210 16.927790 [131,] -988.384710 -1774.822210 [132,] -654.378319 -988.384710 [133,] -1422.940819 -654.378319 [134,] -2469.690819 -1422.940819 [135,] -4570.601094 -2469.690819 [136,] -4615.038594 -4570.601094 [137,] -2505.601094 -4615.038594 [138,] -29.726094 -2505.601094 [139,] 13.836406 -29.726094 [140,] 734.898906 13.836406 [141,] 1249.648906 734.898906 [142,] -1002.101094 1249.648906 [143,] 3523.336406 -1002.101094 [144,] -7871.727753 3523.336406 [145,] -2843.290253 -7871.727753 [146,] 773.959747 -2843.290253 [147,] 1836.120022 773.959747 [148,] -3855.317478 1836.120022 [149,] -1551.879978 -3855.317478 [150,] -3253.004978 -1551.879978 [151,] -60.442478 -3253.004978 [152,] 814.620022 -60.442478 [153,] -806.629978 814.620022 [154,] 940.620022 -806.629978 [155,] 2260.057522 940.620022 [156,] -1469.936087 2260.057522 [157,] -1947.498587 -1469.936087 [158,] -1880.248587 -1947.498587 [159,] -3238.158862 -1880.248587 [160,] -3651.596362 -3238.158862 [161,] 1650.841138 -3651.596362 [162,] -2809.283862 1650.841138 [163,] 1610.278638 -2809.283862 [164,] 610.341138 1610.278638 [165,] -3325.908862 610.341138 [166,] 728.341138 -3325.908862 [167,] -371.221362 728.341138 [168,] -2989.285521 -371.221362 [169,] -1764.848021 -2989.285521 [170,] -202.598021 -1764.848021 [171,] -2077.437746 -202.598021 [172,] 1157.124754 -2077.437746 [173,] -1224.437746 1157.124754 [174,] -2144.562746 -1224.437746 [175,] 685.999754 -2144.562746 [176,] -390.937746 685.999754 [177,] -1638.187746 -390.937746 [178,] 109.062254 -1638.187746 [179,] -1224.500246 109.062254 [180,] 866.506146 -1224.500246 [181,] -32.056354 866.506146 [182,] 630.193646 -32.056354 [183,] -2905.716630 630.193646 [184,] -1.154130 -2905.716630 [185,] 1340.283370 -1.154130 [186,] 594.158370 1340.283370 [187,] 2523.720870 594.158370 [188,] 2305.783370 2523.720870 [189,] 2620.533370 2305.783370 [190,] 3018.783370 2620.533370 [191,] 2624.220870 3018.783370 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 7370.056354 4768.618854 2 788.306354 7370.056354 3 13410.466630 788.306354 4 18205.029130 13410.466630 5 1416.466630 18205.029130 6 2577.341630 1416.466630 7 -460.095870 2577.341630 8 445.966630 -460.095870 9 3287.716630 445.966630 10 -425.033370 3287.716630 11 -2144.595870 -425.033370 12 -169.589479 -2144.595870 13 -3289.151979 -169.589479 14 1353.098021 -3289.151979 15 -1226.812254 1353.098021 16 -6883.249754 -1226.812254 17 -892.812254 -6883.249754 18 893.062746 -892.812254 19 -2068.374754 893.062746 20 -1920.312254 -2068.374754 21 -3418.562254 -1920.312254 22 -2645.312254 -3418.562254 23 -1146.874754 -2645.312254 24 -3519.938913 -1146.874754 25 -639.501413 -3519.938913 26 2771.748587 -639.501413 27 -3340.091138 2771.748587 28 -1198.528638 -3340.091138 29 -663.091138 -1198.528638 30 -5115.216138 -663.091138 31 -2945.653638 -5115.216138 32 -2901.591138 -2945.653638 33 -2301.841138 -2901.591138 34 -2896.591138 -2301.841138 35 -955.153638 -2896.591138 36 -524.147247 -955.153638 37 -6361.709747 -524.147247 38 -2249.459747 -6361.709747 39 -6382.370022 -2249.459747 40 -2332.807522 -6382.370022 41 -1552.370022 -2332.807522 42 -4122.495022 -1552.370022 43 -1719.932522 -4122.495022 44 -2366.870022 -1719.932522 45 -2246.120022 -2366.870022 46 987.129978 -2246.120022 47 -2905.432522 987.129978 48 -3532.496681 -2905.432522 49 1736.940819 -3532.496681 50 -1078.809181 1736.940819 51 -693.648906 -1078.809181 52 -52.086406 -693.648906 53 -2116.648906 -52.086406 54 1969.226094 -2116.648906 55 -4128.211406 1969.226094 56 -2355.148906 -4128.211406 57 -618.398906 -2355.148906 58 -2624.148906 -618.398906 59 -1441.711406 -2624.148906 60 612.294985 -1441.711406 61 385.732485 612.294985 62 -3521.017515 385.732485 63 -1958.927790 -3521.017515 64 -4271.365290 -1958.927790 65 -1063.927790 -4271.365290 66 345.947210 -1063.927790 67 -2864.490290 345.947210 68 533.572210 -2864.490290 69 -619.677790 533.572210 70 -2710.427790 -619.677790 71 -137.990290 -2710.427790 72 -2358.054449 -137.990290 73 -1929.616949 -2358.054449 74 -4408.366949 -1929.616949 75 2160.793326 -4408.366949 76 -1151.644174 2160.793326 77 1636.793326 -1151.644174 78 2187.668326 1636.793326 79 1605.230826 2187.668326 80 1233.293326 1605.230826 81 2173.043326 1233.293326 82 2092.293326 2173.043326 83 313.730826 2092.293326 84 9000.737217 313.730826 85 2114.174717 9000.737217 86 5814.424717 2114.174717 87 1027.514442 5814.424717 88 -251.923058 1027.514442 89 5983.514442 -251.923058 90 3690.389442 5983.514442 91 2929.951942 3690.389442 92 2597.014442 2929.951942 93 150.764442 2597.014442 94 1985.014442 150.764442 95 1808.451942 1985.014442 96 3274.387783 1808.451942 97 5552.825283 3274.387783 98 5554.075283 5552.825283 99 5754.235558 5554.075283 100 7507.798058 5754.235558 101 1351.235558 7507.798058 102 1525.110558 1351.235558 103 2696.673058 1525.110558 104 262.735558 2696.673058 105 1692.485558 262.735558 106 1650.735558 1692.485558 107 -204.826942 1650.735558 108 4578.179449 -204.826942 109 914.616949 4578.179449 110 -278.133051 914.616949 111 -1419.043326 -278.133051 112 1997.519174 -1419.043326 113 1047.956674 1997.519174 114 3123.831674 1047.956674 115 3383.394174 3123.831674 116 -478.543326 3383.394174 117 3784.206674 -478.543326 118 2566.456674 3784.206674 119 990.894174 2566.456674 120 -11.169985 990.894174 121 2156.267515 -11.169985 122 -1597.482485 2156.267515 123 3623.677790 -1597.482485 124 -602.759710 3623.677790 125 -2856.322210 -602.759710 126 567.552790 -2856.322210 127 -1201.884710 567.552790 128 875.177790 -1201.884710 129 16.927790 875.177790 130 -1774.822210 16.927790 131 -988.384710 -1774.822210 132 -654.378319 -988.384710 133 -1422.940819 -654.378319 134 -2469.690819 -1422.940819 135 -4570.601094 -2469.690819 136 -4615.038594 -4570.601094 137 -2505.601094 -4615.038594 138 -29.726094 -2505.601094 139 13.836406 -29.726094 140 734.898906 13.836406 141 1249.648906 734.898906 142 -1002.101094 1249.648906 143 3523.336406 -1002.101094 144 -7871.727753 3523.336406 145 -2843.290253 -7871.727753 146 773.959747 -2843.290253 147 1836.120022 773.959747 148 -3855.317478 1836.120022 149 -1551.879978 -3855.317478 150 -3253.004978 -1551.879978 151 -60.442478 -3253.004978 152 814.620022 -60.442478 153 -806.629978 814.620022 154 940.620022 -806.629978 155 2260.057522 940.620022 156 -1469.936087 2260.057522 157 -1947.498587 -1469.936087 158 -1880.248587 -1947.498587 159 -3238.158862 -1880.248587 160 -3651.596362 -3238.158862 161 1650.841138 -3651.596362 162 -2809.283862 1650.841138 163 1610.278638 -2809.283862 164 610.341138 1610.278638 165 -3325.908862 610.341138 166 728.341138 -3325.908862 167 -371.221362 728.341138 168 -2989.285521 -371.221362 169 -1764.848021 -2989.285521 170 -202.598021 -1764.848021 171 -2077.437746 -202.598021 172 1157.124754 -2077.437746 173 -1224.437746 1157.124754 174 -2144.562746 -1224.437746 175 685.999754 -2144.562746 176 -390.937746 685.999754 177 -1638.187746 -390.937746 178 109.062254 -1638.187746 179 -1224.500246 109.062254 180 866.506146 -1224.500246 181 -32.056354 866.506146 182 630.193646 -32.056354 183 -2905.716630 630.193646 184 -1.154130 -2905.716630 185 1340.283370 -1.154130 186 594.158370 1340.283370 187 2523.720870 594.158370 188 2305.783370 2523.720870 189 2620.533370 2305.783370 190 3018.783370 2620.533370 191 2624.220870 3018.783370 > 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/7d9j81229182493.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/803dh1229182493.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/9d74c1229182493.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/10ymfp1229182493.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/11v5c91229182493.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/12kg871229182493.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/13amm01229182493.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/14nnex1229182493.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/15dw7z1229182493.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/16u6521229182493.tab") + } > > system("convert tmp/18dku1229182492.ps tmp/18dku1229182492.png") > system("convert tmp/2p9xh1229182492.ps tmp/2p9xh1229182492.png") > system("convert tmp/353yv1229182492.ps tmp/353yv1229182492.png") > system("convert tmp/40dex1229182492.ps tmp/40dex1229182492.png") > system("convert tmp/5n0e31229182492.ps tmp/5n0e31229182492.png") > system("convert tmp/6ohiw1229182492.ps tmp/6ohiw1229182492.png") > system("convert tmp/7d9j81229182493.ps tmp/7d9j81229182493.png") > system("convert tmp/803dh1229182493.ps tmp/803dh1229182493.png") > system("convert tmp/9d74c1229182493.ps tmp/9d74c1229182493.png") > system("convert tmp/10ymfp1229182493.ps tmp/10ymfp1229182493.png") > > > proc.time() user system elapsed 4.877 1.754 5.395