R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(140824 + ,186099 + ,32033 + ,165 + ,165 + ,130 + ,279055 + ,110459 + ,113854 + ,20654 + ,135 + ,132 + ,143 + ,212408 + ,105079 + ,99776 + ,16346 + ,121 + ,121 + ,118 + ,233939 + ,112098 + ,106194 + ,35926 + ,148 + ,145 + ,146 + ,222117 + ,43929 + ,100792 + ,10621 + ,73 + ,71 + ,73 + ,179751 + ,76173 + ,47552 + ,10024 + ,49 + ,47 + ,89 + ,70849 + ,187326 + ,250931 + ,43068 + ,185 + ,177 + ,146 + ,599777 + ,22807 + ,6853 + ,1271 + ,5 + ,5 + ,22 + ,33186 + ,144408 + ,115466 + ,34416 + ,125 + ,124 + ,132 + ,227332 + ,66485 + ,110896 + ,20318 + ,93 + ,92 + ,92 + ,258874 + ,79089 + ,169351 + ,24409 + ,154 + ,149 + ,147 + ,359064 + ,81625 + ,94853 + ,20648 + ,98 + ,93 + ,203 + ,264989 + ,68788 + ,72591 + ,12347 + ,70 + ,70 + ,113 + ,209202 + ,103297 + ,101345 + ,21857 + ,148 + ,148 + ,171 + ,368577 + ,69446 + ,113713 + ,11034 + ,100 + ,100 + ,87 + ,269455 + ,114948 + ,165354 + ,33433 + ,150 + ,142 + ,208 + ,397286 + ,167949 + ,164263 + ,35902 + ,197 + ,194 + ,153 + ,335567 + ,125081 + ,135213 + ,22355 + ,114 + ,113 + ,97 + ,428322 + ,125818 + ,111669 + ,31219 + ,169 + ,162 + ,95 + ,182016 + ,136588 + ,134163 + ,21983 + ,200 + ,186 + ,197 + ,267365 + ,112431 + ,140303 + ,40085 + ,148 + ,147 + ,160 + ,279428 + ,103037 + ,150773 + ,18507 + ,140 + ,137 + ,148 + ,508849 + ,82317 + ,111848 + ,16278 + ,74 + ,71 + ,84 + ,206722 + ,118906 + ,102509 + ,24662 + ,128 + ,123 + ,227 + ,200004 + ,83515 + ,96785 + ,31452 + ,140 + ,134 + ,154 + ,257139 + ,104581 + ,116136 + ,32580 + ,116 + ,115 + ,151 + ,270941 + ,103129 + ,158376 + ,22883 + ,147 + ,138 + ,142 + ,296850 + ,83243 + ,153990 + ,27652 + ,132 + ,125 + ,148 + ,329962 + ,37110 + ,64057 + ,9845 + ,70 + ,66 + ,110 + ,187155 + ,113344 + ,230054 + ,20190 + ,144 + ,137 + ,149 + ,393860 + ,139165 + ,184531 + ,46201 + ,155 + ,152 + ,179 + ,327660 + ,86652 + ,114198 + ,10971 + ,165 + ,159 + ,149 + ,269239 + ,112302 + ,198299 + ,34811 + ,161 + ,159 + ,187 + ,386982 + ,69652 + ,33750 + ,3029 + ,31 + ,31 + ,153 + ,130446 + ,119442 + ,189723 + ,38941 + ,199 + ,185 + ,163 + ,430118 + ,69867 + ,100826 + ,4958 + ,78 + ,78 + ,127 + ,273950 + ,101629 + ,188355 + ,32344 + ,121 + ,117 + ,151 + ,428077 + ,70168 + ,104470 + ,19433 + ,112 + ,109 + ,100 + ,254312 + ,31081 + ,58391 + ,12558 + ,41 + ,41 + ,46 + ,120351 + ,103925 + ,164808 + ,36524 + ,158 + ,149 + ,156 + ,395643 + ,92622 + ,134097 + ,26041 + ,123 + ,123 + ,128 + ,345875 + ,79011 + ,80238 + ,16637 + ,104 + ,103 + ,111 + ,212715 + ,93487 + ,133252 + ,28395 + ,94 + ,87 + ,119 + ,224524 + ,64520 + ,54518 + ,16747 + ,73 + ,71 + ,148 + ,182485 + ,93473 + ,121850 + ,9105 + ,52 + ,51 + ,65 + ,157164 + ,114360 + ,79367 + ,11941 + ,71 + ,70 + ,134 + ,459455 + ,33032 + ,56968 + ,7935 + ,21 + ,21 + ,66 + ,78800 + ,96125 + ,106314 + ,19499 + ,155 + ,155 + ,201 + ,217932 + ,151911 + ,191889 + ,22938 + ,174 + ,172 + ,177 + ,368086 + ,89256 + ,104864 + ,25314 + ,136 + ,133 + ,156 + ,228688 + ,95676 + ,160792 + ,28527 + ,128 + ,125 + ,158 + ,244765 + ,5950 + ,15049 + ,2694 + ,7 + ,7 + ,7 + ,24188 + ,149695 + ,191179 + ,20867 + ,165 + ,158 + ,175 + ,400109 + ,32551 + ,25109 + ,3597 + ,21 + ,21 + ,61 + ,65029 + ,31701 + ,45824 + ,5296 + ,35 + ,35 + ,41 + ,101097 + ,100087 + ,129711 + ,32982 + ,137 + ,133 + ,133 + ,305666 + ,169707 + ,210012 + ,38975 + ,174 + ,169 + ,228 + ,369627 + ,150491 + ,194679 + ,42721 + ,257 + ,256 + ,140 + ,367127 + ,120192 + ,197680 + ,41455 + ,207 + ,190 + ,155 + ,377704 + ,95893 + ,81180 + ,23923 + ,103 + ,100 + ,141 + ,280106 + ,151715 + ,197765 + ,26719 + ,171 + ,171 + ,181 + ,400971 + ,176225 + ,214738 + ,53405 + ,279 + ,267 + ,75 + ,315924 + ,59900 + ,96252 + ,12526 + ,83 + ,80 + ,97 + ,291391 + ,104767 + ,124527 + ,26584 + ,130 + ,126 + ,142 + ,295075 + ,114799 + ,153242 + ,37062 + ,131 + ,132 + ,136 + ,280018 + ,72128 + ,145707 + ,25696 + ,126 + ,121 + ,87 + ,267432 + ,143592 + ,113963 + ,24634 + ,158 + ,156 + ,140 + ,217181 + ,89626 + ,134904 + ,27269 + ,138 + ,133 + ,169 + ,258166 + ,131072 + ,114268 + ,25270 + ,200 + ,199 + ,129 + ,260919 + ,126817 + ,94333 + ,24634 + ,104 + ,98 + ,92 + ,182961 + ,81351 + ,102204 + ,17828 + ,111 + ,109 + ,160 + ,256967 + ,22618 + ,23824 + ,3007 + ,26 + ,25 + ,67 + ,73566 + ,88977 + ,111563 + ,20065 + ,115 + ,113 + ,179 + ,272362 + ,92059 + ,91313 + ,24648 + ,127 + ,126 + ,90 + ,229056 + ,81897 + ,89770 + ,21588 + ,140 + ,137 + ,144 + ,229851 + ,108146 + ,100125 + ,25217 + ,121 + ,121 + ,144 + ,371391 + ,126372 + ,165278 + ,30927 + ,183 + ,178 + ,144 + ,398210 + ,249771 + ,181712 + ,18487 + ,68 + ,63 + ,134 + ,220419 + ,71154 + ,80906 + ,18050 + ,112 + ,109 + ,146 + ,231884 + ,71571 + ,75881 + ,17696 + ,103 + ,101 + ,121 + ,217714 + ,55918 + ,83963 + ,17326 + ,63 + ,61 + ,112 + ,200046 + ,160141 + ,175721 + ,39361 + ,166 + ,157 + ,145 + ,483074 + ,38692 + ,68580 + ,9648 + ,38 + ,38 + ,99 + ,145943 + ,102812 + ,136323 + ,26759 + ,163 + ,159 + ,96 + ,295224 + ,56622 + ,55792 + ,7905 + ,59 + ,58 + ,27 + ,80953 + ,15986 + ,25157 + ,4527 + ,27 + ,27 + ,77 + ,217384 + ,123534 + ,100922 + ,41517 + ,108 + ,108 + ,137 + ,179344 + ,108535 + ,118845 + ,21261 + ,88 + ,83 + ,151 + ,415550 + ,93879 + ,170492 + ,36099 + ,92 + ,88 + ,126 + ,389059 + ,144551 + ,81716 + ,39039 + ,170 + ,164 + ,159 + ,180679 + ,56750 + ,115750 + ,13841 + ,98 + ,96 + ,101 + ,299505 + ,127654 + ,105590 + ,23841 + ,205 + ,192 + ,144 + ,292260 + ,65594 + ,92795 + ,8589 + ,96 + ,94 + ,102 + ,199481 + ,59938 + ,82390 + ,15049 + ,107 + ,107 + ,135 + ,282361 + ,146975 + ,135599 + ,39038 + ,150 + ,144 + ,147 + ,329281 + ,165904 + ,127667 + ,36774 + ,138 + ,136 + ,155 + ,234577 + ,169265 + ,163073 + ,40076 + ,177 + ,171 + ,138 + ,297995 + ,183500 + ,211381 + ,43840 + ,213 + ,210 + ,113 + ,329583 + ,165986 + ,189944 + ,43146 + ,208 + ,193 + ,248 + ,416463 + ,184923 + ,226168 + ,50099 + ,307 + ,297 + ,116 + ,415683 + ,140358 + ,117495 + ,40312 + ,125 + ,125 + ,176 + ,297080 + ,149959 + ,195894 + ,32616 + ,208 + ,204 + ,140 + ,318283 + ,57224 + ,80684 + ,11338 + ,73 + ,70 + ,59 + ,224033 + ,43750 + ,19630 + ,7409 + ,49 + ,49 + ,64 + ,43287 + ,48029 + ,88634 + ,18213 + ,82 + ,82 + ,40 + ,238089 + ,104978 + ,139292 + ,45873 + ,206 + ,205 + ,98 + ,263322 + ,100046 + ,128602 + ,39844 + ,112 + ,111 + ,139 + ,299566 + ,101047 + ,135848 + ,28317 + ,139 + ,135 + ,135 + ,321797 + ,197426 + ,178377 + ,24797 + ,60 + ,59 + ,97 + ,193926 + ,160902 + ,106330 + ,7471 + ,70 + ,70 + ,142 + ,170491 + ,147172 + ,178303 + ,27259 + ,112 + ,108 + ,155 + ,354041 + ,109432 + ,116938 + ,23201 + ,142 + ,141 + ,115 + ,303273 + ,1168 + ,5841 + ,238 + ,11 + ,11 + ,0 + ,23668 + ,83248 + ,106020 + ,28830 + ,130 + ,130 + ,103 + ,196743 + ,25162 + ,24610 + ,3913 + ,31 + ,28 + ,30 + ,61857 + ,45724 + ,74151 + ,9935 + ,132 + ,101 + ,130 + ,217543 + ,110529 + ,232241 + ,27738 + ,219 + ,216 + ,102 + ,440711 + ,855 + ,6622 + ,338 + ,4 + ,4 + ,0 + ,21054 + ,101382 + ,127097 + ,13326 + ,102 + ,97 + ,77 + ,252805 + ,14116 + ,13155 + ,3988 + ,39 + ,39 + ,9 + ,31961 + ,89506 + ,160501 + ,24347 + ,125 + ,119 + ,150 + ,360436 + ,135356 + ,91502 + ,27111 + ,121 + ,118 + ,163 + ,251948 + ,116066 + ,24469 + ,3938 + ,42 + ,41 + ,148 + ,187003 + ,144244 + ,88229 + ,17416 + ,111 + ,107 + ,94 + ,180842 + ,8773 + ,13983 + ,1888 + ,16 + ,16 + ,21 + ,38214 + ,102153 + ,80716 + ,18700 + ,70 + ,69 + ,151 + ,278173 + ,117440 + ,157384 + ,36809 + ,162 + ,160 + ,187 + ,358276 + ,104128 + ,122975 + ,24959 + ,173 + ,158 + ,171 + ,211775 + ,134238 + ,191469 + ,37343 + ,171 + ,161 + ,170 + ,445926 + ,134047 + ,231257 + ,21849 + ,172 + ,165 + ,145 + ,348017 + ,279488 + ,258287 + ,49809 + ,254 + ,246 + ,198 + ,441946 + ,79756 + ,122531 + ,21654 + ,90 + ,89 + ,152 + ,215177 + ,66089 + ,61394 + ,8728 + ,50 + ,49 + ,112 + ,126320 + ,102070 + ,86480 + ,20920 + ,113 + ,107 + ,173 + ,316128 + ,146760 + ,195791 + ,27195 + ,187 + ,182 + ,177 + ,466139 + ,154771 + ,18284 + ,1037 + ,16 + ,16 + ,153 + ,162279 + ,165933 + ,147581 + ,42570 + ,175 + ,173 + ,161 + ,416643 + ,64593 + ,72558 + ,17672 + ,90 + ,90 + ,115 + ,178322 + ,92280 + ,147341 + ,34245 + ,140 + ,140 + ,147 + ,292443 + ,67150 + ,114651 + ,16786 + ,145 + ,142 + ,124 + ,283913 + ,128692 + ,100187 + ,20954 + ,141 + ,126 + ,57 + ,244802 + ,124089 + ,130332 + ,16378 + ,125 + ,123 + ,144 + ,387072 + ,125386 + ,134218 + ,31852 + ,241 + ,239 + ,126 + ,246963 + ,37238 + ,10901 + ,2805 + ,16 + ,15 + ,78 + ,173260 + ,140015 + ,145758 + ,38086 + ,175 + ,170 + ,153 + ,346748 + ,150047 + ,75767 + ,21166 + ,132 + ,123 + ,196 + ,176654 + ,154451 + ,134969 + ,34672 + ,154 + ,151 + ,130 + ,267742 + ,156349 + ,169216 + ,36171 + ,198 + ,194 + ,159 + ,314070) + ,dim=c(7 + ,148) + ,dimnames=list(c('Y1' + ,'X1' + ,'X2' + ,'X3' + ,'X4' + ,'X5' + ,'X6') + ,1:148)) > y <- array(NA,dim=c(7,148),dimnames=list(c('Y1','X1','X2','X3','X4','X5','X6'),1:148)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Y1 X1 X2 X3 X4 X5 X6 1 140824 186099 32033 165 165 130 279055 2 110459 113854 20654 135 132 143 212408 3 105079 99776 16346 121 121 118 233939 4 112098 106194 35926 148 145 146 222117 5 43929 100792 10621 73 71 73 179751 6 76173 47552 10024 49 47 89 70849 7 187326 250931 43068 185 177 146 599777 8 22807 6853 1271 5 5 22 33186 9 144408 115466 34416 125 124 132 227332 10 66485 110896 20318 93 92 92 258874 11 79089 169351 24409 154 149 147 359064 12 81625 94853 20648 98 93 203 264989 13 68788 72591 12347 70 70 113 209202 14 103297 101345 21857 148 148 171 368577 15 69446 113713 11034 100 100 87 269455 16 114948 165354 33433 150 142 208 397286 17 167949 164263 35902 197 194 153 335567 18 125081 135213 22355 114 113 97 428322 19 125818 111669 31219 169 162 95 182016 20 136588 134163 21983 200 186 197 267365 21 112431 140303 40085 148 147 160 279428 22 103037 150773 18507 140 137 148 508849 23 82317 111848 16278 74 71 84 206722 24 118906 102509 24662 128 123 227 200004 25 83515 96785 31452 140 134 154 257139 26 104581 116136 32580 116 115 151 270941 27 103129 158376 22883 147 138 142 296850 28 83243 153990 27652 132 125 148 329962 29 37110 64057 9845 70 66 110 187155 30 113344 230054 20190 144 137 149 393860 31 139165 184531 46201 155 152 179 327660 32 86652 114198 10971 165 159 149 269239 33 112302 198299 34811 161 159 187 386982 34 69652 33750 3029 31 31 153 130446 35 119442 189723 38941 199 185 163 430118 36 69867 100826 4958 78 78 127 273950 37 101629 188355 32344 121 117 151 428077 38 70168 104470 19433 112 109 100 254312 39 31081 58391 12558 41 41 46 120351 40 103925 164808 36524 158 149 156 395643 41 92622 134097 26041 123 123 128 345875 42 79011 80238 16637 104 103 111 212715 43 93487 133252 28395 94 87 119 224524 44 64520 54518 16747 73 71 148 182485 45 93473 121850 9105 52 51 65 157164 46 114360 79367 11941 71 70 134 459455 47 33032 56968 7935 21 21 66 78800 48 96125 106314 19499 155 155 201 217932 49 151911 191889 22938 174 172 177 368086 50 89256 104864 25314 136 133 156 228688 51 95676 160792 28527 128 125 158 244765 52 5950 15049 2694 7 7 7 24188 53 149695 191179 20867 165 158 175 400109 54 32551 25109 3597 21 21 61 65029 55 31701 45824 5296 35 35 41 101097 56 100087 129711 32982 137 133 133 305666 57 169707 210012 38975 174 169 228 369627 58 150491 194679 42721 257 256 140 367127 59 120192 197680 41455 207 190 155 377704 60 95893 81180 23923 103 100 141 280106 61 151715 197765 26719 171 171 181 400971 62 176225 214738 53405 279 267 75 315924 63 59900 96252 12526 83 80 97 291391 64 104767 124527 26584 130 126 142 295075 65 114799 153242 37062 131 132 136 280018 66 72128 145707 25696 126 121 87 267432 67 143592 113963 24634 158 156 140 217181 68 89626 134904 27269 138 133 169 258166 69 131072 114268 25270 200 199 129 260919 70 126817 94333 24634 104 98 92 182961 71 81351 102204 17828 111 109 160 256967 72 22618 23824 3007 26 25 67 73566 73 88977 111563 20065 115 113 179 272362 74 92059 91313 24648 127 126 90 229056 75 81897 89770 21588 140 137 144 229851 76 108146 100125 25217 121 121 144 371391 77 126372 165278 30927 183 178 144 398210 78 249771 181712 18487 68 63 134 220419 79 71154 80906 18050 112 109 146 231884 80 71571 75881 17696 103 101 121 217714 81 55918 83963 17326 63 61 112 200046 82 160141 175721 39361 166 157 145 483074 83 38692 68580 9648 38 38 99 145943 84 102812 136323 26759 163 159 96 295224 85 56622 55792 7905 59 58 27 80953 86 15986 25157 4527 27 27 77 217384 87 123534 100922 41517 108 108 137 179344 88 108535 118845 21261 88 83 151 415550 89 93879 170492 36099 92 88 126 389059 90 144551 81716 39039 170 164 159 180679 91 56750 115750 13841 98 96 101 299505 92 127654 105590 23841 205 192 144 292260 93 65594 92795 8589 96 94 102 199481 94 59938 82390 15049 107 107 135 282361 95 146975 135599 39038 150 144 147 329281 96 165904 127667 36774 138 136 155 234577 97 169265 163073 40076 177 171 138 297995 98 183500 211381 43840 213 210 113 329583 99 165986 189944 43146 208 193 248 416463 100 184923 226168 50099 307 297 116 415683 101 140358 117495 40312 125 125 176 297080 102 149959 195894 32616 208 204 140 318283 103 57224 80684 11338 73 70 59 224033 104 43750 19630 7409 49 49 64 43287 105 48029 88634 18213 82 82 40 238089 106 104978 139292 45873 206 205 98 263322 107 100046 128602 39844 112 111 139 299566 108 101047 135848 28317 139 135 135 321797 109 197426 178377 24797 60 59 97 193926 110 160902 106330 7471 70 70 142 170491 111 147172 178303 27259 112 108 155 354041 112 109432 116938 23201 142 141 115 303273 113 1168 5841 238 11 11 0 23668 114 83248 106020 28830 130 130 103 196743 115 25162 24610 3913 31 28 30 61857 116 45724 74151 9935 132 101 130 217543 117 110529 232241 27738 219 216 102 440711 118 855 6622 338 4 4 0 21054 119 101382 127097 13326 102 97 77 252805 120 14116 13155 3988 39 39 9 31961 121 89506 160501 24347 125 119 150 360436 122 135356 91502 27111 121 118 163 251948 123 116066 24469 3938 42 41 148 187003 124 144244 88229 17416 111 107 94 180842 125 8773 13983 1888 16 16 21 38214 126 102153 80716 18700 70 69 151 278173 127 117440 157384 36809 162 160 187 358276 128 104128 122975 24959 173 158 171 211775 129 134238 191469 37343 171 161 170 445926 130 134047 231257 21849 172 165 145 348017 131 279488 258287 49809 254 246 198 441946 132 79756 122531 21654 90 89 152 215177 133 66089 61394 8728 50 49 112 126320 134 102070 86480 20920 113 107 173 316128 135 146760 195791 27195 187 182 177 466139 136 154771 18284 1037 16 16 153 162279 137 165933 147581 42570 175 173 161 416643 138 64593 72558 17672 90 90 115 178322 139 92280 147341 34245 140 140 147 292443 140 67150 114651 16786 145 142 124 283913 141 128692 100187 20954 141 126 57 244802 142 124089 130332 16378 125 123 144 387072 143 125386 134218 31852 241 239 126 246963 144 37238 10901 2805 16 15 78 173260 145 140015 145758 38086 175 170 153 346748 146 150047 75767 21166 132 123 196 176654 147 154451 134969 34672 154 151 130 267742 148 156349 169216 36171 198 194 159 314070 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X1 X2 X3 X4 X5 9975.28657 0.39937 0.82908 -263.96183 351.11059 282.15014 X6 -0.07265 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -45812 -19860 -7094 14932 125933 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 9975.28657 7338.71044 1.359 0.1762 X1 0.39937 0.09347 4.273 3.54e-05 *** X2 0.82908 0.36592 2.266 0.0250 * X3 -263.96183 613.35033 -0.430 0.6676 X4 351.11059 636.37163 0.552 0.5820 X5 282.15014 68.42572 4.123 6.34e-05 *** X6 -0.07265 0.04057 -1.791 0.0755 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 28970 on 141 degrees of freedom Multiple R-squared: 0.6376, Adjusted R-squared: 0.6222 F-statistic: 41.35 on 6 and 141 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,] 5.170061e-01 9.659877e-01 0.4829939 [2,] 6.416381e-01 7.167239e-01 0.3583619 [3,] 5.669840e-01 8.660320e-01 0.4330160 [4,] 4.359400e-01 8.718800e-01 0.5640600 [5,] 3.186866e-01 6.373732e-01 0.6813134 [6,] 2.223601e-01 4.447203e-01 0.7776399 [7,] 1.597999e-01 3.195999e-01 0.8402001 [8,] 1.343085e-01 2.686170e-01 0.8656915 [9,] 1.066832e-01 2.133663e-01 0.8933168 [10,] 6.905568e-02 1.381114e-01 0.9309443 [11,] 7.710689e-02 1.542138e-01 0.9228931 [12,] 7.928392e-02 1.585678e-01 0.9207161 [13,] 5.316342e-02 1.063268e-01 0.9468366 [14,] 3.551414e-02 7.102829e-02 0.9644859 [15,] 3.173978e-02 6.347956e-02 0.9682602 [16,] 4.474725e-02 8.949450e-02 0.9552527 [17,] 2.987786e-02 5.975573e-02 0.9701221 [18,] 2.056885e-02 4.113770e-02 0.9794311 [19,] 2.310834e-02 4.621667e-02 0.9768917 [20,] 1.964956e-02 3.929912e-02 0.9803504 [21,] 1.338074e-02 2.676148e-02 0.9866193 [22,] 8.992371e-03 1.798474e-02 0.9910076 [23,] 6.399525e-03 1.279905e-02 0.9936005 [24,] 6.970521e-03 1.394104e-02 0.9930295 [25,] 1.030461e-02 2.060922e-02 0.9896954 [26,] 8.618847e-03 1.723769e-02 0.9913812 [27,] 5.540436e-03 1.108087e-02 0.9944596 [28,] 4.211220e-03 8.422440e-03 0.9957888 [29,] 3.414051e-03 6.828101e-03 0.9965859 [30,] 2.888397e-03 5.776795e-03 0.9971116 [31,] 2.309013e-03 4.618027e-03 0.9976910 [32,] 1.653747e-03 3.307493e-03 0.9983463 [33,] 1.008204e-03 2.016407e-03 0.9989918 [34,] 6.841293e-04 1.368259e-03 0.9993159 [35,] 4.259931e-04 8.519862e-04 0.9995740 [36,] 5.665043e-04 1.133009e-03 0.9994335 [37,] 2.213196e-03 4.426392e-03 0.9977868 [38,] 1.622205e-03 3.244411e-03 0.9983778 [39,] 1.375165e-03 2.750330e-03 0.9986248 [40,] 1.205575e-03 2.411149e-03 0.9987944 [41,] 9.400754e-04 1.880151e-03 0.9990599 [42,] 9.880272e-04 1.976054e-03 0.9990120 [43,] 7.467317e-04 1.493463e-03 0.9992533 [44,] 7.837212e-04 1.567442e-03 0.9992163 [45,] 4.942070e-04 9.884139e-04 0.9995058 [46,] 3.198107e-04 6.396213e-04 0.9996802 [47,] 2.141253e-04 4.282506e-04 0.9997859 [48,] 2.137904e-04 4.275808e-04 0.9997862 [49,] 1.558212e-04 3.116424e-04 0.9998442 [50,] 1.375667e-04 2.751333e-04 0.9998624 [51,] 8.703795e-05 1.740759e-04 0.9999130 [52,] 5.501113e-05 1.100223e-04 0.9999450 [53,] 4.486658e-05 8.973316e-05 0.9999551 [54,] 2.936755e-05 5.873511e-05 0.9999706 [55,] 1.728492e-05 3.456984e-05 0.9999827 [56,] 1.176014e-05 2.352029e-05 0.9999882 [57,] 1.406325e-05 2.812650e-05 0.9999859 [58,] 2.041752e-05 4.083505e-05 0.9999796 [59,] 2.777403e-05 5.554807e-05 0.9999722 [60,] 1.874078e-05 3.748156e-05 0.9999813 [61,] 6.848946e-05 1.369789e-04 0.9999315 [62,] 5.395734e-05 1.079147e-04 0.9999460 [63,] 3.729816e-05 7.459633e-05 0.9999627 [64,] 3.271000e-05 6.542000e-05 0.9999673 [65,] 1.961407e-05 3.922814e-05 0.9999804 [66,] 1.552513e-05 3.105027e-05 0.9999845 [67,] 9.976924e-06 1.995385e-05 0.9999900 [68,] 5.722800e-06 1.144560e-05 0.9999943 [69,] 7.653981e-02 1.530796e-01 0.9234602 [70,] 6.923743e-02 1.384749e-01 0.9307626 [71,] 5.684305e-02 1.136861e-01 0.9431570 [72,] 5.400665e-02 1.080133e-01 0.9459933 [73,] 6.181600e-02 1.236320e-01 0.9381840 [74,] 6.554280e-02 1.310856e-01 0.9344572 [75,] 5.136400e-02 1.027280e-01 0.9486360 [76,] 4.083333e-02 8.166667e-02 0.9591667 [77,] 3.348275e-02 6.696549e-02 0.9665173 [78,] 2.753858e-02 5.507716e-02 0.9724614 [79,] 2.326594e-02 4.653188e-02 0.9767341 [80,] 2.291763e-02 4.583526e-02 0.9770824 [81,] 2.280926e-02 4.561852e-02 0.9771907 [82,] 2.190867e-02 4.381734e-02 0.9780913 [83,] 2.018036e-02 4.036073e-02 0.9798196 [84,] 1.613426e-02 3.226852e-02 0.9838657 [85,] 1.518871e-02 3.037742e-02 0.9848113 [86,] 1.331848e-02 2.663697e-02 0.9866815 [87,] 1.509288e-02 3.018577e-02 0.9849071 [88,] 1.495892e-02 2.991785e-02 0.9850411 [89,] 1.405446e-02 2.810893e-02 0.9859455 [90,] 1.188099e-02 2.376198e-02 0.9881190 [91,] 1.228552e-02 2.457105e-02 0.9877145 [92,] 9.175356e-03 1.835071e-02 0.9908246 [93,] 6.410577e-03 1.282115e-02 0.9935894 [94,] 4.404025e-03 8.808049e-03 0.9955960 [95,] 3.049054e-03 6.098108e-03 0.9969509 [96,] 2.186464e-03 4.372927e-03 0.9978135 [97,] 1.857802e-03 3.715603e-03 0.9981422 [98,] 1.758049e-03 3.516099e-03 0.9982420 [99,] 1.309102e-03 2.618204e-03 0.9986909 [100,] 1.023631e-02 2.047263e-02 0.9897637 [101,] 3.260425e-02 6.520850e-02 0.9673958 [102,] 2.667673e-02 5.335347e-02 0.9733233 [103,] 1.943694e-02 3.887387e-02 0.9805631 [104,] 1.390167e-02 2.780334e-02 0.9860983 [105,] 1.154786e-02 2.309572e-02 0.9884521 [106,] 7.831862e-03 1.566372e-02 0.9921681 [107,] 1.332929e-02 2.665857e-02 0.9866707 [108,] 1.151211e-02 2.302423e-02 0.9884879 [109,] 7.891361e-03 1.578272e-02 0.9921086 [110,] 6.229866e-03 1.245973e-02 0.9937701 [111,] 4.075905e-03 8.151811e-03 0.9959241 [112,] 4.579977e-03 9.159955e-03 0.9954200 [113,] 3.500640e-03 7.001281e-03 0.9964994 [114,] 5.983737e-03 1.196747e-02 0.9940163 [115,] 1.758471e-02 3.516943e-02 0.9824153 [116,] 1.155739e-02 2.311477e-02 0.9884426 [117,] 7.501971e-03 1.500394e-02 0.9924980 [118,] 8.117078e-03 1.623416e-02 0.9918829 [119,] 1.719685e-02 3.439369e-02 0.9828032 [120,] 2.671916e-02 5.343831e-02 0.9732808 [121,] 1.834335e-02 3.668670e-02 0.9816566 [122,] 1.294749e-01 2.589498e-01 0.8705251 [123,] 1.101477e-01 2.202953e-01 0.8898523 [124,] 7.610075e-02 1.522015e-01 0.9238992 [125,] 1.267028e-01 2.534057e-01 0.8732972 [126,] 8.023135e-02 1.604627e-01 0.9197687 [127,] 6.007512e-01 7.984976e-01 0.3992488 [128,] 4.586815e-01 9.173629e-01 0.5413185 [129,] 3.044213e-01 6.088427e-01 0.6955787 > postscript(file="/var/wessaorg/rcomp/tmp/19fgp1324640985.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/wessaorg/rcomp/tmp/2f69s1324640985.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/wessaorg/rcomp/tmp/3tur61324640985.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/wessaorg/rcomp/tmp/47cey1324640985.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/wessaorg/rcomp/tmp/54spr1324640985.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 = 148 Frequency = 1 1 2 3 4 5 6 -817.10227 2262.49116 14861.36309 -6975.03745 -28302.72885 15363.96358 7 8 9 10 11 12 30496.81668 4809.06944 28515.07233 -19527.99537 -45811.91150 -28160.13095 13 14 15 16 17 18 -3199.05187 358.60369 -8776.49105 -28870.52475 27701.80946 36737.68424 19 20 21 22 23 24 19511.38310 6133.01003 -24200.91474 1566.98888 99.52273 -11372.11521 25 26 27 28 29 30 -26053.23111 -11465.48746 -17218.42705 -37988.85815 -28745.32918 -28764.74460 31 32 33 34 35 36 -21965.53759 -12778.96265 -43705.13462 7293.31728 -25756.96107 -7213.41609 37 38 39 40 41 42 -31030.15108 -16087.13319 -20433.83081 -28031.80059 -14203.76516 -1379.23989 43 44 45 46 47 48 -16245.07069 -15272.69011 16183.34026 52523.92730 -21000.52343 -26862.31909 49 50 51 52 53 54 8623.25005 -21785.96448 -39065.04136 -13096.76158 13838.60437 -4751.07685 55 56 57 58 59 60 -8239.33276 -14889.47893 -7338.95290 -7527.30678 -31463.79981 6306.90731 61 62 63 64 65 66 3765.60138 17902.37762 -11278.93309 -5533.44113 -16900.32051 -31685.34565 67 68 69 70 71 72 30889.90632 -36032.35932 19990.80660 39122.09711 -19668.55131 -14839.01564 73 74 75 76 77 78 -22225.89562 5711.88079 -16905.95567 13084.64127 -1142.99347 125932.97369 79 80 81 82 83 84 -19152.04586 -9977.21414 -23809.53022 30232.34518 -27312.58798 -2230.72048 85 86 87 88 89 90 11283.74831 -16074.48617 3795.43208 15141.92327 -28013.06148 25130.39869 91 92 93 94 95 96 -25503.59820 23045.68988 -10512.56748 -22319.25493 21960.98288 36438.43532 97 98 99 100 101 102 30331.30368 27310.73324 -8195.58348 17313.76419 11068.18559 1608.26724 103 104 105 106 107 108 -53.12512 609.38684 -13578.68680 -24780.34828 -21187.43242 -12079.39513 109 110 111 112 113 114 77495.87594 68488.24287 17020.00983 11081.73922 -10576.42688 -19068.08570 115 116 117 118 119 120 -3504.73722 -23595.67489 -29986.74571 -10864.12051 19107.11362 -8035.50575 121 122 123 124 125 126 -29677.39621 29182.70470 61572.55011 62940.67225 -12895.19401 16294.25900 127 128 129 130 131 132 -26055.99955 -18324.91345 -10124.21862 -14559.85043 81980.15956 -31853.65777 133 134 135 136 137 138 -2071.23600 6627.11823 5428.76920 103860.56823 32019.24841 -16346.54458 139 140 141 142 143 144 -37361.25425 -28473.47797 56013.88659 25784.91687 -2509.20483 10120.50516 145 146 147 148 8779.33671 41453.45344 32231.97072 10909.92018 > postscript(file="/var/wessaorg/rcomp/tmp/6vpt41324640985.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 = 148 Frequency = 1 lag(myerror, k = 1) myerror 0 -817.10227 NA 1 2262.49116 -817.10227 2 14861.36309 2262.49116 3 -6975.03745 14861.36309 4 -28302.72885 -6975.03745 5 15363.96358 -28302.72885 6 30496.81668 15363.96358 7 4809.06944 30496.81668 8 28515.07233 4809.06944 9 -19527.99537 28515.07233 10 -45811.91150 -19527.99537 11 -28160.13095 -45811.91150 12 -3199.05187 -28160.13095 13 358.60369 -3199.05187 14 -8776.49105 358.60369 15 -28870.52475 -8776.49105 16 27701.80946 -28870.52475 17 36737.68424 27701.80946 18 19511.38310 36737.68424 19 6133.01003 19511.38310 20 -24200.91474 6133.01003 21 1566.98888 -24200.91474 22 99.52273 1566.98888 23 -11372.11521 99.52273 24 -26053.23111 -11372.11521 25 -11465.48746 -26053.23111 26 -17218.42705 -11465.48746 27 -37988.85815 -17218.42705 28 -28745.32918 -37988.85815 29 -28764.74460 -28745.32918 30 -21965.53759 -28764.74460 31 -12778.96265 -21965.53759 32 -43705.13462 -12778.96265 33 7293.31728 -43705.13462 34 -25756.96107 7293.31728 35 -7213.41609 -25756.96107 36 -31030.15108 -7213.41609 37 -16087.13319 -31030.15108 38 -20433.83081 -16087.13319 39 -28031.80059 -20433.83081 40 -14203.76516 -28031.80059 41 -1379.23989 -14203.76516 42 -16245.07069 -1379.23989 43 -15272.69011 -16245.07069 44 16183.34026 -15272.69011 45 52523.92730 16183.34026 46 -21000.52343 52523.92730 47 -26862.31909 -21000.52343 48 8623.25005 -26862.31909 49 -21785.96448 8623.25005 50 -39065.04136 -21785.96448 51 -13096.76158 -39065.04136 52 13838.60437 -13096.76158 53 -4751.07685 13838.60437 54 -8239.33276 -4751.07685 55 -14889.47893 -8239.33276 56 -7338.95290 -14889.47893 57 -7527.30678 -7338.95290 58 -31463.79981 -7527.30678 59 6306.90731 -31463.79981 60 3765.60138 6306.90731 61 17902.37762 3765.60138 62 -11278.93309 17902.37762 63 -5533.44113 -11278.93309 64 -16900.32051 -5533.44113 65 -31685.34565 -16900.32051 66 30889.90632 -31685.34565 67 -36032.35932 30889.90632 68 19990.80660 -36032.35932 69 39122.09711 19990.80660 70 -19668.55131 39122.09711 71 -14839.01564 -19668.55131 72 -22225.89562 -14839.01564 73 5711.88079 -22225.89562 74 -16905.95567 5711.88079 75 13084.64127 -16905.95567 76 -1142.99347 13084.64127 77 125932.97369 -1142.99347 78 -19152.04586 125932.97369 79 -9977.21414 -19152.04586 80 -23809.53022 -9977.21414 81 30232.34518 -23809.53022 82 -27312.58798 30232.34518 83 -2230.72048 -27312.58798 84 11283.74831 -2230.72048 85 -16074.48617 11283.74831 86 3795.43208 -16074.48617 87 15141.92327 3795.43208 88 -28013.06148 15141.92327 89 25130.39869 -28013.06148 90 -25503.59820 25130.39869 91 23045.68988 -25503.59820 92 -10512.56748 23045.68988 93 -22319.25493 -10512.56748 94 21960.98288 -22319.25493 95 36438.43532 21960.98288 96 30331.30368 36438.43532 97 27310.73324 30331.30368 98 -8195.58348 27310.73324 99 17313.76419 -8195.58348 100 11068.18559 17313.76419 101 1608.26724 11068.18559 102 -53.12512 1608.26724 103 609.38684 -53.12512 104 -13578.68680 609.38684 105 -24780.34828 -13578.68680 106 -21187.43242 -24780.34828 107 -12079.39513 -21187.43242 108 77495.87594 -12079.39513 109 68488.24287 77495.87594 110 17020.00983 68488.24287 111 11081.73922 17020.00983 112 -10576.42688 11081.73922 113 -19068.08570 -10576.42688 114 -3504.73722 -19068.08570 115 -23595.67489 -3504.73722 116 -29986.74571 -23595.67489 117 -10864.12051 -29986.74571 118 19107.11362 -10864.12051 119 -8035.50575 19107.11362 120 -29677.39621 -8035.50575 121 29182.70470 -29677.39621 122 61572.55011 29182.70470 123 62940.67225 61572.55011 124 -12895.19401 62940.67225 125 16294.25900 -12895.19401 126 -26055.99955 16294.25900 127 -18324.91345 -26055.99955 128 -10124.21862 -18324.91345 129 -14559.85043 -10124.21862 130 81980.15956 -14559.85043 131 -31853.65777 81980.15956 132 -2071.23600 -31853.65777 133 6627.11823 -2071.23600 134 5428.76920 6627.11823 135 103860.56823 5428.76920 136 32019.24841 103860.56823 137 -16346.54458 32019.24841 138 -37361.25425 -16346.54458 139 -28473.47797 -37361.25425 140 56013.88659 -28473.47797 141 25784.91687 56013.88659 142 -2509.20483 25784.91687 143 10120.50516 -2509.20483 144 8779.33671 10120.50516 145 41453.45344 8779.33671 146 32231.97072 41453.45344 147 10909.92018 32231.97072 148 NA 10909.92018 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2262.49116 -817.10227 [2,] 14861.36309 2262.49116 [3,] -6975.03745 14861.36309 [4,] -28302.72885 -6975.03745 [5,] 15363.96358 -28302.72885 [6,] 30496.81668 15363.96358 [7,] 4809.06944 30496.81668 [8,] 28515.07233 4809.06944 [9,] -19527.99537 28515.07233 [10,] -45811.91150 -19527.99537 [11,] -28160.13095 -45811.91150 [12,] -3199.05187 -28160.13095 [13,] 358.60369 -3199.05187 [14,] -8776.49105 358.60369 [15,] -28870.52475 -8776.49105 [16,] 27701.80946 -28870.52475 [17,] 36737.68424 27701.80946 [18,] 19511.38310 36737.68424 [19,] 6133.01003 19511.38310 [20,] -24200.91474 6133.01003 [21,] 1566.98888 -24200.91474 [22,] 99.52273 1566.98888 [23,] -11372.11521 99.52273 [24,] -26053.23111 -11372.11521 [25,] -11465.48746 -26053.23111 [26,] -17218.42705 -11465.48746 [27,] -37988.85815 -17218.42705 [28,] -28745.32918 -37988.85815 [29,] -28764.74460 -28745.32918 [30,] -21965.53759 -28764.74460 [31,] -12778.96265 -21965.53759 [32,] -43705.13462 -12778.96265 [33,] 7293.31728 -43705.13462 [34,] -25756.96107 7293.31728 [35,] -7213.41609 -25756.96107 [36,] -31030.15108 -7213.41609 [37,] -16087.13319 -31030.15108 [38,] -20433.83081 -16087.13319 [39,] -28031.80059 -20433.83081 [40,] -14203.76516 -28031.80059 [41,] -1379.23989 -14203.76516 [42,] -16245.07069 -1379.23989 [43,] -15272.69011 -16245.07069 [44,] 16183.34026 -15272.69011 [45,] 52523.92730 16183.34026 [46,] -21000.52343 52523.92730 [47,] -26862.31909 -21000.52343 [48,] 8623.25005 -26862.31909 [49,] -21785.96448 8623.25005 [50,] -39065.04136 -21785.96448 [51,] -13096.76158 -39065.04136 [52,] 13838.60437 -13096.76158 [53,] -4751.07685 13838.60437 [54,] -8239.33276 -4751.07685 [55,] -14889.47893 -8239.33276 [56,] -7338.95290 -14889.47893 [57,] -7527.30678 -7338.95290 [58,] -31463.79981 -7527.30678 [59,] 6306.90731 -31463.79981 [60,] 3765.60138 6306.90731 [61,] 17902.37762 3765.60138 [62,] -11278.93309 17902.37762 [63,] -5533.44113 -11278.93309 [64,] -16900.32051 -5533.44113 [65,] -31685.34565 -16900.32051 [66,] 30889.90632 -31685.34565 [67,] -36032.35932 30889.90632 [68,] 19990.80660 -36032.35932 [69,] 39122.09711 19990.80660 [70,] -19668.55131 39122.09711 [71,] -14839.01564 -19668.55131 [72,] -22225.89562 -14839.01564 [73,] 5711.88079 -22225.89562 [74,] -16905.95567 5711.88079 [75,] 13084.64127 -16905.95567 [76,] -1142.99347 13084.64127 [77,] 125932.97369 -1142.99347 [78,] -19152.04586 125932.97369 [79,] -9977.21414 -19152.04586 [80,] -23809.53022 -9977.21414 [81,] 30232.34518 -23809.53022 [82,] -27312.58798 30232.34518 [83,] -2230.72048 -27312.58798 [84,] 11283.74831 -2230.72048 [85,] -16074.48617 11283.74831 [86,] 3795.43208 -16074.48617 [87,] 15141.92327 3795.43208 [88,] -28013.06148 15141.92327 [89,] 25130.39869 -28013.06148 [90,] -25503.59820 25130.39869 [91,] 23045.68988 -25503.59820 [92,] -10512.56748 23045.68988 [93,] -22319.25493 -10512.56748 [94,] 21960.98288 -22319.25493 [95,] 36438.43532 21960.98288 [96,] 30331.30368 36438.43532 [97,] 27310.73324 30331.30368 [98,] -8195.58348 27310.73324 [99,] 17313.76419 -8195.58348 [100,] 11068.18559 17313.76419 [101,] 1608.26724 11068.18559 [102,] -53.12512 1608.26724 [103,] 609.38684 -53.12512 [104,] -13578.68680 609.38684 [105,] -24780.34828 -13578.68680 [106,] -21187.43242 -24780.34828 [107,] -12079.39513 -21187.43242 [108,] 77495.87594 -12079.39513 [109,] 68488.24287 77495.87594 [110,] 17020.00983 68488.24287 [111,] 11081.73922 17020.00983 [112,] -10576.42688 11081.73922 [113,] -19068.08570 -10576.42688 [114,] -3504.73722 -19068.08570 [115,] -23595.67489 -3504.73722 [116,] -29986.74571 -23595.67489 [117,] -10864.12051 -29986.74571 [118,] 19107.11362 -10864.12051 [119,] -8035.50575 19107.11362 [120,] -29677.39621 -8035.50575 [121,] 29182.70470 -29677.39621 [122,] 61572.55011 29182.70470 [123,] 62940.67225 61572.55011 [124,] -12895.19401 62940.67225 [125,] 16294.25900 -12895.19401 [126,] -26055.99955 16294.25900 [127,] -18324.91345 -26055.99955 [128,] -10124.21862 -18324.91345 [129,] -14559.85043 -10124.21862 [130,] 81980.15956 -14559.85043 [131,] -31853.65777 81980.15956 [132,] -2071.23600 -31853.65777 [133,] 6627.11823 -2071.23600 [134,] 5428.76920 6627.11823 [135,] 103860.56823 5428.76920 [136,] 32019.24841 103860.56823 [137,] -16346.54458 32019.24841 [138,] -37361.25425 -16346.54458 [139,] -28473.47797 -37361.25425 [140,] 56013.88659 -28473.47797 [141,] 25784.91687 56013.88659 [142,] -2509.20483 25784.91687 [143,] 10120.50516 -2509.20483 [144,] 8779.33671 10120.50516 [145,] 41453.45344 8779.33671 [146,] 32231.97072 41453.45344 [147,] 10909.92018 32231.97072 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2262.49116 -817.10227 2 14861.36309 2262.49116 3 -6975.03745 14861.36309 4 -28302.72885 -6975.03745 5 15363.96358 -28302.72885 6 30496.81668 15363.96358 7 4809.06944 30496.81668 8 28515.07233 4809.06944 9 -19527.99537 28515.07233 10 -45811.91150 -19527.99537 11 -28160.13095 -45811.91150 12 -3199.05187 -28160.13095 13 358.60369 -3199.05187 14 -8776.49105 358.60369 15 -28870.52475 -8776.49105 16 27701.80946 -28870.52475 17 36737.68424 27701.80946 18 19511.38310 36737.68424 19 6133.01003 19511.38310 20 -24200.91474 6133.01003 21 1566.98888 -24200.91474 22 99.52273 1566.98888 23 -11372.11521 99.52273 24 -26053.23111 -11372.11521 25 -11465.48746 -26053.23111 26 -17218.42705 -11465.48746 27 -37988.85815 -17218.42705 28 -28745.32918 -37988.85815 29 -28764.74460 -28745.32918 30 -21965.53759 -28764.74460 31 -12778.96265 -21965.53759 32 -43705.13462 -12778.96265 33 7293.31728 -43705.13462 34 -25756.96107 7293.31728 35 -7213.41609 -25756.96107 36 -31030.15108 -7213.41609 37 -16087.13319 -31030.15108 38 -20433.83081 -16087.13319 39 -28031.80059 -20433.83081 40 -14203.76516 -28031.80059 41 -1379.23989 -14203.76516 42 -16245.07069 -1379.23989 43 -15272.69011 -16245.07069 44 16183.34026 -15272.69011 45 52523.92730 16183.34026 46 -21000.52343 52523.92730 47 -26862.31909 -21000.52343 48 8623.25005 -26862.31909 49 -21785.96448 8623.25005 50 -39065.04136 -21785.96448 51 -13096.76158 -39065.04136 52 13838.60437 -13096.76158 53 -4751.07685 13838.60437 54 -8239.33276 -4751.07685 55 -14889.47893 -8239.33276 56 -7338.95290 -14889.47893 57 -7527.30678 -7338.95290 58 -31463.79981 -7527.30678 59 6306.90731 -31463.79981 60 3765.60138 6306.90731 61 17902.37762 3765.60138 62 -11278.93309 17902.37762 63 -5533.44113 -11278.93309 64 -16900.32051 -5533.44113 65 -31685.34565 -16900.32051 66 30889.90632 -31685.34565 67 -36032.35932 30889.90632 68 19990.80660 -36032.35932 69 39122.09711 19990.80660 70 -19668.55131 39122.09711 71 -14839.01564 -19668.55131 72 -22225.89562 -14839.01564 73 5711.88079 -22225.89562 74 -16905.95567 5711.88079 75 13084.64127 -16905.95567 76 -1142.99347 13084.64127 77 125932.97369 -1142.99347 78 -19152.04586 125932.97369 79 -9977.21414 -19152.04586 80 -23809.53022 -9977.21414 81 30232.34518 -23809.53022 82 -27312.58798 30232.34518 83 -2230.72048 -27312.58798 84 11283.74831 -2230.72048 85 -16074.48617 11283.74831 86 3795.43208 -16074.48617 87 15141.92327 3795.43208 88 -28013.06148 15141.92327 89 25130.39869 -28013.06148 90 -25503.59820 25130.39869 91 23045.68988 -25503.59820 92 -10512.56748 23045.68988 93 -22319.25493 -10512.56748 94 21960.98288 -22319.25493 95 36438.43532 21960.98288 96 30331.30368 36438.43532 97 27310.73324 30331.30368 98 -8195.58348 27310.73324 99 17313.76419 -8195.58348 100 11068.18559 17313.76419 101 1608.26724 11068.18559 102 -53.12512 1608.26724 103 609.38684 -53.12512 104 -13578.68680 609.38684 105 -24780.34828 -13578.68680 106 -21187.43242 -24780.34828 107 -12079.39513 -21187.43242 108 77495.87594 -12079.39513 109 68488.24287 77495.87594 110 17020.00983 68488.24287 111 11081.73922 17020.00983 112 -10576.42688 11081.73922 113 -19068.08570 -10576.42688 114 -3504.73722 -19068.08570 115 -23595.67489 -3504.73722 116 -29986.74571 -23595.67489 117 -10864.12051 -29986.74571 118 19107.11362 -10864.12051 119 -8035.50575 19107.11362 120 -29677.39621 -8035.50575 121 29182.70470 -29677.39621 122 61572.55011 29182.70470 123 62940.67225 61572.55011 124 -12895.19401 62940.67225 125 16294.25900 -12895.19401 126 -26055.99955 16294.25900 127 -18324.91345 -26055.99955 128 -10124.21862 -18324.91345 129 -14559.85043 -10124.21862 130 81980.15956 -14559.85043 131 -31853.65777 81980.15956 132 -2071.23600 -31853.65777 133 6627.11823 -2071.23600 134 5428.76920 6627.11823 135 103860.56823 5428.76920 136 32019.24841 103860.56823 137 -16346.54458 32019.24841 138 -37361.25425 -16346.54458 139 -28473.47797 -37361.25425 140 56013.88659 -28473.47797 141 25784.91687 56013.88659 142 -2509.20483 25784.91687 143 10120.50516 -2509.20483 144 8779.33671 10120.50516 145 41453.45344 8779.33671 146 32231.97072 41453.45344 147 10909.92018 32231.97072 > 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/wessaorg/rcomp/tmp/7nnoo1324640985.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/wessaorg/rcomp/tmp/8062a1324640985.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/wessaorg/rcomp/tmp/9liz11324640985.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/wessaorg/rcomp/tmp/10p9ui1324640985.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/113lpb1324640985.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/wessaorg/rcomp/tmp/12x3921324640985.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/wessaorg/rcomp/tmp/13vztq1324640985.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/wessaorg/rcomp/tmp/14onvb1324640985.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/wessaorg/rcomp/tmp/15akzb1324640985.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/wessaorg/rcomp/tmp/16q1mc1324640985.tab") + } > > try(system("convert tmp/19fgp1324640985.ps tmp/19fgp1324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/2f69s1324640985.ps tmp/2f69s1324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/3tur61324640985.ps tmp/3tur61324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/47cey1324640985.ps tmp/47cey1324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/54spr1324640985.ps tmp/54spr1324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/6vpt41324640985.ps tmp/6vpt41324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/7nnoo1324640985.ps tmp/7nnoo1324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/8062a1324640985.ps tmp/8062a1324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/9liz11324640985.ps tmp/9liz11324640985.png",intern=TRUE)) character(0) > try(system("convert tmp/10p9ui1324640985.ps tmp/10p9ui1324640985.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.747 0.702 5.467