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(170650 + ,65 + ,26 + ,99 + ,95556 + ,127 + ,86621 + ,54 + ,20 + ,77 + ,54565 + ,90 + ,127843 + ,58 + ,27 + ,102 + ,63016 + ,68 + ,152526 + ,99 + ,25 + ,96 + ,79774 + ,111 + ,92389 + ,41 + ,17 + ,49 + ,31258 + ,51 + ,38138 + ,0 + ,16 + ,64 + ,52491 + ,33 + ,316392 + ,112 + ,20 + ,76 + ,91256 + ,123 + ,32750 + ,1 + ,18 + ,67 + ,22807 + ,5 + ,123444 + ,40 + ,19 + ,72 + ,77411 + ,63 + ,137034 + ,60 + ,22 + ,83 + ,48821 + ,66 + ,176816 + ,68 + ,30 + ,113 + ,52295 + ,99 + ,143205 + ,74 + ,40 + ,151 + ,63262 + ,72 + ,113286 + ,38 + ,26 + ,88 + ,50466 + ,55 + ,195452 + ,77 + ,36 + ,123 + ,62932 + ,116 + ,144513 + ,62 + ,31 + ,118 + ,38439 + ,71 + ,263581 + ,126 + ,41 + ,157 + ,70817 + ,125 + ,183271 + ,85 + ,24 + ,92 + ,105965 + ,123 + ,210763 + ,74 + ,27 + ,103 + ,73795 + ,74 + ,113853 + ,78 + ,19 + ,72 + ,82043 + ,116 + ,159968 + ,100 + ,30 + ,115 + ,74349 + ,117 + ,174585 + ,79 + ,31 + ,115 + ,82204 + ,98 + ,294675 + ,77 + ,26 + ,92 + ,55709 + ,101 + ,96213 + ,42 + ,15 + ,56 + ,37137 + ,43 + ,116390 + ,83 + ,33 + ,132 + ,70780 + ,103 + ,146342 + ,103 + ,28 + ,107 + ,55027 + ,107 + ,152647 + ,71 + ,27 + ,102 + ,56699 + ,77 + ,166661 + ,77 + ,21 + ,78 + ,65911 + ,87 + ,175505 + ,100 + ,27 + ,103 + ,56316 + ,99 + ,112485 + ,45 + ,21 + ,81 + ,26982 + ,46 + ,198790 + ,101 + ,30 + ,114 + ,54628 + ,96 + ,191822 + ,87 + ,30 + ,115 + ,96750 + ,92 + ,140267 + ,44 + ,33 + ,118 + ,53009 + ,96 + ,221991 + ,97 + ,35 + ,133 + ,64664 + ,96 + ,75339 + ,32 + ,26 + ,99 + ,36990 + ,15 + ,247985 + ,89 + ,27 + ,103 + ,85224 + ,147 + ,167351 + ,71 + ,25 + ,93 + ,37048 + ,56 + ,266609 + ,70 + ,30 + ,114 + ,59635 + ,81 + ,122024 + ,50 + ,20 + ,76 + ,42051 + ,69 + ,80964 + ,30 + ,8 + ,27 + ,26998 + ,34 + ,215183 + ,90 + ,24 + ,92 + ,63717 + ,98 + ,225469 + ,78 + ,25 + ,96 + ,55071 + ,82 + ,125382 + ,48 + ,28 + ,104 + ,40001 + ,64 + ,141437 + ,57 + ,23 + ,84 + ,54506 + ,61 + ,81106 + ,31 + ,21 + ,79 + ,35838 + ,45 + ,93125 + ,30 + ,21 + ,57 + ,50838 + ,37 + ,318668 + ,72 + ,26 + ,99 + ,86997 + ,64 + ,78800 + ,20 + ,26 + ,82 + ,33032 + ,21 + ,161048 + ,84 + ,30 + ,113 + ,61704 + ,104 + ,236367 + ,94 + ,34 + ,129 + ,117986 + ,126 + ,131108 + ,79 + ,30 + ,110 + ,56733 + ,104 + ,131096 + ,72 + ,18 + ,78 + ,55064 + ,87 + ,24188 + ,8 + ,4 + ,12 + ,5950 + ,7 + ,267003 + ,67 + ,31 + ,114 + ,84607 + ,130 + ,65029 + ,21 + ,18 + ,67 + ,32551 + ,21 + ,100147 + ,30 + ,14 + ,52 + ,31701 + ,35 + ,178549 + ,70 + ,21 + ,80 + ,71170 + ,97 + ,186965 + ,89 + ,37 + ,138 + ,101773 + ,103 + ,197266 + ,87 + ,24 + ,92 + ,101653 + ,210 + ,217300 + ,116 + ,29 + ,105 + ,81493 + ,151 + ,149594 + ,54 + ,24 + ,91 + ,55901 + ,57 + ,263413 + ,112 + ,31 + ,118 + ,109104 + ,117 + ,209228 + ,94 + ,21 + ,77 + ,114425 + ,152 + ,145699 + ,51 + ,31 + ,122 + ,36311 + ,52 + ,187197 + ,52 + ,26 + ,99 + ,70027 + ,83 + ,150752 + ,38 + ,24 + ,92 + ,73713 + ,87 + ,131218 + ,65 + ,18 + ,70 + ,40671 + ,80 + ,118697 + ,64 + ,21 + ,81 + ,89041 + ,88 + ,147913 + ,66 + ,29 + ,107 + ,57231 + ,83 + ,155015 + ,99 + ,24 + ,92 + ,68608 + ,120 + ,96487 + ,100 + ,21 + ,77 + ,59155 + ,76 + ,128780 + ,56 + ,30 + ,115 + ,55827 + ,70 + ,71972 + ,22 + ,20 + ,76 + ,22618 + ,26 + ,140266 + ,51 + ,30 + ,115 + ,58425 + ,66 + ,148454 + ,62 + ,24 + ,92 + ,65724 + ,89 + ,110655 + ,97 + ,26 + ,100 + ,56979 + ,100 + ,204822 + ,99 + ,27 + ,103 + ,72369 + ,98 + ,216052 + ,77 + ,24 + ,92 + ,79194 + ,109 + ,113421 + ,58 + ,23 + ,87 + ,202316 + ,51 + ,103660 + ,77 + ,26 + ,100 + ,44970 + ,82 + ,128390 + ,52 + ,25 + ,95 + ,49319 + ,65 + ,105502 + ,48 + ,18 + ,69 + ,36252 + ,46 + ,299359 + ,111 + ,30 + ,115 + ,75741 + ,104 + ,141493 + ,28 + ,25 + ,95 + ,38417 + ,36 + ,148356 + ,86 + ,27 + ,55 + ,64102 + ,123 + ,80953 + ,49 + ,8 + ,28 + ,56622 + ,59 + ,109237 + ,24 + ,21 + ,79 + ,15430 + ,27 + ,102104 + ,46 + ,26 + ,99 + ,72571 + ,84 + ,233139 + ,44 + ,24 + ,92 + ,67271 + ,61 + ,176507 + ,49 + ,30 + ,98 + ,43460 + ,46 + ,118217 + ,108 + ,27 + ,103 + ,99501 + ,125 + ,142694 + ,44 + ,24 + ,89 + ,28340 + ,58 + ,152193 + ,110 + ,25 + ,95 + ,76013 + ,152 + ,126500 + ,30 + ,21 + ,78 + ,37361 + ,52 + ,174710 + ,82 + ,24 + ,92 + ,48204 + ,85 + ,187772 + ,49 + ,24 + ,92 + ,76168 + ,95 + ,140903 + ,64 + ,24 + ,92 + ,85168 + ,78 + ,155350 + ,75 + ,24 + ,83 + ,125410 + ,144 + ,202077 + ,123 + ,24 + ,92 + ,123328 + ,149 + ,213875 + ,104 + ,40 + ,151 + ,83038 + ,101 + ,252952 + ,106 + ,22 + ,83 + ,120087 + ,205 + ,166981 + ,73 + ,31 + ,118 + ,91939 + ,61 + ,190562 + ,110 + ,26 + ,98 + ,103646 + ,145 + ,106351 + ,30 + ,20 + ,76 + ,29467 + ,28 + ,43287 + ,13 + ,19 + ,71 + ,43750 + ,49 + ,127493 + ,69 + ,15 + ,57 + ,34497 + ,68 + ,132143 + ,75 + ,22 + ,83 + ,66477 + ,142 + ,157469 + ,82 + ,25 + ,95 + ,71181 + ,82 + ,197727 + ,108 + ,28 + ,108 + ,74482 + ,105 + ,88077 + ,28 + ,23 + ,91 + ,174949 + ,52 + ,94968 + ,83 + ,25 + ,99 + ,46765 + ,56 + ,191753 + ,52 + ,26 + ,100 + ,90257 + ,81 + ,153332 + ,90 + ,32 + ,119 + ,51370 + ,100 + ,22938 + ,12 + ,1 + ,0 + ,1168 + ,11 + ,125927 + ,87 + ,24 + ,91 + ,51360 + ,87 + ,61857 + ,23 + ,11 + ,32 + ,25162 + ,31 + ,103749 + ,57 + ,31 + ,117 + ,21067 + ,67 + ,269909 + ,93 + ,26 + ,99 + ,58233 + ,150 + ,21054 + ,4 + ,0 + ,0 + ,855 + ,4 + ,174409 + ,56 + ,19 + ,68 + ,85903 + ,75 + ,31414 + ,18 + ,8 + ,25 + ,14116 + ,39 + ,200405 + ,87 + ,27 + ,102 + ,57637 + ,88 + ,139456 + ,40 + ,31 + ,115 + ,94137 + ,67 + ,78001 + ,16 + ,24 + ,92 + ,62147 + ,24 + ,82724 + ,22 + ,20 + ,71 + ,62832 + ,58 + ,38214 + ,16 + ,8 + ,27 + ,8773 + ,16 + ,91390 + ,42 + ,22 + ,83 + ,63785 + ,49 + ,197612 + ,79 + ,33 + ,126 + ,65196 + ,109 + ,137161 + ,31 + ,33 + ,125 + ,73087 + ,124 + ,251103 + ,105 + ,31 + ,119 + ,72631 + ,115 + ,209835 + ,123 + ,33 + ,127 + ,86281 + ,128 + ,269470 + ,114 + ,35 + ,133 + ,162365 + ,159 + ,139215 + ,57 + ,21 + ,79 + ,56530 + ,75 + ,77796 + ,28 + ,24 + ,92 + ,35606 + ,30 + ,197114 + ,56 + ,25 + ,96 + ,70111 + ,83 + ,291962 + ,84 + ,31 + ,117 + ,92046 + ,135 + ,56727 + ,2 + ,22 + ,84 + ,63989 + ,8 + ,254843 + ,91 + ,27 + ,100 + ,104911 + ,115 + ,105908 + ,41 + ,24 + ,87 + ,43448 + ,60 + ,170155 + ,84 + ,27 + ,101 + ,60029 + ,99 + ,136745 + ,65 + ,26 + ,95 + ,38650 + ,98 + ,86706 + ,3 + ,16 + ,64 + ,47261 + ,36 + ,251448 + ,68 + ,23 + ,88 + ,73586 + ,93 + ,152366 + ,93 + ,24 + ,91 + ,83042 + ,158 + ,173260 + ,41 + ,21 + ,79 + ,37238 + ,16 + ,212582 + ,105 + ,30 + ,114 + ,63958 + ,100 + ,87850 + ,117 + ,37 + ,140 + ,78956 + ,49 + ,148636 + ,70 + ,24 + ,89 + ,99518 + ,89 + ,185455 + ,114 + ,29 + ,111 + ,111436 + ,153 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,14688 + ,4 + ,0 + ,0 + ,6023 + ,5 + ,98 + ,0 + ,0 + ,0 + ,0 + ,0 + ,455 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,137891 + ,42 + ,20 + ,74 + ,42564 + ,80 + ,201052 + ,97 + ,31 + ,123 + ,38885 + ,122 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,203 + ,0 + ,0 + ,0 + ,0 + ,0 + ,7199 + ,7 + ,0 + ,0 + ,1644 + ,6 + ,46660 + ,12 + ,5 + ,15 + ,6179 + ,13 + ,17547 + ,0 + ,1 + ,4 + ,3926 + ,3 + ,73567 + ,37 + ,23 + ,82 + ,23238 + ,18 + ,969 + ,0 + ,0 + ,0 + ,0 + ,0 + ,106662 + ,39 + ,16 + ,54 + ,49288 + ,49) + ,dim=c(6 + ,164) + ,dimnames=list(c('Total_time_RFC' + ,'Blogged_Comp' + ,'Feedback' + ,'reviews' + ,'characters' + ,'Hyperlinks') + ,1:164)) > y <- array(NA,dim=c(6,164),dimnames=list(c('Total_time_RFC','Blogged_Comp','Feedback','reviews','characters','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 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > 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 Total_time_RFC Blogged_Comp Feedback reviews characters Hyperlinks 1 170650 65 26 99 95556 127 2 86621 54 20 77 54565 90 3 127843 58 27 102 63016 68 4 152526 99 25 96 79774 111 5 92389 41 17 49 31258 51 6 38138 0 16 64 52491 33 7 316392 112 20 76 91256 123 8 32750 1 18 67 22807 5 9 123444 40 19 72 77411 63 10 137034 60 22 83 48821 66 11 176816 68 30 113 52295 99 12 143205 74 40 151 63262 72 13 113286 38 26 88 50466 55 14 195452 77 36 123 62932 116 15 144513 62 31 118 38439 71 16 263581 126 41 157 70817 125 17 183271 85 24 92 105965 123 18 210763 74 27 103 73795 74 19 113853 78 19 72 82043 116 20 159968 100 30 115 74349 117 21 174585 79 31 115 82204 98 22 294675 77 26 92 55709 101 23 96213 42 15 56 37137 43 24 116390 83 33 132 70780 103 25 146342 103 28 107 55027 107 26 152647 71 27 102 56699 77 27 166661 77 21 78 65911 87 28 175505 100 27 103 56316 99 29 112485 45 21 81 26982 46 30 198790 101 30 114 54628 96 31 191822 87 30 115 96750 92 32 140267 44 33 118 53009 96 33 221991 97 35 133 64664 96 34 75339 32 26 99 36990 15 35 247985 89 27 103 85224 147 36 167351 71 25 93 37048 56 37 266609 70 30 114 59635 81 38 122024 50 20 76 42051 69 39 80964 30 8 27 26998 34 40 215183 90 24 92 63717 98 41 225469 78 25 96 55071 82 42 125382 48 28 104 40001 64 43 141437 57 23 84 54506 61 44 81106 31 21 79 35838 45 45 93125 30 21 57 50838 37 46 318668 72 26 99 86997 64 47 78800 20 26 82 33032 21 48 161048 84 30 113 61704 104 49 236367 94 34 129 117986 126 50 131108 79 30 110 56733 104 51 131096 72 18 78 55064 87 52 24188 8 4 12 5950 7 53 267003 67 31 114 84607 130 54 65029 21 18 67 32551 21 55 100147 30 14 52 31701 35 56 178549 70 21 80 71170 97 57 186965 89 37 138 101773 103 58 197266 87 24 92 101653 210 59 217300 116 29 105 81493 151 60 149594 54 24 91 55901 57 61 263413 112 31 118 109104 117 62 209228 94 21 77 114425 152 63 145699 51 31 122 36311 52 64 187197 52 26 99 70027 83 65 150752 38 24 92 73713 87 66 131218 65 18 70 40671 80 67 118697 64 21 81 89041 88 68 147913 66 29 107 57231 83 69 155015 99 24 92 68608 120 70 96487 100 21 77 59155 76 71 128780 56 30 115 55827 70 72 71972 22 20 76 22618 26 73 140266 51 30 115 58425 66 74 148454 62 24 92 65724 89 75 110655 97 26 100 56979 100 76 204822 99 27 103 72369 98 77 216052 77 24 92 79194 109 78 113421 58 23 87 202316 51 79 103660 77 26 100 44970 82 80 128390 52 25 95 49319 65 81 105502 48 18 69 36252 46 82 299359 111 30 115 75741 104 83 141493 28 25 95 38417 36 84 148356 86 27 55 64102 123 85 80953 49 8 28 56622 59 86 109237 24 21 79 15430 27 87 102104 46 26 99 72571 84 88 233139 44 24 92 67271 61 89 176507 49 30 98 43460 46 90 118217 108 27 103 99501 125 91 142694 44 24 89 28340 58 92 152193 110 25 95 76013 152 93 126500 30 21 78 37361 52 94 174710 82 24 92 48204 85 95 187772 49 24 92 76168 95 96 140903 64 24 92 85168 78 97 155350 75 24 83 125410 144 98 202077 123 24 92 123328 149 99 213875 104 40 151 83038 101 100 252952 106 22 83 120087 205 101 166981 73 31 118 91939 61 102 190562 110 26 98 103646 145 103 106351 30 20 76 29467 28 104 43287 13 19 71 43750 49 105 127493 69 15 57 34497 68 106 132143 75 22 83 66477 142 107 157469 82 25 95 71181 82 108 197727 108 28 108 74482 105 109 88077 28 23 91 174949 52 110 94968 83 25 99 46765 56 111 191753 52 26 100 90257 81 112 153332 90 32 119 51370 100 113 22938 12 1 0 1168 11 114 125927 87 24 91 51360 87 115 61857 23 11 32 25162 31 116 103749 57 31 117 21067 67 117 269909 93 26 99 58233 150 118 21054 4 0 0 855 4 119 174409 56 19 68 85903 75 120 31414 18 8 25 14116 39 121 200405 87 27 102 57637 88 122 139456 40 31 115 94137 67 123 78001 16 24 92 62147 24 124 82724 22 20 71 62832 58 125 38214 16 8 27 8773 16 126 91390 42 22 83 63785 49 127 197612 79 33 126 65196 109 128 137161 31 33 125 73087 124 129 251103 105 31 119 72631 115 130 209835 123 33 127 86281 128 131 269470 114 35 133 162365 159 132 139215 57 21 79 56530 75 133 77796 28 24 92 35606 30 134 197114 56 25 96 70111 83 135 291962 84 31 117 92046 135 136 56727 2 22 84 63989 8 137 254843 91 27 100 104911 115 138 105908 41 24 87 43448 60 139 170155 84 27 101 60029 99 140 136745 65 26 95 38650 98 141 86706 3 16 64 47261 36 142 251448 68 23 88 73586 93 143 152366 93 24 91 83042 158 144 173260 41 21 79 37238 16 145 212582 105 30 114 63958 100 146 87850 117 37 140 78956 49 147 148636 70 24 89 99518 89 148 185455 114 29 111 111436 153 149 0 0 0 0 0 0 150 14688 4 0 0 6023 5 151 98 0 0 0 0 0 152 455 0 0 0 0 0 153 0 0 0 0 0 0 154 0 0 0 0 0 0 155 137891 42 20 74 42564 80 156 201052 97 31 123 38885 122 157 0 0 0 0 0 0 158 203 0 0 0 0 0 159 7199 7 0 0 1644 6 160 46660 12 5 15 6179 13 161 17547 0 1 4 3926 3 162 73567 37 23 82 23238 18 163 969 0 0 0 0 0 164 106662 39 16 54 49288 49 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Blogged_Comp Feedback reviews characters 8103.6544 617.0127 1255.0633 258.4153 0.1737 Hyperlinks 457.6269 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -111195 -21999 -5745 15712 163528 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8103.6544 8723.3860 0.929 0.35433 Blogged_Comp 617.0127 199.6739 3.090 0.00237 ** Feedback 1255.0633 2333.5879 0.538 0.59145 reviews 258.4153 614.4599 0.421 0.67465 characters 0.1737 0.1405 1.236 0.21815 Hyperlinks 457.6269 152.1422 3.008 0.00306 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 40690 on 158 degrees of freedom Multiple R-squared: 0.691, Adjusted R-squared: 0.6813 F-statistic: 70.68 on 5 and 158 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.7612836 4.774328e-01 2.387164e-01 [2,] 0.6552950 6.894099e-01 3.447050e-01 [3,] 0.7698556 4.602889e-01 2.301444e-01 [4,] 0.6739050 6.521900e-01 3.260950e-01 [5,] 0.5721032 8.557937e-01 4.278968e-01 [6,] 0.4839219 9.678437e-01 5.160781e-01 [7,] 0.4178003 8.356005e-01 5.821997e-01 [8,] 0.3286887 6.573774e-01 6.713113e-01 [9,] 0.2794902 5.589803e-01 7.205098e-01 [10,] 0.2786302 5.572604e-01 7.213698e-01 [11,] 0.3983104 7.966208e-01 6.016896e-01 [12,] 0.4290765 8.581530e-01 5.709235e-01 [13,] 0.3584450 7.168901e-01 6.415550e-01 [14,] 0.8576552 2.846896e-01 1.423448e-01 [15,] 0.8149458 3.701085e-01 1.850542e-01 [16,] 0.8349091 3.301817e-01 1.650909e-01 [17,] 0.8579064 2.841871e-01 1.420936e-01 [18,] 0.8169833 3.660333e-01 1.830167e-01 [19,] 0.7715982 4.568035e-01 2.284018e-01 [20,] 0.7269542 5.460915e-01 2.730458e-01 [21,] 0.6900098 6.199803e-01 3.099902e-01 [22,] 0.6326206 7.347587e-01 3.673794e-01 [23,] 0.5731835 8.536331e-01 4.268165e-01 [24,] 0.5246223 9.507554e-01 4.753777e-01 [25,] 0.4851846 9.703692e-01 5.148154e-01 [26,] 0.4333050 8.666101e-01 5.666950e-01 [27,] 0.4753015 9.506030e-01 5.246985e-01 [28,] 0.4359159 8.718317e-01 5.640841e-01 [29,] 0.7614304 4.771393e-01 2.385696e-01 [30,] 0.7170260 5.659481e-01 2.829740e-01 [31,] 0.6709946 6.580108e-01 3.290054e-01 [32,] 0.6536879 6.926242e-01 3.463121e-01 [33,] 0.7159484 5.681033e-01 2.840516e-01 [34,] 0.6701744 6.596513e-01 3.298256e-01 [35,] 0.6213767 7.572467e-01 3.786233e-01 [36,] 0.5748159 8.503683e-01 4.251841e-01 [37,] 0.5546876 8.906248e-01 4.453124e-01 [38,] 0.9561199 8.776015e-02 4.388007e-02 [39,] 0.9450291 1.099418e-01 5.497088e-02 [40,] 0.9346298 1.307403e-01 6.537016e-02 [41,] 0.9189227 1.621547e-01 8.107734e-02 [42,] 0.9228112 1.543776e-01 7.718878e-02 [43,] 0.9047202 1.905596e-01 9.527979e-02 [44,] 0.8821072 2.357855e-01 1.178928e-01 [45,] 0.9449478 1.101044e-01 5.505219e-02 [46,] 0.9307261 1.385477e-01 6.927386e-02 [47,] 0.9186250 1.627499e-01 8.137497e-02 [48,] 0.9036205 1.927591e-01 9.637954e-02 [49,] 0.8994969 2.010063e-01 1.005031e-01 [50,] 0.8865513 2.268975e-01 1.134487e-01 [51,] 0.8707243 2.585514e-01 1.292757e-01 [52,] 0.8486493 3.027014e-01 1.513507e-01 [53,] 0.8447354 3.105292e-01 1.552646e-01 [54,] 0.8229157 3.541685e-01 1.770843e-01 [55,] 0.7998910 4.002180e-01 2.001090e-01 [56,] 0.8004871 3.990258e-01 1.995129e-01 [57,] 0.7737189 4.525621e-01 2.262811e-01 [58,] 0.7369310 5.261380e-01 2.630690e-01 [59,] 0.7420759 5.158482e-01 2.579241e-01 [60,] 0.7065653 5.868694e-01 2.934347e-01 [61,] 0.7033656 5.932688e-01 2.966344e-01 [62,] 0.7994156 4.011688e-01 2.005844e-01 [63,] 0.7752052 4.495896e-01 2.247948e-01 [64,] 0.7413385 5.173230e-01 2.586615e-01 [65,] 0.7039806 5.920388e-01 2.960194e-01 [66,] 0.6631608 6.736783e-01 3.368392e-01 [67,] 0.7415103 5.169794e-01 2.584897e-01 [68,] 0.7102735 5.794530e-01 2.897265e-01 [69,] 0.7123281 5.753437e-01 2.876719e-01 [70,] 0.7665053 4.669894e-01 2.334947e-01 [71,] 0.7949829 4.100343e-01 2.050171e-01 [72,] 0.7616369 4.767262e-01 2.383631e-01 [73,] 0.7244933 5.510134e-01 2.755067e-01 [74,] 0.8661124 2.677751e-01 1.338876e-01 [75,] 0.8633373 2.733255e-01 1.366627e-01 [76,] 0.8553555 2.892890e-01 1.446445e-01 [77,] 0.8299166 3.401668e-01 1.700834e-01 [78,] 0.8106040 3.787920e-01 1.893960e-01 [79,] 0.8153743 3.692515e-01 1.846257e-01 [80,] 0.9412655 1.174689e-01 5.873447e-02 [81,] 0.9455995 1.088010e-01 5.440050e-02 [82,] 0.9801545 3.969097e-02 1.984548e-02 [83,] 0.9763192 4.736152e-02 2.368076e-02 [84,] 0.9845019 3.099613e-02 1.549807e-02 [85,] 0.9813997 3.720061e-02 1.860031e-02 [86,] 0.9764736 4.705278e-02 2.352639e-02 [87,] 0.9759862 4.802764e-02 2.401382e-02 [88,] 0.9689429 6.211421e-02 3.105711e-02 [89,] 0.9689192 6.216161e-02 3.108081e-02 [90,] 0.9644050 7.119004e-02 3.559502e-02 [91,] 0.9544882 9.102360e-02 4.551180e-02 [92,] 0.9447473 1.105053e-01 5.525266e-02 [93,] 0.9314887 1.370226e-01 6.851129e-02 [94,] 0.9267159 1.465682e-01 7.328412e-02 [95,] 0.9164668 1.670663e-01 8.353316e-02 [96,] 0.9200602 1.598795e-01 7.993976e-02 [97,] 0.9007739 1.984522e-01 9.922611e-02 [98,] 0.9296138 1.407724e-01 7.038621e-02 [99,] 0.9117022 1.765956e-01 8.829778e-02 [100,] 0.8902491 2.195018e-01 1.097509e-01 [101,] 0.9080103 1.839794e-01 9.198971e-02 [102,] 0.9163505 1.672990e-01 8.364950e-02 [103,] 0.9115485 1.769031e-01 8.845155e-02 [104,] 0.9016152 1.967697e-01 9.838484e-02 [105,] 0.8773807 2.452386e-01 1.226193e-01 [106,] 0.8743215 2.513571e-01 1.256785e-01 [107,] 0.8456738 3.086525e-01 1.543262e-01 [108,] 0.8363943 3.272114e-01 1.636057e-01 [109,] 0.8699477 2.601047e-01 1.300523e-01 [110,] 0.8406207 3.187585e-01 1.593793e-01 [111,] 0.8370941 3.258119e-01 1.629059e-01 [112,] 0.8141957 3.716086e-01 1.858043e-01 [113,] 0.7995692 4.008616e-01 2.004308e-01 [114,] 0.7603598 4.792803e-01 2.396402e-01 [115,] 0.7206690 5.586620e-01 2.793310e-01 [116,] 0.6895613 6.208774e-01 3.104387e-01 [117,] 0.6384756 7.230488e-01 3.615244e-01 [118,] 0.6068820 7.862360e-01 3.931180e-01 [119,] 0.5518093 8.963814e-01 4.481907e-01 [120,] 0.6325524 7.348952e-01 3.674476e-01 [121,] 0.6622380 6.755240e-01 3.377620e-01 [122,] 0.6101987 7.796025e-01 3.898013e-01 [123,] 0.5555556 8.888888e-01 4.444444e-01 [124,] 0.4947075 9.894150e-01 5.052925e-01 [125,] 0.4623100 9.246200e-01 5.376900e-01 [126,] 0.4478357 8.956715e-01 5.521643e-01 [127,] 0.5884702 8.230596e-01 4.115298e-01 [128,] 0.6085607 7.828786e-01 3.914393e-01 [129,] 0.7305227 5.389546e-01 2.694773e-01 [130,] 0.7042610 5.914781e-01 2.957390e-01 [131,] 0.6434720 7.130560e-01 3.565280e-01 [132,] 0.6112862 7.774277e-01 3.887138e-01 [133,] 0.7330209 5.339582e-01 2.669791e-01 [134,] 0.9306003 1.387993e-01 6.939966e-02 [135,] 0.9331633 1.336734e-01 6.683669e-02 [136,] 0.9999027 1.945893e-04 9.729466e-05 [137,] 0.9999996 7.633778e-07 3.816889e-07 [138,] 0.9999988 2.444200e-06 1.222100e-06 [139,] 0.9999999 1.088466e-07 5.442331e-08 [140,] 1.0000000 4.163569e-08 2.081784e-08 [141,] 0.9999998 3.199077e-07 1.599539e-07 [142,] 0.9999994 1.267170e-06 6.335848e-07 [143,] 0.9999950 1.002181e-05 5.010905e-06 [144,] 0.9999621 7.579565e-05 3.789782e-05 [145,] 0.9997397 5.206995e-04 2.603498e-04 [146,] 0.9983526 3.294833e-03 1.647416e-03 [147,] 0.9974304 5.139100e-03 2.569550e-03 > postscript(file="/var/wessaorg/rcomp/tmp/1gsyj1321985446.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/2rhre1321985446.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/3adsu1321985446.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/4aum91321985446.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/5tzi51321985446.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 -10487.58725 -50463.03554 -18354.76262 -37496.90046 -3777.99344 6 7 8 9 10 -30802.78091 122306.01279 -22124.54264 5933.65980 4167.84681 11 12 13 14 15 5515.77953 -43716.36831 -7569.98555 -1142.79930 -10412.42906 16 17 18 19 20 16203.14962 -5864.97900 49816.92246 -52162.46623 -43660.74957 21 22 23 24 25 -10010.77230 126760.49354 2770.25235 -77881.19624 -46628.51569 26 27 28 29 30 -4593.52891 13274.67122 -9888.59183 3591.13854 7837.66435 31 32 33 34 35 3764.82031 -20033.29726 20578.60669 -24012.09246 42392.15062 36 37 38 39 40 27969.19021 100778.92240 -550.16118 17084.32305 41739.62643 41 42 43 44 45 65964.59234 -10590.12291 10209.25576 -19713.20236 -336.01181 46 47 48 49 50 163528.21695 -10812.27507 -24046.57222 16105.40020 -49262.97420 51 52 53 54 55 -13556.33159 -1209.68785 75008.41797 -11200.01905 21002.18757 56 57 58 59 60 23475.35677 -22961.41519 -32168.70212 -9161.71418 18741.56858 61 62 63 64 65 44314.06335 7439.94012 5591.52004 38649.65450 12691.22992 66 67 68 69 70 -1344.97216 -31917.90612 -12882.81953 -34898.67537 -64625.03008 71 72 73 74 75 -22975.10253 -10273.01678 -7024.71274 -3942.92034 -71430.01118 76 77 78 79 80 17715.20451 42908.08372 -40292.14882 -55761.92986 -6035.08307 81 82 83 84 85 13.39985 94650.51852 37040.69808 -28330.67994 -11493.65712 86 87 88 89 90 24518.32523 -43640.69960 104393.20262 46594.80687 -91510.71379 91 92 93 94 95 22857.27909 -62468.17457 23088.34562 14845.94234 38836.72714 96 97 98 99 100 -11070.79096 -38277.19373 -25419.10692 -8262.32857 15716.71522 101 102 103 104 105 553.62554 -27724.97876 17065.19633 -45053.06874 6150.29596 106 107 108 109 110 -47824.21734 -7042.78551 -1050.39230 -43864.36641 -55055.95668 111 112 113 114 115 40349.25124 -35900.10591 938.39286 -38227.04641 -1069.12464 116 117 118 119 120 -42985.53508 67451.33390 8503.30351 41093.83168 -24595.67626 121 122 123 124 125 28095.47362 -8962.18524 -15646.38606 -19856.76323 -5625.17077 126 127 128 129 130 -25188.98872 5583.33012 -33227.43690 43314.07242 -21957.28208 131 132 133 134 135 11770.65662 5031.18433 -21392.05912 48114.32490 85122.92752 136 137 138 139 140 -16702.61906 60016.49037 -15099.83584 -5494.37538 -20205.16858 141 142 143 144 145 15449.56781 94441.86636 -53483.68586 79298.71965 15710.81187 146 147 148 149 150 -111195.23648 -13790.60935 -47438.48368 -8103.65439 782.17619 151 152 153 154 155 -8005.65439 -7648.65439 -8103.65439 -8103.65439 15646.78523 156 157 158 159 160 -177.37813 -8103.65439 -7900.65439 -8255.01015 13978.42129 161 162 163 164 5099.93182 -19695.54654 -7134.65439 9476.09373 > postscript(file="/var/wessaorg/rcomp/tmp/6ug2u1321985446.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 -10487.58725 NA 1 -50463.03554 -10487.58725 2 -18354.76262 -50463.03554 3 -37496.90046 -18354.76262 4 -3777.99344 -37496.90046 5 -30802.78091 -3777.99344 6 122306.01279 -30802.78091 7 -22124.54264 122306.01279 8 5933.65980 -22124.54264 9 4167.84681 5933.65980 10 5515.77953 4167.84681 11 -43716.36831 5515.77953 12 -7569.98555 -43716.36831 13 -1142.79930 -7569.98555 14 -10412.42906 -1142.79930 15 16203.14962 -10412.42906 16 -5864.97900 16203.14962 17 49816.92246 -5864.97900 18 -52162.46623 49816.92246 19 -43660.74957 -52162.46623 20 -10010.77230 -43660.74957 21 126760.49354 -10010.77230 22 2770.25235 126760.49354 23 -77881.19624 2770.25235 24 -46628.51569 -77881.19624 25 -4593.52891 -46628.51569 26 13274.67122 -4593.52891 27 -9888.59183 13274.67122 28 3591.13854 -9888.59183 29 7837.66435 3591.13854 30 3764.82031 7837.66435 31 -20033.29726 3764.82031 32 20578.60669 -20033.29726 33 -24012.09246 20578.60669 34 42392.15062 -24012.09246 35 27969.19021 42392.15062 36 100778.92240 27969.19021 37 -550.16118 100778.92240 38 17084.32305 -550.16118 39 41739.62643 17084.32305 40 65964.59234 41739.62643 41 -10590.12291 65964.59234 42 10209.25576 -10590.12291 43 -19713.20236 10209.25576 44 -336.01181 -19713.20236 45 163528.21695 -336.01181 46 -10812.27507 163528.21695 47 -24046.57222 -10812.27507 48 16105.40020 -24046.57222 49 -49262.97420 16105.40020 50 -13556.33159 -49262.97420 51 -1209.68785 -13556.33159 52 75008.41797 -1209.68785 53 -11200.01905 75008.41797 54 21002.18757 -11200.01905 55 23475.35677 21002.18757 56 -22961.41519 23475.35677 57 -32168.70212 -22961.41519 58 -9161.71418 -32168.70212 59 18741.56858 -9161.71418 60 44314.06335 18741.56858 61 7439.94012 44314.06335 62 5591.52004 7439.94012 63 38649.65450 5591.52004 64 12691.22992 38649.65450 65 -1344.97216 12691.22992 66 -31917.90612 -1344.97216 67 -12882.81953 -31917.90612 68 -34898.67537 -12882.81953 69 -64625.03008 -34898.67537 70 -22975.10253 -64625.03008 71 -10273.01678 -22975.10253 72 -7024.71274 -10273.01678 73 -3942.92034 -7024.71274 74 -71430.01118 -3942.92034 75 17715.20451 -71430.01118 76 42908.08372 17715.20451 77 -40292.14882 42908.08372 78 -55761.92986 -40292.14882 79 -6035.08307 -55761.92986 80 13.39985 -6035.08307 81 94650.51852 13.39985 82 37040.69808 94650.51852 83 -28330.67994 37040.69808 84 -11493.65712 -28330.67994 85 24518.32523 -11493.65712 86 -43640.69960 24518.32523 87 104393.20262 -43640.69960 88 46594.80687 104393.20262 89 -91510.71379 46594.80687 90 22857.27909 -91510.71379 91 -62468.17457 22857.27909 92 23088.34562 -62468.17457 93 14845.94234 23088.34562 94 38836.72714 14845.94234 95 -11070.79096 38836.72714 96 -38277.19373 -11070.79096 97 -25419.10692 -38277.19373 98 -8262.32857 -25419.10692 99 15716.71522 -8262.32857 100 553.62554 15716.71522 101 -27724.97876 553.62554 102 17065.19633 -27724.97876 103 -45053.06874 17065.19633 104 6150.29596 -45053.06874 105 -47824.21734 6150.29596 106 -7042.78551 -47824.21734 107 -1050.39230 -7042.78551 108 -43864.36641 -1050.39230 109 -55055.95668 -43864.36641 110 40349.25124 -55055.95668 111 -35900.10591 40349.25124 112 938.39286 -35900.10591 113 -38227.04641 938.39286 114 -1069.12464 -38227.04641 115 -42985.53508 -1069.12464 116 67451.33390 -42985.53508 117 8503.30351 67451.33390 118 41093.83168 8503.30351 119 -24595.67626 41093.83168 120 28095.47362 -24595.67626 121 -8962.18524 28095.47362 122 -15646.38606 -8962.18524 123 -19856.76323 -15646.38606 124 -5625.17077 -19856.76323 125 -25188.98872 -5625.17077 126 5583.33012 -25188.98872 127 -33227.43690 5583.33012 128 43314.07242 -33227.43690 129 -21957.28208 43314.07242 130 11770.65662 -21957.28208 131 5031.18433 11770.65662 132 -21392.05912 5031.18433 133 48114.32490 -21392.05912 134 85122.92752 48114.32490 135 -16702.61906 85122.92752 136 60016.49037 -16702.61906 137 -15099.83584 60016.49037 138 -5494.37538 -15099.83584 139 -20205.16858 -5494.37538 140 15449.56781 -20205.16858 141 94441.86636 15449.56781 142 -53483.68586 94441.86636 143 79298.71965 -53483.68586 144 15710.81187 79298.71965 145 -111195.23648 15710.81187 146 -13790.60935 -111195.23648 147 -47438.48368 -13790.60935 148 -8103.65439 -47438.48368 149 782.17619 -8103.65439 150 -8005.65439 782.17619 151 -7648.65439 -8005.65439 152 -8103.65439 -7648.65439 153 -8103.65439 -8103.65439 154 15646.78523 -8103.65439 155 -177.37813 15646.78523 156 -8103.65439 -177.37813 157 -7900.65439 -8103.65439 158 -8255.01015 -7900.65439 159 13978.42129 -8255.01015 160 5099.93182 13978.42129 161 -19695.54654 5099.93182 162 -7134.65439 -19695.54654 163 9476.09373 -7134.65439 164 NA 9476.09373 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -50463.03554 -10487.58725 [2,] -18354.76262 -50463.03554 [3,] -37496.90046 -18354.76262 [4,] -3777.99344 -37496.90046 [5,] -30802.78091 -3777.99344 [6,] 122306.01279 -30802.78091 [7,] -22124.54264 122306.01279 [8,] 5933.65980 -22124.54264 [9,] 4167.84681 5933.65980 [10,] 5515.77953 4167.84681 [11,] -43716.36831 5515.77953 [12,] -7569.98555 -43716.36831 [13,] -1142.79930 -7569.98555 [14,] -10412.42906 -1142.79930 [15,] 16203.14962 -10412.42906 [16,] -5864.97900 16203.14962 [17,] 49816.92246 -5864.97900 [18,] -52162.46623 49816.92246 [19,] -43660.74957 -52162.46623 [20,] -10010.77230 -43660.74957 [21,] 126760.49354 -10010.77230 [22,] 2770.25235 126760.49354 [23,] -77881.19624 2770.25235 [24,] -46628.51569 -77881.19624 [25,] -4593.52891 -46628.51569 [26,] 13274.67122 -4593.52891 [27,] -9888.59183 13274.67122 [28,] 3591.13854 -9888.59183 [29,] 7837.66435 3591.13854 [30,] 3764.82031 7837.66435 [31,] -20033.29726 3764.82031 [32,] 20578.60669 -20033.29726 [33,] -24012.09246 20578.60669 [34,] 42392.15062 -24012.09246 [35,] 27969.19021 42392.15062 [36,] 100778.92240 27969.19021 [37,] -550.16118 100778.92240 [38,] 17084.32305 -550.16118 [39,] 41739.62643 17084.32305 [40,] 65964.59234 41739.62643 [41,] -10590.12291 65964.59234 [42,] 10209.25576 -10590.12291 [43,] -19713.20236 10209.25576 [44,] -336.01181 -19713.20236 [45,] 163528.21695 -336.01181 [46,] -10812.27507 163528.21695 [47,] -24046.57222 -10812.27507 [48,] 16105.40020 -24046.57222 [49,] -49262.97420 16105.40020 [50,] -13556.33159 -49262.97420 [51,] -1209.68785 -13556.33159 [52,] 75008.41797 -1209.68785 [53,] -11200.01905 75008.41797 [54,] 21002.18757 -11200.01905 [55,] 23475.35677 21002.18757 [56,] -22961.41519 23475.35677 [57,] -32168.70212 -22961.41519 [58,] -9161.71418 -32168.70212 [59,] 18741.56858 -9161.71418 [60,] 44314.06335 18741.56858 [61,] 7439.94012 44314.06335 [62,] 5591.52004 7439.94012 [63,] 38649.65450 5591.52004 [64,] 12691.22992 38649.65450 [65,] -1344.97216 12691.22992 [66,] -31917.90612 -1344.97216 [67,] -12882.81953 -31917.90612 [68,] -34898.67537 -12882.81953 [69,] -64625.03008 -34898.67537 [70,] -22975.10253 -64625.03008 [71,] -10273.01678 -22975.10253 [72,] -7024.71274 -10273.01678 [73,] -3942.92034 -7024.71274 [74,] -71430.01118 -3942.92034 [75,] 17715.20451 -71430.01118 [76,] 42908.08372 17715.20451 [77,] -40292.14882 42908.08372 [78,] -55761.92986 -40292.14882 [79,] -6035.08307 -55761.92986 [80,] 13.39985 -6035.08307 [81,] 94650.51852 13.39985 [82,] 37040.69808 94650.51852 [83,] -28330.67994 37040.69808 [84,] -11493.65712 -28330.67994 [85,] 24518.32523 -11493.65712 [86,] -43640.69960 24518.32523 [87,] 104393.20262 -43640.69960 [88,] 46594.80687 104393.20262 [89,] -91510.71379 46594.80687 [90,] 22857.27909 -91510.71379 [91,] -62468.17457 22857.27909 [92,] 23088.34562 -62468.17457 [93,] 14845.94234 23088.34562 [94,] 38836.72714 14845.94234 [95,] -11070.79096 38836.72714 [96,] -38277.19373 -11070.79096 [97,] -25419.10692 -38277.19373 [98,] -8262.32857 -25419.10692 [99,] 15716.71522 -8262.32857 [100,] 553.62554 15716.71522 [101,] -27724.97876 553.62554 [102,] 17065.19633 -27724.97876 [103,] -45053.06874 17065.19633 [104,] 6150.29596 -45053.06874 [105,] -47824.21734 6150.29596 [106,] -7042.78551 -47824.21734 [107,] -1050.39230 -7042.78551 [108,] -43864.36641 -1050.39230 [109,] -55055.95668 -43864.36641 [110,] 40349.25124 -55055.95668 [111,] -35900.10591 40349.25124 [112,] 938.39286 -35900.10591 [113,] -38227.04641 938.39286 [114,] -1069.12464 -38227.04641 [115,] -42985.53508 -1069.12464 [116,] 67451.33390 -42985.53508 [117,] 8503.30351 67451.33390 [118,] 41093.83168 8503.30351 [119,] -24595.67626 41093.83168 [120,] 28095.47362 -24595.67626 [121,] -8962.18524 28095.47362 [122,] -15646.38606 -8962.18524 [123,] -19856.76323 -15646.38606 [124,] -5625.17077 -19856.76323 [125,] -25188.98872 -5625.17077 [126,] 5583.33012 -25188.98872 [127,] -33227.43690 5583.33012 [128,] 43314.07242 -33227.43690 [129,] -21957.28208 43314.07242 [130,] 11770.65662 -21957.28208 [131,] 5031.18433 11770.65662 [132,] -21392.05912 5031.18433 [133,] 48114.32490 -21392.05912 [134,] 85122.92752 48114.32490 [135,] -16702.61906 85122.92752 [136,] 60016.49037 -16702.61906 [137,] -15099.83584 60016.49037 [138,] -5494.37538 -15099.83584 [139,] -20205.16858 -5494.37538 [140,] 15449.56781 -20205.16858 [141,] 94441.86636 15449.56781 [142,] -53483.68586 94441.86636 [143,] 79298.71965 -53483.68586 [144,] 15710.81187 79298.71965 [145,] -111195.23648 15710.81187 [146,] -13790.60935 -111195.23648 [147,] -47438.48368 -13790.60935 [148,] -8103.65439 -47438.48368 [149,] 782.17619 -8103.65439 [150,] -8005.65439 782.17619 [151,] -7648.65439 -8005.65439 [152,] -8103.65439 -7648.65439 [153,] -8103.65439 -8103.65439 [154,] 15646.78523 -8103.65439 [155,] -177.37813 15646.78523 [156,] -8103.65439 -177.37813 [157,] -7900.65439 -8103.65439 [158,] -8255.01015 -7900.65439 [159,] 13978.42129 -8255.01015 [160,] 5099.93182 13978.42129 [161,] -19695.54654 5099.93182 [162,] -7134.65439 -19695.54654 [163,] 9476.09373 -7134.65439 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -50463.03554 -10487.58725 2 -18354.76262 -50463.03554 3 -37496.90046 -18354.76262 4 -3777.99344 -37496.90046 5 -30802.78091 -3777.99344 6 122306.01279 -30802.78091 7 -22124.54264 122306.01279 8 5933.65980 -22124.54264 9 4167.84681 5933.65980 10 5515.77953 4167.84681 11 -43716.36831 5515.77953 12 -7569.98555 -43716.36831 13 -1142.79930 -7569.98555 14 -10412.42906 -1142.79930 15 16203.14962 -10412.42906 16 -5864.97900 16203.14962 17 49816.92246 -5864.97900 18 -52162.46623 49816.92246 19 -43660.74957 -52162.46623 20 -10010.77230 -43660.74957 21 126760.49354 -10010.77230 22 2770.25235 126760.49354 23 -77881.19624 2770.25235 24 -46628.51569 -77881.19624 25 -4593.52891 -46628.51569 26 13274.67122 -4593.52891 27 -9888.59183 13274.67122 28 3591.13854 -9888.59183 29 7837.66435 3591.13854 30 3764.82031 7837.66435 31 -20033.29726 3764.82031 32 20578.60669 -20033.29726 33 -24012.09246 20578.60669 34 42392.15062 -24012.09246 35 27969.19021 42392.15062 36 100778.92240 27969.19021 37 -550.16118 100778.92240 38 17084.32305 -550.16118 39 41739.62643 17084.32305 40 65964.59234 41739.62643 41 -10590.12291 65964.59234 42 10209.25576 -10590.12291 43 -19713.20236 10209.25576 44 -336.01181 -19713.20236 45 163528.21695 -336.01181 46 -10812.27507 163528.21695 47 -24046.57222 -10812.27507 48 16105.40020 -24046.57222 49 -49262.97420 16105.40020 50 -13556.33159 -49262.97420 51 -1209.68785 -13556.33159 52 75008.41797 -1209.68785 53 -11200.01905 75008.41797 54 21002.18757 -11200.01905 55 23475.35677 21002.18757 56 -22961.41519 23475.35677 57 -32168.70212 -22961.41519 58 -9161.71418 -32168.70212 59 18741.56858 -9161.71418 60 44314.06335 18741.56858 61 7439.94012 44314.06335 62 5591.52004 7439.94012 63 38649.65450 5591.52004 64 12691.22992 38649.65450 65 -1344.97216 12691.22992 66 -31917.90612 -1344.97216 67 -12882.81953 -31917.90612 68 -34898.67537 -12882.81953 69 -64625.03008 -34898.67537 70 -22975.10253 -64625.03008 71 -10273.01678 -22975.10253 72 -7024.71274 -10273.01678 73 -3942.92034 -7024.71274 74 -71430.01118 -3942.92034 75 17715.20451 -71430.01118 76 42908.08372 17715.20451 77 -40292.14882 42908.08372 78 -55761.92986 -40292.14882 79 -6035.08307 -55761.92986 80 13.39985 -6035.08307 81 94650.51852 13.39985 82 37040.69808 94650.51852 83 -28330.67994 37040.69808 84 -11493.65712 -28330.67994 85 24518.32523 -11493.65712 86 -43640.69960 24518.32523 87 104393.20262 -43640.69960 88 46594.80687 104393.20262 89 -91510.71379 46594.80687 90 22857.27909 -91510.71379 91 -62468.17457 22857.27909 92 23088.34562 -62468.17457 93 14845.94234 23088.34562 94 38836.72714 14845.94234 95 -11070.79096 38836.72714 96 -38277.19373 -11070.79096 97 -25419.10692 -38277.19373 98 -8262.32857 -25419.10692 99 15716.71522 -8262.32857 100 553.62554 15716.71522 101 -27724.97876 553.62554 102 17065.19633 -27724.97876 103 -45053.06874 17065.19633 104 6150.29596 -45053.06874 105 -47824.21734 6150.29596 106 -7042.78551 -47824.21734 107 -1050.39230 -7042.78551 108 -43864.36641 -1050.39230 109 -55055.95668 -43864.36641 110 40349.25124 -55055.95668 111 -35900.10591 40349.25124 112 938.39286 -35900.10591 113 -38227.04641 938.39286 114 -1069.12464 -38227.04641 115 -42985.53508 -1069.12464 116 67451.33390 -42985.53508 117 8503.30351 67451.33390 118 41093.83168 8503.30351 119 -24595.67626 41093.83168 120 28095.47362 -24595.67626 121 -8962.18524 28095.47362 122 -15646.38606 -8962.18524 123 -19856.76323 -15646.38606 124 -5625.17077 -19856.76323 125 -25188.98872 -5625.17077 126 5583.33012 -25188.98872 127 -33227.43690 5583.33012 128 43314.07242 -33227.43690 129 -21957.28208 43314.07242 130 11770.65662 -21957.28208 131 5031.18433 11770.65662 132 -21392.05912 5031.18433 133 48114.32490 -21392.05912 134 85122.92752 48114.32490 135 -16702.61906 85122.92752 136 60016.49037 -16702.61906 137 -15099.83584 60016.49037 138 -5494.37538 -15099.83584 139 -20205.16858 -5494.37538 140 15449.56781 -20205.16858 141 94441.86636 15449.56781 142 -53483.68586 94441.86636 143 79298.71965 -53483.68586 144 15710.81187 79298.71965 145 -111195.23648 15710.81187 146 -13790.60935 -111195.23648 147 -47438.48368 -13790.60935 148 -8103.65439 -47438.48368 149 782.17619 -8103.65439 150 -8005.65439 782.17619 151 -7648.65439 -8005.65439 152 -8103.65439 -7648.65439 153 -8103.65439 -8103.65439 154 15646.78523 -8103.65439 155 -177.37813 15646.78523 156 -8103.65439 -177.37813 157 -7900.65439 -8103.65439 158 -8255.01015 -7900.65439 159 13978.42129 -8255.01015 160 5099.93182 13978.42129 161 -19695.54654 5099.93182 162 -7134.65439 -19695.54654 163 9476.09373 -7134.65439 > 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/7aofz1321985446.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/83nik1321985446.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/9gg371321985446.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/10yum81321985446.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/118e3i1321985446.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/128qr11321985446.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/13pa6k1321985446.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/14r9f11321985446.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/15yv111321985446.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/16jjmz1321985446.tab") + } > > try(system("convert tmp/1gsyj1321985446.ps tmp/1gsyj1321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/2rhre1321985446.ps tmp/2rhre1321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/3adsu1321985446.ps tmp/3adsu1321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/4aum91321985446.ps tmp/4aum91321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/5tzi51321985446.ps tmp/5tzi51321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/6ug2u1321985446.ps tmp/6ug2u1321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/7aofz1321985446.ps tmp/7aofz1321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/83nik1321985446.ps tmp/83nik1321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/9gg371321985446.ps tmp/9gg371321985446.png",intern=TRUE)) character(0) > try(system("convert tmp/10yum81321985446.ps tmp/10yum81321985446.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.991 0.516 5.594