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 = 'Include Monthly 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 1687 0 1 0 0 0 0 0 0 0 0 0 0 2 1508 0 0 1 0 0 0 0 0 0 0 0 0 3 1507 0 0 0 1 0 0 0 0 0 0 0 0 4 1385 0 0 0 0 1 0 0 0 0 0 0 0 5 1632 0 0 0 0 0 1 0 0 0 0 0 0 6 1511 0 0 0 0 0 0 1 0 0 0 0 0 7 1559 0 0 0 0 0 0 0 1 0 0 0 0 8 1630 0 0 0 0 0 0 0 0 1 0 0 0 9 1579 0 0 0 0 0 0 0 0 0 1 0 0 10 1653 0 0 0 0 0 0 0 0 0 0 1 0 11 2152 0 0 0 0 0 0 0 0 0 0 0 1 12 2148 0 0 0 0 0 0 0 0 0 0 0 0 13 1752 0 1 0 0 0 0 0 0 0 0 0 0 14 1765 0 0 1 0 0 0 0 0 0 0 0 0 15 1717 0 0 0 1 0 0 0 0 0 0 0 0 16 1558 0 0 0 0 1 0 0 0 0 0 0 0 17 1575 0 0 0 0 0 1 0 0 0 0 0 0 18 1520 0 0 0 0 0 0 1 0 0 0 0 0 19 1805 0 0 0 0 0 0 0 1 0 0 0 0 20 1800 0 0 0 0 0 0 0 0 1 0 0 0 21 1719 0 0 0 0 0 0 0 0 0 1 0 0 22 2008 0 0 0 0 0 0 0 0 0 0 1 0 23 2242 0 0 0 0 0 0 0 0 0 0 0 1 24 2478 0 0 0 0 0 0 0 0 0 0 0 0 25 2030 0 1 0 0 0 0 0 0 0 0 0 0 26 1655 0 0 1 0 0 0 0 0 0 0 0 0 27 1693 0 0 0 1 0 0 0 0 0 0 0 0 28 1623 0 0 0 0 1 0 0 0 0 0 0 0 29 1805 0 0 0 0 0 1 0 0 0 0 0 0 30 1746 0 0 0 0 0 0 1 0 0 0 0 0 31 1795 0 0 0 0 0 0 0 1 0 0 0 0 32 1926 0 0 0 0 0 0 0 0 1 0 0 0 33 1619 0 0 0 0 0 0 0 0 0 1 0 0 34 1992 0 0 0 0 0 0 0 0 0 0 1 0 35 2233 0 0 0 0 0 0 0 0 0 0 0 1 36 2192 0 0 0 0 0 0 0 0 0 0 0 0 37 2080 0 1 0 0 0 0 0 0 0 0 0 0 38 1768 0 0 1 0 0 0 0 0 0 0 0 0 39 1835 0 0 0 1 0 0 0 0 0 0 0 0 40 1569 0 0 0 0 1 0 0 0 0 0 0 0 41 1976 0 0 0 0 0 1 0 0 0 0 0 0 42 1853 0 0 0 0 0 0 1 0 0 0 0 0 43 1965 0 0 0 0 0 0 0 1 0 0 0 0 44 1689 0 0 0 0 0 0 0 0 1 0 0 0 45 1778 0 0 0 0 0 0 0 0 0 1 0 0 46 1976 0 0 0 0 0 0 0 0 0 0 1 0 47 2397 0 0 0 0 0 0 0 0 0 0 0 1 48 2654 0 0 0 0 0 0 0 0 0 0 0 0 49 2097 0 1 0 0 0 0 0 0 0 0 0 0 50 1963 0 0 1 0 0 0 0 0 0 0 0 0 51 1677 0 0 0 1 0 0 0 0 0 0 0 0 52 1941 0 0 0 0 1 0 0 0 0 0 0 0 53 2003 0 0 0 0 0 1 0 0 0 0 0 0 54 1813 0 0 0 0 0 0 1 0 0 0 0 0 55 2012 0 0 0 0 0 0 0 1 0 0 0 0 56 1912 0 0 0 0 0 0 0 0 1 0 0 0 57 2084 0 0 0 0 0 0 0 0 0 1 0 0 58 2080 0 0 0 0 0 0 0 0 0 0 1 0 59 2118 0 0 0 0 0 0 0 0 0 0 0 1 60 2150 0 0 0 0 0 0 0 0 0 0 0 0 61 1608 0 1 0 0 0 0 0 0 0 0 0 0 62 1503 0 0 1 0 0 0 0 0 0 0 0 0 63 1548 0 0 0 1 0 0 0 0 0 0 0 0 64 1382 0 0 0 0 1 0 0 0 0 0 0 0 65 1731 0 0 0 0 0 1 0 0 0 0 0 0 66 1798 0 0 0 0 0 0 1 0 0 0 0 0 67 1779 0 0 0 0 0 0 0 1 0 0 0 0 68 1887 0 0 0 0 0 0 0 0 1 0 0 0 69 2004 0 0 0 0 0 0 0 0 0 1 0 0 70 2077 0 0 0 0 0 0 0 0 0 0 1 0 71 2092 0 0 0 0 0 0 0 0 0 0 0 1 72 2051 0 0 0 0 0 0 0 0 0 0 0 0 73 1577 0 1 0 0 0 0 0 0 0 0 0 0 74 1356 0 0 1 0 0 0 0 0 0 0 0 0 75 1652 0 0 0 1 0 0 0 0 0 0 0 0 76 1382 0 0 0 0 1 0 0 0 0 0 0 0 77 1519 0 0 0 0 0 1 0 0 0 0 0 0 78 1421 0 0 0 0 0 0 1 0 0 0 0 0 79 1442 0 0 0 0 0 0 0 1 0 0 0 0 80 1543 0 0 0 0 0 0 0 0 1 0 0 0 81 1656 0 0 0 0 0 0 0 0 0 1 0 0 82 1561 0 0 0 0 0 0 0 0 0 0 1 0 83 1905 0 0 0 0 0 0 0 0 0 0 0 1 84 2199 0 0 0 0 0 0 0 0 0 0 0 0 85 1473 0 1 0 0 0 0 0 0 0 0 0 0 86 1655 0 0 1 0 0 0 0 0 0 0 0 0 87 1407 0 0 0 1 0 0 0 0 0 0 0 0 88 1395 0 0 0 0 1 0 0 0 0 0 0 0 89 1530 0 0 0 0 0 1 0 0 0 0 0 0 90 1309 0 0 0 0 0 0 1 0 0 0 0 0 91 1526 0 0 0 0 0 0 0 1 0 0 0 0 92 1327 0 0 0 0 0 0 0 0 1 0 0 0 93 1627 0 0 0 0 0 0 0 0 0 1 0 0 94 1748 0 0 0 0 0 0 0 0 0 0 1 0 95 1958 0 0 0 0 0 0 0 0 0 0 0 1 96 2274 0 0 0 0 0 0 0 0 0 0 0 0 97 1648 0 1 0 0 0 0 0 0 0 0 0 0 98 1401 0 0 1 0 0 0 0 0 0 0 0 0 99 1411 0 0 0 1 0 0 0 0 0 0 0 0 100 1403 0 0 0 0 1 0 0 0 0 0 0 0 101 1394 0 0 0 0 0 1 0 0 0 0 0 0 102 1520 0 0 0 0 0 0 1 0 0 0 0 0 103 1528 0 0 0 0 0 0 0 1 0 0 0 0 104 1643 0 0 0 0 0 0 0 0 1 0 0 0 105 1515 0 0 0 0 0 0 0 0 0 1 0 0 106 1685 0 0 0 0 0 0 0 0 0 0 1 0 107 2000 0 0 0 0 0 0 0 0 0 0 0 1 108 2215 0 0 0 0 0 0 0 0 0 0 0 0 109 1956 0 1 0 0 0 0 0 0 0 0 0 0 110 1462 0 0 1 0 0 0 0 0 0 0 0 0 111 1563 0 0 0 1 0 0 0 0 0 0 0 0 112 1459 0 0 0 0 1 0 0 0 0 0 0 0 113 1446 0 0 0 0 0 1 0 0 0 0 0 0 114 1622 0 0 0 0 0 0 1 0 0 0 0 0 115 1657 0 0 0 0 0 0 0 1 0 0 0 0 116 1638 0 0 0 0 0 0 0 0 1 0 0 0 117 1643 0 0 0 0 0 0 0 0 0 1 0 0 118 1683 0 0 0 0 0 0 0 0 0 0 1 0 119 2050 0 0 0 0 0 0 0 0 0 0 0 1 120 2262 0 0 0 0 0 0 0 0 0 0 0 0 121 1813 0 1 0 0 0 0 0 0 0 0 0 0 122 1445 0 0 1 0 0 0 0 0 0 0 0 0 123 1762 0 0 0 1 0 0 0 0 0 0 0 0 124 1461 0 0 0 0 1 0 0 0 0 0 0 0 125 1556 0 0 0 0 0 1 0 0 0 0 0 0 126 1431 0 0 0 0 0 0 1 0 0 0 0 0 127 1427 0 0 0 0 0 0 0 1 0 0 0 0 128 1554 0 0 0 0 0 0 0 0 1 0 0 0 129 1645 0 0 0 0 0 0 0 0 0 1 0 0 130 1653 0 0 0 0 0 0 0 0 0 0 1 0 131 2016 0 0 0 0 0 0 0 0 0 0 0 1 132 2207 0 0 0 0 0 0 0 0 0 0 0 0 133 1665 0 1 0 0 0 0 0 0 0 0 0 0 134 1361 0 0 1 0 0 0 0 0 0 0 0 0 135 1506 0 0 0 1 0 0 0 0 0 0 0 0 136 1360 0 0 0 0 1 0 0 0 0 0 0 0 137 1453 0 0 0 0 0 1 0 0 0 0 0 0 138 1522 0 0 0 0 0 0 1 0 0 0 0 0 139 1460 0 0 0 0 0 0 0 1 0 0 0 0 140 1552 0 0 0 0 0 0 0 0 1 0 0 0 141 1548 0 0 0 0 0 0 0 0 0 1 0 0 142 1827 0 0 0 0 0 0 0 0 0 0 1 0 143 1737 0 0 0 0 0 0 0 0 0 0 0 1 144 1941 0 0 0 0 0 0 0 0 0 0 0 0 145 1474 0 1 0 0 0 0 0 0 0 0 0 0 146 1458 0 0 1 0 0 0 0 0 0 0 0 0 147 1542 0 0 0 1 0 0 0 0 0 0 0 0 148 1404 0 0 0 0 1 0 0 0 0 0 0 0 149 1522 0 0 0 0 0 1 0 0 0 0 0 0 150 1385 0 0 0 0 0 0 1 0 0 0 0 0 151 1641 0 0 0 0 0 0 0 1 0 0 0 0 152 1510 0 0 0 0 0 0 0 0 1 0 0 0 153 1681 0 0 0 0 0 0 0 0 0 1 0 0 154 1938 0 0 0 0 0 0 0 0 0 0 1 0 155 1868 0 0 0 0 0 0 0 0 0 0 0 1 156 1726 0 0 0 0 0 0 0 0 0 0 0 0 157 1456 0 1 0 0 0 0 0 0 0 0 0 0 158 1445 0 0 1 0 0 0 0 0 0 0 0 0 159 1456 0 0 0 1 0 0 0 0 0 0 0 0 160 1365 0 0 0 0 1 0 0 0 0 0 0 0 161 1487 0 0 0 0 0 1 0 0 0 0 0 0 162 1558 0 0 0 0 0 0 1 0 0 0 0 0 163 1488 0 0 0 0 0 0 0 1 0 0 0 0 164 1684 0 0 0 0 0 0 0 0 1 0 0 0 165 1594 0 0 0 0 0 0 0 0 0 1 0 0 166 1850 0 0 0 0 0 0 0 0 0 0 1 0 167 1998 0 0 0 0 0 0 0 0 0 0 0 1 168 2079 0 0 0 0 0 0 0 0 0 0 0 0 169 1494 0 1 0 0 0 0 0 0 0 0 0 0 170 1057 1 0 1 0 0 0 0 0 0 0 0 0 171 1218 1 0 0 1 0 0 0 0 0 0 0 0 172 1168 1 0 0 0 1 0 0 0 0 0 0 0 173 1236 1 0 0 0 0 1 0 0 0 0 0 0 174 1076 1 0 0 0 0 0 1 0 0 0 0 0 175 1174 1 0 0 0 0 0 0 1 0 0 0 0 176 1139 1 0 0 0 0 0 0 0 1 0 0 0 177 1427 1 0 0 0 0 0 0 0 0 1 0 0 178 1487 1 0 0 0 0 0 0 0 0 0 1 0 179 1483 1 0 0 0 0 0 0 0 0 0 0 1 180 1513 1 0 0 0 0 0 0 0 0 0 0 0 181 1357 1 1 0 0 0 0 0 0 0 0 0 0 182 1165 1 0 1 0 0 0 0 0 0 0 0 0 183 1282 1 0 0 1 0 0 0 0 0 0 0 0 184 1110 1 0 0 0 1 0 0 0 0 0 0 0 185 1297 1 0 0 0 0 1 0 0 0 0 0 0 186 1185 1 0 0 0 0 0 1 0 0 0 0 0 187 1222 1 0 0 0 0 0 0 1 0 0 0 0 188 1284 1 0 0 0 0 0 0 0 1 0 0 0 189 1444 1 0 0 0 0 0 0 0 0 1 0 0 190 1575 1 0 0 0 0 0 0 0 0 0 1 0 191 1737 1 0 0 0 0 0 0 0 0 0 0 1 192 1763 1 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 2165.2 -395.8 -442.6 -617.8 -567.2 -680.4 M5 M6 M7 M8 M9 M10 -543.1 -598.9 -523.3 -508.4 -455.6 -316.2 M11 -116.6 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -439.23 -113.88 -27.76 98.43 488.77 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2165.23 43.63 49.625 < 2e-16 *** X -395.81 38.61 -10.253 < 2e-16 *** M1 -442.55 61.37 -7.211 1.51e-11 *** M2 -617.81 61.33 -10.074 < 2e-16 *** M3 -567.25 61.33 -9.250 < 2e-16 *** M4 -680.44 61.33 -11.095 < 2e-16 *** M5 -543.13 61.33 -8.856 8.00e-16 *** M6 -598.87 61.33 -9.765 < 2e-16 *** M7 -523.25 61.33 -8.532 5.95e-15 *** M8 -508.38 61.33 -8.290 2.62e-14 *** M9 -455.56 61.33 -7.429 4.33e-12 *** M10 -316.19 61.33 -5.156 6.64e-07 *** M11 -116.63 61.33 -1.902 0.0588 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 173.5 on 179 degrees of freedom Multiple R-squared: 0.6638, Adjusted R-squared: 0.6413 F-statistic: 29.45 on 12 and 179 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.47741239 9.548248e-01 5.225876e-01 [2,] 0.31778306 6.355661e-01 6.822169e-01 [3,] 0.19188503 3.837701e-01 8.081150e-01 [4,] 0.21949644 4.389929e-01 7.805036e-01 [5,] 0.18287133 3.657427e-01 8.171287e-01 [6,] 0.13885064 2.777013e-01 8.611494e-01 [7,] 0.24706682 4.941336e-01 7.529332e-01 [8,] 0.18657308 3.731462e-01 8.134269e-01 [9,] 0.26817432 5.363486e-01 7.318257e-01 [10,] 0.37531735 7.506347e-01 6.246827e-01 [11,] 0.29847123 5.969425e-01 7.015288e-01 [12,] 0.23992527 4.798505e-01 7.600747e-01 [13,] 0.21304504 4.260901e-01 7.869550e-01 [14,] 0.21376887 4.275377e-01 7.862311e-01 [15,] 0.22977523 4.595505e-01 7.702248e-01 [16,] 0.19477154 3.895431e-01 8.052285e-01 [17,] 0.20776511 4.155302e-01 7.922349e-01 [18,] 0.16215652 3.243130e-01 8.378435e-01 [19,] 0.14811643 2.962329e-01 8.518836e-01 [20,] 0.11783130 2.356626e-01 8.821687e-01 [21,] 0.09738212 1.947642e-01 9.026179e-01 [22,] 0.14140096 2.828019e-01 8.585990e-01 [23,] 0.12978229 2.595646e-01 8.702177e-01 [24,] 0.13977283 2.795457e-01 8.602272e-01 [25,] 0.11058541 2.211708e-01 8.894146e-01 [26,] 0.18412472 3.682494e-01 8.158753e-01 [27,] 0.23489933 4.697987e-01 7.651007e-01 [28,] 0.29165015 5.833003e-01 7.083499e-01 [29,] 0.25525438 5.105088e-01 7.447456e-01 [30,] 0.23193398 4.638680e-01 7.680660e-01 [31,] 0.20390963 4.078193e-01 7.960904e-01 [32,] 0.24314771 4.862954e-01 7.568523e-01 [33,] 0.47388776 9.477755e-01 5.261122e-01 [34,] 0.56919853 8.616029e-01 4.308015e-01 [35,] 0.72641888 5.471622e-01 2.735811e-01 [36,] 0.68839676 6.232065e-01 3.116032e-01 [37,] 0.88824239 2.235152e-01 1.117576e-01 [38,] 0.94487746 1.102451e-01 5.512254e-02 [39,] 0.95465457 9.069086e-02 4.534543e-02 [40,] 0.98111521 3.776959e-02 1.888479e-02 [41,] 0.98651396 2.697207e-02 1.348604e-02 [42,] 0.99784800 4.304002e-03 2.152001e-03 [43,] 0.99856289 2.874213e-03 1.437106e-03 [44,] 0.99850029 2.999419e-03 1.499709e-03 [45,] 0.99854322 2.913559e-03 1.456780e-03 [46,] 0.99907173 1.856538e-03 9.282688e-04 [47,] 0.99911510 1.769792e-03 8.848961e-04 [48,] 0.99887191 2.256189e-03 1.128095e-03 [49,] 0.99891035 2.179308e-03 1.089654e-03 [50,] 0.99893062 2.138754e-03 1.069377e-03 [51,] 0.99939751 1.204988e-03 6.024940e-04 [52,] 0.99950476 9.904806e-04 4.952403e-04 [53,] 0.99976071 4.785728e-04 2.392864e-04 [54,] 0.99994846 1.030889e-04 5.154444e-05 [55,] 0.99997998 4.004880e-05 2.002440e-05 [56,] 0.99998031 3.938805e-05 1.969402e-05 [57,] 0.99998395 3.209181e-05 1.604590e-05 [58,] 0.99998878 2.244154e-05 1.122077e-05 [59,] 0.99999410 1.180842e-05 5.904212e-06 [60,] 0.99999214 1.572156e-05 7.860778e-06 [61,] 0.99999076 1.848517e-05 9.242585e-06 [62,] 0.99999171 1.658808e-05 8.294040e-06 [63,] 0.99999320 1.360741e-05 6.803704e-06 [64,] 0.99999671 6.582016e-06 3.291008e-06 [65,] 0.99999678 6.434503e-06 3.217251e-06 [66,] 0.99999538 9.241981e-06 4.620990e-06 [67,] 0.99999891 2.170476e-06 1.085238e-06 [68,] 0.99999906 1.889264e-06 9.446319e-07 [69,] 0.99999883 2.340760e-06 1.170380e-06 [70,] 0.99999951 9.725548e-07 4.862774e-07 [71,] 0.99999965 6.921906e-07 3.460953e-07 [72,] 0.99999972 5.554639e-07 2.777320e-07 [73,] 0.99999959 8.276925e-07 4.138463e-07 [74,] 0.99999948 1.031699e-06 5.158494e-07 [75,] 0.99999978 4.341386e-07 2.170693e-07 [76,] 0.99999973 5.317610e-07 2.658805e-07 [77,] 0.99999996 8.132188e-08 4.066094e-08 [78,] 0.99999993 1.302404e-07 6.512019e-08 [79,] 0.99999990 1.979434e-07 9.897170e-08 [80,] 0.99999986 2.775578e-07 1.387789e-07 [81,] 0.99999991 1.718401e-07 8.592003e-08 [82,] 0.99999986 2.797564e-07 1.398782e-07 [83,] 0.99999983 3.499577e-07 1.749788e-07 [84,] 0.99999985 3.060981e-07 1.530491e-07 [85,] 0.99999975 5.056908e-07 2.528454e-07 [86,] 0.99999981 3.748334e-07 1.874167e-07 [87,] 0.99999969 6.296961e-07 3.148481e-07 [88,] 0.99999955 9.022465e-07 4.511233e-07 [89,] 0.99999929 1.415548e-06 7.077740e-07 [90,] 0.99999936 1.270947e-06 6.354733e-07 [91,] 0.99999930 1.405501e-06 7.027503e-07 [92,] 0.99999896 2.082544e-06 1.041272e-06 [93,] 0.99999915 1.695707e-06 8.478537e-07 [94,] 0.99999992 1.602973e-07 8.014864e-08 [95,] 0.99999987 2.578258e-07 1.289129e-07 [96,] 0.99999976 4.787881e-07 2.393941e-07 [97,] 0.99999958 8.320678e-07 4.160339e-07 [98,] 0.99999949 1.010353e-06 5.051766e-07 [99,] 0.99999948 1.039465e-06 5.197324e-07 [100,] 0.99999945 1.095198e-06 5.475992e-07 [101,] 0.99999916 1.674251e-06 8.371256e-07 [102,] 0.99999853 2.938252e-06 1.469126e-06 [103,] 0.99999849 3.014493e-06 1.507246e-06 [104,] 0.99999832 3.354157e-06 1.677079e-06 [105,] 0.99999962 7.642658e-07 3.821329e-07 [106,] 0.99999989 2.132533e-07 1.066267e-07 [107,] 0.99999982 3.627772e-07 1.813886e-07 [108,] 0.99999995 1.012869e-07 5.064345e-08 [109,] 0.99999991 1.758676e-07 8.793382e-08 [110,] 0.99999984 3.154519e-07 1.577259e-07 [111,] 0.99999973 5.337449e-07 2.668724e-07 [112,] 0.99999969 6.215975e-07 3.107987e-07 [113,] 0.99999944 1.122448e-06 5.612242e-07 [114,] 0.99999894 2.128644e-06 1.064322e-06 [115,] 0.99999943 1.144548e-06 5.722738e-07 [116,] 0.99999939 1.218006e-06 6.090030e-07 [117,] 0.99999994 1.285110e-07 6.425551e-08 [118,] 0.99999995 1.086202e-07 5.431012e-08 [119,] 0.99999992 1.688809e-07 8.444044e-08 [120,] 0.99999983 3.453907e-07 1.726954e-07 [121,] 0.99999968 6.377744e-07 3.188872e-07 [122,] 0.99999952 9.673572e-07 4.836786e-07 [123,] 0.99999922 1.563660e-06 7.818302e-07 [124,] 0.99999879 2.429792e-06 1.214896e-06 [125,] 0.99999765 4.708264e-06 2.354132e-06 [126,] 0.99999751 4.975224e-06 2.487612e-06 [127,] 0.99999506 9.877835e-06 4.938918e-06 [128,] 0.99999774 4.524341e-06 2.262171e-06 [129,] 0.99999647 7.061571e-06 3.530785e-06 [130,] 0.99999486 1.027521e-05 5.137605e-06 [131,] 0.99999027 1.945645e-05 9.728226e-06 [132,] 0.99998095 3.810912e-05 1.905456e-05 [133,] 0.99996251 7.497375e-05 3.748687e-05 [134,] 0.99992843 1.431343e-04 7.156713e-05 [135,] 0.99989400 2.119945e-04 1.059973e-04 [136,] 0.99989402 2.119584e-04 1.059792e-04 [137,] 0.99981724 3.655169e-04 1.827585e-04 [138,] 0.99964997 7.000595e-04 3.500297e-04 [139,] 0.99953118 9.376331e-04 4.688166e-04 [140,] 0.99925210 1.495796e-03 7.478982e-04 [141,] 0.99984849 3.030268e-04 1.515134e-04 [142,] 0.99982177 3.564521e-04 1.782261e-04 [143,] 0.99964666 7.066722e-04 3.533361e-04 [144,] 0.99947225 1.055507e-03 5.277534e-04 [145,] 0.99916194 1.676116e-03 8.380581e-04 [146,] 0.99879443 2.411139e-03 1.205569e-03 [147,] 0.99813242 3.735163e-03 1.867581e-03 [148,] 0.99654132 6.917365e-03 3.458682e-03 [149,] 0.99643064 7.138715e-03 3.569358e-03 [150,] 0.99630291 7.394174e-03 3.697087e-03 [151,] 0.99262482 1.475036e-02 7.375179e-03 [152,] 0.98694900 2.610199e-02 1.305100e-02 [153,] 0.99091472 1.817056e-02 9.085279e-03 [154,] 0.98227105 3.545791e-02 1.772895e-02 [155,] 0.97187716 5.624568e-02 2.812284e-02 [156,] 0.94975516 1.004897e-01 5.024484e-02 [157,] 0.91220104 1.755979e-01 8.779896e-02 [158,] 0.85246186 2.950763e-01 1.475381e-01 [159,] 0.78235732 4.352854e-01 2.176427e-01 [160,] 0.65694282 6.861144e-01 3.430572e-01 [161,] 0.55007285 8.998543e-01 4.499271e-01 > postscript(file="/var/www/html/rcomp/tmp/1kxun1259073904.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/2021m1259073904.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/3xxbu1259073904.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/4k4uq1259073904.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/5a50h1259073904.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 -35.6756966 -39.4138932 -90.9763932 -99.7888932 9.8986068 -55.3513932 7 8 9 10 11 12 -82.9763932 -26.8513932 -130.6638932 -196.0388932 103.3986068 -17.2263932 13 14 15 16 17 18 29.3243034 217.5861068 119.0236068 73.2111068 -47.1013932 -46.3513932 19 20 21 22 23 24 163.0236068 143.1486068 9.3361068 158.9611068 193.3986068 312.7736068 25 26 27 28 29 30 307.3243034 107.5861068 95.0236068 138.2111068 182.8986068 179.6486068 31 32 33 34 35 36 153.0236068 269.1486068 -90.6638932 142.9611068 184.3986068 26.7736068 37 38 39 40 41 42 357.3243034 220.5861068 237.0236068 84.2111068 353.8986068 286.6486068 43 44 45 46 47 48 323.0236068 32.1486068 68.3361068 126.9611068 348.3986068 488.7736068 49 50 51 52 53 54 374.3243034 415.5861068 79.0236068 456.2111068 380.8986068 246.6486068 55 56 57 58 59 60 370.0236068 255.1486068 374.3361068 230.9611068 69.3986068 -15.2263932 61 62 63 64 65 66 -114.6756966 -44.4138932 -49.9763932 -102.7888932 108.8986068 231.6486068 67 68 69 70 71 72 137.0236068 230.1486068 294.3361068 227.9611068 43.3986068 -114.2263932 73 74 75 76 77 78 -145.6756966 -191.4138932 54.0236068 -102.7888932 -103.1013932 -145.3513932 79 80 81 82 83 84 -199.9763932 -113.8513932 -53.6638932 -288.0388932 -143.6013932 33.7736068 85 86 87 88 89 90 -249.6756966 107.5861068 -190.9763932 -89.7888932 -92.1013932 -257.3513932 91 92 93 94 95 96 -115.9763932 -329.8513932 -82.6638932 -101.0388932 -90.6013932 108.7736068 97 98 99 100 101 102 -74.6756966 -146.4138932 -186.9763932 -81.7888932 -228.1013932 -46.3513932 103 104 105 106 107 108 -113.9763932 -13.8513932 -194.6638932 -164.0388932 -48.6013932 49.7736068 109 110 111 112 113 114 233.3243034 -85.4138932 -34.9763932 -25.7888932 -176.1013932 55.6486068 115 116 117 118 119 120 15.0236068 -18.8513932 -66.6638932 -166.0388932 1.3986068 96.7736068 121 122 123 124 125 126 90.3243034 -102.4138932 164.0236068 -23.7888932 -66.1013932 -135.3513932 127 128 129 130 131 132 -214.9763932 -102.8513932 -64.6638932 -196.0388932 -32.6013932 41.7736068 133 134 135 136 137 138 -57.6756966 -186.4138932 -91.9763932 -124.7888932 -169.1013932 -44.3513932 139 140 141 142 143 144 -181.9763932 -104.8513932 -161.6638932 -22.0388932 -311.6013932 -224.2263932 145 146 147 148 149 150 -248.6756966 -89.4138932 -55.9763932 -80.7888932 -100.1013932 -181.3513932 151 152 153 154 155 156 -0.9763932 -146.8513932 -28.6638932 88.9611068 -180.6013932 -439.2263932 157 158 159 160 161 162 -266.6756966 -102.4138932 -141.9763932 -119.7888932 -135.1013932 -8.3513932 163 164 165 166 167 168 -153.9763932 27.1486068 -115.6638932 0.9611068 -50.6013932 -86.2263932 169 170 171 172 173 174 -228.6756966 -94.6027477 15.8347523 79.0222523 9.7097523 -94.5402477 175 176 177 178 179 180 -72.1652477 -122.0402477 113.1472523 33.7722523 -169.7902477 -256.4152477 181 182 183 184 185 186 30.1354489 13.3972523 79.8347523 21.0222523 70.7097523 14.4597523 187 188 189 190 191 192 -24.1652477 22.9597523 130.1472523 121.7722523 84.2097523 -6.4152477 > postscript(file="/var/www/html/rcomp/tmp/6rwhx1259073904.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 -35.6756966 NA 1 -39.4138932 -35.6756966 2 -90.9763932 -39.4138932 3 -99.7888932 -90.9763932 4 9.8986068 -99.7888932 5 -55.3513932 9.8986068 6 -82.9763932 -55.3513932 7 -26.8513932 -82.9763932 8 -130.6638932 -26.8513932 9 -196.0388932 -130.6638932 10 103.3986068 -196.0388932 11 -17.2263932 103.3986068 12 29.3243034 -17.2263932 13 217.5861068 29.3243034 14 119.0236068 217.5861068 15 73.2111068 119.0236068 16 -47.1013932 73.2111068 17 -46.3513932 -47.1013932 18 163.0236068 -46.3513932 19 143.1486068 163.0236068 20 9.3361068 143.1486068 21 158.9611068 9.3361068 22 193.3986068 158.9611068 23 312.7736068 193.3986068 24 307.3243034 312.7736068 25 107.5861068 307.3243034 26 95.0236068 107.5861068 27 138.2111068 95.0236068 28 182.8986068 138.2111068 29 179.6486068 182.8986068 30 153.0236068 179.6486068 31 269.1486068 153.0236068 32 -90.6638932 269.1486068 33 142.9611068 -90.6638932 34 184.3986068 142.9611068 35 26.7736068 184.3986068 36 357.3243034 26.7736068 37 220.5861068 357.3243034 38 237.0236068 220.5861068 39 84.2111068 237.0236068 40 353.8986068 84.2111068 41 286.6486068 353.8986068 42 323.0236068 286.6486068 43 32.1486068 323.0236068 44 68.3361068 32.1486068 45 126.9611068 68.3361068 46 348.3986068 126.9611068 47 488.7736068 348.3986068 48 374.3243034 488.7736068 49 415.5861068 374.3243034 50 79.0236068 415.5861068 51 456.2111068 79.0236068 52 380.8986068 456.2111068 53 246.6486068 380.8986068 54 370.0236068 246.6486068 55 255.1486068 370.0236068 56 374.3361068 255.1486068 57 230.9611068 374.3361068 58 69.3986068 230.9611068 59 -15.2263932 69.3986068 60 -114.6756966 -15.2263932 61 -44.4138932 -114.6756966 62 -49.9763932 -44.4138932 63 -102.7888932 -49.9763932 64 108.8986068 -102.7888932 65 231.6486068 108.8986068 66 137.0236068 231.6486068 67 230.1486068 137.0236068 68 294.3361068 230.1486068 69 227.9611068 294.3361068 70 43.3986068 227.9611068 71 -114.2263932 43.3986068 72 -145.6756966 -114.2263932 73 -191.4138932 -145.6756966 74 54.0236068 -191.4138932 75 -102.7888932 54.0236068 76 -103.1013932 -102.7888932 77 -145.3513932 -103.1013932 78 -199.9763932 -145.3513932 79 -113.8513932 -199.9763932 80 -53.6638932 -113.8513932 81 -288.0388932 -53.6638932 82 -143.6013932 -288.0388932 83 33.7736068 -143.6013932 84 -249.6756966 33.7736068 85 107.5861068 -249.6756966 86 -190.9763932 107.5861068 87 -89.7888932 -190.9763932 88 -92.1013932 -89.7888932 89 -257.3513932 -92.1013932 90 -115.9763932 -257.3513932 91 -329.8513932 -115.9763932 92 -82.6638932 -329.8513932 93 -101.0388932 -82.6638932 94 -90.6013932 -101.0388932 95 108.7736068 -90.6013932 96 -74.6756966 108.7736068 97 -146.4138932 -74.6756966 98 -186.9763932 -146.4138932 99 -81.7888932 -186.9763932 100 -228.1013932 -81.7888932 101 -46.3513932 -228.1013932 102 -113.9763932 -46.3513932 103 -13.8513932 -113.9763932 104 -194.6638932 -13.8513932 105 -164.0388932 -194.6638932 106 -48.6013932 -164.0388932 107 49.7736068 -48.6013932 108 233.3243034 49.7736068 109 -85.4138932 233.3243034 110 -34.9763932 -85.4138932 111 -25.7888932 -34.9763932 112 -176.1013932 -25.7888932 113 55.6486068 -176.1013932 114 15.0236068 55.6486068 115 -18.8513932 15.0236068 116 -66.6638932 -18.8513932 117 -166.0388932 -66.6638932 118 1.3986068 -166.0388932 119 96.7736068 1.3986068 120 90.3243034 96.7736068 121 -102.4138932 90.3243034 122 164.0236068 -102.4138932 123 -23.7888932 164.0236068 124 -66.1013932 -23.7888932 125 -135.3513932 -66.1013932 126 -214.9763932 -135.3513932 127 -102.8513932 -214.9763932 128 -64.6638932 -102.8513932 129 -196.0388932 -64.6638932 130 -32.6013932 -196.0388932 131 41.7736068 -32.6013932 132 -57.6756966 41.7736068 133 -186.4138932 -57.6756966 134 -91.9763932 -186.4138932 135 -124.7888932 -91.9763932 136 -169.1013932 -124.7888932 137 -44.3513932 -169.1013932 138 -181.9763932 -44.3513932 139 -104.8513932 -181.9763932 140 -161.6638932 -104.8513932 141 -22.0388932 -161.6638932 142 -311.6013932 -22.0388932 143 -224.2263932 -311.6013932 144 -248.6756966 -224.2263932 145 -89.4138932 -248.6756966 146 -55.9763932 -89.4138932 147 -80.7888932 -55.9763932 148 -100.1013932 -80.7888932 149 -181.3513932 -100.1013932 150 -0.9763932 -181.3513932 151 -146.8513932 -0.9763932 152 -28.6638932 -146.8513932 153 88.9611068 -28.6638932 154 -180.6013932 88.9611068 155 -439.2263932 -180.6013932 156 -266.6756966 -439.2263932 157 -102.4138932 -266.6756966 158 -141.9763932 -102.4138932 159 -119.7888932 -141.9763932 160 -135.1013932 -119.7888932 161 -8.3513932 -135.1013932 162 -153.9763932 -8.3513932 163 27.1486068 -153.9763932 164 -115.6638932 27.1486068 165 0.9611068 -115.6638932 166 -50.6013932 0.9611068 167 -86.2263932 -50.6013932 168 -228.6756966 -86.2263932 169 -94.6027477 -228.6756966 170 15.8347523 -94.6027477 171 79.0222523 15.8347523 172 9.7097523 79.0222523 173 -94.5402477 9.7097523 174 -72.1652477 -94.5402477 175 -122.0402477 -72.1652477 176 113.1472523 -122.0402477 177 33.7722523 113.1472523 178 -169.7902477 33.7722523 179 -256.4152477 -169.7902477 180 30.1354489 -256.4152477 181 13.3972523 30.1354489 182 79.8347523 13.3972523 183 21.0222523 79.8347523 184 70.7097523 21.0222523 185 14.4597523 70.7097523 186 -24.1652477 14.4597523 187 22.9597523 -24.1652477 188 130.1472523 22.9597523 189 121.7722523 130.1472523 190 84.2097523 121.7722523 191 -6.4152477 84.2097523 192 NA -6.4152477 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -39.4138932 -35.6756966 [2,] -90.9763932 -39.4138932 [3,] -99.7888932 -90.9763932 [4,] 9.8986068 -99.7888932 [5,] -55.3513932 9.8986068 [6,] -82.9763932 -55.3513932 [7,] -26.8513932 -82.9763932 [8,] -130.6638932 -26.8513932 [9,] -196.0388932 -130.6638932 [10,] 103.3986068 -196.0388932 [11,] -17.2263932 103.3986068 [12,] 29.3243034 -17.2263932 [13,] 217.5861068 29.3243034 [14,] 119.0236068 217.5861068 [15,] 73.2111068 119.0236068 [16,] -47.1013932 73.2111068 [17,] -46.3513932 -47.1013932 [18,] 163.0236068 -46.3513932 [19,] 143.1486068 163.0236068 [20,] 9.3361068 143.1486068 [21,] 158.9611068 9.3361068 [22,] 193.3986068 158.9611068 [23,] 312.7736068 193.3986068 [24,] 307.3243034 312.7736068 [25,] 107.5861068 307.3243034 [26,] 95.0236068 107.5861068 [27,] 138.2111068 95.0236068 [28,] 182.8986068 138.2111068 [29,] 179.6486068 182.8986068 [30,] 153.0236068 179.6486068 [31,] 269.1486068 153.0236068 [32,] -90.6638932 269.1486068 [33,] 142.9611068 -90.6638932 [34,] 184.3986068 142.9611068 [35,] 26.7736068 184.3986068 [36,] 357.3243034 26.7736068 [37,] 220.5861068 357.3243034 [38,] 237.0236068 220.5861068 [39,] 84.2111068 237.0236068 [40,] 353.8986068 84.2111068 [41,] 286.6486068 353.8986068 [42,] 323.0236068 286.6486068 [43,] 32.1486068 323.0236068 [44,] 68.3361068 32.1486068 [45,] 126.9611068 68.3361068 [46,] 348.3986068 126.9611068 [47,] 488.7736068 348.3986068 [48,] 374.3243034 488.7736068 [49,] 415.5861068 374.3243034 [50,] 79.0236068 415.5861068 [51,] 456.2111068 79.0236068 [52,] 380.8986068 456.2111068 [53,] 246.6486068 380.8986068 [54,] 370.0236068 246.6486068 [55,] 255.1486068 370.0236068 [56,] 374.3361068 255.1486068 [57,] 230.9611068 374.3361068 [58,] 69.3986068 230.9611068 [59,] -15.2263932 69.3986068 [60,] -114.6756966 -15.2263932 [61,] -44.4138932 -114.6756966 [62,] -49.9763932 -44.4138932 [63,] -102.7888932 -49.9763932 [64,] 108.8986068 -102.7888932 [65,] 231.6486068 108.8986068 [66,] 137.0236068 231.6486068 [67,] 230.1486068 137.0236068 [68,] 294.3361068 230.1486068 [69,] 227.9611068 294.3361068 [70,] 43.3986068 227.9611068 [71,] -114.2263932 43.3986068 [72,] -145.6756966 -114.2263932 [73,] -191.4138932 -145.6756966 [74,] 54.0236068 -191.4138932 [75,] -102.7888932 54.0236068 [76,] -103.1013932 -102.7888932 [77,] -145.3513932 -103.1013932 [78,] -199.9763932 -145.3513932 [79,] -113.8513932 -199.9763932 [80,] -53.6638932 -113.8513932 [81,] -288.0388932 -53.6638932 [82,] -143.6013932 -288.0388932 [83,] 33.7736068 -143.6013932 [84,] -249.6756966 33.7736068 [85,] 107.5861068 -249.6756966 [86,] -190.9763932 107.5861068 [87,] -89.7888932 -190.9763932 [88,] -92.1013932 -89.7888932 [89,] -257.3513932 -92.1013932 [90,] -115.9763932 -257.3513932 [91,] -329.8513932 -115.9763932 [92,] -82.6638932 -329.8513932 [93,] -101.0388932 -82.6638932 [94,] -90.6013932 -101.0388932 [95,] 108.7736068 -90.6013932 [96,] -74.6756966 108.7736068 [97,] -146.4138932 -74.6756966 [98,] -186.9763932 -146.4138932 [99,] -81.7888932 -186.9763932 [100,] -228.1013932 -81.7888932 [101,] -46.3513932 -228.1013932 [102,] -113.9763932 -46.3513932 [103,] -13.8513932 -113.9763932 [104,] -194.6638932 -13.8513932 [105,] -164.0388932 -194.6638932 [106,] -48.6013932 -164.0388932 [107,] 49.7736068 -48.6013932 [108,] 233.3243034 49.7736068 [109,] -85.4138932 233.3243034 [110,] -34.9763932 -85.4138932 [111,] -25.7888932 -34.9763932 [112,] -176.1013932 -25.7888932 [113,] 55.6486068 -176.1013932 [114,] 15.0236068 55.6486068 [115,] -18.8513932 15.0236068 [116,] -66.6638932 -18.8513932 [117,] -166.0388932 -66.6638932 [118,] 1.3986068 -166.0388932 [119,] 96.7736068 1.3986068 [120,] 90.3243034 96.7736068 [121,] -102.4138932 90.3243034 [122,] 164.0236068 -102.4138932 [123,] -23.7888932 164.0236068 [124,] -66.1013932 -23.7888932 [125,] -135.3513932 -66.1013932 [126,] -214.9763932 -135.3513932 [127,] -102.8513932 -214.9763932 [128,] -64.6638932 -102.8513932 [129,] -196.0388932 -64.6638932 [130,] -32.6013932 -196.0388932 [131,] 41.7736068 -32.6013932 [132,] -57.6756966 41.7736068 [133,] -186.4138932 -57.6756966 [134,] -91.9763932 -186.4138932 [135,] -124.7888932 -91.9763932 [136,] -169.1013932 -124.7888932 [137,] -44.3513932 -169.1013932 [138,] -181.9763932 -44.3513932 [139,] -104.8513932 -181.9763932 [140,] -161.6638932 -104.8513932 [141,] -22.0388932 -161.6638932 [142,] -311.6013932 -22.0388932 [143,] -224.2263932 -311.6013932 [144,] -248.6756966 -224.2263932 [145,] -89.4138932 -248.6756966 [146,] -55.9763932 -89.4138932 [147,] -80.7888932 -55.9763932 [148,] -100.1013932 -80.7888932 [149,] -181.3513932 -100.1013932 [150,] -0.9763932 -181.3513932 [151,] -146.8513932 -0.9763932 [152,] -28.6638932 -146.8513932 [153,] 88.9611068 -28.6638932 [154,] -180.6013932 88.9611068 [155,] -439.2263932 -180.6013932 [156,] -266.6756966 -439.2263932 [157,] -102.4138932 -266.6756966 [158,] -141.9763932 -102.4138932 [159,] -119.7888932 -141.9763932 [160,] -135.1013932 -119.7888932 [161,] -8.3513932 -135.1013932 [162,] -153.9763932 -8.3513932 [163,] 27.1486068 -153.9763932 [164,] -115.6638932 27.1486068 [165,] 0.9611068 -115.6638932 [166,] -50.6013932 0.9611068 [167,] -86.2263932 -50.6013932 [168,] -228.6756966 -86.2263932 [169,] -94.6027477 -228.6756966 [170,] 15.8347523 -94.6027477 [171,] 79.0222523 15.8347523 [172,] 9.7097523 79.0222523 [173,] -94.5402477 9.7097523 [174,] -72.1652477 -94.5402477 [175,] -122.0402477 -72.1652477 [176,] 113.1472523 -122.0402477 [177,] 33.7722523 113.1472523 [178,] -169.7902477 33.7722523 [179,] -256.4152477 -169.7902477 [180,] 30.1354489 -256.4152477 [181,] 13.3972523 30.1354489 [182,] 79.8347523 13.3972523 [183,] 21.0222523 79.8347523 [184,] 70.7097523 21.0222523 [185,] 14.4597523 70.7097523 [186,] -24.1652477 14.4597523 [187,] 22.9597523 -24.1652477 [188,] 130.1472523 22.9597523 [189,] 121.7722523 130.1472523 [190,] 84.2097523 121.7722523 [191,] -6.4152477 84.2097523 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -39.4138932 -35.6756966 2 -90.9763932 -39.4138932 3 -99.7888932 -90.9763932 4 9.8986068 -99.7888932 5 -55.3513932 9.8986068 6 -82.9763932 -55.3513932 7 -26.8513932 -82.9763932 8 -130.6638932 -26.8513932 9 -196.0388932 -130.6638932 10 103.3986068 -196.0388932 11 -17.2263932 103.3986068 12 29.3243034 -17.2263932 13 217.5861068 29.3243034 14 119.0236068 217.5861068 15 73.2111068 119.0236068 16 -47.1013932 73.2111068 17 -46.3513932 -47.1013932 18 163.0236068 -46.3513932 19 143.1486068 163.0236068 20 9.3361068 143.1486068 21 158.9611068 9.3361068 22 193.3986068 158.9611068 23 312.7736068 193.3986068 24 307.3243034 312.7736068 25 107.5861068 307.3243034 26 95.0236068 107.5861068 27 138.2111068 95.0236068 28 182.8986068 138.2111068 29 179.6486068 182.8986068 30 153.0236068 179.6486068 31 269.1486068 153.0236068 32 -90.6638932 269.1486068 33 142.9611068 -90.6638932 34 184.3986068 142.9611068 35 26.7736068 184.3986068 36 357.3243034 26.7736068 37 220.5861068 357.3243034 38 237.0236068 220.5861068 39 84.2111068 237.0236068 40 353.8986068 84.2111068 41 286.6486068 353.8986068 42 323.0236068 286.6486068 43 32.1486068 323.0236068 44 68.3361068 32.1486068 45 126.9611068 68.3361068 46 348.3986068 126.9611068 47 488.7736068 348.3986068 48 374.3243034 488.7736068 49 415.5861068 374.3243034 50 79.0236068 415.5861068 51 456.2111068 79.0236068 52 380.8986068 456.2111068 53 246.6486068 380.8986068 54 370.0236068 246.6486068 55 255.1486068 370.0236068 56 374.3361068 255.1486068 57 230.9611068 374.3361068 58 69.3986068 230.9611068 59 -15.2263932 69.3986068 60 -114.6756966 -15.2263932 61 -44.4138932 -114.6756966 62 -49.9763932 -44.4138932 63 -102.7888932 -49.9763932 64 108.8986068 -102.7888932 65 231.6486068 108.8986068 66 137.0236068 231.6486068 67 230.1486068 137.0236068 68 294.3361068 230.1486068 69 227.9611068 294.3361068 70 43.3986068 227.9611068 71 -114.2263932 43.3986068 72 -145.6756966 -114.2263932 73 -191.4138932 -145.6756966 74 54.0236068 -191.4138932 75 -102.7888932 54.0236068 76 -103.1013932 -102.7888932 77 -145.3513932 -103.1013932 78 -199.9763932 -145.3513932 79 -113.8513932 -199.9763932 80 -53.6638932 -113.8513932 81 -288.0388932 -53.6638932 82 -143.6013932 -288.0388932 83 33.7736068 -143.6013932 84 -249.6756966 33.7736068 85 107.5861068 -249.6756966 86 -190.9763932 107.5861068 87 -89.7888932 -190.9763932 88 -92.1013932 -89.7888932 89 -257.3513932 -92.1013932 90 -115.9763932 -257.3513932 91 -329.8513932 -115.9763932 92 -82.6638932 -329.8513932 93 -101.0388932 -82.6638932 94 -90.6013932 -101.0388932 95 108.7736068 -90.6013932 96 -74.6756966 108.7736068 97 -146.4138932 -74.6756966 98 -186.9763932 -146.4138932 99 -81.7888932 -186.9763932 100 -228.1013932 -81.7888932 101 -46.3513932 -228.1013932 102 -113.9763932 -46.3513932 103 -13.8513932 -113.9763932 104 -194.6638932 -13.8513932 105 -164.0388932 -194.6638932 106 -48.6013932 -164.0388932 107 49.7736068 -48.6013932 108 233.3243034 49.7736068 109 -85.4138932 233.3243034 110 -34.9763932 -85.4138932 111 -25.7888932 -34.9763932 112 -176.1013932 -25.7888932 113 55.6486068 -176.1013932 114 15.0236068 55.6486068 115 -18.8513932 15.0236068 116 -66.6638932 -18.8513932 117 -166.0388932 -66.6638932 118 1.3986068 -166.0388932 119 96.7736068 1.3986068 120 90.3243034 96.7736068 121 -102.4138932 90.3243034 122 164.0236068 -102.4138932 123 -23.7888932 164.0236068 124 -66.1013932 -23.7888932 125 -135.3513932 -66.1013932 126 -214.9763932 -135.3513932 127 -102.8513932 -214.9763932 128 -64.6638932 -102.8513932 129 -196.0388932 -64.6638932 130 -32.6013932 -196.0388932 131 41.7736068 -32.6013932 132 -57.6756966 41.7736068 133 -186.4138932 -57.6756966 134 -91.9763932 -186.4138932 135 -124.7888932 -91.9763932 136 -169.1013932 -124.7888932 137 -44.3513932 -169.1013932 138 -181.9763932 -44.3513932 139 -104.8513932 -181.9763932 140 -161.6638932 -104.8513932 141 -22.0388932 -161.6638932 142 -311.6013932 -22.0388932 143 -224.2263932 -311.6013932 144 -248.6756966 -224.2263932 145 -89.4138932 -248.6756966 146 -55.9763932 -89.4138932 147 -80.7888932 -55.9763932 148 -100.1013932 -80.7888932 149 -181.3513932 -100.1013932 150 -0.9763932 -181.3513932 151 -146.8513932 -0.9763932 152 -28.6638932 -146.8513932 153 88.9611068 -28.6638932 154 -180.6013932 88.9611068 155 -439.2263932 -180.6013932 156 -266.6756966 -439.2263932 157 -102.4138932 -266.6756966 158 -141.9763932 -102.4138932 159 -119.7888932 -141.9763932 160 -135.1013932 -119.7888932 161 -8.3513932 -135.1013932 162 -153.9763932 -8.3513932 163 27.1486068 -153.9763932 164 -115.6638932 27.1486068 165 0.9611068 -115.6638932 166 -50.6013932 0.9611068 167 -86.2263932 -50.6013932 168 -228.6756966 -86.2263932 169 -94.6027477 -228.6756966 170 15.8347523 -94.6027477 171 79.0222523 15.8347523 172 9.7097523 79.0222523 173 -94.5402477 9.7097523 174 -72.1652477 -94.5402477 175 -122.0402477 -72.1652477 176 113.1472523 -122.0402477 177 33.7722523 113.1472523 178 -169.7902477 33.7722523 179 -256.4152477 -169.7902477 180 30.1354489 -256.4152477 181 13.3972523 30.1354489 182 79.8347523 13.3972523 183 21.0222523 79.8347523 184 70.7097523 21.0222523 185 14.4597523 70.7097523 186 -24.1652477 14.4597523 187 22.9597523 -24.1652477 188 130.1472523 22.9597523 189 121.7722523 130.1472523 190 84.2097523 121.7722523 191 -6.4152477 84.2097523 > 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/7675f1259073904.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/8a4v21259073904.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/90q3d1259073904.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/10dwv41259073904.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/11ozg61259073904.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/12rabh1259073904.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/138tw31259073904.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/14wzew1259073904.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/150db91259073904.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/16abbm1259073904.tab") + } > system("convert tmp/1kxun1259073904.ps tmp/1kxun1259073904.png") > system("convert tmp/2021m1259073904.ps tmp/2021m1259073904.png") > system("convert tmp/3xxbu1259073904.ps tmp/3xxbu1259073904.png") > system("convert tmp/4k4uq1259073904.ps tmp/4k4uq1259073904.png") > system("convert tmp/5a50h1259073904.ps tmp/5a50h1259073904.png") > system("convert tmp/6rwhx1259073904.ps tmp/6rwhx1259073904.png") > system("convert tmp/7675f1259073904.ps tmp/7675f1259073904.png") > system("convert tmp/8a4v21259073904.ps tmp/8a4v21259073904.png") > system("convert tmp/90q3d1259073904.ps tmp/90q3d1259073904.png") > system("convert tmp/10dwv41259073904.ps tmp/10dwv41259073904.png") > > > proc.time() user system elapsed 4.785 1.670 6.312