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(170588 + ,65 + ,26 + ,84 + ,95556 + ,86621 + ,54 + ,20 + ,72 + ,54565 + ,113514 + ,58 + ,24 + ,37 + ,63016 + ,152510 + ,99 + ,25 + ,85 + ,79774 + ,86206 + ,41 + ,15 + ,30 + ,31258 + ,37257 + ,0 + ,16 + ,53 + ,52491 + ,306055 + ,111 + ,20 + ,74 + ,91256 + ,32750 + ,1 + ,18 + ,22 + ,22807 + ,116502 + ,37 + ,19 + ,68 + ,77411 + ,130539 + ,60 + ,20 + ,47 + ,48821 + ,161876 + ,64 + ,30 + ,102 + ,52295 + ,128274 + ,71 + ,37 + ,123 + ,63262 + ,104367 + ,38 + ,23 + ,69 + ,50466 + ,193024 + ,76 + ,36 + ,108 + ,62932 + ,141574 + ,62 + ,29 + ,59 + ,38439 + ,253559 + ,126 + ,35 + ,122 + ,70817 + ,181110 + ,85 + ,24 + ,91 + ,105965 + ,198432 + ,74 + ,22 + ,45 + ,73795 + ,113853 + ,78 + ,19 + ,53 + ,82043 + ,159940 + ,100 + ,30 + ,112 + ,74349 + ,166822 + ,79 + ,27 + ,82 + ,82204 + ,286675 + ,76 + ,26 + ,92 + ,55709 + ,91657 + ,40 + ,15 + ,51 + ,37137 + ,108278 + ,81 + ,30 + ,120 + ,70780 + ,146342 + ,103 + ,28 + ,99 + ,55027 + ,145142 + ,70 + ,24 + ,86 + ,56699 + ,161740 + ,75 + ,21 + ,59 + ,65911 + ,160905 + ,93 + ,27 + ,98 + ,56316 + ,106888 + ,42 + ,21 + ,71 + ,26982 + ,188150 + ,95 + ,30 + ,100 + ,54628 + ,189401 + ,87 + ,30 + ,113 + ,96750 + ,129484 + ,44 + ,33 + ,92 + ,53009 + ,204030 + ,88 + ,30 + ,107 + ,64664 + ,68538 + ,29 + ,20 + ,75 + ,36990 + ,243625 + ,89 + ,27 + ,100 + ,85224 + ,167255 + ,71 + ,25 + ,69 + ,37048 + ,264528 + ,70 + ,30 + ,106 + ,59635 + ,122024 + ,50 + ,20 + ,51 + ,42051 + ,80964 + ,30 + ,8 + ,18 + ,26998 + ,209795 + ,87 + ,24 + ,91 + ,63717 + ,224205 + ,78 + ,25 + ,75 + ,55071 + ,115971 + ,48 + ,25 + ,63 + ,40001 + ,138191 + ,57 + ,21 + ,72 + ,54506 + ,81106 + ,31 + ,21 + ,59 + ,35838 + ,93125 + ,30 + ,21 + ,29 + ,50838 + ,305756 + ,70 + ,26 + ,85 + ,86997 + ,78800 + ,20 + ,26 + ,66 + ,33032 + ,158835 + ,84 + ,30 + ,106 + ,61704 + ,223590 + ,81 + ,34 + ,113 + ,117986 + ,131108 + ,79 + ,30 + ,101 + ,56733 + ,128734 + ,72 + ,18 + ,65 + ,55064 + ,24188 + ,8 + ,4 + ,7 + ,5950 + ,257662 + ,67 + ,31 + ,111 + ,84607 + ,65029 + ,21 + ,18 + ,61 + ,32551 + ,98066 + ,30 + ,14 + ,41 + ,31701 + ,173587 + ,70 + ,20 + ,70 + ,71170 + ,180042 + ,87 + ,36 + ,136 + ,101773 + ,197266 + ,87 + ,24 + ,87 + ,101653 + ,212060 + ,116 + ,26 + ,90 + ,81493 + ,141582 + ,54 + ,22 + ,76 + ,55901 + ,245107 + ,96 + ,31 + ,101 + ,109104 + ,206879 + ,94 + ,21 + ,57 + ,114425 + ,145696 + ,51 + ,31 + ,61 + ,36311 + ,173535 + ,51 + ,26 + ,92 + ,70027 + ,142064 + ,38 + ,24 + ,80 + ,73713 + ,117926 + ,65 + ,15 + ,35 + ,40671 + ,113461 + ,64 + ,19 + ,72 + ,89041 + ,145285 + ,66 + ,28 + ,88 + ,57231 + ,150999 + ,98 + ,24 + ,80 + ,68608 + ,91812 + ,100 + ,18 + ,62 + ,59155 + ,118807 + ,56 + ,25 + ,81 + ,55827 + ,69471 + ,22 + ,20 + ,63 + ,22618 + ,126630 + ,51 + ,25 + ,91 + ,58425 + ,145908 + ,61 + ,24 + ,65 + ,65724 + ,98393 + ,94 + ,23 + ,79 + ,56979 + ,190926 + ,98 + ,25 + ,85 + ,72369 + ,198797 + ,76 + ,20 + ,75 + ,79194 + ,106193 + ,57 + ,23 + ,70 + ,202316 + ,89318 + ,75 + ,22 + ,78 + ,44970 + ,120362 + ,48 + ,25 + ,75 + ,49319 + ,98791 + ,48 + ,18 + ,55 + ,36252 + ,274953 + ,109 + ,30 + ,80 + ,75741 + ,132798 + ,27 + ,22 + ,83 + ,38417 + ,135251 + ,85 + ,25 + ,38 + ,64102 + ,80953 + ,49 + ,8 + ,27 + ,56622 + ,109237 + ,24 + ,21 + ,62 + ,15430 + ,96634 + ,46 + ,22 + ,82 + ,72571 + ,226191 + ,44 + ,24 + ,88 + ,67271 + ,171286 + ,49 + ,30 + ,59 + ,43460 + ,117815 + ,108 + ,27 + ,92 + ,99501 + ,133561 + ,42 + ,24 + ,40 + ,28340 + ,152193 + ,110 + ,25 + ,91 + ,76013 + ,112004 + ,28 + ,21 + ,63 + ,37361 + ,169613 + ,79 + ,24 + ,88 + ,48204 + ,187483 + ,49 + ,24 + ,85 + ,76168 + ,130533 + ,64 + ,20 + ,76 + ,85168 + ,142339 + ,75 + ,20 + ,67 + ,125410 + ,189764 + ,118 + ,24 + ,69 + ,123328 + ,201744 + ,95 + ,40 + ,150 + ,83038 + ,246834 + ,106 + ,22 + ,77 + ,120087 + ,155947 + ,73 + ,31 + ,103 + ,91939 + ,182581 + ,108 + ,26 + ,81 + ,103646 + ,106351 + ,30 + ,20 + ,37 + ,29467 + ,43287 + ,13 + ,19 + ,64 + ,43750 + ,127493 + ,69 + ,15 + ,22 + ,34497 + ,127930 + ,75 + ,21 + ,35 + ,66477 + ,149006 + ,82 + ,22 + ,61 + ,71181 + ,187714 + ,108 + ,24 + ,80 + ,74482 + ,74112 + ,28 + ,19 + ,54 + ,174949 + ,94006 + ,83 + ,24 + ,76 + ,46765 + ,176625 + ,51 + ,23 + ,87 + ,90257 + ,141933 + ,90 + ,27 + ,75 + ,51370 + ,22938 + ,12 + ,1 + ,0 + ,1168 + ,125927 + ,87 + ,24 + ,61 + ,51360 + ,61857 + ,23 + ,11 + ,30 + ,25162 + ,91290 + ,57 + ,27 + ,66 + ,21067 + ,255100 + ,93 + ,22 + ,56 + ,58233 + ,21054 + ,4 + ,0 + ,0 + ,855 + ,169102 + ,56 + ,17 + ,32 + ,85903 + ,31414 + ,18 + ,8 + ,9 + ,14116 + ,188701 + ,86 + ,24 + ,82 + ,57637 + ,137544 + ,40 + ,31 + ,110 + ,94137 + ,77166 + ,16 + ,24 + ,71 + ,62147 + ,74567 + ,18 + ,20 + ,50 + ,62832 + ,38214 + ,16 + ,8 + ,21 + ,8773 + ,90961 + ,42 + ,22 + ,78 + ,63785 + ,194652 + ,78 + ,33 + ,118 + ,65196 + ,135261 + ,31 + ,33 + ,102 + ,73087 + ,244272 + ,104 + ,31 + ,109 + ,72631 + ,201748 + ,121 + ,33 + ,104 + ,86281 + ,256402 + ,111 + ,35 + ,124 + ,162365 + ,139144 + ,57 + ,21 + ,76 + ,56530 + ,76470 + ,28 + ,20 + ,57 + ,35606 + ,193518 + ,56 + ,24 + ,91 + ,70111 + ,280334 + ,82 + ,29 + ,101 + ,92046 + ,50999 + ,2 + ,20 + ,66 + ,63989 + ,253274 + ,91 + ,27 + ,98 + ,104911 + ,103239 + ,41 + ,24 + ,63 + ,43448 + ,168059 + ,84 + ,26 + ,85 + ,60029 + ,128768 + ,55 + ,26 + ,74 + ,38650 + ,78256 + ,3 + ,12 + ,19 + ,47261 + ,249232 + ,68 + ,21 + ,57 + ,73586 + ,152366 + ,93 + ,24 + ,74 + ,83042 + ,173260 + ,41 + ,21 + ,78 + ,37238 + ,197197 + ,94 + ,30 + ,91 + ,63958 + ,68388 + ,105 + ,32 + ,112 + ,78956 + ,139409 + ,70 + ,24 + ,79 + ,99518 + ,185366 + ,114 + ,29 + ,100 + ,111436 + ,0 + ,0 + ,0 + ,0 + ,0 + ,14688 + ,4 + ,0 + ,0 + ,6023 + ,98 + ,0 + ,0 + ,0 + ,0 + ,455 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,137885 + ,42 + ,20 + ,48 + ,42564 + ,185288 + ,97 + ,27 + ,55 + ,38885 + ,0 + ,0 + ,0 + ,0 + ,0 + ,203 + ,0 + ,0 + ,0 + ,0 + ,7199 + ,7 + ,0 + ,0 + ,1644 + ,46660 + ,12 + ,5 + ,13 + ,6179 + ,17547 + ,0 + ,1 + ,4 + ,3926 + ,73567 + ,37 + ,23 + ,31 + ,23238 + ,969 + ,0 + ,0 + ,0 + ,0 + ,105477 + ,39 + ,16 + ,29 + ,49288) + ,dim=c(5 + ,164) + ,dimnames=list(c('Total_Time_RFC' + ,'Blogged_Computations' + ,'Reviewed_Compendiums' + ,'Long_feedback_messages' + ,'number_characters_compendium ') + ,1:164)) > y <- array(NA,dim=c(5,164),dimnames=list(c('Total_Time_RFC','Blogged_Computations','Reviewed_Compendiums','Long_feedback_messages','number_characters_compendium '),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_Computations Reviewed_Compendiums 1 170588 65 26 2 86621 54 20 3 113514 58 24 4 152510 99 25 5 86206 41 15 6 37257 0 16 7 306055 111 20 8 32750 1 18 9 116502 37 19 10 130539 60 20 11 161876 64 30 12 128274 71 37 13 104367 38 23 14 193024 76 36 15 141574 62 29 16 253559 126 35 17 181110 85 24 18 198432 74 22 19 113853 78 19 20 159940 100 30 21 166822 79 27 22 286675 76 26 23 91657 40 15 24 108278 81 30 25 146342 103 28 26 145142 70 24 27 161740 75 21 28 160905 93 27 29 106888 42 21 30 188150 95 30 31 189401 87 30 32 129484 44 33 33 204030 88 30 34 68538 29 20 35 243625 89 27 36 167255 71 25 37 264528 70 30 38 122024 50 20 39 80964 30 8 40 209795 87 24 41 224205 78 25 42 115971 48 25 43 138191 57 21 44 81106 31 21 45 93125 30 21 46 305756 70 26 47 78800 20 26 48 158835 84 30 49 223590 81 34 50 131108 79 30 51 128734 72 18 52 24188 8 4 53 257662 67 31 54 65029 21 18 55 98066 30 14 56 173587 70 20 57 180042 87 36 58 197266 87 24 59 212060 116 26 60 141582 54 22 61 245107 96 31 62 206879 94 21 63 145696 51 31 64 173535 51 26 65 142064 38 24 66 117926 65 15 67 113461 64 19 68 145285 66 28 69 150999 98 24 70 91812 100 18 71 118807 56 25 72 69471 22 20 73 126630 51 25 74 145908 61 24 75 98393 94 23 76 190926 98 25 77 198797 76 20 78 106193 57 23 79 89318 75 22 80 120362 48 25 81 98791 48 18 82 274953 109 30 83 132798 27 22 84 135251 85 25 85 80953 49 8 86 109237 24 21 87 96634 46 22 88 226191 44 24 89 171286 49 30 90 117815 108 27 91 133561 42 24 92 152193 110 25 93 112004 28 21 94 169613 79 24 95 187483 49 24 96 130533 64 20 97 142339 75 20 98 189764 118 24 99 201744 95 40 100 246834 106 22 101 155947 73 31 102 182581 108 26 103 106351 30 20 104 43287 13 19 105 127493 69 15 106 127930 75 21 107 149006 82 22 108 187714 108 24 109 74112 28 19 110 94006 83 24 111 176625 51 23 112 141933 90 27 113 22938 12 1 114 125927 87 24 115 61857 23 11 116 91290 57 27 117 255100 93 22 118 21054 4 0 119 169102 56 17 120 31414 18 8 121 188701 86 24 122 137544 40 31 123 77166 16 24 124 74567 18 20 125 38214 16 8 126 90961 42 22 127 194652 78 33 128 135261 31 33 129 244272 104 31 130 201748 121 33 131 256402 111 35 132 139144 57 21 133 76470 28 20 134 193518 56 24 135 280334 82 29 136 50999 2 20 137 253274 91 27 138 103239 41 24 139 168059 84 26 140 128768 55 26 141 78256 3 12 142 249232 68 21 143 152366 93 24 144 173260 41 21 145 197197 94 30 146 68388 105 32 147 139409 70 24 148 185366 114 29 149 0 0 0 150 14688 4 0 151 98 0 0 152 455 0 0 153 0 0 0 154 0 0 0 155 137885 42 20 156 185288 97 27 157 0 0 0 158 203 0 0 159 7199 7 0 160 46660 12 5 161 17547 0 1 162 73567 37 23 163 969 0 0 164 105477 39 16 Long_feedback_messages number_characters_compendium\r\r 1 84 95556 2 72 54565 3 37 63016 4 85 79774 5 30 31258 6 53 52491 7 74 91256 8 22 22807 9 68 77411 10 47 48821 11 102 52295 12 123 63262 13 69 50466 14 108 62932 15 59 38439 16 122 70817 17 91 105965 18 45 73795 19 53 82043 20 112 74349 21 82 82204 22 92 55709 23 51 37137 24 120 70780 25 99 55027 26 86 56699 27 59 65911 28 98 56316 29 71 26982 30 100 54628 31 113 96750 32 92 53009 33 107 64664 34 75 36990 35 100 85224 36 69 37048 37 106 59635 38 51 42051 39 18 26998 40 91 63717 41 75 55071 42 63 40001 43 72 54506 44 59 35838 45 29 50838 46 85 86997 47 66 33032 48 106 61704 49 113 117986 50 101 56733 51 65 55064 52 7 5950 53 111 84607 54 61 32551 55 41 31701 56 70 71170 57 136 101773 58 87 101653 59 90 81493 60 76 55901 61 101 109104 62 57 114425 63 61 36311 64 92 70027 65 80 73713 66 35 40671 67 72 89041 68 88 57231 69 80 68608 70 62 59155 71 81 55827 72 63 22618 73 91 58425 74 65 65724 75 79 56979 76 85 72369 77 75 79194 78 70 202316 79 78 44970 80 75 49319 81 55 36252 82 80 75741 83 83 38417 84 38 64102 85 27 56622 86 62 15430 87 82 72571 88 88 67271 89 59 43460 90 92 99501 91 40 28340 92 91 76013 93 63 37361 94 88 48204 95 85 76168 96 76 85168 97 67 125410 98 69 123328 99 150 83038 100 77 120087 101 103 91939 102 81 103646 103 37 29467 104 64 43750 105 22 34497 106 35 66477 107 61 71181 108 80 74482 109 54 174949 110 76 46765 111 87 90257 112 75 51370 113 0 1168 114 61 51360 115 30 25162 116 66 21067 117 56 58233 118 0 855 119 32 85903 120 9 14116 121 82 57637 122 110 94137 123 71 62147 124 50 62832 125 21 8773 126 78 63785 127 118 65196 128 102 73087 129 109 72631 130 104 86281 131 124 162365 132 76 56530 133 57 35606 134 91 70111 135 101 92046 136 66 63989 137 98 104911 138 63 43448 139 85 60029 140 74 38650 141 19 47261 142 57 73586 143 74 83042 144 78 37238 145 91 63958 146 112 78956 147 79 99518 148 100 111436 149 0 0 150 0 6023 151 0 0 152 0 0 153 0 0 154 0 0 155 48 42564 156 55 38885 157 0 0 158 0 0 159 0 1644 160 13 6179 161 4 3926 162 31 23238 163 0 0 164 29 49288 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Blogged_Computations 7842.4799 982.3467 Reviewed_Compendiums Long_feedback_messages 1960.0273 153.9625 `number_characters_compendium\r\r` 0.2762 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -144375 -22230 -5350 15607 141071 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7842.4799 8742.2905 0.897 0.3710 Blogged_Computations 982.3467 146.0002 6.728 2.94e-10 *** Reviewed_Compendiums 1960.0273 889.9740 2.202 0.0291 * Long_feedback_messages 153.9625 241.0475 0.639 0.5239 `number_characters_compendium\r\r` 0.2762 0.1302 2.121 0.0355 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 40270 on 159 degrees of freedom Multiple R-squared: 0.6724, Adjusted R-squared: 0.6641 F-statistic: 81.57 on 4 and 159 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.4389096 8.778192e-01 5.610904e-01 [2,] 0.3251938 6.503877e-01 6.748062e-01 [3,] 0.2119272 4.238543e-01 7.880728e-01 [4,] 0.6156006 7.687988e-01 3.843994e-01 [5,] 0.5126558 9.746883e-01 4.873442e-01 [6,] 0.4152886 8.305771e-01 5.847114e-01 [7,] 0.4207865 8.415730e-01 5.792135e-01 [8,] 0.3415718 6.831437e-01 6.584282e-01 [9,] 0.2583475 5.166949e-01 7.416525e-01 [10,] 0.2124304 4.248608e-01 7.875696e-01 [11,] 0.1836945 3.673891e-01 8.163055e-01 [12,] 0.3063447 6.126894e-01 6.936553e-01 [13,] 0.3238447 6.476894e-01 6.761553e-01 [14,] 0.2582890 5.165781e-01 7.417110e-01 [15,] 0.8118536 3.762929e-01 1.881464e-01 [16,] 0.7663151 4.673697e-01 2.336849e-01 [17,] 0.8432964 3.134072e-01 1.567036e-01 [18,] 0.8686000 2.627999e-01 1.314000e-01 [19,] 0.8307978 3.384043e-01 1.692022e-01 [20,] 0.7877299 4.245402e-01 2.122701e-01 [21,] 0.7499845 5.000310e-01 2.500155e-01 [22,] 0.7043450 5.913101e-01 2.956550e-01 [23,] 0.6490568 7.018865e-01 3.509432e-01 [24,] 0.5917575 8.164849e-01 4.082425e-01 [25,] 0.5451546 9.096909e-01 4.548454e-01 [26,] 0.5071349 9.857303e-01 4.928651e-01 [27,] 0.4572596 9.145191e-01 5.427404e-01 [28,] 0.5095259 9.809482e-01 4.904741e-01 [29,] 0.4669449 9.338898e-01 5.330551e-01 [30,] 0.7627455 4.745091e-01 2.372545e-01 [31,] 0.7187965 5.624070e-01 2.812035e-01 [32,] 0.6750088 6.499824e-01 3.249912e-01 [33,] 0.6542793 6.914414e-01 3.457207e-01 [34,] 0.7035785 5.928430e-01 2.964215e-01 [35,] 0.6568554 6.862892e-01 3.431446e-01 [36,] 0.6077561 7.844878e-01 3.922439e-01 [37,] 0.5608224 8.783551e-01 4.391776e-01 [38,] 0.5092492 9.815016e-01 4.907508e-01 [39,] 0.9072936 1.854129e-01 9.270643e-02 [40,] 0.8880064 2.239872e-01 1.119936e-01 [41,] 0.8713665 2.572671e-01 1.286335e-01 [42,] 0.8461954 3.076092e-01 1.538046e-01 [43,] 0.8483793 3.032414e-01 1.516207e-01 [44,] 0.8249314 3.501372e-01 1.750686e-01 [45,] 0.7914088 4.171824e-01 2.085912e-01 [46,] 0.8794515 2.410971e-01 1.205485e-01 [47,] 0.8558997 2.882007e-01 1.441003e-01 [48,] 0.8340410 3.319179e-01 1.659590e-01 [49,] 0.8115757 3.768487e-01 1.884243e-01 [50,] 0.8061335 3.877329e-01 1.938665e-01 [51,] 0.7784945 4.430109e-01 2.215055e-01 [52,] 0.7501227 4.997546e-01 2.498773e-01 [53,] 0.7133888 5.732224e-01 2.866112e-01 [54,] 0.6938708 6.122585e-01 3.061292e-01 [55,] 0.6724978 6.550045e-01 3.275022e-01 [56,] 0.6339990 7.320021e-01 3.660010e-01 [57,] 0.6162746 7.674508e-01 3.837254e-01 [58,] 0.5772336 8.455328e-01 4.227664e-01 [59,] 0.5336225 9.327549e-01 4.663775e-01 [60,] 0.5359072 9.281855e-01 4.640928e-01 [61,] 0.4929480 9.858959e-01 5.070520e-01 [62,] 0.4865925 9.731849e-01 5.134075e-01 [63,] 0.6107882 7.784236e-01 3.892118e-01 [64,] 0.5772591 8.454818e-01 4.227409e-01 [65,] 0.5365676 9.268648e-01 4.634324e-01 [66,] 0.4931193 9.862386e-01 5.068807e-01 [67,] 0.4478606 8.957211e-01 5.521394e-01 [68,] 0.5511004 8.977992e-01 4.488996e-01 [69,] 0.5062709 9.874581e-01 4.937291e-01 [70,] 0.5096325 9.807350e-01 4.903675e-01 [71,] 0.6622159 6.755683e-01 3.377841e-01 [72,] 0.7063653 5.872694e-01 2.936347e-01 [73,] 0.6677401 6.645198e-01 3.322599e-01 [74,] 0.6273620 7.452760e-01 3.726380e-01 [75,] 0.6955350 6.089301e-01 3.044650e-01 [76,] 0.6847456 6.305088e-01 3.152544e-01 [77,] 0.6672466 6.655068e-01 3.327534e-01 [78,] 0.6264584 7.470832e-01 3.735416e-01 [79,] 0.5980465 8.039071e-01 4.019535e-01 [80,] 0.5793919 8.412162e-01 4.206081e-01 [81,] 0.7695349 4.609301e-01 2.304651e-01 [82,] 0.7598842 4.802316e-01 2.401158e-01 [83,] 0.8766055 2.467890e-01 1.233945e-01 [84,] 0.8618864 2.762272e-01 1.381136e-01 [85,] 0.8720364 2.559272e-01 1.279636e-01 [86,] 0.8515631 2.968737e-01 1.484369e-01 [87,] 0.8250423 3.499154e-01 1.749577e-01 [88,] 0.8440496 3.119008e-01 1.559504e-01 [89,] 0.8184020 3.631960e-01 1.815980e-01 [90,] 0.7990118 4.019764e-01 2.009882e-01 [91,] 0.7846279 4.307442e-01 2.153721e-01 [92,] 0.7586368 4.827264e-01 2.413632e-01 [93,] 0.7626550 4.746900e-01 2.373450e-01 [94,] 0.7381579 5.236841e-01 2.618421e-01 [95,] 0.7143491 5.713017e-01 2.856509e-01 [96,] 0.6843911 6.312178e-01 3.156089e-01 [97,] 0.6705548 6.588905e-01 3.294452e-01 [98,] 0.6290521 7.418958e-01 3.709479e-01 [99,] 0.5907559 8.184882e-01 4.092441e-01 [100,] 0.5475788 9.048424e-01 4.524212e-01 [101,] 0.5021055 9.957889e-01 4.978945e-01 [102,] 0.6216493 7.567013e-01 3.783507e-01 [103,] 0.6869111 6.261779e-01 3.130889e-01 [104,] 0.6660675 6.678651e-01 3.339325e-01 [105,] 0.6470688 7.058624e-01 3.529312e-01 [106,] 0.5994911 8.010179e-01 4.005089e-01 [107,] 0.6008219 7.983562e-01 3.991781e-01 [108,] 0.5511920 8.976159e-01 4.488080e-01 [109,] 0.5371632 9.256735e-01 4.628368e-01 [110,] 0.6885659 6.228683e-01 3.114341e-01 [111,] 0.6431297 7.137405e-01 3.568703e-01 [112,] 0.6312800 7.374400e-01 3.687200e-01 [113,] 0.5870043 8.259913e-01 4.129957e-01 [114,] 0.5488615 9.022769e-01 4.511385e-01 [115,] 0.5036459 9.927082e-01 4.963541e-01 [116,] 0.4693754 9.387507e-01 5.306246e-01 [117,] 0.4320790 8.641580e-01 5.679210e-01 [118,] 0.3797926 7.595852e-01 6.202074e-01 [119,] 0.3675214 7.350427e-01 6.324786e-01 [120,] 0.3194928 6.389856e-01 6.805072e-01 [121,] 0.2781918 5.563835e-01 7.218082e-01 [122,] 0.2820985 5.641969e-01 7.179015e-01 [123,] 0.2487382 4.974764e-01 7.512618e-01 [124,] 0.2156058 4.312117e-01 7.843942e-01 [125,] 0.1760741 3.521481e-01 8.239259e-01 [126,] 0.1474826 2.949652e-01 8.525174e-01 [127,] 0.1556263 3.112526e-01 8.443737e-01 [128,] 0.3578398 7.156796e-01 6.421602e-01 [129,] 0.3640795 7.281591e-01 6.359205e-01 [130,] 0.4640843 9.281686e-01 5.359157e-01 [131,] 0.4174154 8.348308e-01 5.825846e-01 [132,] 0.3685803 7.371607e-01 6.314197e-01 [133,] 0.3063340 6.126680e-01 6.936660e-01 [134,] 0.2601467 5.202933e-01 7.398533e-01 [135,] 0.7120456 5.759088e-01 2.879544e-01 [136,] 0.6528982 6.942036e-01 3.471018e-01 [137,] 0.9351289 1.297422e-01 6.487112e-02 [138,] 0.9916430 1.671397e-02 8.356986e-03 [139,] 0.9997984 4.032060e-04 2.016030e-04 [140,] 0.9994922 1.015657e-03 5.078284e-04 [141,] 1.0000000 5.326572e-10 2.663286e-10 [142,] 1.0000000 5.010605e-09 2.505302e-09 [143,] 1.0000000 2.360642e-08 1.180321e-08 [144,] 0.9999999 2.329535e-07 1.164768e-07 [145,] 0.9999989 2.243442e-06 1.121721e-06 [146,] 0.9999903 1.933939e-05 9.669695e-06 [147,] 0.9999228 1.543307e-04 7.716537e-05 [148,] 0.9999910 1.799341e-05 8.996706e-06 [149,] 0.9999476 1.048070e-04 5.240352e-05 > postscript(file="/var/wessaorg/rcomp/tmp/1fz5n1321901967.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/2jv2h1321901967.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/3kz4j1321901967.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/46ae11321901967.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/5url81321901967.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 8604.7545 -39626.1028 -21448.2622 -36707.6345 -4566.1273 -24605.0979 7 8 9 10 11 12 113371.3485 -21042.2879 3220.1020 3833.4990 2213.3050 -58247.8526 13 14 15 16 17 18 -10448.5156 5951.0322 -3716.2540 14995.2375 -553.0577 47463.1479 19 20 21 22 23 24 -38675.1361 -42718.6018 -6878.0863 123660.8569 -2989.9026 -75961.8780 25 26 27 28 29 30 -48004.9137 -7407.6927 11771.0871 -21860.5067 -1757.9763 -2301.9444 31 32 33 34 35 36 -6828.7051 -15069.4395 16604.5814 -28757.7211 56495.9306 19808.3341 37 38 39 40 41 42 96327.9053 6396.1389 17742.1337 37837.0745 63979.7833 -8773.5994 43 44 45 46 47 48 7053.1268 -17332.8337 -3855.9406 141071.2421 -18935.8150 -23689.4522 49 50 51 52 53 54 19548.4164 -44361.8065 -10335.3864 -2074.6213 82781.2906 -17106.2680 55 56 57 58 59 60 18243.7599 27343.6089 -32876.4700 15445.1681 2937.8056 10429.9600 61 62 63 64 65 66 36511.2512 25152.7918 7571.3807 31124.5790 17173.5372 207.6612 67 68 69 70 71 72 -30172.5713 -11630.2901 -31422.1533 -75431.2313 -20939.1876 -15130.8816 73 74 75 76 77 78 -10461.7039 2939.7377 -74772.5913 4736.1359 43673.3108 -69385.3716 79 80 81 82 83 84 -59751.8641 -8803.9860 -9966.1520 67995.5776 31921.0488 -28648.5908 85 86 87 88 89 90 -10501.9164 22849.8437 -32187.6616 95954.1786 35419.3157 -90690.5781 91 92 93 94 95 96 23432.6708 -47715.3528 15475.6703 10260.7673 50338.7857 -14606.6410 97 98 99 100 101 102 -23336.5167 -25725.3661 -23853.8098 46716.3844 -25621.3490 -23415.9030 103 104 105 106 107 108 16001.5261 -36504.8188 9552.1816 -18500.1539 -11562.9822 -6153.1484 109 110 111 112 113 114 -55115.4403 -67030.5859 35276.5032 -32978.1345 1024.7048 -37998.7748 115 116 117 118 119 120 -1708.9279 -41447.6754 88071.5385 9045.9634 44272.5428 -15075.7514 121 122 123 124 125 126 20790.5136 -13291.7806 -21532.3887 -15211.9719 -6682.7543 -30888.5383 127 128 129 130 131 132 9329.4289 -3607.5420 36660.4209 -29484.1452 6977.9448 6831.2035 133 134 135 136 137 138 -16689.7577 50246.6598 94122.9543 -25845.4135 59050.1803 -13621.2821 139 140 141 142 143 144 -2929.4581 -6133.4657 27966.3380 104327.4356 -28206.6324 61685.7002 145 146 147 148 149 150 6535.9141 -144374.9446 -23890.5034 -37482.1224 -7842.4799 1252.4483 151 152 153 154 155 156 -7744.4799 -7387.4799 -7842.4799 -7842.4799 30436.0985 10028.3202 157 158 159 160 161 162 -7842.4799 -7639.4799 -7974.0159 13520.9345 6044.1953 -26894.6211 163 164 -6873.4799 9883.2194 > postscript(file="/var/wessaorg/rcomp/tmp/6v4kt1321901967.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 8604.7545 NA 1 -39626.1028 8604.7545 2 -21448.2622 -39626.1028 3 -36707.6345 -21448.2622 4 -4566.1273 -36707.6345 5 -24605.0979 -4566.1273 6 113371.3485 -24605.0979 7 -21042.2879 113371.3485 8 3220.1020 -21042.2879 9 3833.4990 3220.1020 10 2213.3050 3833.4990 11 -58247.8526 2213.3050 12 -10448.5156 -58247.8526 13 5951.0322 -10448.5156 14 -3716.2540 5951.0322 15 14995.2375 -3716.2540 16 -553.0577 14995.2375 17 47463.1479 -553.0577 18 -38675.1361 47463.1479 19 -42718.6018 -38675.1361 20 -6878.0863 -42718.6018 21 123660.8569 -6878.0863 22 -2989.9026 123660.8569 23 -75961.8780 -2989.9026 24 -48004.9137 -75961.8780 25 -7407.6927 -48004.9137 26 11771.0871 -7407.6927 27 -21860.5067 11771.0871 28 -1757.9763 -21860.5067 29 -2301.9444 -1757.9763 30 -6828.7051 -2301.9444 31 -15069.4395 -6828.7051 32 16604.5814 -15069.4395 33 -28757.7211 16604.5814 34 56495.9306 -28757.7211 35 19808.3341 56495.9306 36 96327.9053 19808.3341 37 6396.1389 96327.9053 38 17742.1337 6396.1389 39 37837.0745 17742.1337 40 63979.7833 37837.0745 41 -8773.5994 63979.7833 42 7053.1268 -8773.5994 43 -17332.8337 7053.1268 44 -3855.9406 -17332.8337 45 141071.2421 -3855.9406 46 -18935.8150 141071.2421 47 -23689.4522 -18935.8150 48 19548.4164 -23689.4522 49 -44361.8065 19548.4164 50 -10335.3864 -44361.8065 51 -2074.6213 -10335.3864 52 82781.2906 -2074.6213 53 -17106.2680 82781.2906 54 18243.7599 -17106.2680 55 27343.6089 18243.7599 56 -32876.4700 27343.6089 57 15445.1681 -32876.4700 58 2937.8056 15445.1681 59 10429.9600 2937.8056 60 36511.2512 10429.9600 61 25152.7918 36511.2512 62 7571.3807 25152.7918 63 31124.5790 7571.3807 64 17173.5372 31124.5790 65 207.6612 17173.5372 66 -30172.5713 207.6612 67 -11630.2901 -30172.5713 68 -31422.1533 -11630.2901 69 -75431.2313 -31422.1533 70 -20939.1876 -75431.2313 71 -15130.8816 -20939.1876 72 -10461.7039 -15130.8816 73 2939.7377 -10461.7039 74 -74772.5913 2939.7377 75 4736.1359 -74772.5913 76 43673.3108 4736.1359 77 -69385.3716 43673.3108 78 -59751.8641 -69385.3716 79 -8803.9860 -59751.8641 80 -9966.1520 -8803.9860 81 67995.5776 -9966.1520 82 31921.0488 67995.5776 83 -28648.5908 31921.0488 84 -10501.9164 -28648.5908 85 22849.8437 -10501.9164 86 -32187.6616 22849.8437 87 95954.1786 -32187.6616 88 35419.3157 95954.1786 89 -90690.5781 35419.3157 90 23432.6708 -90690.5781 91 -47715.3528 23432.6708 92 15475.6703 -47715.3528 93 10260.7673 15475.6703 94 50338.7857 10260.7673 95 -14606.6410 50338.7857 96 -23336.5167 -14606.6410 97 -25725.3661 -23336.5167 98 -23853.8098 -25725.3661 99 46716.3844 -23853.8098 100 -25621.3490 46716.3844 101 -23415.9030 -25621.3490 102 16001.5261 -23415.9030 103 -36504.8188 16001.5261 104 9552.1816 -36504.8188 105 -18500.1539 9552.1816 106 -11562.9822 -18500.1539 107 -6153.1484 -11562.9822 108 -55115.4403 -6153.1484 109 -67030.5859 -55115.4403 110 35276.5032 -67030.5859 111 -32978.1345 35276.5032 112 1024.7048 -32978.1345 113 -37998.7748 1024.7048 114 -1708.9279 -37998.7748 115 -41447.6754 -1708.9279 116 88071.5385 -41447.6754 117 9045.9634 88071.5385 118 44272.5428 9045.9634 119 -15075.7514 44272.5428 120 20790.5136 -15075.7514 121 -13291.7806 20790.5136 122 -21532.3887 -13291.7806 123 -15211.9719 -21532.3887 124 -6682.7543 -15211.9719 125 -30888.5383 -6682.7543 126 9329.4289 -30888.5383 127 -3607.5420 9329.4289 128 36660.4209 -3607.5420 129 -29484.1452 36660.4209 130 6977.9448 -29484.1452 131 6831.2035 6977.9448 132 -16689.7577 6831.2035 133 50246.6598 -16689.7577 134 94122.9543 50246.6598 135 -25845.4135 94122.9543 136 59050.1803 -25845.4135 137 -13621.2821 59050.1803 138 -2929.4581 -13621.2821 139 -6133.4657 -2929.4581 140 27966.3380 -6133.4657 141 104327.4356 27966.3380 142 -28206.6324 104327.4356 143 61685.7002 -28206.6324 144 6535.9141 61685.7002 145 -144374.9446 6535.9141 146 -23890.5034 -144374.9446 147 -37482.1224 -23890.5034 148 -7842.4799 -37482.1224 149 1252.4483 -7842.4799 150 -7744.4799 1252.4483 151 -7387.4799 -7744.4799 152 -7842.4799 -7387.4799 153 -7842.4799 -7842.4799 154 30436.0985 -7842.4799 155 10028.3202 30436.0985 156 -7842.4799 10028.3202 157 -7639.4799 -7842.4799 158 -7974.0159 -7639.4799 159 13520.9345 -7974.0159 160 6044.1953 13520.9345 161 -26894.6211 6044.1953 162 -6873.4799 -26894.6211 163 9883.2194 -6873.4799 164 NA 9883.2194 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -39626.1028 8604.7545 [2,] -21448.2622 -39626.1028 [3,] -36707.6345 -21448.2622 [4,] -4566.1273 -36707.6345 [5,] -24605.0979 -4566.1273 [6,] 113371.3485 -24605.0979 [7,] -21042.2879 113371.3485 [8,] 3220.1020 -21042.2879 [9,] 3833.4990 3220.1020 [10,] 2213.3050 3833.4990 [11,] -58247.8526 2213.3050 [12,] -10448.5156 -58247.8526 [13,] 5951.0322 -10448.5156 [14,] -3716.2540 5951.0322 [15,] 14995.2375 -3716.2540 [16,] -553.0577 14995.2375 [17,] 47463.1479 -553.0577 [18,] -38675.1361 47463.1479 [19,] -42718.6018 -38675.1361 [20,] -6878.0863 -42718.6018 [21,] 123660.8569 -6878.0863 [22,] -2989.9026 123660.8569 [23,] -75961.8780 -2989.9026 [24,] -48004.9137 -75961.8780 [25,] -7407.6927 -48004.9137 [26,] 11771.0871 -7407.6927 [27,] -21860.5067 11771.0871 [28,] -1757.9763 -21860.5067 [29,] -2301.9444 -1757.9763 [30,] -6828.7051 -2301.9444 [31,] -15069.4395 -6828.7051 [32,] 16604.5814 -15069.4395 [33,] -28757.7211 16604.5814 [34,] 56495.9306 -28757.7211 [35,] 19808.3341 56495.9306 [36,] 96327.9053 19808.3341 [37,] 6396.1389 96327.9053 [38,] 17742.1337 6396.1389 [39,] 37837.0745 17742.1337 [40,] 63979.7833 37837.0745 [41,] -8773.5994 63979.7833 [42,] 7053.1268 -8773.5994 [43,] -17332.8337 7053.1268 [44,] -3855.9406 -17332.8337 [45,] 141071.2421 -3855.9406 [46,] -18935.8150 141071.2421 [47,] -23689.4522 -18935.8150 [48,] 19548.4164 -23689.4522 [49,] -44361.8065 19548.4164 [50,] -10335.3864 -44361.8065 [51,] -2074.6213 -10335.3864 [52,] 82781.2906 -2074.6213 [53,] -17106.2680 82781.2906 [54,] 18243.7599 -17106.2680 [55,] 27343.6089 18243.7599 [56,] -32876.4700 27343.6089 [57,] 15445.1681 -32876.4700 [58,] 2937.8056 15445.1681 [59,] 10429.9600 2937.8056 [60,] 36511.2512 10429.9600 [61,] 25152.7918 36511.2512 [62,] 7571.3807 25152.7918 [63,] 31124.5790 7571.3807 [64,] 17173.5372 31124.5790 [65,] 207.6612 17173.5372 [66,] -30172.5713 207.6612 [67,] -11630.2901 -30172.5713 [68,] -31422.1533 -11630.2901 [69,] -75431.2313 -31422.1533 [70,] -20939.1876 -75431.2313 [71,] -15130.8816 -20939.1876 [72,] -10461.7039 -15130.8816 [73,] 2939.7377 -10461.7039 [74,] -74772.5913 2939.7377 [75,] 4736.1359 -74772.5913 [76,] 43673.3108 4736.1359 [77,] -69385.3716 43673.3108 [78,] -59751.8641 -69385.3716 [79,] -8803.9860 -59751.8641 [80,] -9966.1520 -8803.9860 [81,] 67995.5776 -9966.1520 [82,] 31921.0488 67995.5776 [83,] -28648.5908 31921.0488 [84,] -10501.9164 -28648.5908 [85,] 22849.8437 -10501.9164 [86,] -32187.6616 22849.8437 [87,] 95954.1786 -32187.6616 [88,] 35419.3157 95954.1786 [89,] -90690.5781 35419.3157 [90,] 23432.6708 -90690.5781 [91,] -47715.3528 23432.6708 [92,] 15475.6703 -47715.3528 [93,] 10260.7673 15475.6703 [94,] 50338.7857 10260.7673 [95,] -14606.6410 50338.7857 [96,] -23336.5167 -14606.6410 [97,] -25725.3661 -23336.5167 [98,] -23853.8098 -25725.3661 [99,] 46716.3844 -23853.8098 [100,] -25621.3490 46716.3844 [101,] -23415.9030 -25621.3490 [102,] 16001.5261 -23415.9030 [103,] -36504.8188 16001.5261 [104,] 9552.1816 -36504.8188 [105,] -18500.1539 9552.1816 [106,] -11562.9822 -18500.1539 [107,] -6153.1484 -11562.9822 [108,] -55115.4403 -6153.1484 [109,] -67030.5859 -55115.4403 [110,] 35276.5032 -67030.5859 [111,] -32978.1345 35276.5032 [112,] 1024.7048 -32978.1345 [113,] -37998.7748 1024.7048 [114,] -1708.9279 -37998.7748 [115,] -41447.6754 -1708.9279 [116,] 88071.5385 -41447.6754 [117,] 9045.9634 88071.5385 [118,] 44272.5428 9045.9634 [119,] -15075.7514 44272.5428 [120,] 20790.5136 -15075.7514 [121,] -13291.7806 20790.5136 [122,] -21532.3887 -13291.7806 [123,] -15211.9719 -21532.3887 [124,] -6682.7543 -15211.9719 [125,] -30888.5383 -6682.7543 [126,] 9329.4289 -30888.5383 [127,] -3607.5420 9329.4289 [128,] 36660.4209 -3607.5420 [129,] -29484.1452 36660.4209 [130,] 6977.9448 -29484.1452 [131,] 6831.2035 6977.9448 [132,] -16689.7577 6831.2035 [133,] 50246.6598 -16689.7577 [134,] 94122.9543 50246.6598 [135,] -25845.4135 94122.9543 [136,] 59050.1803 -25845.4135 [137,] -13621.2821 59050.1803 [138,] -2929.4581 -13621.2821 [139,] -6133.4657 -2929.4581 [140,] 27966.3380 -6133.4657 [141,] 104327.4356 27966.3380 [142,] -28206.6324 104327.4356 [143,] 61685.7002 -28206.6324 [144,] 6535.9141 61685.7002 [145,] -144374.9446 6535.9141 [146,] -23890.5034 -144374.9446 [147,] -37482.1224 -23890.5034 [148,] -7842.4799 -37482.1224 [149,] 1252.4483 -7842.4799 [150,] -7744.4799 1252.4483 [151,] -7387.4799 -7744.4799 [152,] -7842.4799 -7387.4799 [153,] -7842.4799 -7842.4799 [154,] 30436.0985 -7842.4799 [155,] 10028.3202 30436.0985 [156,] -7842.4799 10028.3202 [157,] -7639.4799 -7842.4799 [158,] -7974.0159 -7639.4799 [159,] 13520.9345 -7974.0159 [160,] 6044.1953 13520.9345 [161,] -26894.6211 6044.1953 [162,] -6873.4799 -26894.6211 [163,] 9883.2194 -6873.4799 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -39626.1028 8604.7545 2 -21448.2622 -39626.1028 3 -36707.6345 -21448.2622 4 -4566.1273 -36707.6345 5 -24605.0979 -4566.1273 6 113371.3485 -24605.0979 7 -21042.2879 113371.3485 8 3220.1020 -21042.2879 9 3833.4990 3220.1020 10 2213.3050 3833.4990 11 -58247.8526 2213.3050 12 -10448.5156 -58247.8526 13 5951.0322 -10448.5156 14 -3716.2540 5951.0322 15 14995.2375 -3716.2540 16 -553.0577 14995.2375 17 47463.1479 -553.0577 18 -38675.1361 47463.1479 19 -42718.6018 -38675.1361 20 -6878.0863 -42718.6018 21 123660.8569 -6878.0863 22 -2989.9026 123660.8569 23 -75961.8780 -2989.9026 24 -48004.9137 -75961.8780 25 -7407.6927 -48004.9137 26 11771.0871 -7407.6927 27 -21860.5067 11771.0871 28 -1757.9763 -21860.5067 29 -2301.9444 -1757.9763 30 -6828.7051 -2301.9444 31 -15069.4395 -6828.7051 32 16604.5814 -15069.4395 33 -28757.7211 16604.5814 34 56495.9306 -28757.7211 35 19808.3341 56495.9306 36 96327.9053 19808.3341 37 6396.1389 96327.9053 38 17742.1337 6396.1389 39 37837.0745 17742.1337 40 63979.7833 37837.0745 41 -8773.5994 63979.7833 42 7053.1268 -8773.5994 43 -17332.8337 7053.1268 44 -3855.9406 -17332.8337 45 141071.2421 -3855.9406 46 -18935.8150 141071.2421 47 -23689.4522 -18935.8150 48 19548.4164 -23689.4522 49 -44361.8065 19548.4164 50 -10335.3864 -44361.8065 51 -2074.6213 -10335.3864 52 82781.2906 -2074.6213 53 -17106.2680 82781.2906 54 18243.7599 -17106.2680 55 27343.6089 18243.7599 56 -32876.4700 27343.6089 57 15445.1681 -32876.4700 58 2937.8056 15445.1681 59 10429.9600 2937.8056 60 36511.2512 10429.9600 61 25152.7918 36511.2512 62 7571.3807 25152.7918 63 31124.5790 7571.3807 64 17173.5372 31124.5790 65 207.6612 17173.5372 66 -30172.5713 207.6612 67 -11630.2901 -30172.5713 68 -31422.1533 -11630.2901 69 -75431.2313 -31422.1533 70 -20939.1876 -75431.2313 71 -15130.8816 -20939.1876 72 -10461.7039 -15130.8816 73 2939.7377 -10461.7039 74 -74772.5913 2939.7377 75 4736.1359 -74772.5913 76 43673.3108 4736.1359 77 -69385.3716 43673.3108 78 -59751.8641 -69385.3716 79 -8803.9860 -59751.8641 80 -9966.1520 -8803.9860 81 67995.5776 -9966.1520 82 31921.0488 67995.5776 83 -28648.5908 31921.0488 84 -10501.9164 -28648.5908 85 22849.8437 -10501.9164 86 -32187.6616 22849.8437 87 95954.1786 -32187.6616 88 35419.3157 95954.1786 89 -90690.5781 35419.3157 90 23432.6708 -90690.5781 91 -47715.3528 23432.6708 92 15475.6703 -47715.3528 93 10260.7673 15475.6703 94 50338.7857 10260.7673 95 -14606.6410 50338.7857 96 -23336.5167 -14606.6410 97 -25725.3661 -23336.5167 98 -23853.8098 -25725.3661 99 46716.3844 -23853.8098 100 -25621.3490 46716.3844 101 -23415.9030 -25621.3490 102 16001.5261 -23415.9030 103 -36504.8188 16001.5261 104 9552.1816 -36504.8188 105 -18500.1539 9552.1816 106 -11562.9822 -18500.1539 107 -6153.1484 -11562.9822 108 -55115.4403 -6153.1484 109 -67030.5859 -55115.4403 110 35276.5032 -67030.5859 111 -32978.1345 35276.5032 112 1024.7048 -32978.1345 113 -37998.7748 1024.7048 114 -1708.9279 -37998.7748 115 -41447.6754 -1708.9279 116 88071.5385 -41447.6754 117 9045.9634 88071.5385 118 44272.5428 9045.9634 119 -15075.7514 44272.5428 120 20790.5136 -15075.7514 121 -13291.7806 20790.5136 122 -21532.3887 -13291.7806 123 -15211.9719 -21532.3887 124 -6682.7543 -15211.9719 125 -30888.5383 -6682.7543 126 9329.4289 -30888.5383 127 -3607.5420 9329.4289 128 36660.4209 -3607.5420 129 -29484.1452 36660.4209 130 6977.9448 -29484.1452 131 6831.2035 6977.9448 132 -16689.7577 6831.2035 133 50246.6598 -16689.7577 134 94122.9543 50246.6598 135 -25845.4135 94122.9543 136 59050.1803 -25845.4135 137 -13621.2821 59050.1803 138 -2929.4581 -13621.2821 139 -6133.4657 -2929.4581 140 27966.3380 -6133.4657 141 104327.4356 27966.3380 142 -28206.6324 104327.4356 143 61685.7002 -28206.6324 144 6535.9141 61685.7002 145 -144374.9446 6535.9141 146 -23890.5034 -144374.9446 147 -37482.1224 -23890.5034 148 -7842.4799 -37482.1224 149 1252.4483 -7842.4799 150 -7744.4799 1252.4483 151 -7387.4799 -7744.4799 152 -7842.4799 -7387.4799 153 -7842.4799 -7842.4799 154 30436.0985 -7842.4799 155 10028.3202 30436.0985 156 -7842.4799 10028.3202 157 -7639.4799 -7842.4799 158 -7974.0159 -7639.4799 159 13520.9345 -7974.0159 160 6044.1953 13520.9345 161 -26894.6211 6044.1953 162 -6873.4799 -26894.6211 163 9883.2194 -6873.4799 > 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/7d8i01321901967.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/88r7o1321901967.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/9rdca1321901967.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/109eru1321901967.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/11evdk1321901967.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/126rl11321901967.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/13j79e1321901967.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/14bt8p1321901967.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/152qpb1321901967.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/16ix091321901967.tab") + } > > try(system("convert tmp/1fz5n1321901967.ps tmp/1fz5n1321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/2jv2h1321901967.ps tmp/2jv2h1321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/3kz4j1321901967.ps tmp/3kz4j1321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/46ae11321901967.ps tmp/46ae11321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/5url81321901967.ps tmp/5url81321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/6v4kt1321901967.ps tmp/6v4kt1321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/7d8i01321901967.ps tmp/7d8i01321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/88r7o1321901967.ps tmp/88r7o1321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/9rdca1321901967.ps tmp/9rdca1321901967.png",intern=TRUE)) character(0) > try(system("convert tmp/109eru1321901967.ps tmp/109eru1321901967.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.911 0.537 5.480