R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(1687 + ,0 + ,1508 + ,0 + ,1507 + ,0 + ,1385 + ,0 + ,1632 + ,0 + ,1511 + ,0 + ,1559 + ,0 + ,1630 + ,0 + ,1579 + ,0 + ,1653 + ,0 + ,2152 + ,0 + ,2148 + ,0 + ,1752 + ,0 + ,1765 + ,0 + ,1717 + ,0 + ,1558 + ,0 + ,1575 + ,0 + ,1520 + ,0 + ,1805 + ,0 + ,1800 + ,0 + ,1719 + ,0 + ,2008 + ,0 + ,2242 + ,0 + ,2478 + ,0 + ,2030 + ,0 + ,1655 + ,0 + ,1693 + ,0 + ,1623 + ,0 + ,1805 + ,0 + ,1746 + ,0 + ,1795 + ,0 + ,1926 + ,0 + ,1619 + ,0 + ,1992 + ,0 + ,2233 + ,0 + ,2192 + ,0 + ,2080 + ,0 + ,1768 + ,0 + ,1835 + ,0 + ,1569 + ,0 + ,1976 + ,0 + ,1853 + ,0 + ,1965 + ,0 + ,1689 + ,0 + ,1778 + ,0 + ,1976 + ,0 + ,2397 + ,0 + ,2654 + ,0 + ,2097 + ,0 + ,1963 + ,0 + ,1677 + ,0 + ,1941 + ,0 + ,2003 + ,0 + ,1813 + ,0 + ,2012 + ,0 + ,1912 + ,0 + ,2084 + ,0 + ,2080 + ,0 + ,2118 + ,0 + ,2150 + ,0 + ,1608 + ,0 + ,1503 + ,0 + ,1548 + ,0 + ,1382 + ,0 + ,1731 + ,0 + ,1798 + ,0 + ,1779 + ,0 + ,1887 + ,0 + ,2004 + ,0 + ,2077 + ,0 + ,2092 + ,0 + ,2051 + ,0 + ,1577 + ,0 + ,1356 + ,0 + ,1652 + ,0 + ,1382 + ,0 + ,1519 + ,0 + ,1421 + ,0 + ,1442 + ,0 + ,1543 + ,0 + ,1656 + ,0 + ,1561 + ,0 + ,1905 + ,0 + ,2199 + ,0 + ,1473 + ,0 + ,1655 + ,0 + ,1407 + ,0 + ,1395 + ,0 + ,1530 + ,0 + ,1309 + ,0 + ,1526 + ,0 + ,1327 + ,0 + ,1627 + ,0 + ,1748 + ,0 + ,1958 + ,0 + ,2274 + ,0 + ,1648 + ,0 + ,1401 + ,0 + ,1411 + ,0 + ,1403 + ,0 + ,1394 + ,0 + ,1520 + ,0 + ,1528 + ,0 + ,1643 + ,0 + ,1515 + ,0 + ,1685 + ,0 + ,2000 + ,0 + ,2215 + ,0 + ,1956 + ,0 + ,1462 + ,0 + ,1563 + ,0 + ,1459 + ,0 + ,1446 + ,0 + ,1622 + ,0 + ,1657 + ,0 + ,1638 + ,0 + ,1643 + ,0 + ,1683 + ,0 + ,2050 + ,0 + ,2262 + ,0 + ,1813 + ,0 + ,1445 + ,0 + ,1762 + ,0 + ,1461 + ,0 + ,1556 + ,0 + ,1431 + ,0 + ,1427 + ,0 + ,1554 + ,0 + ,1645 + ,0 + ,1653 + ,0 + ,2016 + ,0 + ,2207 + ,0 + ,1665 + ,0 + ,1361 + ,0 + ,1506 + ,0 + ,1360 + ,0 + ,1453 + ,0 + ,1522 + ,0 + ,1460 + ,0 + ,1552 + ,0 + ,1548 + ,0 + ,1827 + ,0 + ,1737 + ,0 + ,1941 + ,0 + ,1474 + ,0 + ,1458 + ,0 + ,1542 + ,0 + ,1404 + ,0 + ,1522 + ,0 + ,1385 + ,0 + ,1641 + ,0 + ,1510 + ,0 + ,1681 + ,0 + ,1938 + ,0 + ,1868 + ,0 + ,1726 + ,0 + ,1456 + ,0 + ,1445 + ,0 + ,1456 + ,0 + ,1365 + ,0 + ,1487 + ,0 + ,1558 + ,0 + ,1488 + ,0 + ,1684 + ,0 + ,1594 + ,0 + ,1850 + ,0 + ,1998 + ,0 + ,2079 + ,0 + ,1494 + ,0 + ,1057 + ,1 + ,1218 + ,1 + ,1168 + ,1 + ,1236 + ,1 + ,1076 + ,1 + ,1174 + ,1 + ,1139 + ,1 + ,1427 + ,1 + ,1487 + ,1 + ,1483 + ,1 + ,1513 + ,1 + ,1357 + ,1 + ,1165 + ,1 + ,1282 + ,1 + ,1110 + ,1 + ,1297 + ,1 + ,1185 + ,1 + ,1222 + ,1 + ,1284 + ,1 + ,1444 + ,1 + ,1575 + ,1 + ,1737 + ,1 + ,1763 + ,1) + ,dim=c(2 + ,192) + ,dimnames=list(c('Y' + ,'X') + ,1:192)) > y <- array(NA,dim=c(2,192),dimnames=list(c('Y','X'),1:192)) > 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' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : 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 Y X 1 1687 0 2 1508 0 3 1507 0 4 1385 0 5 1632 0 6 1511 0 7 1559 0 8 1630 0 9 1579 0 10 1653 0 11 2152 0 12 2148 0 13 1752 0 14 1765 0 15 1717 0 16 1558 0 17 1575 0 18 1520 0 19 1805 0 20 1800 0 21 1719 0 22 2008 0 23 2242 0 24 2478 0 25 2030 0 26 1655 0 27 1693 0 28 1623 0 29 1805 0 30 1746 0 31 1795 0 32 1926 0 33 1619 0 34 1992 0 35 2233 0 36 2192 0 37 2080 0 38 1768 0 39 1835 0 40 1569 0 41 1976 0 42 1853 0 43 1965 0 44 1689 0 45 1778 0 46 1976 0 47 2397 0 48 2654 0 49 2097 0 50 1963 0 51 1677 0 52 1941 0 53 2003 0 54 1813 0 55 2012 0 56 1912 0 57 2084 0 58 2080 0 59 2118 0 60 2150 0 61 1608 0 62 1503 0 63 1548 0 64 1382 0 65 1731 0 66 1798 0 67 1779 0 68 1887 0 69 2004 0 70 2077 0 71 2092 0 72 2051 0 73 1577 0 74 1356 0 75 1652 0 76 1382 0 77 1519 0 78 1421 0 79 1442 0 80 1543 0 81 1656 0 82 1561 0 83 1905 0 84 2199 0 85 1473 0 86 1655 0 87 1407 0 88 1395 0 89 1530 0 90 1309 0 91 1526 0 92 1327 0 93 1627 0 94 1748 0 95 1958 0 96 2274 0 97 1648 0 98 1401 0 99 1411 0 100 1403 0 101 1394 0 102 1520 0 103 1528 0 104 1643 0 105 1515 0 106 1685 0 107 2000 0 108 2215 0 109 1956 0 110 1462 0 111 1563 0 112 1459 0 113 1446 0 114 1622 0 115 1657 0 116 1638 0 117 1643 0 118 1683 0 119 2050 0 120 2262 0 121 1813 0 122 1445 0 123 1762 0 124 1461 0 125 1556 0 126 1431 0 127 1427 0 128 1554 0 129 1645 0 130 1653 0 131 2016 0 132 2207 0 133 1665 0 134 1361 0 135 1506 0 136 1360 0 137 1453 0 138 1522 0 139 1460 0 140 1552 0 141 1548 0 142 1827 0 143 1737 0 144 1941 0 145 1474 0 146 1458 0 147 1542 0 148 1404 0 149 1522 0 150 1385 0 151 1641 0 152 1510 0 153 1681 0 154 1938 0 155 1868 0 156 1726 0 157 1456 0 158 1445 0 159 1456 0 160 1365 0 161 1487 0 162 1558 0 163 1488 0 164 1684 0 165 1594 0 166 1850 0 167 1998 0 168 2079 0 169 1494 0 170 1057 1 171 1218 1 172 1168 1 173 1236 1 174 1076 1 175 1174 1 176 1139 1 177 1427 1 178 1487 1 179 1483 1 180 1513 1 181 1357 1 182 1165 1 183 1282 1 184 1110 1 185 1297 1 186 1185 1 187 1222 1 188 1284 1 189 1444 1 190 1575 1 191 1737 1 192 1763 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 1717.8 -396.1 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -408.75 -198.00 -63.75 188.26 936.25 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1717.75 20.00 85.886 < 2e-16 *** X -396.06 57.79 -6.854 9.76e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 260 on 190 degrees of freedom Multiple R-squared: 0.1982, Adjusted R-squared: 0.194 F-statistic: 46.97 on 1 and 190 DF, p-value: 9.763e-11 > 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.155930803 0.311861606 0.844069197 [2,] 0.066493527 0.132987055 0.933506473 [3,] 0.025673833 0.051347666 0.974326167 [4,] 0.012217397 0.024434794 0.987782603 [5,] 0.004379978 0.008759956 0.995620022 [6,] 0.002240160 0.004480320 0.997759840 [7,] 0.223580158 0.447160317 0.776419842 [8,] 0.503981354 0.992037292 0.496018646 [9,] 0.420841205 0.841682411 0.579158795 [10,] 0.345365653 0.690731305 0.654634347 [11,] 0.270018209 0.540036419 0.729981791 [12,] 0.219064424 0.438128849 0.780935576 [13,] 0.171075045 0.342150090 0.828924955 [14,] 0.140711527 0.281423053 0.859288473 [15,] 0.114092243 0.228184485 0.885907757 [16,] 0.090079287 0.180158575 0.909920713 [17,] 0.063884764 0.127769529 0.936115236 [18,] 0.088286043 0.176572086 0.911713957 [19,] 0.254036609 0.508073217 0.745963391 [20,] 0.704134516 0.591730968 0.295865484 [21,] 0.709949406 0.580101187 0.290050594 [22,] 0.661732750 0.676534499 0.338267250 [23,] 0.606522270 0.786955459 0.393477730 [24,] 0.559718944 0.880562112 0.440281056 [25,] 0.503737542 0.992524917 0.496262458 [26,] 0.444960835 0.889921670 0.555039165 [27,] 0.390182856 0.780365712 0.609817144 [28,] 0.362128113 0.724256225 0.637871887 [29,] 0.322724827 0.645449653 0.677275173 [30,] 0.318469940 0.636939879 0.681530060 [31,] 0.447502776 0.895005552 0.552497224 [32,] 0.540190518 0.919618963 0.459809482 [33,] 0.562294510 0.875410980 0.437705490 [34,] 0.510686000 0.978627999 0.489314000 [35,] 0.462277789 0.924555578 0.537722211 [36,] 0.443241447 0.886482894 0.556758553 [37,] 0.425738674 0.851477347 0.574261326 [38,] 0.382073907 0.764147813 0.617926093 [39,] 0.362011567 0.724023135 0.637988433 [40,] 0.321992732 0.643985463 0.678007268 [41,] 0.279428291 0.558856581 0.720571709 [42,] 0.265648617 0.531297234 0.734351383 [43,] 0.493782233 0.987564466 0.506217767 [44,] 0.889937541 0.220124918 0.110062459 [45,] 0.901113662 0.197772675 0.098886338 [46,] 0.891931280 0.216137439 0.108068720 [47,] 0.874958770 0.250082459 0.125041230 [48,] 0.861924269 0.276151462 0.138075731 [49,] 0.857741868 0.284516265 0.142258132 [50,] 0.833787221 0.332425559 0.166212779 [51,] 0.831683517 0.336632966 0.168316483 [52,] 0.813452152 0.373095696 0.186547848 [53,] 0.829990046 0.340019907 0.170009954 [54,] 0.845293938 0.309412125 0.154706062 [55,] 0.869886557 0.260226886 0.130113443 [56,] 0.899973181 0.200053639 0.100026819 [57,] 0.892911538 0.214176924 0.107088462 [58,] 0.899813658 0.200372685 0.100186342 [59,] 0.898719123 0.202561753 0.101280877 [60,] 0.924221577 0.151556846 0.075778423 [61,] 0.910274155 0.179451691 0.089725845 [62,] 0.894792537 0.210414927 0.105207463 [63,] 0.877169795 0.245660411 0.122830205 [64,] 0.864097265 0.271805469 0.135902735 [65,] 0.867873641 0.264252718 0.132126359 [66,] 0.887176441 0.225647117 0.112823559 [67,] 0.908449632 0.183100735 0.091550368 [68,] 0.920869504 0.158260991 0.079130496 [69,] 0.916010299 0.167979401 0.083989701 [70,] 0.940402539 0.119194921 0.059597461 [71,] 0.931292248 0.137415505 0.068707752 [72,] 0.946956056 0.106087888 0.053043944 [73,] 0.945881642 0.108236716 0.054118358 [74,] 0.953436315 0.093127370 0.046563685 [75,] 0.957766908 0.084466183 0.042233092 [76,] 0.954411752 0.091176497 0.045588248 [77,] 0.945791198 0.108417604 0.054208802 [78,] 0.940175036 0.119649928 0.059824964 [79,] 0.936131062 0.127737876 0.063868938 [80,] 0.966338566 0.067322867 0.033661434 [81,] 0.966916075 0.066167850 0.033083925 [82,] 0.960164119 0.079671761 0.039835881 [83,] 0.965277069 0.069445861 0.034722931 [84,] 0.970379455 0.059241090 0.029620545 [85,] 0.967464051 0.065071898 0.032535949 [86,] 0.977737303 0.044525394 0.022262697 [87,] 0.975322648 0.049354704 0.024677352 [88,] 0.982127604 0.035744793 0.017872396 [89,] 0.977903932 0.044192137 0.022096068 [90,] 0.972580035 0.054839929 0.027419965 [91,] 0.973652199 0.052695601 0.026347801 [92,] 0.992147867 0.015704267 0.007852133 [93,] 0.989944177 0.020111646 0.010055823 [94,] 0.991080475 0.017839050 0.008919525 [95,] 0.991852053 0.016295894 0.008147947 [96,] 0.992689156 0.014621688 0.007310844 [97,] 0.993587966 0.012824069 0.006412034 [98,] 0.992587471 0.014825059 0.007412529 [99,] 0.991334311 0.017331378 0.008665689 [100,] 0.988786623 0.022426753 0.011213377 [101,] 0.987197427 0.025605146 0.012802573 [102,] 0.983488735 0.033022530 0.016511265 [103,] 0.986210074 0.027579852 0.013789926 [104,] 0.995481226 0.009037549 0.004518774 [105,] 0.996074339 0.007851321 0.003925661 [106,] 0.995808214 0.008383573 0.004191786 [107,] 0.994712555 0.010574889 0.005287445 [108,] 0.994383717 0.011232567 0.005616283 [109,] 0.994202766 0.011594469 0.005797234 [110,] 0.992371889 0.015256222 0.007628111 [111,] 0.989937179 0.020125642 0.010062821 [112,] 0.986889938 0.026220124 0.013110062 [113,] 0.983038754 0.033922493 0.016961246 [114,] 0.978201030 0.043597941 0.021798970 [115,] 0.985499029 0.029001943 0.014500971 [116,] 0.997273738 0.005452524 0.002726262 [117,] 0.996840500 0.006319000 0.003159500 [118,] 0.996604329 0.006791343 0.003395671 [119,] 0.995731903 0.008536193 0.004268097 [120,] 0.995231935 0.009536129 0.004768065 [121,] 0.993835720 0.012328561 0.006164280 [122,] 0.993579113 0.012841775 0.006420887 [123,] 0.993393504 0.013212993 0.006606496 [124,] 0.991524685 0.016950630 0.008475315 [125,] 0.988655488 0.022689023 0.011344512 [126,] 0.984959360 0.030081280 0.015040640 [127,] 0.990221627 0.019556746 0.009778373 [128,] 0.998279991 0.003440018 0.001720009 [129,] 0.997591625 0.004816750 0.002408375 [130,] 0.997892813 0.004214375 0.002107187 [131,] 0.997293899 0.005412202 0.002706101 [132,] 0.997677692 0.004644616 0.002322308 [133,] 0.997354591 0.005290817 0.002645409 [134,] 0.996546554 0.006906892 0.003453446 [135,] 0.996045290 0.007909420 0.003954710 [136,] 0.994686971 0.010626058 0.005313029 [137,] 0.992957425 0.014085150 0.007042575 [138,] 0.992033010 0.015933981 0.007966990 [139,] 0.989583771 0.020832458 0.010416229 [140,] 0.992081659 0.015836682 0.007918341 [141,] 0.990449484 0.019101031 0.009550516 [142,] 0.988949707 0.022100585 0.011050293 [143,] 0.985456061 0.029087878 0.014543939 [144,] 0.985571135 0.028857731 0.014428865 [145,] 0.981780175 0.036439651 0.018219825 [146,] 0.983522710 0.032954581 0.016477290 [147,] 0.977248898 0.045502204 0.022751102 [148,] 0.972640095 0.054719809 0.027359905 [149,] 0.962925549 0.074148902 0.037074451 [150,] 0.967302522 0.065394955 0.032697478 [151,] 0.966685544 0.066628912 0.033314456 [152,] 0.957191721 0.085616558 0.042808279 [153,] 0.951103840 0.097792320 0.048896160 [154,] 0.946573335 0.106853330 0.053426665 [155,] 0.941989760 0.116020480 0.058010240 [156,] 0.953946389 0.092107223 0.046053611 [157,] 0.951782015 0.096435970 0.048217985 [158,] 0.943781676 0.112436649 0.056218324 [159,] 0.948852830 0.102294340 0.051147170 [160,] 0.933869588 0.132260824 0.066130412 [161,] 0.932017992 0.135964017 0.067982008 [162,] 0.908408409 0.183183183 0.091591591 [163,] 0.896695572 0.206608857 0.103304428 [164,] 0.946324945 0.107350109 0.053675055 [165,] 0.925761978 0.148476043 0.074238022 [166,] 0.932074147 0.135851705 0.067925853 [167,] 0.912198628 0.175602743 0.087801372 [168,] 0.897139750 0.205720500 0.102860250 [169,] 0.867972376 0.264055249 0.132027624 [170,] 0.884055444 0.231889112 0.115944556 [171,] 0.871741028 0.256517944 0.128258972 [172,] 0.875980463 0.248039073 0.124019537 [173,] 0.829472349 0.341055301 0.170527651 [174,] 0.781248855 0.437502290 0.218751145 [175,] 0.723085430 0.553829141 0.276914570 [176,] 0.668097907 0.663804186 0.331902093 [177,] 0.573634400 0.852731200 0.426365600 [178,] 0.540064086 0.919871828 0.459935914 [179,] 0.449856184 0.899712367 0.550143816 [180,] 0.491029489 0.982058978 0.508970511 [181,] 0.403462687 0.806925374 0.596537313 [182,] 0.428895543 0.857791087 0.571104457 [183,] 0.488140963 0.976281926 0.511859037 > postscript(file="/var/www/html/rcomp/tmp/1g2oy1258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/21s5w1258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3bksp1258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/40yy41258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/58azj1258722864.ps",horizontal=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 = 192 Frequency = 1 1 2 3 4 5 6 -30.7514793 -209.7514793 -210.7514793 -332.7514793 -85.7514793 -206.7514793 7 8 9 10 11 12 -158.7514793 -87.7514793 -138.7514793 -64.7514793 434.2485207 430.2485207 13 14 15 16 17 18 34.2485207 47.2485207 -0.7514793 -159.7514793 -142.7514793 -197.7514793 19 20 21 22 23 24 87.2485207 82.2485207 1.2485207 290.2485207 524.2485207 760.2485207 25 26 27 28 29 30 312.2485207 -62.7514793 -24.7514793 -94.7514793 87.2485207 28.2485207 31 32 33 34 35 36 77.2485207 208.2485207 -98.7514793 274.2485207 515.2485207 474.2485207 37 38 39 40 41 42 362.2485207 50.2485207 117.2485207 -148.7514793 258.2485207 135.2485207 43 44 45 46 47 48 247.2485207 -28.7514793 60.2485207 258.2485207 679.2485207 936.2485207 49 50 51 52 53 54 379.2485207 245.2485207 -40.7514793 223.2485207 285.2485207 95.2485207 55 56 57 58 59 60 294.2485207 194.2485207 366.2485207 362.2485207 400.2485207 432.2485207 61 62 63 64 65 66 -109.7514793 -214.7514793 -169.7514793 -335.7514793 13.2485207 80.2485207 67 68 69 70 71 72 61.2485207 169.2485207 286.2485207 359.2485207 374.2485207 333.2485207 73 74 75 76 77 78 -140.7514793 -361.7514793 -65.7514793 -335.7514793 -198.7514793 -296.7514793 79 80 81 82 83 84 -275.7514793 -174.7514793 -61.7514793 -156.7514793 187.2485207 481.2485207 85 86 87 88 89 90 -244.7514793 -62.7514793 -310.7514793 -322.7514793 -187.7514793 -408.7514793 91 92 93 94 95 96 -191.7514793 -390.7514793 -90.7514793 30.2485207 240.2485207 556.2485207 97 98 99 100 101 102 -69.7514793 -316.7514793 -306.7514793 -314.7514793 -323.7514793 -197.7514793 103 104 105 106 107 108 -189.7514793 -74.7514793 -202.7514793 -32.7514793 282.2485207 497.2485207 109 110 111 112 113 114 238.2485207 -255.7514793 -154.7514793 -258.7514793 -271.7514793 -95.7514793 115 116 117 118 119 120 -60.7514793 -79.7514793 -74.7514793 -34.7514793 332.2485207 544.2485207 121 122 123 124 125 126 95.2485207 -272.7514793 44.2485207 -256.7514793 -161.7514793 -286.7514793 127 128 129 130 131 132 -290.7514793 -163.7514793 -72.7514793 -64.7514793 298.2485207 489.2485207 133 134 135 136 137 138 -52.7514793 -356.7514793 -211.7514793 -357.7514793 -264.7514793 -195.7514793 139 140 141 142 143 144 -257.7514793 -165.7514793 -169.7514793 109.2485207 19.2485207 223.2485207 145 146 147 148 149 150 -243.7514793 -259.7514793 -175.7514793 -313.7514793 -195.7514793 -332.7514793 151 152 153 154 155 156 -76.7514793 -207.7514793 -36.7514793 220.2485207 150.2485207 8.2485207 157 158 159 160 161 162 -261.7514793 -272.7514793 -261.7514793 -352.7514793 -230.7514793 -159.7514793 163 164 165 166 167 168 -229.7514793 -33.7514793 -123.7514793 132.2485207 280.2485207 361.2485207 169 170 171 172 173 174 -223.7514793 -264.6956522 -103.6956522 -153.6956522 -85.6956522 -245.6956522 175 176 177 178 179 180 -147.6956522 -182.6956522 105.3043478 165.3043478 161.3043478 191.3043478 181 182 183 184 185 186 35.3043478 -156.6956522 -39.6956522 -211.6956522 -24.6956522 -136.6956522 187 188 189 190 191 192 -99.6956522 -37.6956522 122.3043478 253.3043478 415.3043478 441.3043478 > postscript(file="/var/www/html/rcomp/tmp/6k8u81258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 192 Frequency = 1 lag(myerror, k = 1) myerror 0 -30.7514793 NA 1 -209.7514793 -30.7514793 2 -210.7514793 -209.7514793 3 -332.7514793 -210.7514793 4 -85.7514793 -332.7514793 5 -206.7514793 -85.7514793 6 -158.7514793 -206.7514793 7 -87.7514793 -158.7514793 8 -138.7514793 -87.7514793 9 -64.7514793 -138.7514793 10 434.2485207 -64.7514793 11 430.2485207 434.2485207 12 34.2485207 430.2485207 13 47.2485207 34.2485207 14 -0.7514793 47.2485207 15 -159.7514793 -0.7514793 16 -142.7514793 -159.7514793 17 -197.7514793 -142.7514793 18 87.2485207 -197.7514793 19 82.2485207 87.2485207 20 1.2485207 82.2485207 21 290.2485207 1.2485207 22 524.2485207 290.2485207 23 760.2485207 524.2485207 24 312.2485207 760.2485207 25 -62.7514793 312.2485207 26 -24.7514793 -62.7514793 27 -94.7514793 -24.7514793 28 87.2485207 -94.7514793 29 28.2485207 87.2485207 30 77.2485207 28.2485207 31 208.2485207 77.2485207 32 -98.7514793 208.2485207 33 274.2485207 -98.7514793 34 515.2485207 274.2485207 35 474.2485207 515.2485207 36 362.2485207 474.2485207 37 50.2485207 362.2485207 38 117.2485207 50.2485207 39 -148.7514793 117.2485207 40 258.2485207 -148.7514793 41 135.2485207 258.2485207 42 247.2485207 135.2485207 43 -28.7514793 247.2485207 44 60.2485207 -28.7514793 45 258.2485207 60.2485207 46 679.2485207 258.2485207 47 936.2485207 679.2485207 48 379.2485207 936.2485207 49 245.2485207 379.2485207 50 -40.7514793 245.2485207 51 223.2485207 -40.7514793 52 285.2485207 223.2485207 53 95.2485207 285.2485207 54 294.2485207 95.2485207 55 194.2485207 294.2485207 56 366.2485207 194.2485207 57 362.2485207 366.2485207 58 400.2485207 362.2485207 59 432.2485207 400.2485207 60 -109.7514793 432.2485207 61 -214.7514793 -109.7514793 62 -169.7514793 -214.7514793 63 -335.7514793 -169.7514793 64 13.2485207 -335.7514793 65 80.2485207 13.2485207 66 61.2485207 80.2485207 67 169.2485207 61.2485207 68 286.2485207 169.2485207 69 359.2485207 286.2485207 70 374.2485207 359.2485207 71 333.2485207 374.2485207 72 -140.7514793 333.2485207 73 -361.7514793 -140.7514793 74 -65.7514793 -361.7514793 75 -335.7514793 -65.7514793 76 -198.7514793 -335.7514793 77 -296.7514793 -198.7514793 78 -275.7514793 -296.7514793 79 -174.7514793 -275.7514793 80 -61.7514793 -174.7514793 81 -156.7514793 -61.7514793 82 187.2485207 -156.7514793 83 481.2485207 187.2485207 84 -244.7514793 481.2485207 85 -62.7514793 -244.7514793 86 -310.7514793 -62.7514793 87 -322.7514793 -310.7514793 88 -187.7514793 -322.7514793 89 -408.7514793 -187.7514793 90 -191.7514793 -408.7514793 91 -390.7514793 -191.7514793 92 -90.7514793 -390.7514793 93 30.2485207 -90.7514793 94 240.2485207 30.2485207 95 556.2485207 240.2485207 96 -69.7514793 556.2485207 97 -316.7514793 -69.7514793 98 -306.7514793 -316.7514793 99 -314.7514793 -306.7514793 100 -323.7514793 -314.7514793 101 -197.7514793 -323.7514793 102 -189.7514793 -197.7514793 103 -74.7514793 -189.7514793 104 -202.7514793 -74.7514793 105 -32.7514793 -202.7514793 106 282.2485207 -32.7514793 107 497.2485207 282.2485207 108 238.2485207 497.2485207 109 -255.7514793 238.2485207 110 -154.7514793 -255.7514793 111 -258.7514793 -154.7514793 112 -271.7514793 -258.7514793 113 -95.7514793 -271.7514793 114 -60.7514793 -95.7514793 115 -79.7514793 -60.7514793 116 -74.7514793 -79.7514793 117 -34.7514793 -74.7514793 118 332.2485207 -34.7514793 119 544.2485207 332.2485207 120 95.2485207 544.2485207 121 -272.7514793 95.2485207 122 44.2485207 -272.7514793 123 -256.7514793 44.2485207 124 -161.7514793 -256.7514793 125 -286.7514793 -161.7514793 126 -290.7514793 -286.7514793 127 -163.7514793 -290.7514793 128 -72.7514793 -163.7514793 129 -64.7514793 -72.7514793 130 298.2485207 -64.7514793 131 489.2485207 298.2485207 132 -52.7514793 489.2485207 133 -356.7514793 -52.7514793 134 -211.7514793 -356.7514793 135 -357.7514793 -211.7514793 136 -264.7514793 -357.7514793 137 -195.7514793 -264.7514793 138 -257.7514793 -195.7514793 139 -165.7514793 -257.7514793 140 -169.7514793 -165.7514793 141 109.2485207 -169.7514793 142 19.2485207 109.2485207 143 223.2485207 19.2485207 144 -243.7514793 223.2485207 145 -259.7514793 -243.7514793 146 -175.7514793 -259.7514793 147 -313.7514793 -175.7514793 148 -195.7514793 -313.7514793 149 -332.7514793 -195.7514793 150 -76.7514793 -332.7514793 151 -207.7514793 -76.7514793 152 -36.7514793 -207.7514793 153 220.2485207 -36.7514793 154 150.2485207 220.2485207 155 8.2485207 150.2485207 156 -261.7514793 8.2485207 157 -272.7514793 -261.7514793 158 -261.7514793 -272.7514793 159 -352.7514793 -261.7514793 160 -230.7514793 -352.7514793 161 -159.7514793 -230.7514793 162 -229.7514793 -159.7514793 163 -33.7514793 -229.7514793 164 -123.7514793 -33.7514793 165 132.2485207 -123.7514793 166 280.2485207 132.2485207 167 361.2485207 280.2485207 168 -223.7514793 361.2485207 169 -264.6956522 -223.7514793 170 -103.6956522 -264.6956522 171 -153.6956522 -103.6956522 172 -85.6956522 -153.6956522 173 -245.6956522 -85.6956522 174 -147.6956522 -245.6956522 175 -182.6956522 -147.6956522 176 105.3043478 -182.6956522 177 165.3043478 105.3043478 178 161.3043478 165.3043478 179 191.3043478 161.3043478 180 35.3043478 191.3043478 181 -156.6956522 35.3043478 182 -39.6956522 -156.6956522 183 -211.6956522 -39.6956522 184 -24.6956522 -211.6956522 185 -136.6956522 -24.6956522 186 -99.6956522 -136.6956522 187 -37.6956522 -99.6956522 188 122.3043478 -37.6956522 189 253.3043478 122.3043478 190 415.3043478 253.3043478 191 441.3043478 415.3043478 192 NA 441.3043478 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -209.7514793 -30.7514793 [2,] -210.7514793 -209.7514793 [3,] -332.7514793 -210.7514793 [4,] -85.7514793 -332.7514793 [5,] -206.7514793 -85.7514793 [6,] -158.7514793 -206.7514793 [7,] -87.7514793 -158.7514793 [8,] -138.7514793 -87.7514793 [9,] -64.7514793 -138.7514793 [10,] 434.2485207 -64.7514793 [11,] 430.2485207 434.2485207 [12,] 34.2485207 430.2485207 [13,] 47.2485207 34.2485207 [14,] -0.7514793 47.2485207 [15,] -159.7514793 -0.7514793 [16,] -142.7514793 -159.7514793 [17,] -197.7514793 -142.7514793 [18,] 87.2485207 -197.7514793 [19,] 82.2485207 87.2485207 [20,] 1.2485207 82.2485207 [21,] 290.2485207 1.2485207 [22,] 524.2485207 290.2485207 [23,] 760.2485207 524.2485207 [24,] 312.2485207 760.2485207 [25,] -62.7514793 312.2485207 [26,] -24.7514793 -62.7514793 [27,] -94.7514793 -24.7514793 [28,] 87.2485207 -94.7514793 [29,] 28.2485207 87.2485207 [30,] 77.2485207 28.2485207 [31,] 208.2485207 77.2485207 [32,] -98.7514793 208.2485207 [33,] 274.2485207 -98.7514793 [34,] 515.2485207 274.2485207 [35,] 474.2485207 515.2485207 [36,] 362.2485207 474.2485207 [37,] 50.2485207 362.2485207 [38,] 117.2485207 50.2485207 [39,] -148.7514793 117.2485207 [40,] 258.2485207 -148.7514793 [41,] 135.2485207 258.2485207 [42,] 247.2485207 135.2485207 [43,] -28.7514793 247.2485207 [44,] 60.2485207 -28.7514793 [45,] 258.2485207 60.2485207 [46,] 679.2485207 258.2485207 [47,] 936.2485207 679.2485207 [48,] 379.2485207 936.2485207 [49,] 245.2485207 379.2485207 [50,] -40.7514793 245.2485207 [51,] 223.2485207 -40.7514793 [52,] 285.2485207 223.2485207 [53,] 95.2485207 285.2485207 [54,] 294.2485207 95.2485207 [55,] 194.2485207 294.2485207 [56,] 366.2485207 194.2485207 [57,] 362.2485207 366.2485207 [58,] 400.2485207 362.2485207 [59,] 432.2485207 400.2485207 [60,] -109.7514793 432.2485207 [61,] -214.7514793 -109.7514793 [62,] -169.7514793 -214.7514793 [63,] -335.7514793 -169.7514793 [64,] 13.2485207 -335.7514793 [65,] 80.2485207 13.2485207 [66,] 61.2485207 80.2485207 [67,] 169.2485207 61.2485207 [68,] 286.2485207 169.2485207 [69,] 359.2485207 286.2485207 [70,] 374.2485207 359.2485207 [71,] 333.2485207 374.2485207 [72,] -140.7514793 333.2485207 [73,] -361.7514793 -140.7514793 [74,] -65.7514793 -361.7514793 [75,] -335.7514793 -65.7514793 [76,] -198.7514793 -335.7514793 [77,] -296.7514793 -198.7514793 [78,] -275.7514793 -296.7514793 [79,] -174.7514793 -275.7514793 [80,] -61.7514793 -174.7514793 [81,] -156.7514793 -61.7514793 [82,] 187.2485207 -156.7514793 [83,] 481.2485207 187.2485207 [84,] -244.7514793 481.2485207 [85,] -62.7514793 -244.7514793 [86,] -310.7514793 -62.7514793 [87,] -322.7514793 -310.7514793 [88,] -187.7514793 -322.7514793 [89,] -408.7514793 -187.7514793 [90,] -191.7514793 -408.7514793 [91,] -390.7514793 -191.7514793 [92,] -90.7514793 -390.7514793 [93,] 30.2485207 -90.7514793 [94,] 240.2485207 30.2485207 [95,] 556.2485207 240.2485207 [96,] -69.7514793 556.2485207 [97,] -316.7514793 -69.7514793 [98,] -306.7514793 -316.7514793 [99,] -314.7514793 -306.7514793 [100,] -323.7514793 -314.7514793 [101,] -197.7514793 -323.7514793 [102,] -189.7514793 -197.7514793 [103,] -74.7514793 -189.7514793 [104,] -202.7514793 -74.7514793 [105,] -32.7514793 -202.7514793 [106,] 282.2485207 -32.7514793 [107,] 497.2485207 282.2485207 [108,] 238.2485207 497.2485207 [109,] -255.7514793 238.2485207 [110,] -154.7514793 -255.7514793 [111,] -258.7514793 -154.7514793 [112,] -271.7514793 -258.7514793 [113,] -95.7514793 -271.7514793 [114,] -60.7514793 -95.7514793 [115,] -79.7514793 -60.7514793 [116,] -74.7514793 -79.7514793 [117,] -34.7514793 -74.7514793 [118,] 332.2485207 -34.7514793 [119,] 544.2485207 332.2485207 [120,] 95.2485207 544.2485207 [121,] -272.7514793 95.2485207 [122,] 44.2485207 -272.7514793 [123,] -256.7514793 44.2485207 [124,] -161.7514793 -256.7514793 [125,] -286.7514793 -161.7514793 [126,] -290.7514793 -286.7514793 [127,] -163.7514793 -290.7514793 [128,] -72.7514793 -163.7514793 [129,] -64.7514793 -72.7514793 [130,] 298.2485207 -64.7514793 [131,] 489.2485207 298.2485207 [132,] -52.7514793 489.2485207 [133,] -356.7514793 -52.7514793 [134,] -211.7514793 -356.7514793 [135,] -357.7514793 -211.7514793 [136,] -264.7514793 -357.7514793 [137,] -195.7514793 -264.7514793 [138,] -257.7514793 -195.7514793 [139,] -165.7514793 -257.7514793 [140,] -169.7514793 -165.7514793 [141,] 109.2485207 -169.7514793 [142,] 19.2485207 109.2485207 [143,] 223.2485207 19.2485207 [144,] -243.7514793 223.2485207 [145,] -259.7514793 -243.7514793 [146,] -175.7514793 -259.7514793 [147,] -313.7514793 -175.7514793 [148,] -195.7514793 -313.7514793 [149,] -332.7514793 -195.7514793 [150,] -76.7514793 -332.7514793 [151,] -207.7514793 -76.7514793 [152,] -36.7514793 -207.7514793 [153,] 220.2485207 -36.7514793 [154,] 150.2485207 220.2485207 [155,] 8.2485207 150.2485207 [156,] -261.7514793 8.2485207 [157,] -272.7514793 -261.7514793 [158,] -261.7514793 -272.7514793 [159,] -352.7514793 -261.7514793 [160,] -230.7514793 -352.7514793 [161,] -159.7514793 -230.7514793 [162,] -229.7514793 -159.7514793 [163,] -33.7514793 -229.7514793 [164,] -123.7514793 -33.7514793 [165,] 132.2485207 -123.7514793 [166,] 280.2485207 132.2485207 [167,] 361.2485207 280.2485207 [168,] -223.7514793 361.2485207 [169,] -264.6956522 -223.7514793 [170,] -103.6956522 -264.6956522 [171,] -153.6956522 -103.6956522 [172,] -85.6956522 -153.6956522 [173,] -245.6956522 -85.6956522 [174,] -147.6956522 -245.6956522 [175,] -182.6956522 -147.6956522 [176,] 105.3043478 -182.6956522 [177,] 165.3043478 105.3043478 [178,] 161.3043478 165.3043478 [179,] 191.3043478 161.3043478 [180,] 35.3043478 191.3043478 [181,] -156.6956522 35.3043478 [182,] -39.6956522 -156.6956522 [183,] -211.6956522 -39.6956522 [184,] -24.6956522 -211.6956522 [185,] -136.6956522 -24.6956522 [186,] -99.6956522 -136.6956522 [187,] -37.6956522 -99.6956522 [188,] 122.3043478 -37.6956522 [189,] 253.3043478 122.3043478 [190,] 415.3043478 253.3043478 [191,] 441.3043478 415.3043478 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -209.7514793 -30.7514793 2 -210.7514793 -209.7514793 3 -332.7514793 -210.7514793 4 -85.7514793 -332.7514793 5 -206.7514793 -85.7514793 6 -158.7514793 -206.7514793 7 -87.7514793 -158.7514793 8 -138.7514793 -87.7514793 9 -64.7514793 -138.7514793 10 434.2485207 -64.7514793 11 430.2485207 434.2485207 12 34.2485207 430.2485207 13 47.2485207 34.2485207 14 -0.7514793 47.2485207 15 -159.7514793 -0.7514793 16 -142.7514793 -159.7514793 17 -197.7514793 -142.7514793 18 87.2485207 -197.7514793 19 82.2485207 87.2485207 20 1.2485207 82.2485207 21 290.2485207 1.2485207 22 524.2485207 290.2485207 23 760.2485207 524.2485207 24 312.2485207 760.2485207 25 -62.7514793 312.2485207 26 -24.7514793 -62.7514793 27 -94.7514793 -24.7514793 28 87.2485207 -94.7514793 29 28.2485207 87.2485207 30 77.2485207 28.2485207 31 208.2485207 77.2485207 32 -98.7514793 208.2485207 33 274.2485207 -98.7514793 34 515.2485207 274.2485207 35 474.2485207 515.2485207 36 362.2485207 474.2485207 37 50.2485207 362.2485207 38 117.2485207 50.2485207 39 -148.7514793 117.2485207 40 258.2485207 -148.7514793 41 135.2485207 258.2485207 42 247.2485207 135.2485207 43 -28.7514793 247.2485207 44 60.2485207 -28.7514793 45 258.2485207 60.2485207 46 679.2485207 258.2485207 47 936.2485207 679.2485207 48 379.2485207 936.2485207 49 245.2485207 379.2485207 50 -40.7514793 245.2485207 51 223.2485207 -40.7514793 52 285.2485207 223.2485207 53 95.2485207 285.2485207 54 294.2485207 95.2485207 55 194.2485207 294.2485207 56 366.2485207 194.2485207 57 362.2485207 366.2485207 58 400.2485207 362.2485207 59 432.2485207 400.2485207 60 -109.7514793 432.2485207 61 -214.7514793 -109.7514793 62 -169.7514793 -214.7514793 63 -335.7514793 -169.7514793 64 13.2485207 -335.7514793 65 80.2485207 13.2485207 66 61.2485207 80.2485207 67 169.2485207 61.2485207 68 286.2485207 169.2485207 69 359.2485207 286.2485207 70 374.2485207 359.2485207 71 333.2485207 374.2485207 72 -140.7514793 333.2485207 73 -361.7514793 -140.7514793 74 -65.7514793 -361.7514793 75 -335.7514793 -65.7514793 76 -198.7514793 -335.7514793 77 -296.7514793 -198.7514793 78 -275.7514793 -296.7514793 79 -174.7514793 -275.7514793 80 -61.7514793 -174.7514793 81 -156.7514793 -61.7514793 82 187.2485207 -156.7514793 83 481.2485207 187.2485207 84 -244.7514793 481.2485207 85 -62.7514793 -244.7514793 86 -310.7514793 -62.7514793 87 -322.7514793 -310.7514793 88 -187.7514793 -322.7514793 89 -408.7514793 -187.7514793 90 -191.7514793 -408.7514793 91 -390.7514793 -191.7514793 92 -90.7514793 -390.7514793 93 30.2485207 -90.7514793 94 240.2485207 30.2485207 95 556.2485207 240.2485207 96 -69.7514793 556.2485207 97 -316.7514793 -69.7514793 98 -306.7514793 -316.7514793 99 -314.7514793 -306.7514793 100 -323.7514793 -314.7514793 101 -197.7514793 -323.7514793 102 -189.7514793 -197.7514793 103 -74.7514793 -189.7514793 104 -202.7514793 -74.7514793 105 -32.7514793 -202.7514793 106 282.2485207 -32.7514793 107 497.2485207 282.2485207 108 238.2485207 497.2485207 109 -255.7514793 238.2485207 110 -154.7514793 -255.7514793 111 -258.7514793 -154.7514793 112 -271.7514793 -258.7514793 113 -95.7514793 -271.7514793 114 -60.7514793 -95.7514793 115 -79.7514793 -60.7514793 116 -74.7514793 -79.7514793 117 -34.7514793 -74.7514793 118 332.2485207 -34.7514793 119 544.2485207 332.2485207 120 95.2485207 544.2485207 121 -272.7514793 95.2485207 122 44.2485207 -272.7514793 123 -256.7514793 44.2485207 124 -161.7514793 -256.7514793 125 -286.7514793 -161.7514793 126 -290.7514793 -286.7514793 127 -163.7514793 -290.7514793 128 -72.7514793 -163.7514793 129 -64.7514793 -72.7514793 130 298.2485207 -64.7514793 131 489.2485207 298.2485207 132 -52.7514793 489.2485207 133 -356.7514793 -52.7514793 134 -211.7514793 -356.7514793 135 -357.7514793 -211.7514793 136 -264.7514793 -357.7514793 137 -195.7514793 -264.7514793 138 -257.7514793 -195.7514793 139 -165.7514793 -257.7514793 140 -169.7514793 -165.7514793 141 109.2485207 -169.7514793 142 19.2485207 109.2485207 143 223.2485207 19.2485207 144 -243.7514793 223.2485207 145 -259.7514793 -243.7514793 146 -175.7514793 -259.7514793 147 -313.7514793 -175.7514793 148 -195.7514793 -313.7514793 149 -332.7514793 -195.7514793 150 -76.7514793 -332.7514793 151 -207.7514793 -76.7514793 152 -36.7514793 -207.7514793 153 220.2485207 -36.7514793 154 150.2485207 220.2485207 155 8.2485207 150.2485207 156 -261.7514793 8.2485207 157 -272.7514793 -261.7514793 158 -261.7514793 -272.7514793 159 -352.7514793 -261.7514793 160 -230.7514793 -352.7514793 161 -159.7514793 -230.7514793 162 -229.7514793 -159.7514793 163 -33.7514793 -229.7514793 164 -123.7514793 -33.7514793 165 132.2485207 -123.7514793 166 280.2485207 132.2485207 167 361.2485207 280.2485207 168 -223.7514793 361.2485207 169 -264.6956522 -223.7514793 170 -103.6956522 -264.6956522 171 -153.6956522 -103.6956522 172 -85.6956522 -153.6956522 173 -245.6956522 -85.6956522 174 -147.6956522 -245.6956522 175 -182.6956522 -147.6956522 176 105.3043478 -182.6956522 177 165.3043478 105.3043478 178 161.3043478 165.3043478 179 191.3043478 161.3043478 180 35.3043478 191.3043478 181 -156.6956522 35.3043478 182 -39.6956522 -156.6956522 183 -211.6956522 -39.6956522 184 -24.6956522 -211.6956522 185 -136.6956522 -24.6956522 186 -99.6956522 -136.6956522 187 -37.6956522 -99.6956522 188 122.3043478 -37.6956522 189 253.3043478 122.3043478 190 415.3043478 253.3043478 191 441.3043478 415.3043478 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7g0sb1258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8b1gd1258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/98oyk1258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10q83o1258722864.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/1195vo1258722864.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/1263du1258722864.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/13kxc31258722864.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/14txau1258722864.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/15u4l11258722864.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/16lft61258722864.tab") + } > > system("convert tmp/1g2oy1258722864.ps tmp/1g2oy1258722864.png") > system("convert tmp/21s5w1258722864.ps tmp/21s5w1258722864.png") > system("convert tmp/3bksp1258722864.ps tmp/3bksp1258722864.png") > system("convert tmp/40yy41258722864.ps tmp/40yy41258722864.png") > system("convert tmp/58azj1258722864.ps tmp/58azj1258722864.png") > system("convert tmp/6k8u81258722864.ps tmp/6k8u81258722864.png") > system("convert tmp/7g0sb1258722864.ps tmp/7g0sb1258722864.png") > system("convert tmp/8b1gd1258722864.ps tmp/8b1gd1258722864.png") > system("convert tmp/98oyk1258722864.ps tmp/98oyk1258722864.png") > system("convert tmp/10q83o1258722864.ps tmp/10q83o1258722864.png") > > > proc.time() user system elapsed 4.375 1.702 4.787