R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(100 + ,100 + ,100 + ,100 + ,102.815 + ,101.542 + ,100.254 + ,102 + ,104.301 + ,102.179 + ,102.839 + ,103.65 + ,104.964 + ,105.494 + ,104.726 + ,104.974 + ,104.83 + ,106.14 + ,103.387 + ,104.641 + ,105.878 + ,106.371 + ,101.746 + ,104.902 + ,107.542 + ,107.249 + ,100.371 + ,105.695 + ,107.954 + ,109.481 + ,101.337 + ,106.489 + ,108.09 + ,111.951 + ,102.307 + ,107.146 + ,109.19 + ,111.972 + ,101.794 + ,107.695 + ,110.115 + ,110.661 + ,100.294 + ,107.711 + ,110.439 + ,113.149 + ,100.578 + ,108.313 + ,111.054 + ,113.853 + ,97.9592 + ,108.124 + ,112.319 + ,115.143 + ,100.107 + ,109.615 + ,113.607 + ,116.923 + ,102.865 + ,111.34 + ,112.716 + ,116.638 + ,102.719 + ,110.717 + ,113.126 + ,116.227 + ,103.921 + ,111.217 + ,112.818 + ,115.942 + ,105.751 + ,111.452 + ,112.565 + ,116.42 + ,106.746 + ,111.611 + ,112.698 + ,113.365 + ,108.454 + ,111.717 + ,113.701 + ,112.709 + ,107.724 + ,112.062 + ,113.844 + ,115.609 + ,108.936 + ,112.842 + ,114.151 + ,115.626 + ,109.764 + ,113.241 + ,114.069 + ,116.697 + ,108.502 + ,113.015 + ,114.798 + ,119.368 + ,109.211 + ,113.998 + ,114.537 + ,120.264 + ,113.097 + ,114.936 + ,114.118 + ,118.74 + ,112.18 + ,114.245 + ,113.814 + ,116.522 + ,114.855 + ,114.437 + ,115.232 + ,116.967 + ,114.53 + ,115.286 + ,115.945 + ,118.061 + ,115.328 + ,116.071 + ,117.543 + ,118.711 + ,117.973 + ,117.807 + ,118.205 + ,119.223 + ,117.863 + ,118.255 + ,119.899 + ,119.196 + ,116.582 + ,118.969 + ,121.35 + ,120.729 + ,117.645 + ,120.333 + ,122.563 + ,121.828 + ,120.711 + ,121.998 + ,124.143 + ,122.603 + ,121.37 + ,123.239 + ,126.574 + ,123.803 + ,120.473 + ,124.666 + ,128.069 + ,127.692 + ,122.204 + ,126.54 + ,128.101 + ,128.336 + ,124.943 + ,127.336 + ,128.752 + ,128.718 + ,125.276 + ,127.871 + ,129.991 + ,130.539 + ,130.192 + ,130.115 + ,133.236 + ,132.864 + ,131.595 + ,132.773 + ,134.689 + ,134.529 + ,133.091 + ,134.265 + ,135.058 + ,135.166 + ,133.167 + ,134.596 + ,135.615 + ,133.458 + ,131.858 + ,134.38 + ,136.088 + ,135.621 + ,132.5 + ,135.121 + ,136.114 + ,137.409 + ,131.551 + ,135.136 + ,136.177 + ,138.866 + ,131.422 + ,135.336 + ,136.883 + ,135.802 + ,131.112 + ,135.284 + ,139.095 + ,139.408 + ,131.193 + ,137.144 + ,141.551 + ,142.191 + ,136.448 + ,140.349 + ,144.647 + ,146.027 + ,138.433 + ,143.264 + ,147.403 + ,145.695 + ,136.323 + ,144.381 + ,148.778 + ,148.469 + ,137.453 + ,145.881 + ,149.123 + ,152.221 + ,137.072 + ,146.497 + ,150.925 + ,157.061 + ,139.485 + ,148.857 + ,152.195 + ,160.782 + ,142.049 + ,150.78 + ,155.762 + ,164.581 + ,141.315 + ,153.293 + ,159.863 + ,171.274 + ,145.023 + ,157.641 + ,164.488 + ,177.848 + ,148.287 + ,162.182 + ,172.288 + ,185.538 + ,147.732 + ,167.86 + ,181.098 + ,193.704 + ,151.23 + ,175.245 + ,186.026 + ,203.366 + ,150.278 + ,179.32 + ,191.144 + ,213.692 + ,154.789 + ,184.979 + ,196.021 + ,220.819 + ,153.029 + ,188.482 + ,200.338 + ,225.005 + ,157.658 + ,192.86 + ,202.319 + ,229.096 + ,161.039 + ,195.475 + ,204.148 + ,233.982 + ,165.599 + ,198.4 + ,205.288 + ,234.529 + ,171.248 + ,200.598 + ,206.439 + ,238.753 + ,172.249 + ,202.121 + ,210.638 + ,238.258 + ,177.164 + ,205.875 + ,212.831 + ,241.42 + ,174.947 + ,207.085 + ,214.227 + ,242.44 + ,179.407 + ,209.204 + ,216.573 + ,248.809 + ,181.625 + ,212.246 + ,217.504 + ,254.991 + ,188.871 + ,215.466 + ,219.151 + ,255.458 + ,189.866 + ,216.693 + ,220.494 + ,261.125 + ,192.114 + ,219.019 + ,220.484 + ,258.58 + ,189.665 + ,217.924 + ,220.269 + ,257.981 + ,191.006 + ,217.978 + ,222.524 + ,257.756 + ,186.398 + ,218.186 + ,221.905 + ,257.984 + ,189.577 + ,218.54 + ,222.286 + ,252.604 + ,190.244 + ,217.886 + ,219.929 + ,251.688 + ,190.269 + ,216.347 + ,222.144 + ,255.734 + ,196.606 + ,219.825 + ,224.73 + ,257.646 + ,197.796 + ,221.956 + ,228.912 + ,263.016 + ,205.874 + ,227.184 + ,231.613 + ,265.367 + ,206.229 + ,229.247 + ,235.936 + ,271.406 + ,208.473 + ,233.33 + ,239.005 + ,278.478 + ,211.102 + ,236.987 + ,242.293 + ,284.415 + ,211.503 + ,240.027 + ,248.077 + ,287.685 + ,218.055 + ,245.433 + ,248.956 + ,287.97 + ,221.076 + ,246.641 + ,252.358 + ,290.44 + ,226.743 + ,250.328 + ,254.122 + ,292.298 + ,223.179 + ,250.849 + ,255.015 + ,296.637 + ,219.996 + ,251.435 + ,253.493 + ,299.882 + ,223.847 + ,252.091 + ,255.976 + ,292.588 + ,227.227 + ,252.946 + ,255.878 + ,292.523 + ,226.757 + ,252.773 + ,254.149 + ,290.063 + ,223.928 + ,250.677 + ,252.408 + ,296.831 + ,220.682 + ,250.105 + ,252.503 + ,296.742 + ,227.654 + ,251.788 + ,253.733 + ,296.479 + ,218.398 + ,250.212 + ,252.299 + ,295.557 + ,213.639 + ,248.073 + ,248.838 + ,288.037 + ,212.71 + ,244.468 + ,247.559 + ,287.377 + ,217.355 + ,244.727 + ,245.331 + ,290.101 + ,217.786 + ,244.034 + ,242.351 + ,296.679 + ,218.186 + ,243.588 + ,238.172 + ,285.712 + ,206.917 + ,236.447 + ,226.723 + ,270.085 + ,197.833 + ,224.906 + ,225.84 + ,261.006 + ,194.438 + ,221.934 + ,225.751 + ,266.44 + ,202.508 + ,224.903 + ,226.192 + ,267.075 + ,196.651 + ,223.798 + ,220.037 + ,263.672 + ,191.446 + ,218.529 + ,220.406 + ,259.121 + ,190.056 + ,217.521 + ,223.551 + ,262.711 + ,190.322 + ,219.971 + ,223.373 + ,265.838 + ,203.701 + ,223.841 + ,224.678 + ,265.766 + ,200.524 + ,223.764 + ,223.629 + ,269.162 + ,200.524 + ,223.664 + ,220.855 + ,256.573 + ,191.582 + ,217.678 + ,220.127 + ,257.917 + ,195.727 + ,218.478 + ,215.471 + ,253.316 + ,194.766 + ,214.815 + ,214.691 + ,257.496 + ,194.576 + ,215.143 + ,216.2 + ,264.861 + ,198.563 + ,218.381 + ,219.85 + ,257.795 + ,201.679 + ,219.962 + ,220.182 + ,251.318 + ,201.506 + ,218.933 + ,220.283 + ,243.526 + ,204.453 + ,218.36 + ,216.675 + ,247.503 + ,206.552 + ,217.72 + ,217.808 + ,256.9 + ,205.642 + ,219.934 + ,217.66 + ,261.806 + ,205.679 + ,220.842 + ,217.951 + ,260.758 + ,204.583 + ,220.584 + ,215.9 + ,244.361 + ,204.484 + ,216.346 + ,217.141 + ,255.116 + ,208.73 + ,220.221 + ,219.459 + ,256.46 + ,210.264 + ,222.182 + ,222.898 + ,258.249 + ,214.211 + ,225.455 + ,225.478 + ,256.327 + ,214.169 + ,226.42 + ,228.098 + ,259.192 + ,213.656 + ,228.287 + ,230.729 + ,260.776 + ,219.028 + ,231.349 + ,230.535 + ,261.166 + ,217.602 + ,231.015 + ,229.735 + ,265.351 + ,220.635 + ,232.241 + ,233.148 + ,261.627 + ,222.011 + ,233.688 + ,235.221 + ,266.932 + ,224.948 + ,236.667 + ,237.46 + ,268.695 + ,225.566 + ,238.439 + ,239.951 + ,274.37 + ,219.318 + ,239.488 + ,240.436 + ,275.671 + ,213.558 + ,238.741 + ,241.588 + ,270.831 + ,214.026 + ,238.5 + ,241.512 + ,275.141 + ,225.59 + ,242.116 + ,243.05 + ,277.59 + ,227.637 + ,243.923 + ,246.469 + ,276.357 + ,229 + ,245.813 + ,248.64 + ,279.389 + ,226.841 + ,247.143 + ,251.147 + ,274.787 + ,221.488 + ,246.381) + ,dim=c(4 + ,150) + ,dimnames=list(c('SMF' + ,'SSF' + ,'NS' + ,'TOT') + ,1:150)) > y <- array(NA,dim=c(4,150),dimnames=list(c('SMF','SSF','NS','TOT'),1:150)) > 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 = '4' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric > 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 TOT SMF SSF NS 1 100.000 100.000 100.000 100.0000 2 102.000 102.815 101.542 100.2540 3 103.650 104.301 102.179 102.8390 4 104.974 104.964 105.494 104.7260 5 104.641 104.830 106.140 103.3870 6 104.902 105.878 106.371 101.7460 7 105.695 107.542 107.249 100.3710 8 106.489 107.954 109.481 101.3370 9 107.146 108.090 111.951 102.3070 10 107.695 109.190 111.972 101.7940 11 107.711 110.115 110.661 100.2940 12 108.313 110.439 113.149 100.5780 13 108.124 111.054 113.853 97.9592 14 109.615 112.319 115.143 100.1070 15 111.340 113.607 116.923 102.8650 16 110.717 112.716 116.638 102.7190 17 111.217 113.126 116.227 103.9210 18 111.452 112.818 115.942 105.7510 19 111.611 112.565 116.420 106.7460 20 111.717 112.698 113.365 108.4540 21 112.062 113.701 112.709 107.7240 22 112.842 113.844 115.609 108.9360 23 113.241 114.151 115.626 109.7640 24 113.015 114.069 116.697 108.5020 25 113.998 114.798 119.368 109.2110 26 114.936 114.537 120.264 113.0970 27 114.245 114.118 118.740 112.1800 28 114.437 113.814 116.522 114.8550 29 115.286 115.232 116.967 114.5300 30 116.071 115.945 118.061 115.3280 31 117.807 117.543 118.711 117.9730 32 118.255 118.205 119.223 117.8630 33 118.969 119.899 119.196 116.5820 34 120.333 121.350 120.729 117.6450 35 121.998 122.563 121.828 120.7110 36 123.239 124.143 122.603 121.3700 37 124.666 126.574 123.803 120.4730 38 126.540 128.069 127.692 122.2040 39 127.336 128.101 128.336 124.9430 40 127.871 128.752 128.718 125.2760 41 130.115 129.991 130.539 130.1920 42 132.773 133.236 132.864 131.5950 43 134.265 134.689 134.529 133.0910 44 134.596 135.058 135.166 133.1670 45 134.380 135.615 133.458 131.8580 46 135.121 136.088 135.621 132.5000 47 135.136 136.114 137.409 131.5510 48 135.336 136.177 138.866 131.4220 49 135.284 136.883 135.802 131.1120 50 137.144 139.095 139.408 131.1930 51 140.349 141.551 142.191 136.4480 52 143.264 144.647 146.027 138.4330 53 144.381 147.403 145.695 136.3230 54 145.881 148.778 148.469 137.4530 55 146.497 149.123 152.221 137.0720 56 148.857 150.925 157.061 139.4850 57 150.780 152.195 160.782 142.0490 58 153.293 155.762 164.581 141.3150 59 157.641 159.863 171.274 145.0230 60 162.182 164.488 177.848 148.2870 61 167.860 172.288 185.538 147.7320 62 175.245 181.098 193.704 151.2300 63 179.320 186.026 203.366 150.2780 64 184.979 191.144 213.692 154.7890 65 188.482 196.021 220.819 153.0290 66 192.860 200.338 225.005 157.6580 67 195.475 202.319 229.096 161.0390 68 198.400 204.148 233.982 165.5990 69 200.598 205.288 234.529 171.2480 70 202.121 206.439 238.753 172.2490 71 205.875 210.638 238.258 177.1640 72 207.085 212.831 241.420 174.9470 73 209.204 214.227 242.440 179.4070 74 212.246 216.573 248.809 181.6250 75 215.466 217.504 254.991 188.8710 76 216.693 219.151 255.458 189.8660 77 219.019 220.494 261.125 192.1140 78 217.924 220.484 258.580 189.6650 79 217.978 220.269 257.981 191.0060 80 218.186 222.524 257.756 186.3980 81 218.540 221.905 257.984 189.5770 82 217.886 222.286 252.604 190.2440 83 216.347 219.929 251.688 190.2690 84 219.825 222.144 255.734 196.6060 85 221.956 224.730 257.646 197.7960 86 227.184 228.912 263.016 205.8740 87 229.247 231.613 265.367 206.2290 88 233.330 235.936 271.406 208.4730 89 236.987 239.005 278.478 211.1020 90 240.027 242.293 284.415 211.5030 91 245.433 248.077 287.685 218.0550 92 246.641 248.956 287.970 221.0760 93 250.328 252.358 290.440 226.7430 94 250.849 254.122 292.298 223.1790 95 251.435 255.015 296.637 219.9960 96 252.091 253.493 299.882 223.8470 97 252.946 255.976 292.588 227.2270 98 252.773 255.878 292.523 226.7570 99 250.677 254.149 290.063 223.9280 100 250.105 252.408 296.831 220.6820 101 251.788 252.503 296.742 227.6540 102 250.212 253.733 296.479 218.3980 103 248.073 252.299 295.557 213.6390 104 244.468 248.838 288.037 212.7100 105 244.727 247.559 287.377 217.3550 106 244.034 245.331 290.101 217.7860 107 243.588 242.351 296.679 218.1860 108 236.447 238.172 285.712 206.9170 109 224.906 226.723 270.085 197.8330 110 221.934 225.840 261.006 194.4380 111 224.903 225.751 266.440 202.5080 112 223.798 226.192 267.075 196.6510 113 218.529 220.037 263.672 191.4460 114 217.521 220.406 259.121 190.0560 115 219.971 223.551 262.711 190.3220 116 223.841 223.373 265.838 203.7010 117 223.764 224.678 265.766 200.5240 118 223.664 223.629 269.162 200.5240 119 217.678 220.855 256.573 191.5820 120 218.478 220.127 257.917 195.7270 121 214.815 215.471 253.316 194.7660 122 215.143 214.691 257.496 194.5760 123 218.381 216.200 264.861 198.5630 124 219.962 219.850 257.795 201.6790 125 218.933 220.182 251.318 201.5060 126 218.360 220.283 243.526 204.4530 127 217.720 216.675 247.503 206.5520 128 219.934 217.808 256.900 205.6420 129 220.842 217.660 261.806 205.6790 130 220.584 217.951 260.758 204.5830 131 216.346 215.900 244.361 204.4840 132 220.221 217.141 255.116 208.7300 133 222.182 219.459 256.460 210.2640 134 225.455 222.898 258.249 214.2110 135 226.420 225.478 256.327 214.1690 136 228.287 228.098 259.192 213.6560 137 231.349 230.729 260.776 219.0280 138 231.015 230.535 261.166 217.6020 139 232.241 229.735 265.351 220.6350 140 233.688 233.148 261.627 222.0110 141 236.667 235.221 266.932 224.9480 142 238.439 237.460 268.695 225.5660 143 239.488 239.951 274.370 219.3180 144 238.741 240.436 275.671 213.5580 145 238.500 241.588 270.831 214.0260 146 242.116 241.512 275.141 225.5900 147 243.923 243.050 277.590 227.6370 148 245.813 246.469 276.357 229.0000 149 247.143 248.640 279.389 226.8410 150 246.381 251.147 274.787 221.4880 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) SMF SSF NS 0.5545 0.6038 0.1407 0.2509 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.75389 -0.08679 -0.01902 0.11559 0.65297 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.554471 0.120368 4.606 8.85e-06 *** SMF 0.603776 0.004448 135.756 < 2e-16 *** SSF 0.140660 0.002927 48.059 < 2e-16 *** NS 0.250930 0.002144 117.014 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.2048 on 146 degrees of freedom Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 3.383e+06 on 3 and 146 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,] 9.083172e-09 1.816634e-08 1.000000e+00 [2,] 1.422077e-11 2.844155e-11 1.000000e+00 [3,] 1.969604e-14 3.939209e-14 1.000000e+00 [4,] 1.286039e-16 2.572079e-16 1.000000e+00 [5,] 3.349914e-19 6.699829e-19 1.000000e+00 [6,] 6.431820e-22 1.286364e-21 1.000000e+00 [7,] 2.660228e-24 5.320456e-24 1.000000e+00 [8,] 5.569769e-27 1.113954e-26 1.000000e+00 [9,] 2.216027e-29 4.432054e-29 1.000000e+00 [10,] 3.882150e-32 7.764300e-32 1.000000e+00 [11,] 1.682117e-34 3.364233e-34 1.000000e+00 [12,] 3.699921e-37 7.399841e-37 1.000000e+00 [13,] 6.581659e-40 1.316332e-39 1.000000e+00 [14,] 1.175552e-42 2.351105e-42 1.000000e+00 [15,] 1.804254e-45 3.608508e-45 1.000000e+00 [16,] 5.101728e-48 1.020346e-47 1.000000e+00 [17,] 1.811718e-50 3.623436e-50 1.000000e+00 [18,] 3.383817e-53 6.767634e-53 1.000000e+00 [19,] 8.265620e-56 1.653124e-55 1.000000e+00 [20,] 4.316779e-58 8.633557e-58 1.000000e+00 [21,] 8.436566e-61 1.687313e-60 1.000000e+00 [22,] 2.307373e-63 4.614745e-63 1.000000e+00 [23,] 4.643987e-66 9.287974e-66 1.000000e+00 [24,] 1.173131e-68 2.346263e-68 1.000000e+00 [25,] 2.024070e-71 4.048141e-71 1.000000e+00 [26,] 7.639873e-74 1.527975e-73 1.000000e+00 [27,] 1.562911e-76 3.125821e-76 1.000000e+00 [28,] 3.119978e-79 6.239955e-79 1.000000e+00 [29,] 7.224738e-82 1.444948e-81 1.000000e+00 [30,] 1.149493e-84 2.298986e-84 1.000000e+00 [31,] 8.475554e-87 1.695111e-86 1.000000e+00 [32,] 1.606700e-89 3.213401e-89 1.000000e+00 [33,] 2.384548e-92 4.769096e-92 1.000000e+00 [34,] 3.483250e-95 6.966500e-95 1.000000e+00 [35,] 6.165492e-98 1.233098e-97 1.000000e+00 [36,] 1.068705e-100 2.137410e-100 1.000000e+00 [37,] 1.569958e-103 3.139915e-103 1.000000e+00 [38,] 3.307659e-106 6.615317e-106 1.000000e+00 [39,] 1.656634e-108 3.313268e-108 1.000000e+00 [40,] 2.376799e-111 4.753597e-111 1.000000e+00 [41,] 3.855238e-114 7.710477e-114 1.000000e+00 [42,] 5.237413e-117 1.047483e-116 1.000000e+00 [43,] 7.987538e-120 1.597508e-119 1.000000e+00 [44,] 1.034205e-122 2.068409e-122 1.000000e+00 [45,] 3.207456e-125 6.414912e-125 1.000000e+00 [46,] 5.806416e-128 1.161283e-127 1.000000e+00 [47,] 1.422914e-130 2.845828e-130 1.000000e+00 [48,] 2.116659e-133 4.233319e-133 1.000000e+00 [49,] 1.392595e-135 2.785189e-135 1.000000e+00 [50,] 1.834305e-138 3.668611e-138 1.000000e+00 [51,] 2.764439e-141 5.528878e-141 1.000000e+00 [52,] 3.448957e-144 6.897914e-144 1.000000e+00 [53,] 9.608573e-146 1.921715e-145 1.000000e+00 [54,] 1.830442e-148 3.660883e-148 1.000000e+00 [55,] 2.295846e-151 4.591691e-151 1.000000e+00 [56,] 5.251157e-154 1.050231e-153 1.000000e+00 [57,] 9.190669e-157 1.838134e-156 1.000000e+00 [58,] 1.436467e-159 2.872934e-159 1.000000e+00 [59,] 2.660980e-162 5.321960e-162 1.000000e+00 [60,] 3.667813e-165 7.335626e-165 1.000000e+00 [61,] 5.378241e-168 1.075648e-167 1.000000e+00 [62,] 7.236712e-171 1.447342e-170 1.000000e+00 [63,] 1.135655e-173 2.271310e-173 1.000000e+00 [64,] 3.082254e-176 6.164508e-176 1.000000e+00 [65,] 5.801328e-179 1.160266e-178 1.000000e+00 [66,] 1.312506e-181 2.625011e-181 1.000000e+00 [67,] 7.404291e-184 1.480858e-183 1.000000e+00 [68,] 2.921315e-57 5.842631e-57 1.000000e+00 [69,] 7.036398e-52 1.407280e-51 1.000000e+00 [70,] 2.345313e-52 4.690627e-52 1.000000e+00 [71,] 1.185389e-46 2.370777e-46 1.000000e+00 [72,] 1.041801e-46 2.083602e-46 1.000000e+00 [73,] 2.788988e-46 5.577975e-46 1.000000e+00 [74,] 1.266364e-45 2.532728e-45 1.000000e+00 [75,] 7.000723e-43 1.400145e-42 1.000000e+00 [76,] 2.496945e-26 4.993890e-26 1.000000e+00 [77,] 2.945774e-20 5.891548e-20 1.000000e+00 [78,] 1.553428e-16 3.106857e-16 1.000000e+00 [79,] 3.167532e-14 6.335064e-14 1.000000e+00 [80,] 5.135487e-12 1.027097e-11 1.000000e+00 [81,] 1.006728e-10 2.013456e-10 1.000000e+00 [82,] 3.215749e-10 6.431498e-10 1.000000e+00 [83,] 1.918831e-10 3.837663e-10 1.000000e+00 [84,] 1.223623e-10 2.447246e-10 1.000000e+00 [85,] 1.225879e-10 2.451758e-10 1.000000e+00 [86,] 4.417776e-10 8.835553e-10 1.000000e+00 [87,] 1.491791e-08 2.983582e-08 1.000000e+00 [88,] 5.299555e-08 1.059911e-07 9.999999e-01 [89,] 2.895614e-08 5.791229e-08 1.000000e+00 [90,] 2.268318e-08 4.536635e-08 1.000000e+00 [91,] 2.374710e-07 4.749421e-07 9.999998e-01 [92,] 1.545189e-06 3.090377e-06 9.999985e-01 [93,] 6.687824e-06 1.337565e-05 9.999933e-01 [94,] 4.542662e-06 9.085323e-06 9.999955e-01 [95,] 1.366902e-05 2.733804e-05 9.999863e-01 [96,] 1.024691e-05 2.049383e-05 9.999898e-01 [97,] 5.955779e-06 1.191156e-05 9.999940e-01 [98,] 8.795734e-06 1.759147e-05 9.999912e-01 [99,] 3.709362e-05 7.418723e-05 9.999629e-01 [100,] 1.359703e-04 2.719406e-04 9.998640e-01 [101,] 2.320462e-03 4.640924e-03 9.976795e-01 [102,] 6.905443e-03 1.381089e-02 9.930946e-01 [103,] 8.174897e-03 1.634979e-02 9.918251e-01 [104,] 2.152024e-02 4.304048e-02 9.784798e-01 [105,] 3.709585e-02 7.419171e-02 9.629041e-01 [106,] 4.346398e-02 8.692795e-02 9.565360e-01 [107,] 3.343213e-02 6.686427e-02 9.665679e-01 [108,] 3.128766e-02 6.257531e-02 9.687123e-01 [109,] 2.978383e-02 5.956766e-02 9.702162e-01 [110,] 3.781726e-02 7.563452e-02 9.621827e-01 [111,] 4.137027e-02 8.274054e-02 9.586297e-01 [112,] 1.139837e-01 2.279674e-01 8.860163e-01 [113,] 1.262239e-01 2.524479e-01 8.737761e-01 [114,] 1.943210e-01 3.886419e-01 8.056790e-01 [115,] 2.265697e-01 4.531394e-01 7.734303e-01 [116,] 2.596076e-01 5.192152e-01 7.403924e-01 [117,] 6.123334e-01 7.753331e-01 3.876666e-01 [118,] 8.912659e-01 2.174682e-01 1.087341e-01 [119,] 9.836828e-01 3.263434e-02 1.631717e-02 [120,] 9.942665e-01 1.146700e-02 5.733498e-03 [121,] 9.926683e-01 1.466341e-02 7.331707e-03 [122,] 9.962567e-01 7.486601e-03 3.743301e-03 [123,] 9.994452e-01 1.109504e-03 5.547519e-04 [124,] 9.999983e-01 3.388956e-06 1.694478e-06 [125,] 9.999984e-01 3.145109e-06 1.572554e-06 [126,] 9.999961e-01 7.808528e-06 3.904264e-06 [127,] 9.999890e-01 2.208568e-05 1.104284e-05 [128,] 9.999815e-01 3.699033e-05 1.849517e-05 [129,] 9.999436e-01 1.128381e-04 5.641904e-05 [130,] 9.998829e-01 2.342714e-04 1.171357e-04 [131,] 9.998617e-01 2.766826e-04 1.383413e-04 [132,] 9.998791e-01 2.418530e-04 1.209265e-04 [133,] 9.996205e-01 7.589749e-04 3.794875e-04 [134,] 9.987450e-01 2.510058e-03 1.255029e-03 [135,] 9.955470e-01 8.905967e-03 4.452984e-03 [136,] 9.861200e-01 2.776008e-02 1.388004e-02 [137,] 9.832518e-01 3.349649e-02 1.674824e-02 > postscript(file="/var/wessaorg/rcomp/tmp/16svt1353429666.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/29z561353429666.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/3ykjc1353429666.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/4n3bx1353429666.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/554fb1353429666.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 = 150 Frequency = 1 1 2 3 4 5 6 -0.091107978 -0.071371732 -0.056838208 -0.072935029 -0.079899740 -0.072372990 7 8 9 10 11 12 -0.062526789 -0.073634266 -0.089580330 -0.078960692 -0.060652961 -0.075502648 13 14 15 16 17 18 -0.077713387 -0.070889592 -0.065993689 -0.074305252 -0.065660399 -0.063811660 19 20 21 22 23 24 -0.068967393 -0.042142289 -0.027277692 -0.045659106 -0.042179860 -0.052643051 25 26 27 28 29 30 -0.063408208 -0.068969023 -0.062517961 -0.046224669 -0.034420558 -0.034037306 31 32 33 34 35 36 -0.018011104 -0.014126474 0.002316278 0.007866501 0.016548534 0.029207731 37 38 39 40 41 42 0.044720464 0.034688206 0.033484326 0.038134180 0.044340524 0.063997392 43 44 45 46 47 48 0.069120137 0.068655642 0.085067313 0.075136440 0.061071049 0.050461570 49 50 51 52 53 54 0.080966188 0.077868176 0.089898721 0.097939584 0.127094587 0.123160433 55 56 57 58 59 60 0.098705867 0.084412254 0.073835582 0.082981725 0.083009169 0.087809504 61 62 63 64 65 66 0.113946837 0.153295741 0.132715931 0.117188350 0.114725828 0.135865414 67 68 69 70 71 72 0.130949696 0.120136472 0.135385575 0.118110308 0.173158778 0.170623311 73 74 75 76 77 78 0.184129652 0.357244126 0.327327813 0.244544712 0.398462031 0.282007676 79 80 81 82 83 84 0.213577373 0.247997416 0.145957021 -0.148701489 -0.142029891 -0.160649410 85 86 87 88 89 90 -0.158563360 -0.237913923 -0.225485079 -0.165142388 -0.015574356 0.103488431 91 92 93 94 95 96 -0.086805926 -0.207673584 -0.344171948 -0.255263770 -0.020048432 0.132124710 97 98 99 100 101 102 -0.334221836 -0.320971649 -0.317137448 0.024569709 -0.086756148 -0.045796594 103 104 105 106 107 108 0.004884032 -0.219569555 -0.261075431 -0.100170965 0.227448425 -0.020019939 109 110 111 112 113 114 -0.170843058 -0.480748523 -0.247366075 -0.238251821 -0.006251825 -0.248108572 115 116 117 118 119 120 -0.268701244 -0.088268971 -0.145863811 -0.090183948 -0.386722021 -0.376325999 121 122 123 124 125 126 -0.339823831 -0.081160416 0.209321679 -0.201456482 -0.476444536 -0.753894887 127 128 129 130 131 132 -0.301578024 0.134908363 0.432904955 0.421637341 -0.246774074 0.300691754 133 134 135 136 137 138 0.288164658 0.242716092 -0.069138747 -0.058295789 -0.155633594 -0.069531849 139 140 141 142 143 144 0.289755519 -0.145394674 0.098794032 0.115880849 0.430441503 0.652969826 145 146 147 148 149 150 0.279778663 0.433663463 0.453925235 0.111030472 0.245509921 -0.039609839 > postscript(file="/var/wessaorg/rcomp/tmp/6ntvn1353429666.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 = 150 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.091107978 NA 1 -0.071371732 -0.091107978 2 -0.056838208 -0.071371732 3 -0.072935029 -0.056838208 4 -0.079899740 -0.072935029 5 -0.072372990 -0.079899740 6 -0.062526789 -0.072372990 7 -0.073634266 -0.062526789 8 -0.089580330 -0.073634266 9 -0.078960692 -0.089580330 10 -0.060652961 -0.078960692 11 -0.075502648 -0.060652961 12 -0.077713387 -0.075502648 13 -0.070889592 -0.077713387 14 -0.065993689 -0.070889592 15 -0.074305252 -0.065993689 16 -0.065660399 -0.074305252 17 -0.063811660 -0.065660399 18 -0.068967393 -0.063811660 19 -0.042142289 -0.068967393 20 -0.027277692 -0.042142289 21 -0.045659106 -0.027277692 22 -0.042179860 -0.045659106 23 -0.052643051 -0.042179860 24 -0.063408208 -0.052643051 25 -0.068969023 -0.063408208 26 -0.062517961 -0.068969023 27 -0.046224669 -0.062517961 28 -0.034420558 -0.046224669 29 -0.034037306 -0.034420558 30 -0.018011104 -0.034037306 31 -0.014126474 -0.018011104 32 0.002316278 -0.014126474 33 0.007866501 0.002316278 34 0.016548534 0.007866501 35 0.029207731 0.016548534 36 0.044720464 0.029207731 37 0.034688206 0.044720464 38 0.033484326 0.034688206 39 0.038134180 0.033484326 40 0.044340524 0.038134180 41 0.063997392 0.044340524 42 0.069120137 0.063997392 43 0.068655642 0.069120137 44 0.085067313 0.068655642 45 0.075136440 0.085067313 46 0.061071049 0.075136440 47 0.050461570 0.061071049 48 0.080966188 0.050461570 49 0.077868176 0.080966188 50 0.089898721 0.077868176 51 0.097939584 0.089898721 52 0.127094587 0.097939584 53 0.123160433 0.127094587 54 0.098705867 0.123160433 55 0.084412254 0.098705867 56 0.073835582 0.084412254 57 0.082981725 0.073835582 58 0.083009169 0.082981725 59 0.087809504 0.083009169 60 0.113946837 0.087809504 61 0.153295741 0.113946837 62 0.132715931 0.153295741 63 0.117188350 0.132715931 64 0.114725828 0.117188350 65 0.135865414 0.114725828 66 0.130949696 0.135865414 67 0.120136472 0.130949696 68 0.135385575 0.120136472 69 0.118110308 0.135385575 70 0.173158778 0.118110308 71 0.170623311 0.173158778 72 0.184129652 0.170623311 73 0.357244126 0.184129652 74 0.327327813 0.357244126 75 0.244544712 0.327327813 76 0.398462031 0.244544712 77 0.282007676 0.398462031 78 0.213577373 0.282007676 79 0.247997416 0.213577373 80 0.145957021 0.247997416 81 -0.148701489 0.145957021 82 -0.142029891 -0.148701489 83 -0.160649410 -0.142029891 84 -0.158563360 -0.160649410 85 -0.237913923 -0.158563360 86 -0.225485079 -0.237913923 87 -0.165142388 -0.225485079 88 -0.015574356 -0.165142388 89 0.103488431 -0.015574356 90 -0.086805926 0.103488431 91 -0.207673584 -0.086805926 92 -0.344171948 -0.207673584 93 -0.255263770 -0.344171948 94 -0.020048432 -0.255263770 95 0.132124710 -0.020048432 96 -0.334221836 0.132124710 97 -0.320971649 -0.334221836 98 -0.317137448 -0.320971649 99 0.024569709 -0.317137448 100 -0.086756148 0.024569709 101 -0.045796594 -0.086756148 102 0.004884032 -0.045796594 103 -0.219569555 0.004884032 104 -0.261075431 -0.219569555 105 -0.100170965 -0.261075431 106 0.227448425 -0.100170965 107 -0.020019939 0.227448425 108 -0.170843058 -0.020019939 109 -0.480748523 -0.170843058 110 -0.247366075 -0.480748523 111 -0.238251821 -0.247366075 112 -0.006251825 -0.238251821 113 -0.248108572 -0.006251825 114 -0.268701244 -0.248108572 115 -0.088268971 -0.268701244 116 -0.145863811 -0.088268971 117 -0.090183948 -0.145863811 118 -0.386722021 -0.090183948 119 -0.376325999 -0.386722021 120 -0.339823831 -0.376325999 121 -0.081160416 -0.339823831 122 0.209321679 -0.081160416 123 -0.201456482 0.209321679 124 -0.476444536 -0.201456482 125 -0.753894887 -0.476444536 126 -0.301578024 -0.753894887 127 0.134908363 -0.301578024 128 0.432904955 0.134908363 129 0.421637341 0.432904955 130 -0.246774074 0.421637341 131 0.300691754 -0.246774074 132 0.288164658 0.300691754 133 0.242716092 0.288164658 134 -0.069138747 0.242716092 135 -0.058295789 -0.069138747 136 -0.155633594 -0.058295789 137 -0.069531849 -0.155633594 138 0.289755519 -0.069531849 139 -0.145394674 0.289755519 140 0.098794032 -0.145394674 141 0.115880849 0.098794032 142 0.430441503 0.115880849 143 0.652969826 0.430441503 144 0.279778663 0.652969826 145 0.433663463 0.279778663 146 0.453925235 0.433663463 147 0.111030472 0.453925235 148 0.245509921 0.111030472 149 -0.039609839 0.245509921 150 NA -0.039609839 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.071371732 -0.091107978 [2,] -0.056838208 -0.071371732 [3,] -0.072935029 -0.056838208 [4,] -0.079899740 -0.072935029 [5,] -0.072372990 -0.079899740 [6,] -0.062526789 -0.072372990 [7,] -0.073634266 -0.062526789 [8,] -0.089580330 -0.073634266 [9,] -0.078960692 -0.089580330 [10,] -0.060652961 -0.078960692 [11,] -0.075502648 -0.060652961 [12,] -0.077713387 -0.075502648 [13,] -0.070889592 -0.077713387 [14,] -0.065993689 -0.070889592 [15,] -0.074305252 -0.065993689 [16,] -0.065660399 -0.074305252 [17,] -0.063811660 -0.065660399 [18,] -0.068967393 -0.063811660 [19,] -0.042142289 -0.068967393 [20,] -0.027277692 -0.042142289 [21,] -0.045659106 -0.027277692 [22,] -0.042179860 -0.045659106 [23,] -0.052643051 -0.042179860 [24,] -0.063408208 -0.052643051 [25,] -0.068969023 -0.063408208 [26,] -0.062517961 -0.068969023 [27,] -0.046224669 -0.062517961 [28,] -0.034420558 -0.046224669 [29,] -0.034037306 -0.034420558 [30,] -0.018011104 -0.034037306 [31,] -0.014126474 -0.018011104 [32,] 0.002316278 -0.014126474 [33,] 0.007866501 0.002316278 [34,] 0.016548534 0.007866501 [35,] 0.029207731 0.016548534 [36,] 0.044720464 0.029207731 [37,] 0.034688206 0.044720464 [38,] 0.033484326 0.034688206 [39,] 0.038134180 0.033484326 [40,] 0.044340524 0.038134180 [41,] 0.063997392 0.044340524 [42,] 0.069120137 0.063997392 [43,] 0.068655642 0.069120137 [44,] 0.085067313 0.068655642 [45,] 0.075136440 0.085067313 [46,] 0.061071049 0.075136440 [47,] 0.050461570 0.061071049 [48,] 0.080966188 0.050461570 [49,] 0.077868176 0.080966188 [50,] 0.089898721 0.077868176 [51,] 0.097939584 0.089898721 [52,] 0.127094587 0.097939584 [53,] 0.123160433 0.127094587 [54,] 0.098705867 0.123160433 [55,] 0.084412254 0.098705867 [56,] 0.073835582 0.084412254 [57,] 0.082981725 0.073835582 [58,] 0.083009169 0.082981725 [59,] 0.087809504 0.083009169 [60,] 0.113946837 0.087809504 [61,] 0.153295741 0.113946837 [62,] 0.132715931 0.153295741 [63,] 0.117188350 0.132715931 [64,] 0.114725828 0.117188350 [65,] 0.135865414 0.114725828 [66,] 0.130949696 0.135865414 [67,] 0.120136472 0.130949696 [68,] 0.135385575 0.120136472 [69,] 0.118110308 0.135385575 [70,] 0.173158778 0.118110308 [71,] 0.170623311 0.173158778 [72,] 0.184129652 0.170623311 [73,] 0.357244126 0.184129652 [74,] 0.327327813 0.357244126 [75,] 0.244544712 0.327327813 [76,] 0.398462031 0.244544712 [77,] 0.282007676 0.398462031 [78,] 0.213577373 0.282007676 [79,] 0.247997416 0.213577373 [80,] 0.145957021 0.247997416 [81,] -0.148701489 0.145957021 [82,] -0.142029891 -0.148701489 [83,] -0.160649410 -0.142029891 [84,] -0.158563360 -0.160649410 [85,] -0.237913923 -0.158563360 [86,] -0.225485079 -0.237913923 [87,] -0.165142388 -0.225485079 [88,] -0.015574356 -0.165142388 [89,] 0.103488431 -0.015574356 [90,] -0.086805926 0.103488431 [91,] -0.207673584 -0.086805926 [92,] -0.344171948 -0.207673584 [93,] -0.255263770 -0.344171948 [94,] -0.020048432 -0.255263770 [95,] 0.132124710 -0.020048432 [96,] -0.334221836 0.132124710 [97,] -0.320971649 -0.334221836 [98,] -0.317137448 -0.320971649 [99,] 0.024569709 -0.317137448 [100,] -0.086756148 0.024569709 [101,] -0.045796594 -0.086756148 [102,] 0.004884032 -0.045796594 [103,] -0.219569555 0.004884032 [104,] -0.261075431 -0.219569555 [105,] -0.100170965 -0.261075431 [106,] 0.227448425 -0.100170965 [107,] -0.020019939 0.227448425 [108,] -0.170843058 -0.020019939 [109,] -0.480748523 -0.170843058 [110,] -0.247366075 -0.480748523 [111,] -0.238251821 -0.247366075 [112,] -0.006251825 -0.238251821 [113,] -0.248108572 -0.006251825 [114,] -0.268701244 -0.248108572 [115,] -0.088268971 -0.268701244 [116,] -0.145863811 -0.088268971 [117,] -0.090183948 -0.145863811 [118,] -0.386722021 -0.090183948 [119,] -0.376325999 -0.386722021 [120,] -0.339823831 -0.376325999 [121,] -0.081160416 -0.339823831 [122,] 0.209321679 -0.081160416 [123,] -0.201456482 0.209321679 [124,] -0.476444536 -0.201456482 [125,] -0.753894887 -0.476444536 [126,] -0.301578024 -0.753894887 [127,] 0.134908363 -0.301578024 [128,] 0.432904955 0.134908363 [129,] 0.421637341 0.432904955 [130,] -0.246774074 0.421637341 [131,] 0.300691754 -0.246774074 [132,] 0.288164658 0.300691754 [133,] 0.242716092 0.288164658 [134,] -0.069138747 0.242716092 [135,] -0.058295789 -0.069138747 [136,] -0.155633594 -0.058295789 [137,] -0.069531849 -0.155633594 [138,] 0.289755519 -0.069531849 [139,] -0.145394674 0.289755519 [140,] 0.098794032 -0.145394674 [141,] 0.115880849 0.098794032 [142,] 0.430441503 0.115880849 [143,] 0.652969826 0.430441503 [144,] 0.279778663 0.652969826 [145,] 0.433663463 0.279778663 [146,] 0.453925235 0.433663463 [147,] 0.111030472 0.453925235 [148,] 0.245509921 0.111030472 [149,] -0.039609839 0.245509921 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.071371732 -0.091107978 2 -0.056838208 -0.071371732 3 -0.072935029 -0.056838208 4 -0.079899740 -0.072935029 5 -0.072372990 -0.079899740 6 -0.062526789 -0.072372990 7 -0.073634266 -0.062526789 8 -0.089580330 -0.073634266 9 -0.078960692 -0.089580330 10 -0.060652961 -0.078960692 11 -0.075502648 -0.060652961 12 -0.077713387 -0.075502648 13 -0.070889592 -0.077713387 14 -0.065993689 -0.070889592 15 -0.074305252 -0.065993689 16 -0.065660399 -0.074305252 17 -0.063811660 -0.065660399 18 -0.068967393 -0.063811660 19 -0.042142289 -0.068967393 20 -0.027277692 -0.042142289 21 -0.045659106 -0.027277692 22 -0.042179860 -0.045659106 23 -0.052643051 -0.042179860 24 -0.063408208 -0.052643051 25 -0.068969023 -0.063408208 26 -0.062517961 -0.068969023 27 -0.046224669 -0.062517961 28 -0.034420558 -0.046224669 29 -0.034037306 -0.034420558 30 -0.018011104 -0.034037306 31 -0.014126474 -0.018011104 32 0.002316278 -0.014126474 33 0.007866501 0.002316278 34 0.016548534 0.007866501 35 0.029207731 0.016548534 36 0.044720464 0.029207731 37 0.034688206 0.044720464 38 0.033484326 0.034688206 39 0.038134180 0.033484326 40 0.044340524 0.038134180 41 0.063997392 0.044340524 42 0.069120137 0.063997392 43 0.068655642 0.069120137 44 0.085067313 0.068655642 45 0.075136440 0.085067313 46 0.061071049 0.075136440 47 0.050461570 0.061071049 48 0.080966188 0.050461570 49 0.077868176 0.080966188 50 0.089898721 0.077868176 51 0.097939584 0.089898721 52 0.127094587 0.097939584 53 0.123160433 0.127094587 54 0.098705867 0.123160433 55 0.084412254 0.098705867 56 0.073835582 0.084412254 57 0.082981725 0.073835582 58 0.083009169 0.082981725 59 0.087809504 0.083009169 60 0.113946837 0.087809504 61 0.153295741 0.113946837 62 0.132715931 0.153295741 63 0.117188350 0.132715931 64 0.114725828 0.117188350 65 0.135865414 0.114725828 66 0.130949696 0.135865414 67 0.120136472 0.130949696 68 0.135385575 0.120136472 69 0.118110308 0.135385575 70 0.173158778 0.118110308 71 0.170623311 0.173158778 72 0.184129652 0.170623311 73 0.357244126 0.184129652 74 0.327327813 0.357244126 75 0.244544712 0.327327813 76 0.398462031 0.244544712 77 0.282007676 0.398462031 78 0.213577373 0.282007676 79 0.247997416 0.213577373 80 0.145957021 0.247997416 81 -0.148701489 0.145957021 82 -0.142029891 -0.148701489 83 -0.160649410 -0.142029891 84 -0.158563360 -0.160649410 85 -0.237913923 -0.158563360 86 -0.225485079 -0.237913923 87 -0.165142388 -0.225485079 88 -0.015574356 -0.165142388 89 0.103488431 -0.015574356 90 -0.086805926 0.103488431 91 -0.207673584 -0.086805926 92 -0.344171948 -0.207673584 93 -0.255263770 -0.344171948 94 -0.020048432 -0.255263770 95 0.132124710 -0.020048432 96 -0.334221836 0.132124710 97 -0.320971649 -0.334221836 98 -0.317137448 -0.320971649 99 0.024569709 -0.317137448 100 -0.086756148 0.024569709 101 -0.045796594 -0.086756148 102 0.004884032 -0.045796594 103 -0.219569555 0.004884032 104 -0.261075431 -0.219569555 105 -0.100170965 -0.261075431 106 0.227448425 -0.100170965 107 -0.020019939 0.227448425 108 -0.170843058 -0.020019939 109 -0.480748523 -0.170843058 110 -0.247366075 -0.480748523 111 -0.238251821 -0.247366075 112 -0.006251825 -0.238251821 113 -0.248108572 -0.006251825 114 -0.268701244 -0.248108572 115 -0.088268971 -0.268701244 116 -0.145863811 -0.088268971 117 -0.090183948 -0.145863811 118 -0.386722021 -0.090183948 119 -0.376325999 -0.386722021 120 -0.339823831 -0.376325999 121 -0.081160416 -0.339823831 122 0.209321679 -0.081160416 123 -0.201456482 0.209321679 124 -0.476444536 -0.201456482 125 -0.753894887 -0.476444536 126 -0.301578024 -0.753894887 127 0.134908363 -0.301578024 128 0.432904955 0.134908363 129 0.421637341 0.432904955 130 -0.246774074 0.421637341 131 0.300691754 -0.246774074 132 0.288164658 0.300691754 133 0.242716092 0.288164658 134 -0.069138747 0.242716092 135 -0.058295789 -0.069138747 136 -0.155633594 -0.058295789 137 -0.069531849 -0.155633594 138 0.289755519 -0.069531849 139 -0.145394674 0.289755519 140 0.098794032 -0.145394674 141 0.115880849 0.098794032 142 0.430441503 0.115880849 143 0.652969826 0.430441503 144 0.279778663 0.652969826 145 0.433663463 0.279778663 146 0.453925235 0.433663463 147 0.111030472 0.453925235 148 0.245509921 0.111030472 149 -0.039609839 0.245509921 > 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/7fa1d1353429666.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/875201353429666.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/995jd1353429666.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/10fi2m1353429666.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/11l8wf1353429666.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/128uxn1353429666.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/1378vi1353429666.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/14fw901353429666.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/15oa6h1353429667.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/16ijsd1353429667.tab") + } > > try(system("convert tmp/16svt1353429666.ps tmp/16svt1353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/29z561353429666.ps tmp/29z561353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/3ykjc1353429666.ps tmp/3ykjc1353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/4n3bx1353429666.ps tmp/4n3bx1353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/554fb1353429666.ps tmp/554fb1353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/6ntvn1353429666.ps tmp/6ntvn1353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/7fa1d1353429666.ps tmp/7fa1d1353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/875201353429666.ps tmp/875201353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/995jd1353429666.ps tmp/995jd1353429666.png",intern=TRUE)) character(0) > try(system("convert tmp/10fi2m1353429666.ps tmp/10fi2m1353429666.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.693 1.467 10.167