R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(65 + ,146455 + ,1 + ,95556 + ,114468 + ,127 + ,54 + ,84944 + ,4 + ,54565 + ,88594 + ,90 + ,58 + ,113337 + ,9 + ,63016 + ,74151 + ,68 + ,75 + ,128655 + ,2 + ,79774 + ,77921 + ,111 + ,41 + ,74398 + ,1 + ,31258 + ,53212 + ,51 + ,0 + ,35523 + ,2 + ,52491 + ,34956 + ,33 + ,111 + ,293403 + ,0 + ,91256 + ,149703 + ,123 + ,1 + ,32750 + ,0 + ,22807 + ,6853 + ,5 + ,36 + ,106539 + ,5 + ,77411 + ,58907 + ,63 + ,60 + ,130539 + ,0 + ,48821 + ,67067 + ,66 + ,63 + ,154991 + ,0 + ,52295 + ,110563 + ,99 + ,71 + ,126683 + ,7 + ,63262 + ,58126 + ,72 + ,38 + ,100672 + ,6 + ,50466 + ,57113 + ,55 + ,76 + ,179562 + ,3 + ,62932 + ,77993 + ,116 + ,61 + ,125971 + ,4 + ,38439 + ,68091 + ,71 + ,125 + ,234509 + ,0 + ,70817 + ,124676 + ,125 + ,84 + ,158980 + ,4 + ,105965 + ,109522 + ,123 + ,69 + ,184217 + ,3 + ,73795 + ,75865 + ,74 + ,77 + ,107342 + ,0 + ,82043 + ,79746 + ,116 + ,95 + ,141371 + ,5 + ,74349 + ,77844 + ,117 + ,78 + ,154730 + ,0 + ,82204 + ,98681 + ,98 + ,76 + ,264020 + ,1 + ,55709 + ,105531 + ,101 + ,40 + ,90938 + ,3 + ,37137 + ,51428 + ,43 + ,81 + ,101324 + ,5 + ,70780 + ,65703 + ,103 + ,102 + ,130232 + ,0 + ,55027 + ,72562 + ,107 + ,70 + ,137793 + ,0 + ,56699 + ,81728 + ,77 + ,75 + ,161678 + ,4 + ,65911 + ,95580 + ,87 + ,93 + ,151503 + ,0 + ,56316 + ,98278 + ,99 + ,42 + ,105324 + ,0 + ,26982 + ,46629 + ,46 + ,95 + ,175914 + ,0 + ,54628 + ,115189 + ,96 + ,87 + ,181853 + ,3 + ,96750 + ,124865 + ,92 + ,44 + ,114928 + ,4 + ,53009 + ,59392 + ,96 + ,84 + ,190410 + ,1 + ,64664 + ,127818 + ,96 + ,28 + ,61499 + ,4 + ,36990 + ,17821 + ,15 + ,87 + ,223004 + ,1 + ,85224 + ,154076 + ,147 + ,71 + ,167131 + ,0 + ,37048 + ,64881 + ,56 + ,68 + ,233482 + ,0 + ,59635 + ,136506 + ,81 + ,50 + ,121185 + ,2 + ,42051 + ,66524 + ,69 + ,30 + ,78776 + ,1 + ,26998 + ,45988 + ,34 + ,86 + ,188967 + ,2 + ,63717 + ,107445 + ,98 + ,75 + ,199512 + ,8 + ,55071 + ,102772 + ,82 + ,46 + ,102531 + ,5 + ,40001 + ,46657 + ,64 + ,52 + ,118958 + ,3 + ,54506 + ,97563 + ,61 + ,31 + ,68948 + ,4 + ,35838 + ,36663 + ,45 + ,30 + ,93125 + ,1 + ,50838 + ,55369 + ,37 + ,70 + ,277108 + ,2 + ,86997 + ,77921 + ,64 + ,20 + ,78800 + ,2 + ,33032 + ,56968 + ,21 + ,84 + ,157250 + ,0 + ,61704 + ,77519 + ,104 + ,81 + ,210554 + ,6 + ,117986 + ,129805 + ,126 + ,79 + ,127324 + ,3 + ,56733 + ,72761 + ,104 + ,70 + ,114397 + ,0 + ,55064 + ,81278 + ,87 + ,8 + ,24188 + ,0 + ,5950 + ,15049 + ,7 + ,67 + ,246209 + ,6 + ,84607 + ,113935 + ,130 + ,21 + ,65029 + ,5 + ,32551 + ,25109 + ,21 + ,30 + ,98030 + ,3 + ,31701 + ,45824 + ,35 + ,70 + ,173587 + ,1 + ,71170 + ,89644 + ,97 + ,87 + ,172684 + ,5 + ,101773 + ,109011 + ,103 + ,87 + ,191381 + ,5 + ,101653 + ,134245 + ,210 + ,112 + ,191276 + ,0 + ,81493 + ,136692 + ,151 + ,54 + ,134043 + ,9 + ,55901 + ,50741 + ,57 + ,96 + ,233406 + ,6 + ,109104 + ,149510 + ,117 + ,93 + ,195304 + ,6 + ,114425 + ,147888 + ,152 + ,49 + ,127619 + ,5 + ,36311 + ,54987 + ,52 + ,49 + ,162810 + ,6 + ,70027 + ,74467 + ,83 + ,38 + ,129100 + ,2 + ,73713 + ,100033 + ,87 + ,64 + ,108715 + ,0 + ,40671 + ,85505 + ,80 + ,62 + ,106469 + ,3 + ,89041 + ,62426 + ,88 + ,66 + ,142069 + ,8 + ,57231 + ,82932 + ,83 + ,98 + ,143937 + ,2 + ,78792 + ,79169 + ,140 + ,97 + ,84256 + ,5 + ,59155 + ,65469 + ,76 + ,56 + ,118807 + ,11 + ,55827 + ,63572 + ,70 + ,22 + ,69471 + ,6 + ,22618 + ,23824 + ,26 + ,51 + ,122433 + ,5 + ,58425 + ,73831 + ,66 + ,56 + ,131122 + ,1 + ,65724 + ,63551 + ,89 + ,94 + ,94763 + ,0 + ,56979 + ,56756 + ,100 + ,98 + ,188780 + ,3 + ,72369 + ,81399 + ,98 + ,76 + ,191467 + ,3 + ,79194 + ,117881 + ,109 + ,57 + ,105615 + ,6 + ,202316 + ,70711 + ,51 + ,75 + ,89318 + ,1 + ,44970 + ,50495 + ,82 + ,48 + ,107335 + ,0 + ,49319 + ,53845 + ,65 + ,48 + ,98599 + ,1 + ,36252 + ,51390 + ,46 + ,109 + ,260646 + ,0 + ,75741 + ,104953 + ,104 + ,27 + ,131876 + ,5 + ,38417 + ,65983 + ,36 + ,83 + ,119291 + ,2 + ,64102 + ,76839 + ,123 + ,49 + ,80953 + ,0 + ,56622 + ,55792 + ,59 + ,24 + ,99768 + ,0 + ,15430 + ,25155 + ,27 + ,43 + ,84572 + ,5 + ,72571 + ,55291 + ,84 + ,44 + ,202373 + ,1 + ,67271 + ,84279 + ,61 + ,49 + ,166790 + ,0 + ,43460 + ,99692 + ,46 + ,106 + ,99946 + ,1 + ,99501 + ,59633 + ,125 + ,42 + ,116900 + ,1 + ,28340 + ,63249 + ,58 + ,108 + ,142146 + ,2 + ,76013 + ,82928 + ,152 + ,27 + ,99246 + ,4 + ,37361 + ,50000 + ,52 + ,79 + ,156833 + ,1 + ,48204 + ,69455 + ,85 + ,49 + ,175078 + ,4 + ,76168 + ,84068 + ,95 + ,64 + ,130533 + ,0 + ,85168 + ,76195 + ,78 + ,75 + ,142339 + ,2 + ,125410 + ,114634 + ,144 + ,115 + ,176789 + ,0 + ,123328 + ,139357 + ,149 + ,92 + ,181379 + ,7 + ,83038 + ,110044 + ,101 + ,106 + ,228548 + ,7 + ,120087 + ,155118 + ,205 + ,73 + ,142141 + ,6 + ,91939 + ,83061 + ,61 + ,105 + ,167845 + ,0 + ,103646 + ,127122 + ,145 + ,30 + ,103012 + ,0 + ,29467 + ,45653 + ,28 + ,13 + ,43287 + ,4 + ,43750 + ,19630 + ,49 + ,69 + ,125366 + ,4 + ,34497 + ,67229 + ,68 + ,72 + ,118372 + ,0 + ,66477 + ,86060 + ,142 + ,80 + ,135171 + ,0 + ,71181 + ,88003 + ,82 + ,106 + ,175568 + ,0 + ,74482 + ,95815 + ,105 + ,28 + ,74112 + ,0 + ,174949 + ,85499 + ,52 + ,70 + ,88817 + ,0 + ,46765 + ,27220 + ,56 + ,51 + ,164767 + ,4 + ,90257 + ,109882 + ,81 + ,90 + ,141933 + ,0 + ,51370 + ,72579 + ,100 + ,12 + ,22938 + ,0 + ,1168 + ,5841 + ,11 + ,84 + ,115199 + ,0 + ,51360 + ,68369 + ,87 + ,23 + ,61857 + ,4 + ,25162 + ,24610 + ,31 + ,57 + ,91185 + ,0 + ,21067 + ,30995 + ,67 + ,84 + ,213765 + ,1 + ,58233 + ,150662 + ,150 + ,4 + ,21054 + ,0 + ,855 + ,6622 + ,4 + ,56 + ,167105 + ,5 + ,85903 + ,93694 + ,75 + ,18 + ,31414 + ,0 + ,14116 + ,13155 + ,39 + ,86 + ,178863 + ,1 + ,57637 + ,111908 + ,88 + ,39 + ,126681 + ,7 + ,94137 + ,57550 + ,67 + ,16 + ,64320 + ,5 + ,62147 + ,16356 + ,24 + ,18 + ,67746 + ,2 + ,62832 + ,40174 + ,58 + ,16 + ,38214 + ,0 + ,8773 + ,13983 + ,16 + ,42 + ,90961 + ,1 + ,63785 + ,52316 + ,49 + ,75 + ,181510 + ,0 + ,65196 + ,99585 + ,109 + ,30 + ,116775 + ,0 + ,73087 + ,86271 + ,124 + ,104 + ,223914 + ,2 + ,72631 + ,131012 + ,115 + ,121 + ,185139 + ,0 + ,86281 + ,130274 + ,128 + ,106 + ,242879 + ,2 + ,162365 + ,159051 + ,159 + ,57 + ,139144 + ,0 + ,56530 + ,76506 + ,75 + ,28 + ,75812 + ,0 + ,35606 + ,49145 + ,30 + ,56 + ,178218 + ,4 + ,70111 + ,66398 + ,83 + ,81 + ,246834 + ,4 + ,92046 + ,127546 + ,135 + ,2 + ,50999 + ,8 + ,63989 + ,6802 + ,8 + ,88 + ,223842 + ,0 + ,104911 + ,99509 + ,115 + ,41 + ,93577 + ,4 + ,43448 + ,43106 + ,60 + ,83 + ,155383 + ,0 + ,60029 + ,108303 + ,99 + ,55 + ,111664 + ,1 + ,38650 + ,64167 + ,98 + ,3 + ,75426 + ,0 + ,47261 + ,8579 + ,36 + ,54 + ,243551 + ,9 + ,73586 + ,97811 + ,93 + ,89 + ,136548 + ,0 + ,83042 + ,84365 + ,158 + ,41 + ,173260 + ,3 + ,37238 + ,10901 + ,16 + ,94 + ,185039 + ,7 + ,63958 + ,91346 + ,100 + ,101 + ,67507 + ,5 + ,78956 + ,33660 + ,49 + ,70 + ,139350 + ,2 + ,99518 + ,93634 + ,89 + ,111 + ,172964 + ,1 + ,111436 + ,109348 + ,153 + ,0 + ,0 + ,9 + ,0 + ,0 + ,0 + ,4 + ,14688 + ,0 + ,6023 + ,7953 + ,5 + ,0 + ,98 + ,0 + ,0 + ,0 + ,0 + ,0 + ,455 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,42 + ,128066 + ,2 + ,42564 + ,63538 + ,80 + ,97 + ,176460 + ,1 + ,38885 + ,108281 + ,122 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,203 + ,0 + ,0 + ,0 + ,0 + ,7 + ,7199 + ,0 + ,1644 + ,4245 + ,6 + ,12 + ,46660 + ,0 + ,6179 + ,21509 + ,13 + ,0 + ,17547 + ,0 + ,3926 + ,7670 + ,3 + ,37 + ,73567 + ,0 + ,23238 + ,10641 + ,18 + ,0 + ,969 + ,0 + ,0 + ,0 + ,0 + ,39 + ,101060 + ,2 + ,49288 + ,41243 + ,49) + ,dim=c(6 + ,164) + ,dimnames=list(c('BloggedComputation' + ,'TotalTime' + ,'Shared' + ,'Charachters' + ,'Writing' + ,'Hyperlinks') + ,1:164)) > y <- array(NA,dim=c(6,164),dimnames=list(c('BloggedComputation','TotalTime','Shared','Charachters','Writing','Hyperlinks'),1:164)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '4' > 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 Charachters BloggedComputation TotalTime Shared Writing Hyperlinks t 1 95556 65 146455 1 114468 127 1 2 54565 54 84944 4 88594 90 2 3 63016 58 113337 9 74151 68 3 4 79774 75 128655 2 77921 111 4 5 31258 41 74398 1 53212 51 5 6 52491 0 35523 2 34956 33 6 7 91256 111 293403 0 149703 123 7 8 22807 1 32750 0 6853 5 8 9 77411 36 106539 5 58907 63 9 10 48821 60 130539 0 67067 66 10 11 52295 63 154991 0 110563 99 11 12 63262 71 126683 7 58126 72 12 13 50466 38 100672 6 57113 55 13 14 62932 76 179562 3 77993 116 14 15 38439 61 125971 4 68091 71 15 16 70817 125 234509 0 124676 125 16 17 105965 84 158980 4 109522 123 17 18 73795 69 184217 3 75865 74 18 19 82043 77 107342 0 79746 116 19 20 74349 95 141371 5 77844 117 20 21 82204 78 154730 0 98681 98 21 22 55709 76 264020 1 105531 101 22 23 37137 40 90938 3 51428 43 23 24 70780 81 101324 5 65703 103 24 25 55027 102 130232 0 72562 107 25 26 56699 70 137793 0 81728 77 26 27 65911 75 161678 4 95580 87 27 28 56316 93 151503 0 98278 99 28 29 26982 42 105324 0 46629 46 29 30 54628 95 175914 0 115189 96 30 31 96750 87 181853 3 124865 92 31 32 53009 44 114928 4 59392 96 32 33 64664 84 190410 1 127818 96 33 34 36990 28 61499 4 17821 15 34 35 85224 87 223004 1 154076 147 35 36 37048 71 167131 0 64881 56 36 37 59635 68 233482 0 136506 81 37 38 42051 50 121185 2 66524 69 38 39 26998 30 78776 1 45988 34 39 40 63717 86 188967 2 107445 98 40 41 55071 75 199512 8 102772 82 41 42 40001 46 102531 5 46657 64 42 43 54506 52 118958 3 97563 61 43 44 35838 31 68948 4 36663 45 44 45 50838 30 93125 1 55369 37 45 46 86997 70 277108 2 77921 64 46 47 33032 20 78800 2 56968 21 47 48 61704 84 157250 0 77519 104 48 49 117986 81 210554 6 129805 126 49 50 56733 79 127324 3 72761 104 50 51 55064 70 114397 0 81278 87 51 52 5950 8 24188 0 15049 7 52 53 84607 67 246209 6 113935 130 53 54 32551 21 65029 5 25109 21 54 55 31701 30 98030 3 45824 35 55 56 71170 70 173587 1 89644 97 56 57 101773 87 172684 5 109011 103 57 58 101653 87 191381 5 134245 210 58 59 81493 112 191276 0 136692 151 59 60 55901 54 134043 9 50741 57 60 61 109104 96 233406 6 149510 117 61 62 114425 93 195304 6 147888 152 62 63 36311 49 127619 5 54987 52 63 64 70027 49 162810 6 74467 83 64 65 73713 38 129100 2 100033 87 65 66 40671 64 108715 0 85505 80 66 67 89041 62 106469 3 62426 88 67 68 57231 66 142069 8 82932 83 68 69 78792 98 143937 2 79169 140 69 70 59155 97 84256 5 65469 76 70 71 55827 56 118807 11 63572 70 71 72 22618 22 69471 6 23824 26 72 73 58425 51 122433 5 73831 66 73 74 65724 56 131122 1 63551 89 74 75 56979 94 94763 0 56756 100 75 76 72369 98 188780 3 81399 98 76 77 79194 76 191467 3 117881 109 77 78 202316 57 105615 6 70711 51 78 79 44970 75 89318 1 50495 82 79 80 49319 48 107335 0 53845 65 80 81 36252 48 98599 1 51390 46 81 82 75741 109 260646 0 104953 104 82 83 38417 27 131876 5 65983 36 83 84 64102 83 119291 2 76839 123 84 85 56622 49 80953 0 55792 59 85 86 15430 24 99768 0 25155 27 86 87 72571 43 84572 5 55291 84 87 88 67271 44 202373 1 84279 61 88 89 43460 49 166790 0 99692 46 89 90 99501 106 99946 1 59633 125 90 91 28340 42 116900 1 63249 58 91 92 76013 108 142146 2 82928 152 92 93 37361 27 99246 4 50000 52 93 94 48204 79 156833 1 69455 85 94 95 76168 49 175078 4 84068 95 95 96 85168 64 130533 0 76195 78 96 97 125410 75 142339 2 114634 144 97 98 123328 115 176789 0 139357 149 98 99 83038 92 181379 7 110044 101 99 100 120087 106 228548 7 155118 205 100 101 91939 73 142141 6 83061 61 101 102 103646 105 167845 0 127122 145 102 103 29467 30 103012 0 45653 28 103 104 43750 13 43287 4 19630 49 104 105 34497 69 125366 4 67229 68 105 106 66477 72 118372 0 86060 142 106 107 71181 80 135171 0 88003 82 107 108 74482 106 175568 0 95815 105 108 109 174949 28 74112 0 85499 52 109 110 46765 70 88817 0 27220 56 110 111 90257 51 164767 4 109882 81 111 112 51370 90 141933 0 72579 100 112 113 1168 12 22938 0 5841 11 113 114 51360 84 115199 0 68369 87 114 115 25162 23 61857 4 24610 31 115 116 21067 57 91185 0 30995 67 116 117 58233 84 213765 1 150662 150 117 118 855 4 21054 0 6622 4 118 119 85903 56 167105 5 93694 75 119 120 14116 18 31414 0 13155 39 120 121 57637 86 178863 1 111908 88 121 122 94137 39 126681 7 57550 67 122 123 62147 16 64320 5 16356 24 123 124 62832 18 67746 2 40174 58 124 125 8773 16 38214 0 13983 16 125 126 63785 42 90961 1 52316 49 126 127 65196 75 181510 0 99585 109 127 128 73087 30 116775 0 86271 124 128 129 72631 104 223914 2 131012 115 129 130 86281 121 185139 0 130274 128 130 131 162365 106 242879 2 159051 159 131 132 56530 57 139144 0 76506 75 132 133 35606 28 75812 0 49145 30 133 134 70111 56 178218 4 66398 83 134 135 92046 81 246834 4 127546 135 135 136 63989 2 50999 8 6802 8 136 137 104911 88 223842 0 99509 115 137 138 43448 41 93577 4 43106 60 138 139 60029 83 155383 0 108303 99 139 140 38650 55 111664 1 64167 98 140 141 47261 3 75426 0 8579 36 141 142 73586 54 243551 9 97811 93 142 143 83042 89 136548 0 84365 158 143 144 37238 41 173260 3 10901 16 144 145 63958 94 185039 7 91346 100 145 146 78956 101 67507 5 33660 49 146 147 99518 70 139350 2 93634 89 147 148 111436 111 172964 1 109348 153 148 149 0 0 0 9 0 0 149 150 6023 4 14688 0 7953 5 150 151 0 0 98 0 0 0 151 152 0 0 455 0 0 0 152 153 0 0 0 1 0 0 153 154 0 0 0 0 0 0 154 155 42564 42 128066 2 63538 80 155 156 38885 97 176460 1 108281 122 156 157 0 0 0 0 0 0 157 158 0 0 203 0 0 0 158 159 1644 7 7199 0 4245 6 159 160 6179 12 46660 0 21509 13 160 161 3926 0 17547 0 7670 3 161 162 23238 37 73567 0 10641 18 162 163 0 0 969 0 0 0 163 164 49288 39 101060 2 41243 49 164 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) BloggedComputation TotalTime Shared 4792.85969 74.05169 -0.05308 2588.89390 Writing Hyperlinks t 0.44302 205.63412 42.21277 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -46553 -11651 -5860 10196 138268 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4792.85969 5943.14372 0.806 0.421202 BloggedComputation 74.05169 113.13465 0.655 0.513719 TotalTime -0.05308 0.05889 -0.901 0.368811 Shared 2588.89390 678.58744 3.815 0.000195 *** Writing 0.44302 0.11809 3.752 0.000247 *** Hyperlinks 205.63412 93.05624 2.210 0.028567 * t 42.21277 38.45448 1.098 0.274002 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 21870 on 157 degrees of freedom Multiple R-squared: 0.5904, Adjusted R-squared: 0.5748 F-statistic: 37.72 on 6 and 157 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,] 1.150091e-03 2.300181e-03 9.988499e-01 [2,] 6.902179e-03 1.380436e-02 9.930978e-01 [3,] 1.507889e-03 3.015778e-03 9.984921e-01 [4,] 8.052298e-04 1.610460e-03 9.991948e-01 [5,] 3.208059e-02 6.416117e-02 9.679194e-01 [6,] 1.498422e-02 2.996844e-02 9.850158e-01 [7,] 1.888563e-02 3.777125e-02 9.811144e-01 [8,] 8.146504e-02 1.629301e-01 9.185350e-01 [9,] 6.170855e-02 1.234171e-01 9.382915e-01 [10,] 5.006602e-02 1.001320e-01 9.499340e-01 [11,] 3.025562e-02 6.051124e-02 9.697444e-01 [12,] 2.387987e-02 4.775973e-02 9.761201e-01 [13,] 3.290702e-02 6.581403e-02 9.670930e-01 [14,] 2.143001e-02 4.286002e-02 9.785700e-01 [15,] 1.273226e-02 2.546453e-02 9.872677e-01 [16,] 7.854688e-03 1.570938e-02 9.921453e-01 [17,] 4.477728e-03 8.955456e-03 9.955223e-01 [18,] 2.475058e-03 4.950115e-03 9.975249e-01 [19,] 1.443184e-03 2.886369e-03 9.985568e-01 [20,] 9.086112e-04 1.817222e-03 9.990914e-01 [21,] 5.252732e-04 1.050546e-03 9.994747e-01 [22,] 1.096054e-03 2.192107e-03 9.989039e-01 [23,] 1.003559e-03 2.007118e-03 9.989964e-01 [24,] 6.387002e-04 1.277400e-03 9.993613e-01 [25,] 4.864412e-04 9.728825e-04 9.995136e-01 [26,] 3.340443e-04 6.680887e-04 9.996660e-01 [27,] 1.794922e-04 3.589843e-04 9.998205e-01 [28,] 1.028533e-04 2.057065e-04 9.998971e-01 [29,] 5.993247e-05 1.198649e-04 9.999401e-01 [30,] 3.171178e-05 6.342355e-05 9.999683e-01 [31,] 1.656099e-05 3.312198e-05 9.999834e-01 [32,] 1.445941e-05 2.891881e-05 9.999855e-01 [33,] 7.726891e-06 1.545378e-05 9.999923e-01 [34,] 4.129571e-06 8.259142e-06 9.999959e-01 [35,] 2.006170e-06 4.012340e-06 9.999980e-01 [36,] 2.356527e-06 4.713054e-06 9.999976e-01 [37,] 3.020488e-05 6.040976e-05 9.999698e-01 [38,] 1.660128e-05 3.320255e-05 9.999834e-01 [39,] 8.831236e-06 1.766247e-05 9.999912e-01 [40,] 2.044935e-05 4.089871e-05 9.999796e-01 [41,] 1.234440e-05 2.468880e-05 9.999877e-01 [42,] 6.757534e-06 1.351507e-05 9.999932e-01 [43,] 4.066946e-06 8.133891e-06 9.999959e-01 [44,] 2.699112e-06 5.398225e-06 9.999973e-01 [45,] 1.406249e-06 2.812497e-06 9.999986e-01 [46,] 7.620455e-07 1.524091e-06 9.999992e-01 [47,] 4.476271e-07 8.952542e-07 9.999996e-01 [48,] 9.808401e-07 1.961680e-06 9.999990e-01 [49,] 8.797612e-07 1.759522e-06 9.999991e-01 [50,] 5.227948e-07 1.045590e-06 9.999995e-01 [51,] 2.703780e-07 5.407559e-07 9.999997e-01 [52,] 2.226415e-07 4.452831e-07 9.999998e-01 [53,] 1.451629e-07 2.903259e-07 9.999999e-01 [54,] 1.108738e-07 2.217475e-07 9.999999e-01 [55,] 5.661821e-08 1.132364e-07 9.999999e-01 [56,] 3.313452e-08 6.626904e-08 1.000000e+00 [57,] 2.707965e-08 5.415931e-08 1.000000e+00 [58,] 1.307539e-07 2.615079e-07 9.999999e-01 [59,] 1.319250e-07 2.638500e-07 9.999999e-01 [60,] 6.962855e-08 1.392571e-07 9.999999e-01 [61,] 4.217339e-08 8.434679e-08 1.000000e+00 [62,] 4.214328e-08 8.428656e-08 1.000000e+00 [63,] 3.453963e-08 6.907926e-08 1.000000e+00 [64,] 2.098024e-08 4.196048e-08 1.000000e+00 [65,] 1.323690e-08 2.647379e-08 1.000000e+00 [66,] 6.953785e-09 1.390757e-08 1.000000e+00 [67,] 3.708764e-09 7.417528e-09 1.000000e+00 [68,] 2.118395e-09 4.236790e-09 1.000000e+00 [69,] 2.791725e-01 5.583451e-01 7.208275e-01 [70,] 2.487490e-01 4.974981e-01 7.512510e-01 [71,] 2.136186e-01 4.272373e-01 7.863814e-01 [72,] 1.877966e-01 3.755933e-01 8.122034e-01 [73,] 1.585008e-01 3.170015e-01 8.414992e-01 [74,] 1.528840e-01 3.057680e-01 8.471160e-01 [75,] 1.348763e-01 2.697526e-01 8.651237e-01 [76,] 1.142002e-01 2.284003e-01 8.857998e-01 [77,] 9.938642e-02 1.987728e-01 9.006136e-01 [78,] 8.251924e-02 1.650385e-01 9.174808e-01 [79,] 6.893301e-02 1.378660e-01 9.310670e-01 [80,] 6.584335e-02 1.316867e-01 9.341567e-01 [81,] 8.134875e-02 1.626975e-01 9.186513e-01 [82,] 8.925112e-02 1.785022e-01 9.107489e-01 [83,] 7.400245e-02 1.480049e-01 9.259975e-01 [84,] 6.920573e-02 1.384115e-01 9.307943e-01 [85,] 6.115738e-02 1.223148e-01 9.388426e-01 [86,] 4.949307e-02 9.898614e-02 9.505069e-01 [87,] 5.051223e-02 1.010245e-01 9.494878e-01 [88,] 6.058370e-02 1.211674e-01 9.394163e-01 [89,] 5.711664e-02 1.142333e-01 9.428834e-01 [90,] 5.097576e-02 1.019515e-01 9.490242e-01 [91,] 4.543890e-02 9.087780e-02 9.545611e-01 [92,] 3.894685e-02 7.789370e-02 9.610531e-01 [93,] 3.041203e-02 6.082407e-02 9.695880e-01 [94,] 2.493034e-02 4.986069e-02 9.750697e-01 [95,] 1.876536e-02 3.753072e-02 9.812346e-01 [96,] 2.747783e-02 5.495567e-02 9.725222e-01 [97,] 2.293835e-02 4.587671e-02 9.770616e-01 [98,] 1.722701e-02 3.445402e-02 9.827730e-01 [99,] 1.280066e-02 2.560131e-02 9.871993e-01 [100,] 8.511804e-01 2.976392e-01 1.488196e-01 [101,] 8.224774e-01 3.550452e-01 1.775226e-01 [102,] 8.032781e-01 3.934438e-01 1.967219e-01 [103,] 7.861308e-01 4.277385e-01 2.138692e-01 [104,] 7.733373e-01 4.533254e-01 2.266627e-01 [105,] 7.438328e-01 5.123345e-01 2.561672e-01 [106,] 7.279992e-01 5.440016e-01 2.720008e-01 [107,] 7.755105e-01 4.489790e-01 2.244895e-01 [108,] 8.897848e-01 2.204303e-01 1.102152e-01 [109,] 8.896474e-01 2.207052e-01 1.103526e-01 [110,] 8.651167e-01 2.697666e-01 1.348833e-01 [111,] 8.804951e-01 2.390097e-01 1.195049e-01 [112,] 8.882500e-01 2.235001e-01 1.117500e-01 [113,] 8.876820e-01 2.246360e-01 1.123180e-01 [114,] 8.797633e-01 2.404735e-01 1.202367e-01 [115,] 8.613992e-01 2.772016e-01 1.386008e-01 [116,] 8.653763e-01 2.692474e-01 1.346237e-01 [117,] 8.412392e-01 3.175215e-01 1.587608e-01 [118,] 8.312382e-01 3.375236e-01 1.687618e-01 [119,] 7.906706e-01 4.186589e-01 2.093294e-01 [120,] 8.163921e-01 3.672159e-01 1.836079e-01 [121,] 8.134897e-01 3.730207e-01 1.865103e-01 [122,] 9.620247e-01 7.595069e-02 3.797534e-02 [123,] 9.486068e-01 1.027864e-01 5.139318e-02 [124,] 9.300458e-01 1.399084e-01 6.995418e-02 [125,] 9.062227e-01 1.875547e-01 9.377734e-02 [126,] 8.746855e-01 2.506291e-01 1.253145e-01 [127,] 9.392515e-01 1.214970e-01 6.074849e-02 [128,] 9.386104e-01 1.227792e-01 6.138962e-02 [129,] 9.146620e-01 1.706761e-01 8.533804e-02 [130,] 8.999504e-01 2.000992e-01 1.000496e-01 [131,] 9.250649e-01 1.498703e-01 7.493514e-02 [132,] 9.297008e-01 1.405985e-01 7.029923e-02 [133,] 9.084006e-01 1.831988e-01 9.159939e-02 [134,] 8.697358e-01 2.605285e-01 1.302642e-01 [135,] 8.196417e-01 3.607166e-01 1.803583e-01 [136,] 8.288636e-01 3.422728e-01 1.711364e-01 [137,] 7.763511e-01 4.472978e-01 2.236489e-01 [138,] 9.973354e-01 5.329173e-03 2.664586e-03 [139,] 9.999390e-01 1.219079e-04 6.095396e-05 [140,] 9.999786e-01 4.280144e-05 2.140072e-05 [141,] 9.999624e-01 7.526763e-05 3.763381e-05 [142,] 9.998634e-01 2.732747e-04 1.366373e-04 [143,] 9.996251e-01 7.497348e-04 3.748674e-04 [144,] 9.999773e-01 4.546571e-05 2.273286e-05 [145,] 9.996040e-01 7.919617e-04 3.959809e-04 > postscript(file="/var/www/rcomp/tmp/1obh41321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2lyy81321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/32p6q1321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/4pc531321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5s5nt1321619320.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 = 164 Frequency = 1 1 2 3 4 5 6 14264.87045 -17914.05397 -10316.51200 13563.21517 -9483.46774 21880.39784 7 8 9 10 11 12 1906.20935 15276.42832 23230.65932 2807.55155 -18740.46720 749.86323 13 14 15 16 17 18 -4491.73414 -4722.02088 -19939.40893 -12399.09710 18503.27549 16316.93163 19 20 21 22 23 24 17260.83492 -2309.69128 15091.35421 -11737.62522 -6154.75030 1121.23668 25 26 27 28 29 30 -5611.48972 897.57256 -7583.80058 -12401.28239 -6671.76481 -19901.16925 31 32 33 34 35 36 11855.45594 -6701.29509 -16591.63066 10617.42178 -16728.38836 -5910.63785 37 38 39 40 41 42 -16494.13149 -10454.48669 -7435.62532 -12033.36215 -29520.32009 -11304.26514 43 44 45 46 47 48 -13171.51744 -5299.87680 12139.81909 36927.53131 -5777.52750 1282.39692 49 50 51 52 53 54 17352.49883 -10649.90284 -4891.47971 -8452.97202 -7058.06474 -1011.53155 55 56 57 58 59 60 -7696.88435 5793.45850 14878.12486 -17473.71294 -15539.97384 -5809.42241 61 62 63 64 65 66 1187.07959 -1812.87254 -15994.06740 1953.94574 2829.96685 -20208.13430 67 68 69 70 71 72 28961.21299 -22298.55667 2429.01702 -8880.47950 -20839.92050 -14590.43852 73 74 75 76 77 78 -5952.66095 11575.25770 1381.54273 3150.39269 -6719.23710 138268.17934 79 80 81 82 83 84 -5792.06352 6070.94028 -5096.17414 5366.88289 -14458.52663 -8563.48061 85 86 87 88 89 90 12059.83995 -6171.42582 10697.43371 13776.44161 -13490.44334 33652.50972 91 92 93 94 95 96 -19736.02334 -6289.36658 -11288.99305 -8920.61046 5894.23794 28716.24828 97 98 99 100 101 102 32949.25498 22888.29570 -10762.73729 -13643.71840 20146.47082 9546.12092 103 104 105 106 107 108 -2410.79917 6773.71568 -27306.29782 -9165.70101 7272.54790 2559.63108 109 110 111 112 113 114 118844.42624 13284.63973 10055.27500 -9999.43812 -12915.72595 -6530.11848 115 116 117 118 119 120 -10538.34977 -15512.65180 -46553.48090 -11853.92851 10933.89500 -9255.65017 121 122 123 124 125 126 -19400.82450 30634.35627 29265.25221 20165.08452 -9937.93271 19549.03504 127 128 129 130 131 132 -7410.15074 3148.96545 -20290.79723 -7168.39256 48747.55662 13.10584 133 134 135 136 137 138 -792.01537 8134.97695 -5964.36758 30644.25450 31966.69850 -7030.08027 139 140 141 142 143 144 -16868.70826 -21367.07899 29093.76195 -14029.39560 3004.01477 16640.04215 145 146 147 148 149 150 -23249.18261 26171.27441 25771.49348 18861.95582 -34382.60679 -9169.90590 151 152 153 154 155 156 -11161.78587 -11185.05075 -13840.30668 -11293.62555 -14861.87826 -45957.11292 157 158 159 160 161 162 -11420.26384 -11451.70232 -13111.37931 -15982.15168 -10746.65479 4355.77983 163 164 -11622.11045 6522.76000 > postscript(file="/var/www/rcomp/tmp/63i4w1321619320.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 = 164 Frequency = 1 lag(myerror, k = 1) myerror 0 14264.87045 NA 1 -17914.05397 14264.87045 2 -10316.51200 -17914.05397 3 13563.21517 -10316.51200 4 -9483.46774 13563.21517 5 21880.39784 -9483.46774 6 1906.20935 21880.39784 7 15276.42832 1906.20935 8 23230.65932 15276.42832 9 2807.55155 23230.65932 10 -18740.46720 2807.55155 11 749.86323 -18740.46720 12 -4491.73414 749.86323 13 -4722.02088 -4491.73414 14 -19939.40893 -4722.02088 15 -12399.09710 -19939.40893 16 18503.27549 -12399.09710 17 16316.93163 18503.27549 18 17260.83492 16316.93163 19 -2309.69128 17260.83492 20 15091.35421 -2309.69128 21 -11737.62522 15091.35421 22 -6154.75030 -11737.62522 23 1121.23668 -6154.75030 24 -5611.48972 1121.23668 25 897.57256 -5611.48972 26 -7583.80058 897.57256 27 -12401.28239 -7583.80058 28 -6671.76481 -12401.28239 29 -19901.16925 -6671.76481 30 11855.45594 -19901.16925 31 -6701.29509 11855.45594 32 -16591.63066 -6701.29509 33 10617.42178 -16591.63066 34 -16728.38836 10617.42178 35 -5910.63785 -16728.38836 36 -16494.13149 -5910.63785 37 -10454.48669 -16494.13149 38 -7435.62532 -10454.48669 39 -12033.36215 -7435.62532 40 -29520.32009 -12033.36215 41 -11304.26514 -29520.32009 42 -13171.51744 -11304.26514 43 -5299.87680 -13171.51744 44 12139.81909 -5299.87680 45 36927.53131 12139.81909 46 -5777.52750 36927.53131 47 1282.39692 -5777.52750 48 17352.49883 1282.39692 49 -10649.90284 17352.49883 50 -4891.47971 -10649.90284 51 -8452.97202 -4891.47971 52 -7058.06474 -8452.97202 53 -1011.53155 -7058.06474 54 -7696.88435 -1011.53155 55 5793.45850 -7696.88435 56 14878.12486 5793.45850 57 -17473.71294 14878.12486 58 -15539.97384 -17473.71294 59 -5809.42241 -15539.97384 60 1187.07959 -5809.42241 61 -1812.87254 1187.07959 62 -15994.06740 -1812.87254 63 1953.94574 -15994.06740 64 2829.96685 1953.94574 65 -20208.13430 2829.96685 66 28961.21299 -20208.13430 67 -22298.55667 28961.21299 68 2429.01702 -22298.55667 69 -8880.47950 2429.01702 70 -20839.92050 -8880.47950 71 -14590.43852 -20839.92050 72 -5952.66095 -14590.43852 73 11575.25770 -5952.66095 74 1381.54273 11575.25770 75 3150.39269 1381.54273 76 -6719.23710 3150.39269 77 138268.17934 -6719.23710 78 -5792.06352 138268.17934 79 6070.94028 -5792.06352 80 -5096.17414 6070.94028 81 5366.88289 -5096.17414 82 -14458.52663 5366.88289 83 -8563.48061 -14458.52663 84 12059.83995 -8563.48061 85 -6171.42582 12059.83995 86 10697.43371 -6171.42582 87 13776.44161 10697.43371 88 -13490.44334 13776.44161 89 33652.50972 -13490.44334 90 -19736.02334 33652.50972 91 -6289.36658 -19736.02334 92 -11288.99305 -6289.36658 93 -8920.61046 -11288.99305 94 5894.23794 -8920.61046 95 28716.24828 5894.23794 96 32949.25498 28716.24828 97 22888.29570 32949.25498 98 -10762.73729 22888.29570 99 -13643.71840 -10762.73729 100 20146.47082 -13643.71840 101 9546.12092 20146.47082 102 -2410.79917 9546.12092 103 6773.71568 -2410.79917 104 -27306.29782 6773.71568 105 -9165.70101 -27306.29782 106 7272.54790 -9165.70101 107 2559.63108 7272.54790 108 118844.42624 2559.63108 109 13284.63973 118844.42624 110 10055.27500 13284.63973 111 -9999.43812 10055.27500 112 -12915.72595 -9999.43812 113 -6530.11848 -12915.72595 114 -10538.34977 -6530.11848 115 -15512.65180 -10538.34977 116 -46553.48090 -15512.65180 117 -11853.92851 -46553.48090 118 10933.89500 -11853.92851 119 -9255.65017 10933.89500 120 -19400.82450 -9255.65017 121 30634.35627 -19400.82450 122 29265.25221 30634.35627 123 20165.08452 29265.25221 124 -9937.93271 20165.08452 125 19549.03504 -9937.93271 126 -7410.15074 19549.03504 127 3148.96545 -7410.15074 128 -20290.79723 3148.96545 129 -7168.39256 -20290.79723 130 48747.55662 -7168.39256 131 13.10584 48747.55662 132 -792.01537 13.10584 133 8134.97695 -792.01537 134 -5964.36758 8134.97695 135 30644.25450 -5964.36758 136 31966.69850 30644.25450 137 -7030.08027 31966.69850 138 -16868.70826 -7030.08027 139 -21367.07899 -16868.70826 140 29093.76195 -21367.07899 141 -14029.39560 29093.76195 142 3004.01477 -14029.39560 143 16640.04215 3004.01477 144 -23249.18261 16640.04215 145 26171.27441 -23249.18261 146 25771.49348 26171.27441 147 18861.95582 25771.49348 148 -34382.60679 18861.95582 149 -9169.90590 -34382.60679 150 -11161.78587 -9169.90590 151 -11185.05075 -11161.78587 152 -13840.30668 -11185.05075 153 -11293.62555 -13840.30668 154 -14861.87826 -11293.62555 155 -45957.11292 -14861.87826 156 -11420.26384 -45957.11292 157 -11451.70232 -11420.26384 158 -13111.37931 -11451.70232 159 -15982.15168 -13111.37931 160 -10746.65479 -15982.15168 161 4355.77983 -10746.65479 162 -11622.11045 4355.77983 163 6522.76000 -11622.11045 164 NA 6522.76000 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -17914.05397 14264.87045 [2,] -10316.51200 -17914.05397 [3,] 13563.21517 -10316.51200 [4,] -9483.46774 13563.21517 [5,] 21880.39784 -9483.46774 [6,] 1906.20935 21880.39784 [7,] 15276.42832 1906.20935 [8,] 23230.65932 15276.42832 [9,] 2807.55155 23230.65932 [10,] -18740.46720 2807.55155 [11,] 749.86323 -18740.46720 [12,] -4491.73414 749.86323 [13,] -4722.02088 -4491.73414 [14,] -19939.40893 -4722.02088 [15,] -12399.09710 -19939.40893 [16,] 18503.27549 -12399.09710 [17,] 16316.93163 18503.27549 [18,] 17260.83492 16316.93163 [19,] -2309.69128 17260.83492 [20,] 15091.35421 -2309.69128 [21,] -11737.62522 15091.35421 [22,] -6154.75030 -11737.62522 [23,] 1121.23668 -6154.75030 [24,] -5611.48972 1121.23668 [25,] 897.57256 -5611.48972 [26,] -7583.80058 897.57256 [27,] -12401.28239 -7583.80058 [28,] -6671.76481 -12401.28239 [29,] -19901.16925 -6671.76481 [30,] 11855.45594 -19901.16925 [31,] -6701.29509 11855.45594 [32,] -16591.63066 -6701.29509 [33,] 10617.42178 -16591.63066 [34,] -16728.38836 10617.42178 [35,] -5910.63785 -16728.38836 [36,] -16494.13149 -5910.63785 [37,] -10454.48669 -16494.13149 [38,] -7435.62532 -10454.48669 [39,] -12033.36215 -7435.62532 [40,] -29520.32009 -12033.36215 [41,] -11304.26514 -29520.32009 [42,] -13171.51744 -11304.26514 [43,] -5299.87680 -13171.51744 [44,] 12139.81909 -5299.87680 [45,] 36927.53131 12139.81909 [46,] -5777.52750 36927.53131 [47,] 1282.39692 -5777.52750 [48,] 17352.49883 1282.39692 [49,] -10649.90284 17352.49883 [50,] -4891.47971 -10649.90284 [51,] -8452.97202 -4891.47971 [52,] -7058.06474 -8452.97202 [53,] -1011.53155 -7058.06474 [54,] -7696.88435 -1011.53155 [55,] 5793.45850 -7696.88435 [56,] 14878.12486 5793.45850 [57,] -17473.71294 14878.12486 [58,] -15539.97384 -17473.71294 [59,] -5809.42241 -15539.97384 [60,] 1187.07959 -5809.42241 [61,] -1812.87254 1187.07959 [62,] -15994.06740 -1812.87254 [63,] 1953.94574 -15994.06740 [64,] 2829.96685 1953.94574 [65,] -20208.13430 2829.96685 [66,] 28961.21299 -20208.13430 [67,] -22298.55667 28961.21299 [68,] 2429.01702 -22298.55667 [69,] -8880.47950 2429.01702 [70,] -20839.92050 -8880.47950 [71,] -14590.43852 -20839.92050 [72,] -5952.66095 -14590.43852 [73,] 11575.25770 -5952.66095 [74,] 1381.54273 11575.25770 [75,] 3150.39269 1381.54273 [76,] -6719.23710 3150.39269 [77,] 138268.17934 -6719.23710 [78,] -5792.06352 138268.17934 [79,] 6070.94028 -5792.06352 [80,] -5096.17414 6070.94028 [81,] 5366.88289 -5096.17414 [82,] -14458.52663 5366.88289 [83,] -8563.48061 -14458.52663 [84,] 12059.83995 -8563.48061 [85,] -6171.42582 12059.83995 [86,] 10697.43371 -6171.42582 [87,] 13776.44161 10697.43371 [88,] -13490.44334 13776.44161 [89,] 33652.50972 -13490.44334 [90,] -19736.02334 33652.50972 [91,] -6289.36658 -19736.02334 [92,] -11288.99305 -6289.36658 [93,] -8920.61046 -11288.99305 [94,] 5894.23794 -8920.61046 [95,] 28716.24828 5894.23794 [96,] 32949.25498 28716.24828 [97,] 22888.29570 32949.25498 [98,] -10762.73729 22888.29570 [99,] -13643.71840 -10762.73729 [100,] 20146.47082 -13643.71840 [101,] 9546.12092 20146.47082 [102,] -2410.79917 9546.12092 [103,] 6773.71568 -2410.79917 [104,] -27306.29782 6773.71568 [105,] -9165.70101 -27306.29782 [106,] 7272.54790 -9165.70101 [107,] 2559.63108 7272.54790 [108,] 118844.42624 2559.63108 [109,] 13284.63973 118844.42624 [110,] 10055.27500 13284.63973 [111,] -9999.43812 10055.27500 [112,] -12915.72595 -9999.43812 [113,] -6530.11848 -12915.72595 [114,] -10538.34977 -6530.11848 [115,] -15512.65180 -10538.34977 [116,] -46553.48090 -15512.65180 [117,] -11853.92851 -46553.48090 [118,] 10933.89500 -11853.92851 [119,] -9255.65017 10933.89500 [120,] -19400.82450 -9255.65017 [121,] 30634.35627 -19400.82450 [122,] 29265.25221 30634.35627 [123,] 20165.08452 29265.25221 [124,] -9937.93271 20165.08452 [125,] 19549.03504 -9937.93271 [126,] -7410.15074 19549.03504 [127,] 3148.96545 -7410.15074 [128,] -20290.79723 3148.96545 [129,] -7168.39256 -20290.79723 [130,] 48747.55662 -7168.39256 [131,] 13.10584 48747.55662 [132,] -792.01537 13.10584 [133,] 8134.97695 -792.01537 [134,] -5964.36758 8134.97695 [135,] 30644.25450 -5964.36758 [136,] 31966.69850 30644.25450 [137,] -7030.08027 31966.69850 [138,] -16868.70826 -7030.08027 [139,] -21367.07899 -16868.70826 [140,] 29093.76195 -21367.07899 [141,] -14029.39560 29093.76195 [142,] 3004.01477 -14029.39560 [143,] 16640.04215 3004.01477 [144,] -23249.18261 16640.04215 [145,] 26171.27441 -23249.18261 [146,] 25771.49348 26171.27441 [147,] 18861.95582 25771.49348 [148,] -34382.60679 18861.95582 [149,] -9169.90590 -34382.60679 [150,] -11161.78587 -9169.90590 [151,] -11185.05075 -11161.78587 [152,] -13840.30668 -11185.05075 [153,] -11293.62555 -13840.30668 [154,] -14861.87826 -11293.62555 [155,] -45957.11292 -14861.87826 [156,] -11420.26384 -45957.11292 [157,] -11451.70232 -11420.26384 [158,] -13111.37931 -11451.70232 [159,] -15982.15168 -13111.37931 [160,] -10746.65479 -15982.15168 [161,] 4355.77983 -10746.65479 [162,] -11622.11045 4355.77983 [163,] 6522.76000 -11622.11045 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -17914.05397 14264.87045 2 -10316.51200 -17914.05397 3 13563.21517 -10316.51200 4 -9483.46774 13563.21517 5 21880.39784 -9483.46774 6 1906.20935 21880.39784 7 15276.42832 1906.20935 8 23230.65932 15276.42832 9 2807.55155 23230.65932 10 -18740.46720 2807.55155 11 749.86323 -18740.46720 12 -4491.73414 749.86323 13 -4722.02088 -4491.73414 14 -19939.40893 -4722.02088 15 -12399.09710 -19939.40893 16 18503.27549 -12399.09710 17 16316.93163 18503.27549 18 17260.83492 16316.93163 19 -2309.69128 17260.83492 20 15091.35421 -2309.69128 21 -11737.62522 15091.35421 22 -6154.75030 -11737.62522 23 1121.23668 -6154.75030 24 -5611.48972 1121.23668 25 897.57256 -5611.48972 26 -7583.80058 897.57256 27 -12401.28239 -7583.80058 28 -6671.76481 -12401.28239 29 -19901.16925 -6671.76481 30 11855.45594 -19901.16925 31 -6701.29509 11855.45594 32 -16591.63066 -6701.29509 33 10617.42178 -16591.63066 34 -16728.38836 10617.42178 35 -5910.63785 -16728.38836 36 -16494.13149 -5910.63785 37 -10454.48669 -16494.13149 38 -7435.62532 -10454.48669 39 -12033.36215 -7435.62532 40 -29520.32009 -12033.36215 41 -11304.26514 -29520.32009 42 -13171.51744 -11304.26514 43 -5299.87680 -13171.51744 44 12139.81909 -5299.87680 45 36927.53131 12139.81909 46 -5777.52750 36927.53131 47 1282.39692 -5777.52750 48 17352.49883 1282.39692 49 -10649.90284 17352.49883 50 -4891.47971 -10649.90284 51 -8452.97202 -4891.47971 52 -7058.06474 -8452.97202 53 -1011.53155 -7058.06474 54 -7696.88435 -1011.53155 55 5793.45850 -7696.88435 56 14878.12486 5793.45850 57 -17473.71294 14878.12486 58 -15539.97384 -17473.71294 59 -5809.42241 -15539.97384 60 1187.07959 -5809.42241 61 -1812.87254 1187.07959 62 -15994.06740 -1812.87254 63 1953.94574 -15994.06740 64 2829.96685 1953.94574 65 -20208.13430 2829.96685 66 28961.21299 -20208.13430 67 -22298.55667 28961.21299 68 2429.01702 -22298.55667 69 -8880.47950 2429.01702 70 -20839.92050 -8880.47950 71 -14590.43852 -20839.92050 72 -5952.66095 -14590.43852 73 11575.25770 -5952.66095 74 1381.54273 11575.25770 75 3150.39269 1381.54273 76 -6719.23710 3150.39269 77 138268.17934 -6719.23710 78 -5792.06352 138268.17934 79 6070.94028 -5792.06352 80 -5096.17414 6070.94028 81 5366.88289 -5096.17414 82 -14458.52663 5366.88289 83 -8563.48061 -14458.52663 84 12059.83995 -8563.48061 85 -6171.42582 12059.83995 86 10697.43371 -6171.42582 87 13776.44161 10697.43371 88 -13490.44334 13776.44161 89 33652.50972 -13490.44334 90 -19736.02334 33652.50972 91 -6289.36658 -19736.02334 92 -11288.99305 -6289.36658 93 -8920.61046 -11288.99305 94 5894.23794 -8920.61046 95 28716.24828 5894.23794 96 32949.25498 28716.24828 97 22888.29570 32949.25498 98 -10762.73729 22888.29570 99 -13643.71840 -10762.73729 100 20146.47082 -13643.71840 101 9546.12092 20146.47082 102 -2410.79917 9546.12092 103 6773.71568 -2410.79917 104 -27306.29782 6773.71568 105 -9165.70101 -27306.29782 106 7272.54790 -9165.70101 107 2559.63108 7272.54790 108 118844.42624 2559.63108 109 13284.63973 118844.42624 110 10055.27500 13284.63973 111 -9999.43812 10055.27500 112 -12915.72595 -9999.43812 113 -6530.11848 -12915.72595 114 -10538.34977 -6530.11848 115 -15512.65180 -10538.34977 116 -46553.48090 -15512.65180 117 -11853.92851 -46553.48090 118 10933.89500 -11853.92851 119 -9255.65017 10933.89500 120 -19400.82450 -9255.65017 121 30634.35627 -19400.82450 122 29265.25221 30634.35627 123 20165.08452 29265.25221 124 -9937.93271 20165.08452 125 19549.03504 -9937.93271 126 -7410.15074 19549.03504 127 3148.96545 -7410.15074 128 -20290.79723 3148.96545 129 -7168.39256 -20290.79723 130 48747.55662 -7168.39256 131 13.10584 48747.55662 132 -792.01537 13.10584 133 8134.97695 -792.01537 134 -5964.36758 8134.97695 135 30644.25450 -5964.36758 136 31966.69850 30644.25450 137 -7030.08027 31966.69850 138 -16868.70826 -7030.08027 139 -21367.07899 -16868.70826 140 29093.76195 -21367.07899 141 -14029.39560 29093.76195 142 3004.01477 -14029.39560 143 16640.04215 3004.01477 144 -23249.18261 16640.04215 145 26171.27441 -23249.18261 146 25771.49348 26171.27441 147 18861.95582 25771.49348 148 -34382.60679 18861.95582 149 -9169.90590 -34382.60679 150 -11161.78587 -9169.90590 151 -11185.05075 -11161.78587 152 -13840.30668 -11185.05075 153 -11293.62555 -13840.30668 154 -14861.87826 -11293.62555 155 -45957.11292 -14861.87826 156 -11420.26384 -45957.11292 157 -11451.70232 -11420.26384 158 -13111.37931 -11451.70232 159 -15982.15168 -13111.37931 160 -10746.65479 -15982.15168 161 4355.77983 -10746.65479 162 -11622.11045 4355.77983 163 6522.76000 -11622.11045 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/71m601321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/8rv0f1321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/96ijs1321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/10gi0i1321619320.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/11868y1321619320.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/12ie1b1321619320.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/13jp5n1321619320.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/1479j91321619320.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/15wpan1321619320.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/16la3s1321619320.tab") + } > > try(system("convert tmp/1obh41321619320.ps tmp/1obh41321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/2lyy81321619320.ps tmp/2lyy81321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/32p6q1321619320.ps tmp/32p6q1321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/4pc531321619320.ps tmp/4pc531321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/5s5nt1321619320.ps tmp/5s5nt1321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/63i4w1321619320.ps tmp/63i4w1321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/71m601321619320.ps tmp/71m601321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/8rv0f1321619320.ps tmp/8rv0f1321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/96ijs1321619320.ps tmp/96ijs1321619320.png",intern=TRUE)) character(0) > try(system("convert tmp/10gi0i1321619320.ps tmp/10gi0i1321619320.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.610 0.430 6.018