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(97 + ,197426 + ,39 + ,178377 + ,490 + ,146 + ,187326 + ,173 + ,250931 + ,2563 + ,116 + ,184923 + ,165 + ,226168 + ,1538 + ,113 + ,183500 + ,181 + ,211381 + ,898 + ,75 + ,176225 + ,139 + ,214738 + ,1212 + ,228 + ,169707 + ,166 + ,210012 + ,790 + ,138 + ,169265 + ,116 + ,163073 + ,738 + ,153 + ,167949 + ,114 + ,164263 + ,845 + ,248 + ,165986 + ,155 + ,189944 + ,1369 + ,161 + ,165933 + ,127 + ,147581 + ,1830 + ,155 + ,165904 + ,107 + ,127667 + ,711 + ,142 + ,160902 + ,126 + ,106330 + ,992 + ,145 + ,160141 + ,161 + ,175721 + ,1272 + ,159 + ,156349 + ,185 + ,169216 + ,852 + ,153 + ,154771 + ,63 + ,18284 + ,575 + ,130 + ,154451 + ,121 + ,134969 + ,1101 + ,177 + ,151911 + ,150 + ,191889 + ,1410 + ,181 + ,151715 + ,160 + ,197765 + ,1352 + ,140 + ,150491 + ,132 + ,194679 + ,1208 + ,196 + ,150047 + ,147 + ,75767 + ,739 + ,140 + ,149959 + ,176 + ,195894 + ,926 + ,175 + ,149695 + ,88 + ,191179 + ,865 + ,155 + ,147172 + ,82 + ,178303 + ,677 + ,147 + ,146975 + ,75 + ,135599 + ,971 + ,177 + ,146760 + ,128 + ,195791 + ,1574 + ,159 + ,144551 + ,165 + ,81716 + ,1051 + ,132 + ,144408 + ,88 + ,115466 + ,763 + ,94 + ,144244 + ,62 + ,88229 + ,724 + ,140 + ,143592 + ,93 + ,113963 + ,652 + ,130 + ,140824 + ,96 + ,186099 + ,504 + ,176 + ,140358 + ,121 + ,117495 + ,893 + ,153 + ,140015 + ,146 + ,145758 + ,1034 + ,179 + ,139165 + ,143 + ,184531 + ,1111 + ,197 + ,136588 + ,135 + ,134163 + ,692 + ,163 + ,135356 + ,76 + ,91502 + ,740 + ,170 + ,134238 + ,152 + ,191469 + ,1716 + ,145 + ,134047 + ,163 + ,231257 + ,884 + ,129 + ,131072 + ,154 + ,114268 + ,925 + ,57 + ,128692 + ,48 + ,100187 + ,723 + ,144 + ,127654 + ,168 + ,105590 + ,732 + ,92 + ,126817 + ,143 + ,94333 + ,637 + ,144 + ,126372 + ,156 + ,165278 + ,1266 + ,95 + ,125818 + ,103 + ,111669 + ,527 + ,126 + ,125386 + ,128 + ,134218 + ,811 + ,97 + ,125081 + ,121 + ,135213 + ,1390 + ,144 + ,124089 + ,96 + ,130332 + ,1613 + ,137 + ,123534 + ,76 + ,100922 + ,459 + ,155 + ,120192 + ,161 + ,197680 + ,1118 + ,163 + ,119442 + ,141 + ,189723 + ,1293 + ,227 + ,118906 + ,103 + ,102509 + ,636 + ,187 + ,117440 + ,137 + ,157384 + ,1031 + ,148 + ,116066 + ,55 + ,24469 + ,524 + ,208 + ,114948 + ,176 + ,165354 + ,1775 + ,136 + ,114799 + ,66 + ,153242 + ,669 + ,134 + ,114360 + ,101 + ,79367 + ,2089 + ,149 + ,113344 + ,155 + ,230054 + ,1230 + ,160 + ,112431 + ,123 + ,140303 + ,847 + ,187 + ,112302 + ,145 + ,198299 + ,906 + ,146 + ,112098 + ,134 + ,106194 + ,1154 + ,102 + ,110529 + ,164 + ,232241 + ,1251 + ,143 + ,110459 + ,75 + ,113854 + ,510 + ,115 + ,109432 + ,148 + ,116938 + ,698 + ,151 + ,108535 + ,85 + ,118845 + ,1586 + ,144 + ,108146 + ,140 + ,100125 + ,1001 + ,118 + ,105079 + ,70 + ,99776 + ,710 + ,98 + ,104978 + ,117 + ,139292 + ,906 + ,142 + ,104767 + ,103 + ,124527 + ,1030 + ,151 + ,104581 + ,116 + ,116136 + ,1092 + ,171 + ,104128 + ,50 + ,122975 + ,511 + ,156 + ,103925 + ,152 + ,164808 + ,1319 + ,171 + ,103297 + ,139 + ,101345 + ,1186 + ,142 + ,103129 + ,114 + ,158376 + ,1201 + ,148 + ,103037 + ,110 + ,150773 + ,1443 + ,96 + ,102812 + ,120 + ,136323 + ,703 + ,151 + ,102153 + ,98 + ,80716 + ,862 + ,173 + ,102070 + ,94 + ,86480 + ,1031 + ,151 + ,101629 + ,112 + ,188355 + ,1348 + ,77 + ,101382 + ,81 + ,127097 + ,866 + ,135 + ,101047 + ,169 + ,135848 + ,1079 + ,71 + ,100350 + ,62 + ,75882 + ,695 + ,133 + ,100087 + ,102 + ,129711 + ,1229 + ,139 + ,100046 + ,133 + ,128602 + ,1288 + ,201 + ,96125 + ,107 + ,106314 + ,764 + ,141 + ,95893 + ,90 + ,81180 + ,919 + ,158 + ,95676 + ,99 + ,160792 + ,691 + ,126 + ,93879 + ,152 + ,170492 + ,1099 + ,119 + ,93487 + ,84 + ,133252 + ,766 + ,65 + ,93473 + ,57 + ,121850 + ,1150 + ,128 + ,92622 + ,126 + ,134097 + ,1566 + ,147 + ,92280 + ,118 + ,147341 + ,668 + ,90 + ,92059 + ,101 + ,91313 + ,910 + ,169 + ,89626 + ,85 + ,134904 + ,894 + ,150 + ,89506 + ,118 + ,160501 + ,1351 + ,156 + ,89256 + ,129 + ,104864 + ,1187 + ,179 + ,88977 + ,85 + ,111563 + ,784 + ,149 + ,86652 + ,50 + ,114198 + ,758 + ,94 + ,84601 + ,85 + ,105406 + ,816 + ,154 + ,83515 + ,158 + ,96785 + ,1370 + ,103 + ,83248 + ,146 + ,106020 + ,785 + ,148 + ,83243 + ,150 + ,153990 + ,763 + ,84 + ,82317 + ,77 + ,111848 + ,569 + ,144 + ,81897 + ,131 + ,89770 + ,781 + ,203 + ,81625 + ,132 + ,94853 + ,743 + ,160 + ,81351 + ,107 + ,102204 + ,900 + ,152 + ,79756 + ,80 + ,122531 + ,575 + ,147 + ,79089 + ,114 + ,169351 + ,981 + ,111 + ,79011 + ,97 + ,80238 + ,784 + ,89 + ,76173 + ,8 + ,47552 + ,179 + ,87 + ,72128 + ,163 + ,145707 + ,542 + ,121 + ,71571 + ,102 + ,75881 + ,746 + ,146 + ,71154 + ,137 + ,80906 + ,767 + ,100 + ,70168 + ,79 + ,104470 + ,695 + ,127 + ,69867 + ,83 + ,100826 + ,1186 + ,153 + ,69652 + ,56 + ,33750 + ,456 + ,87 + ,69446 + ,87 + ,113713 + ,724 + ,129 + ,68946 + ,164 + ,174586 + ,1145 + ,113 + ,68788 + ,57 + ,72591 + ,785 + ,124 + ,67150 + ,110 + ,114651 + ,905 + ,92 + ,66485 + ,104 + ,110896 + ,661 + ,112 + ,66089 + ,65 + ,61394 + ,507 + ,102 + ,65594 + ,48 + ,92795 + ,632 + ,115 + ,64593 + ,60 + ,72558 + ,790 + ,148 + ,64520 + ,68 + ,54518 + ,488 + ,135 + ,59938 + ,149 + ,82390 + ,1128 + ,97 + ,59900 + ,104 + ,96252 + ,1257 + ,59 + ,57224 + ,86 + ,80684 + ,800 + ,101 + ,56750 + ,89 + ,115750 + ,846 + ,27 + ,56622 + ,49 + ,55792 + ,437 + ,112 + ,55918 + ,74 + ,83963 + ,795 + ,89 + ,52789 + ,37 + ,15673 + ,309 + ,40 + ,48029 + ,120 + ,88634 + ,833 + ,130 + ,45724 + ,87 + ,74151 + ,641 + ,73 + ,43929 + ,83 + ,100792 + ,415 + ,64 + ,43750 + ,13 + ,19630 + ,214 + ,99 + ,38692 + ,30 + ,68580 + ,657 + ,78 + ,37238 + ,41 + ,10901 + ,716 + ,110 + ,37110 + ,67 + ,64057 + ,665) + ,dim=c(5 + ,137) + ,dimnames=list(c('FbackMess' + ,'CompendiumCharacters' + ,'BloggedComputations' + ,'CompendiumSeconds' + ,'CourseViews') + ,1:137)) > y <- array(NA,dim=c(5,137),dimnames=list(c('FbackMess','CompendiumCharacters','BloggedComputations','CompendiumSeconds','CourseViews'),1:137)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > 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 CompendiumCharacters FbackMess BloggedComputations CompendiumSeconds 1 197426 97 39 178377 2 187326 146 173 250931 3 184923 116 165 226168 4 183500 113 181 211381 5 176225 75 139 214738 6 169707 228 166 210012 7 169265 138 116 163073 8 167949 153 114 164263 9 165986 248 155 189944 10 165933 161 127 147581 11 165904 155 107 127667 12 160902 142 126 106330 13 160141 145 161 175721 14 156349 159 185 169216 15 154771 153 63 18284 16 154451 130 121 134969 17 151911 177 150 191889 18 151715 181 160 197765 19 150491 140 132 194679 20 150047 196 147 75767 21 149959 140 176 195894 22 149695 175 88 191179 23 147172 155 82 178303 24 146975 147 75 135599 25 146760 177 128 195791 26 144551 159 165 81716 27 144408 132 88 115466 28 144244 94 62 88229 29 143592 140 93 113963 30 140824 130 96 186099 31 140358 176 121 117495 32 140015 153 146 145758 33 139165 179 143 184531 34 136588 197 135 134163 35 135356 163 76 91502 36 134238 170 152 191469 37 134047 145 163 231257 38 131072 129 154 114268 39 128692 57 48 100187 40 127654 144 168 105590 41 126817 92 143 94333 42 126372 144 156 165278 43 125818 95 103 111669 44 125386 126 128 134218 45 125081 97 121 135213 46 124089 144 96 130332 47 123534 137 76 100922 48 120192 155 161 197680 49 119442 163 141 189723 50 118906 227 103 102509 51 117440 187 137 157384 52 116066 148 55 24469 53 114948 208 176 165354 54 114799 136 66 153242 55 114360 134 101 79367 56 113344 149 155 230054 57 112431 160 123 140303 58 112302 187 145 198299 59 112098 146 134 106194 60 110529 102 164 232241 61 110459 143 75 113854 62 109432 115 148 116938 63 108535 151 85 118845 64 108146 144 140 100125 65 105079 118 70 99776 66 104978 98 117 139292 67 104767 142 103 124527 68 104581 151 116 116136 69 104128 171 50 122975 70 103925 156 152 164808 71 103297 171 139 101345 72 103129 142 114 158376 73 103037 148 110 150773 74 102812 96 120 136323 75 102153 151 98 80716 76 102070 173 94 86480 77 101629 151 112 188355 78 101382 77 81 127097 79 101047 135 169 135848 80 100350 71 62 75882 81 100087 133 102 129711 82 100046 139 133 128602 83 96125 201 107 106314 84 95893 141 90 81180 85 95676 158 99 160792 86 93879 126 152 170492 87 93487 119 84 133252 88 93473 65 57 121850 89 92622 128 126 134097 90 92280 147 118 147341 91 92059 90 101 91313 92 89626 169 85 134904 93 89506 150 118 160501 94 89256 156 129 104864 95 88977 179 85 111563 96 86652 149 50 114198 97 84601 94 85 105406 98 83515 154 158 96785 99 83248 103 146 106020 100 83243 148 150 153990 101 82317 84 77 111848 102 81897 144 131 89770 103 81625 203 132 94853 104 81351 160 107 102204 105 79756 152 80 122531 106 79089 147 114 169351 107 79011 111 97 80238 108 76173 89 8 47552 109 72128 87 163 145707 110 71571 121 102 75881 111 71154 146 137 80906 112 70168 100 79 104470 113 69867 127 83 100826 114 69652 153 56 33750 115 69446 87 87 113713 116 68946 129 164 174586 117 68788 113 57 72591 118 67150 124 110 114651 119 66485 92 104 110896 120 66089 112 65 61394 121 65594 102 48 92795 122 64593 115 60 72558 123 64520 148 68 54518 124 59938 135 149 82390 125 59900 97 104 96252 126 57224 59 86 80684 127 56750 101 89 115750 128 56622 27 49 55792 129 55918 112 74 83963 130 52789 89 37 15673 131 48029 40 120 88634 132 45724 130 87 74151 133 43929 73 83 100792 134 43750 64 13 19630 135 38692 99 30 68580 136 37238 78 41 10901 137 37110 110 67 64057 CourseViews t 1 490 1 2 2563 2 3 1538 3 4 898 4 5 1212 5 6 790 6 7 738 7 8 845 8 9 1369 9 10 1830 10 11 711 11 12 992 12 13 1272 13 14 852 14 15 575 15 16 1101 16 17 1410 17 18 1352 18 19 1208 19 20 739 20 21 926 21 22 865 22 23 677 23 24 971 24 25 1574 25 26 1051 26 27 763 27 28 724 28 29 652 29 30 504 30 31 893 31 32 1034 32 33 1111 33 34 692 34 35 740 35 36 1716 36 37 884 37 38 925 38 39 723 39 40 732 40 41 637 41 42 1266 42 43 527 43 44 811 44 45 1390 45 46 1613 46 47 459 47 48 1118 48 49 1293 49 50 636 50 51 1031 51 52 524 52 53 1775 53 54 669 54 55 2089 55 56 1230 56 57 847 57 58 906 58 59 1154 59 60 1251 60 61 510 61 62 698 62 63 1586 63 64 1001 64 65 710 65 66 906 66 67 1030 67 68 1092 68 69 511 69 70 1319 70 71 1186 71 72 1201 72 73 1443 73 74 703 74 75 862 75 76 1031 76 77 1348 77 78 866 78 79 1079 79 80 695 80 81 1229 81 82 1288 82 83 764 83 84 919 84 85 691 85 86 1099 86 87 766 87 88 1150 88 89 1566 89 90 668 90 91 910 91 92 894 92 93 1351 93 94 1187 94 95 784 95 96 758 96 97 816 97 98 1370 98 99 785 99 100 763 100 101 569 101 102 781 102 103 743 103 104 900 104 105 575 105 106 981 106 107 784 107 108 179 108 109 542 109 110 746 110 111 767 111 112 695 112 113 1186 113 114 456 114 115 724 115 116 1145 116 117 785 117 118 905 118 119 661 119 120 507 120 121 632 121 122 790 122 123 488 123 124 1128 124 125 1257 125 126 800 126 127 846 127 128 437 128 129 795 129 130 309 130 131 833 131 132 641 132 133 415 133 134 214 134 135 657 135 136 716 136 137 665 137 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) FbackMess BloggedComputations 1.692e+05 -1.797e+01 -2.052e+01 CompendiumSeconds CourseViews t 3.780e-02 5.041e-01 -8.967e+02 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -9950.2 -3974.2 216.4 3112.7 24709.0 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.692e+05 3.018e+03 56.061 < 2e-16 *** FbackMess -1.797e+01 1.415e+01 -1.270 0.20623 BloggedComputations -2.052e+01 1.655e+01 -1.240 0.21734 CompendiumSeconds 3.780e-02 1.383e-02 2.734 0.00713 ** CourseViews 5.041e-01 1.551e+00 0.325 0.74570 t -8.967e+02 1.491e+01 -60.126 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5363 on 131 degrees of freedom Multiple R-squared: 0.9792, Adjusted R-squared: 0.9784 F-statistic: 1233 on 5 and 131 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.5660923 0.8678153310 0.4339076655 [2,] 0.4436308 0.8872615592 0.5563692204 [3,] 0.5418167 0.9163665197 0.4581832598 [4,] 0.4398056 0.8796111993 0.5601944003 [5,] 0.6564066 0.6871868127 0.3435934063 [6,] 0.6264786 0.7470428424 0.3735214212 [7,] 0.5326707 0.9346586746 0.4673293373 [8,] 0.4538518 0.9077036086 0.5461481957 [9,] 0.3773567 0.7547133168 0.6226433416 [10,] 0.3423289 0.6846577123 0.6576711439 [11,] 0.2655358 0.5310716565 0.7344641717 [12,] 0.6137492 0.7725015620 0.3862507810 [13,] 0.6363254 0.7273492677 0.3636746339 [14,] 0.5940284 0.8119432710 0.4059716355 [15,] 0.5219702 0.9560596530 0.4780298265 [16,] 0.4908147 0.9816293064 0.5091853468 [17,] 0.5231074 0.9537851252 0.4768925626 [18,] 0.7657981 0.4684038415 0.2342019207 [19,] 0.7582230 0.4835539970 0.2417769985 [20,] 0.7416345 0.5167309984 0.2583654992 [21,] 0.7904639 0.4190721899 0.2095360949 [22,] 0.7503031 0.4993937967 0.2496968984 [23,] 0.8311246 0.3377507485 0.1688753742 [24,] 0.8689691 0.2620618825 0.1310309412 [25,] 0.8894938 0.2210123566 0.1105061783 [26,] 0.9118537 0.1762926588 0.0881463294 [27,] 0.9047389 0.1905222636 0.0952611318 [28,] 0.8839354 0.2321292310 0.1160646155 [29,] 0.8566498 0.2867003517 0.1433501758 [30,] 0.8335060 0.3329880027 0.1664940013 [31,] 0.8251586 0.3496827193 0.1748413596 [32,] 0.8057318 0.3885364515 0.1942682257 [33,] 0.7660621 0.4678758448 0.2339379224 [34,] 0.7290861 0.5418278595 0.2709139298 [35,] 0.6835518 0.6328963487 0.3164481744 [36,] 0.6502079 0.6995842137 0.3497921069 [37,] 0.6047501 0.7904997158 0.3952498579 [38,] 0.5772938 0.8454123624 0.4227061812 [39,] 0.5798654 0.8402692006 0.4201346003 [40,] 0.5495250 0.9009499678 0.4504749839 [41,] 0.5231421 0.9537157887 0.4768578944 [42,] 0.6052569 0.7894861686 0.3947430843 [43,] 0.6057577 0.7884845200 0.3942422600 [44,] 0.6004099 0.7991802873 0.3995901436 [45,] 0.6337733 0.7324534590 0.3662267295 [46,] 0.6049093 0.7901813472 0.3950906736 [47,] 0.5806972 0.8386056490 0.4193028245 [48,] 0.5832223 0.8335554369 0.4167777185 [49,] 0.6026845 0.7946310592 0.3973155296 [50,] 0.6525808 0.6948383103 0.3474191551 [51,] 0.6874450 0.6251099654 0.3125549827 [52,] 0.6978775 0.6042450764 0.3021225382 [53,] 0.7169388 0.5661223932 0.2830611966 [54,] 0.7490888 0.5018223449 0.2509111724 [55,] 0.7520085 0.4959830661 0.2479915331 [56,] 0.7987807 0.4024386956 0.2012193478 [57,] 0.8133877 0.3732245265 0.1866122633 [58,] 0.8344341 0.3311317707 0.1655658853 [59,] 0.8682228 0.2635543317 0.1317771658 [60,] 0.9054714 0.1890571925 0.0945285963 [61,] 0.9388074 0.1223851035 0.0611925517 [62,] 0.9624418 0.0751163423 0.0375581712 [63,] 0.9822136 0.0355728446 0.0177864223 [64,] 0.9881544 0.0236911698 0.0118455849 [65,] 0.9917402 0.0165196978 0.0082598489 [66,] 0.9942249 0.0115502918 0.0057751459 [67,] 0.9971563 0.0056873298 0.0028436649 [68,] 0.9986184 0.0027632454 0.0013816227 [69,] 0.9989055 0.0021890020 0.0010945010 [70,] 0.9988617 0.0022765446 0.0011382723 [71,] 0.9993438 0.0013124328 0.0006562164 [72,] 0.9993151 0.0013697951 0.0006848975 [73,] 0.9993648 0.0012703743 0.0006351872 [74,] 0.9994816 0.0010368824 0.0005184412 [75,] 0.9997476 0.0005048111 0.0002524056 [76,] 0.9997880 0.0004239650 0.0002119825 [77,] 0.9998129 0.0003741317 0.0001870659 [78,] 0.9998297 0.0003405071 0.0001702535 [79,] 0.9998257 0.0003486859 0.0001743429 [80,] 0.9997341 0.0005318637 0.0002659319 [81,] 0.9996838 0.0006323267 0.0003161633 [82,] 0.9996893 0.0006213285 0.0003106643 [83,] 0.9996083 0.0007833006 0.0003916503 [84,] 0.9996309 0.0007381233 0.0003690616 [85,] 0.9995866 0.0008268579 0.0004134289 [86,] 0.9995509 0.0008982906 0.0004491453 [87,] 0.9995024 0.0009951354 0.0004975677 [88,] 0.9994966 0.0010068826 0.0005034413 [89,] 0.9994950 0.0010099960 0.0005049980 [90,] 0.9995987 0.0008026361 0.0004013180 [91,] 0.9995317 0.0009366771 0.0004683385 [92,] 0.9994056 0.0011888877 0.0005944439 [93,] 0.9992834 0.0014331404 0.0007165702 [94,] 0.9991002 0.0017995861 0.0008997930 [95,] 0.9988512 0.0022975850 0.0011487925 [96,] 0.9983939 0.0032121215 0.0016060607 [97,] 0.9976169 0.0047662600 0.0023831300 [98,] 0.9966521 0.0066958286 0.0033479143 [99,] 0.9949313 0.0101373985 0.0050686992 [100,] 0.9927077 0.0145845273 0.0072922637 [101,] 0.9926233 0.0147534587 0.0073767294 [102,] 0.9936931 0.0126138608 0.0063069304 [103,] 0.9954247 0.0091506663 0.0045753332 [104,] 0.9974107 0.0051785399 0.0025892700 [105,] 0.9982195 0.0035609368 0.0017804684 [106,] 0.9992524 0.0014951906 0.0007475953 [107,] 0.9995264 0.0009471703 0.0004735851 [108,] 0.9993825 0.0012349434 0.0006174717 [109,] 0.9994237 0.0011526952 0.0005763476 [110,] 0.9994948 0.0010104961 0.0005052480 [111,] 0.9996298 0.0007404395 0.0003702197 [112,] 0.9997353 0.0005294304 0.0002647152 [113,] 0.9996971 0.0006058160 0.0003029080 [114,] 0.9995368 0.0009263059 0.0004631530 [115,] 0.9988984 0.0022031260 0.0011015630 [116,] 0.9981813 0.0036373251 0.0018186626 [117,] 0.9940740 0.0118520681 0.0059260340 [118,] 0.9919508 0.0160984071 0.0080492036 [119,] 0.9790466 0.0419068903 0.0209534451 [120,] 0.9314691 0.1370618004 0.0685309002 > postscript(file="/var/wessaorg/rcomp/tmp/1mjfv1324669260.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/2yrb51324669260.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/35uky1324669260.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/4xolh1324669260.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/5i4ff1324669260.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 = 137 Frequency = 1 1 2 3 4 5 6 24709.00854 15348.06440 14591.13054 15220.72240 7012.53982 5086.66385 7 8 9 10 11 12 4698.32040 4408.68598 4656.24865 4730.59545 6396.96507 3112.65287 13 14 15 16 17 18 1256.25409 -437.41578 2115.25412 -1207.30876 -3718.14152 -2933.25745 19 20 21 22 23 24 -4382.72126 2115.49010 -2122.40261 -2456.99643 -3984.41253 -2106.15890 25 26 27 28 29 30 -2377.07326 1321.74305 -1120.11840 -554.67259 216.42112 -4425.14848 31 32 33 34 35 36 -257.65353 -743.87817 -1795.78673 -1201.58163 -1770.09883 -4577.06414 37 38 39 40 41 42 -5179.59018 -3328.71876 -7646.78128 -3971.16945 -4885.65304 -6231.31168 43 44 45 46 47 48 -5457.79376 -4918.48874 -5321.15889 -5012.46225 -3513.48311 -7880.98447 49 50 51 52 53 54 -7788.25527 -3428.95970 -6293.06752 -3874.01605 -6490.41154 -8278.24492 55 56 57 58 59 60 -5061.88038 -9066.51568 -5956.01581 -6473.59585 -3387.06748 -9048.14861 61 62 63 64 65 66 -4461.91374 -3809.20925 -4974.64548 -2461.90344 -6375.75663 -6567.79180 67 68 69 70 71 72 -4882.83332 -3457.74255 -3974.20397 -3446.10125 -708.59576 -3177.33861 73 74 75 76 77 78 -2181.46446 -1320.05392 1476.64771 2300.65674 -1280.39415 -38.33062 79 80 81 82 83 84 2933.12284 2247.50252 2512.37424 4124.08237 2787.42527 2896.77931 85 86 87 88 89 90 1172.36364 211.87209 771.18888 366.73523 2287.78374 2971.95741 91 92 93 94 95 96 4270.14309 2185.95629 2100.22850 5266.14965 5344.51692 2572.43108 97 98 99 100 101 102 1450.65983 3884.07094 3296.70212 3277.19146 2290.59146 5681.27391 103 104 105 106 107 108 7214.01781 6193.90437 4193.37548 3056.30864 6346.85189 3724.70067 109 110 111 112 113 114 -172.78526 2063.11664 3509.70339 549.25367 1602.55111 5101.08251 115 116 117 118 119 120 2083.80403 2301.96968 4594.69457 3488.12083 3286.47308 5295.31765 121 122 123 124 125 126 3918.55798 4979.40515 7394.53103 3761.15820 2424.60999 411.82280 127 128 129 130 131 132 302.35225 1392.83561 2380.96350 1802.46238 -4260.81476 -4084.17753 133 134 135 136 137 -6982.17688 -4693.17173 -9950.18133 -8508.80854 -8615.05228 > postscript(file="/var/wessaorg/rcomp/tmp/6egpb1324669260.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 = 137 Frequency = 1 lag(myerror, k = 1) myerror 0 24709.00854 NA 1 15348.06440 24709.00854 2 14591.13054 15348.06440 3 15220.72240 14591.13054 4 7012.53982 15220.72240 5 5086.66385 7012.53982 6 4698.32040 5086.66385 7 4408.68598 4698.32040 8 4656.24865 4408.68598 9 4730.59545 4656.24865 10 6396.96507 4730.59545 11 3112.65287 6396.96507 12 1256.25409 3112.65287 13 -437.41578 1256.25409 14 2115.25412 -437.41578 15 -1207.30876 2115.25412 16 -3718.14152 -1207.30876 17 -2933.25745 -3718.14152 18 -4382.72126 -2933.25745 19 2115.49010 -4382.72126 20 -2122.40261 2115.49010 21 -2456.99643 -2122.40261 22 -3984.41253 -2456.99643 23 -2106.15890 -3984.41253 24 -2377.07326 -2106.15890 25 1321.74305 -2377.07326 26 -1120.11840 1321.74305 27 -554.67259 -1120.11840 28 216.42112 -554.67259 29 -4425.14848 216.42112 30 -257.65353 -4425.14848 31 -743.87817 -257.65353 32 -1795.78673 -743.87817 33 -1201.58163 -1795.78673 34 -1770.09883 -1201.58163 35 -4577.06414 -1770.09883 36 -5179.59018 -4577.06414 37 -3328.71876 -5179.59018 38 -7646.78128 -3328.71876 39 -3971.16945 -7646.78128 40 -4885.65304 -3971.16945 41 -6231.31168 -4885.65304 42 -5457.79376 -6231.31168 43 -4918.48874 -5457.79376 44 -5321.15889 -4918.48874 45 -5012.46225 -5321.15889 46 -3513.48311 -5012.46225 47 -7880.98447 -3513.48311 48 -7788.25527 -7880.98447 49 -3428.95970 -7788.25527 50 -6293.06752 -3428.95970 51 -3874.01605 -6293.06752 52 -6490.41154 -3874.01605 53 -8278.24492 -6490.41154 54 -5061.88038 -8278.24492 55 -9066.51568 -5061.88038 56 -5956.01581 -9066.51568 57 -6473.59585 -5956.01581 58 -3387.06748 -6473.59585 59 -9048.14861 -3387.06748 60 -4461.91374 -9048.14861 61 -3809.20925 -4461.91374 62 -4974.64548 -3809.20925 63 -2461.90344 -4974.64548 64 -6375.75663 -2461.90344 65 -6567.79180 -6375.75663 66 -4882.83332 -6567.79180 67 -3457.74255 -4882.83332 68 -3974.20397 -3457.74255 69 -3446.10125 -3974.20397 70 -708.59576 -3446.10125 71 -3177.33861 -708.59576 72 -2181.46446 -3177.33861 73 -1320.05392 -2181.46446 74 1476.64771 -1320.05392 75 2300.65674 1476.64771 76 -1280.39415 2300.65674 77 -38.33062 -1280.39415 78 2933.12284 -38.33062 79 2247.50252 2933.12284 80 2512.37424 2247.50252 81 4124.08237 2512.37424 82 2787.42527 4124.08237 83 2896.77931 2787.42527 84 1172.36364 2896.77931 85 211.87209 1172.36364 86 771.18888 211.87209 87 366.73523 771.18888 88 2287.78374 366.73523 89 2971.95741 2287.78374 90 4270.14309 2971.95741 91 2185.95629 4270.14309 92 2100.22850 2185.95629 93 5266.14965 2100.22850 94 5344.51692 5266.14965 95 2572.43108 5344.51692 96 1450.65983 2572.43108 97 3884.07094 1450.65983 98 3296.70212 3884.07094 99 3277.19146 3296.70212 100 2290.59146 3277.19146 101 5681.27391 2290.59146 102 7214.01781 5681.27391 103 6193.90437 7214.01781 104 4193.37548 6193.90437 105 3056.30864 4193.37548 106 6346.85189 3056.30864 107 3724.70067 6346.85189 108 -172.78526 3724.70067 109 2063.11664 -172.78526 110 3509.70339 2063.11664 111 549.25367 3509.70339 112 1602.55111 549.25367 113 5101.08251 1602.55111 114 2083.80403 5101.08251 115 2301.96968 2083.80403 116 4594.69457 2301.96968 117 3488.12083 4594.69457 118 3286.47308 3488.12083 119 5295.31765 3286.47308 120 3918.55798 5295.31765 121 4979.40515 3918.55798 122 7394.53103 4979.40515 123 3761.15820 7394.53103 124 2424.60999 3761.15820 125 411.82280 2424.60999 126 302.35225 411.82280 127 1392.83561 302.35225 128 2380.96350 1392.83561 129 1802.46238 2380.96350 130 -4260.81476 1802.46238 131 -4084.17753 -4260.81476 132 -6982.17688 -4084.17753 133 -4693.17173 -6982.17688 134 -9950.18133 -4693.17173 135 -8508.80854 -9950.18133 136 -8615.05228 -8508.80854 137 NA -8615.05228 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 15348.06440 24709.00854 [2,] 14591.13054 15348.06440 [3,] 15220.72240 14591.13054 [4,] 7012.53982 15220.72240 [5,] 5086.66385 7012.53982 [6,] 4698.32040 5086.66385 [7,] 4408.68598 4698.32040 [8,] 4656.24865 4408.68598 [9,] 4730.59545 4656.24865 [10,] 6396.96507 4730.59545 [11,] 3112.65287 6396.96507 [12,] 1256.25409 3112.65287 [13,] -437.41578 1256.25409 [14,] 2115.25412 -437.41578 [15,] -1207.30876 2115.25412 [16,] -3718.14152 -1207.30876 [17,] -2933.25745 -3718.14152 [18,] -4382.72126 -2933.25745 [19,] 2115.49010 -4382.72126 [20,] -2122.40261 2115.49010 [21,] -2456.99643 -2122.40261 [22,] -3984.41253 -2456.99643 [23,] -2106.15890 -3984.41253 [24,] -2377.07326 -2106.15890 [25,] 1321.74305 -2377.07326 [26,] -1120.11840 1321.74305 [27,] -554.67259 -1120.11840 [28,] 216.42112 -554.67259 [29,] -4425.14848 216.42112 [30,] -257.65353 -4425.14848 [31,] -743.87817 -257.65353 [32,] -1795.78673 -743.87817 [33,] -1201.58163 -1795.78673 [34,] -1770.09883 -1201.58163 [35,] -4577.06414 -1770.09883 [36,] -5179.59018 -4577.06414 [37,] -3328.71876 -5179.59018 [38,] -7646.78128 -3328.71876 [39,] -3971.16945 -7646.78128 [40,] -4885.65304 -3971.16945 [41,] -6231.31168 -4885.65304 [42,] -5457.79376 -6231.31168 [43,] -4918.48874 -5457.79376 [44,] -5321.15889 -4918.48874 [45,] -5012.46225 -5321.15889 [46,] -3513.48311 -5012.46225 [47,] -7880.98447 -3513.48311 [48,] -7788.25527 -7880.98447 [49,] -3428.95970 -7788.25527 [50,] -6293.06752 -3428.95970 [51,] -3874.01605 -6293.06752 [52,] -6490.41154 -3874.01605 [53,] -8278.24492 -6490.41154 [54,] -5061.88038 -8278.24492 [55,] -9066.51568 -5061.88038 [56,] -5956.01581 -9066.51568 [57,] -6473.59585 -5956.01581 [58,] -3387.06748 -6473.59585 [59,] -9048.14861 -3387.06748 [60,] -4461.91374 -9048.14861 [61,] -3809.20925 -4461.91374 [62,] -4974.64548 -3809.20925 [63,] -2461.90344 -4974.64548 [64,] -6375.75663 -2461.90344 [65,] -6567.79180 -6375.75663 [66,] -4882.83332 -6567.79180 [67,] -3457.74255 -4882.83332 [68,] -3974.20397 -3457.74255 [69,] -3446.10125 -3974.20397 [70,] -708.59576 -3446.10125 [71,] -3177.33861 -708.59576 [72,] -2181.46446 -3177.33861 [73,] -1320.05392 -2181.46446 [74,] 1476.64771 -1320.05392 [75,] 2300.65674 1476.64771 [76,] -1280.39415 2300.65674 [77,] -38.33062 -1280.39415 [78,] 2933.12284 -38.33062 [79,] 2247.50252 2933.12284 [80,] 2512.37424 2247.50252 [81,] 4124.08237 2512.37424 [82,] 2787.42527 4124.08237 [83,] 2896.77931 2787.42527 [84,] 1172.36364 2896.77931 [85,] 211.87209 1172.36364 [86,] 771.18888 211.87209 [87,] 366.73523 771.18888 [88,] 2287.78374 366.73523 [89,] 2971.95741 2287.78374 [90,] 4270.14309 2971.95741 [91,] 2185.95629 4270.14309 [92,] 2100.22850 2185.95629 [93,] 5266.14965 2100.22850 [94,] 5344.51692 5266.14965 [95,] 2572.43108 5344.51692 [96,] 1450.65983 2572.43108 [97,] 3884.07094 1450.65983 [98,] 3296.70212 3884.07094 [99,] 3277.19146 3296.70212 [100,] 2290.59146 3277.19146 [101,] 5681.27391 2290.59146 [102,] 7214.01781 5681.27391 [103,] 6193.90437 7214.01781 [104,] 4193.37548 6193.90437 [105,] 3056.30864 4193.37548 [106,] 6346.85189 3056.30864 [107,] 3724.70067 6346.85189 [108,] -172.78526 3724.70067 [109,] 2063.11664 -172.78526 [110,] 3509.70339 2063.11664 [111,] 549.25367 3509.70339 [112,] 1602.55111 549.25367 [113,] 5101.08251 1602.55111 [114,] 2083.80403 5101.08251 [115,] 2301.96968 2083.80403 [116,] 4594.69457 2301.96968 [117,] 3488.12083 4594.69457 [118,] 3286.47308 3488.12083 [119,] 5295.31765 3286.47308 [120,] 3918.55798 5295.31765 [121,] 4979.40515 3918.55798 [122,] 7394.53103 4979.40515 [123,] 3761.15820 7394.53103 [124,] 2424.60999 3761.15820 [125,] 411.82280 2424.60999 [126,] 302.35225 411.82280 [127,] 1392.83561 302.35225 [128,] 2380.96350 1392.83561 [129,] 1802.46238 2380.96350 [130,] -4260.81476 1802.46238 [131,] -4084.17753 -4260.81476 [132,] -6982.17688 -4084.17753 [133,] -4693.17173 -6982.17688 [134,] -9950.18133 -4693.17173 [135,] -8508.80854 -9950.18133 [136,] -8615.05228 -8508.80854 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 15348.06440 24709.00854 2 14591.13054 15348.06440 3 15220.72240 14591.13054 4 7012.53982 15220.72240 5 5086.66385 7012.53982 6 4698.32040 5086.66385 7 4408.68598 4698.32040 8 4656.24865 4408.68598 9 4730.59545 4656.24865 10 6396.96507 4730.59545 11 3112.65287 6396.96507 12 1256.25409 3112.65287 13 -437.41578 1256.25409 14 2115.25412 -437.41578 15 -1207.30876 2115.25412 16 -3718.14152 -1207.30876 17 -2933.25745 -3718.14152 18 -4382.72126 -2933.25745 19 2115.49010 -4382.72126 20 -2122.40261 2115.49010 21 -2456.99643 -2122.40261 22 -3984.41253 -2456.99643 23 -2106.15890 -3984.41253 24 -2377.07326 -2106.15890 25 1321.74305 -2377.07326 26 -1120.11840 1321.74305 27 -554.67259 -1120.11840 28 216.42112 -554.67259 29 -4425.14848 216.42112 30 -257.65353 -4425.14848 31 -743.87817 -257.65353 32 -1795.78673 -743.87817 33 -1201.58163 -1795.78673 34 -1770.09883 -1201.58163 35 -4577.06414 -1770.09883 36 -5179.59018 -4577.06414 37 -3328.71876 -5179.59018 38 -7646.78128 -3328.71876 39 -3971.16945 -7646.78128 40 -4885.65304 -3971.16945 41 -6231.31168 -4885.65304 42 -5457.79376 -6231.31168 43 -4918.48874 -5457.79376 44 -5321.15889 -4918.48874 45 -5012.46225 -5321.15889 46 -3513.48311 -5012.46225 47 -7880.98447 -3513.48311 48 -7788.25527 -7880.98447 49 -3428.95970 -7788.25527 50 -6293.06752 -3428.95970 51 -3874.01605 -6293.06752 52 -6490.41154 -3874.01605 53 -8278.24492 -6490.41154 54 -5061.88038 -8278.24492 55 -9066.51568 -5061.88038 56 -5956.01581 -9066.51568 57 -6473.59585 -5956.01581 58 -3387.06748 -6473.59585 59 -9048.14861 -3387.06748 60 -4461.91374 -9048.14861 61 -3809.20925 -4461.91374 62 -4974.64548 -3809.20925 63 -2461.90344 -4974.64548 64 -6375.75663 -2461.90344 65 -6567.79180 -6375.75663 66 -4882.83332 -6567.79180 67 -3457.74255 -4882.83332 68 -3974.20397 -3457.74255 69 -3446.10125 -3974.20397 70 -708.59576 -3446.10125 71 -3177.33861 -708.59576 72 -2181.46446 -3177.33861 73 -1320.05392 -2181.46446 74 1476.64771 -1320.05392 75 2300.65674 1476.64771 76 -1280.39415 2300.65674 77 -38.33062 -1280.39415 78 2933.12284 -38.33062 79 2247.50252 2933.12284 80 2512.37424 2247.50252 81 4124.08237 2512.37424 82 2787.42527 4124.08237 83 2896.77931 2787.42527 84 1172.36364 2896.77931 85 211.87209 1172.36364 86 771.18888 211.87209 87 366.73523 771.18888 88 2287.78374 366.73523 89 2971.95741 2287.78374 90 4270.14309 2971.95741 91 2185.95629 4270.14309 92 2100.22850 2185.95629 93 5266.14965 2100.22850 94 5344.51692 5266.14965 95 2572.43108 5344.51692 96 1450.65983 2572.43108 97 3884.07094 1450.65983 98 3296.70212 3884.07094 99 3277.19146 3296.70212 100 2290.59146 3277.19146 101 5681.27391 2290.59146 102 7214.01781 5681.27391 103 6193.90437 7214.01781 104 4193.37548 6193.90437 105 3056.30864 4193.37548 106 6346.85189 3056.30864 107 3724.70067 6346.85189 108 -172.78526 3724.70067 109 2063.11664 -172.78526 110 3509.70339 2063.11664 111 549.25367 3509.70339 112 1602.55111 549.25367 113 5101.08251 1602.55111 114 2083.80403 5101.08251 115 2301.96968 2083.80403 116 4594.69457 2301.96968 117 3488.12083 4594.69457 118 3286.47308 3488.12083 119 5295.31765 3286.47308 120 3918.55798 5295.31765 121 4979.40515 3918.55798 122 7394.53103 4979.40515 123 3761.15820 7394.53103 124 2424.60999 3761.15820 125 411.82280 2424.60999 126 302.35225 411.82280 127 1392.83561 302.35225 128 2380.96350 1392.83561 129 1802.46238 2380.96350 130 -4260.81476 1802.46238 131 -4084.17753 -4260.81476 132 -6982.17688 -4084.17753 133 -4693.17173 -6982.17688 134 -9950.18133 -4693.17173 135 -8508.80854 -9950.18133 136 -8615.05228 -8508.80854 > 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/7d9zc1324669260.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/8h8031324669260.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/9sgyq1324669260.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/1079wc1324669260.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/114gb21324669260.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/125wkn1324669260.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/131z3g1324669260.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/14gsru1324669260.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/152q6j1324669260.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/16z7ns1324669260.tab") + } > > try(system("convert tmp/1mjfv1324669260.ps tmp/1mjfv1324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/2yrb51324669260.ps tmp/2yrb51324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/35uky1324669260.ps tmp/35uky1324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/4xolh1324669260.ps tmp/4xolh1324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/5i4ff1324669260.ps tmp/5i4ff1324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/6egpb1324669260.ps tmp/6egpb1324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/7d9zc1324669260.ps tmp/7d9zc1324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/8h8031324669260.ps tmp/8h8031324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/9sgyq1324669260.ps tmp/9sgyq1324669260.png",intern=TRUE)) character(0) > try(system("convert tmp/1079wc1324669260.ps tmp/1079wc1324669260.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.361 0.590 4.959