R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(2560 + ,0 + ,2491 + ,0 + ,2380 + ,0 + ,2291 + ,0 + ,2079 + ,0 + ,1929 + ,0 + ,1851 + ,0 + ,1607 + ,0 + ,1661 + ,0 + ,2259 + ,0 + ,1668 + ,0 + ,2011 + ,0 + ,1944 + ,0 + ,1958 + ,0 + ,1844 + ,0 + ,1868 + ,0 + ,1701 + ,0 + ,2338 + ,0 + ,2018 + ,0 + ,1302 + ,0 + ,2168 + ,0 + ,2139 + ,0 + ,1560 + ,0 + ,2093 + ,0 + ,1973 + ,0 + ,2090 + ,0 + ,2811 + ,0 + ,1984 + ,0 + ,1849 + ,0 + ,2433 + ,0 + ,2071 + ,0 + ,1855 + ,0 + ,1756 + ,0 + ,1898 + ,0 + ,1770 + ,0 + ,1969 + ,0 + ,1769 + ,0 + ,2139 + ,0 + ,3013 + ,0 + ,2061 + ,0 + ,2132 + ,0 + ,2973 + ,0 + ,2081 + ,0 + ,2257 + ,0 + ,2075 + ,0 + ,2084 + ,0 + ,1747 + ,0 + ,2092 + ,0 + ,1919 + ,0 + ,2551 + ,0 + ,2643 + ,0 + ,2153 + ,0 + ,2496 + ,0 + ,2645 + ,0 + ,2035 + ,0 + ,2294 + ,0 + ,2205 + ,0 + ,2044 + ,0 + ,1762 + ,0 + ,1897 + ,0 + ,1821 + ,0 + ,1905 + ,0 + ,2111 + ,0 + ,1643 + ,0 + ,1956 + ,0 + ,1977 + ,0 + ,1685 + ,0 + ,1393 + ,0 + ,1574 + ,0 + ,1793 + ,0 + ,1562 + ,0 + ,1510 + ,0 + ,1675 + ,0 + ,1965 + ,0 + ,2173 + ,0 + ,2395 + ,0 + ,2197 + ,0 + ,2257 + ,0 + ,2885 + ,0 + ,1594 + ,0 + ,1950 + ,0 + ,1772 + ,0 + ,1280 + ,0 + ,1724 + ,0 + ,1473 + ,0 + ,1461 + ,0 + ,1576 + ,0 + ,1900 + ,0 + ,1618 + ,0 + ,2303 + ,0 + ,1994 + ,0 + ,1575 + ,0 + ,1893 + ,0 + ,1788 + ,0 + ,1817 + ,0 + ,3233 + ,0 + ,727 + ,1 + ,1121 + ,1 + ,1665 + ,1 + ,1401 + ,1 + ,1415 + ,1 + ,2058 + ,1 + ,1544 + ,1 + ,1379 + ,1 + ,1402 + ,1 + ,1313 + ,1 + ,1296 + ,1 + ,1398 + ,1 + ,1288 + ,1 + ,1563 + ,1 + ,1972 + ,1 + ,1496 + ,1 + ,1481 + ,1 + ,1819 + ,1 + ,1479 + ,1 + ,1635 + ,1 + ,1511 + ,1 + ,1547 + ,1 + ,1388 + ,1 + ,1958 + ,1 + ,1390 + ,1 + ,1597 + ,1 + ,1842 + ,1 + ,1396 + ,1 + ,1671 + ,1 + ,1385 + ,1 + ,1632 + ,1 + ,1313 + ,1 + ,1300 + ,1 + ,1431 + ,1 + ,1398 + ,1 + ,1198 + ,1 + ,1292 + ,1 + ,1434 + ,1 + ,1660 + ,1 + ,1837 + ,1 + ,1455 + ,1 + ,1315 + ,1 + ,1642 + ,1 + ,1069 + ,1 + ,1209 + ,1 + ,1586 + ,1 + ,1122 + ,1 + ,1063 + ,1 + ,1125 + ,1 + ,1414 + ,1 + ,1347 + ,1 + ,1403 + ,1 + ,1299 + ,1 + ,1547 + ,1 + ,1515 + ,1 + ,1247 + ,1 + ,1639 + ,1 + ,1296 + ,1 + ,1063 + ,1 + ,1282 + ,1 + ,1365 + ,1 + ,1268 + ,1 + ,1532 + ,1 + ,1455 + ,1 + ,1393 + ,1 + ,1515 + ,1 + ,1510 + ,1 + ,1225 + ,1 + ,1577 + ,1 + ,1417 + ,1 + ,1224 + ,1 + ,1693 + ,1 + ,1633 + ,1 + ,1639 + ,1 + ,1914 + ,1 + ,1586 + ,1 + ,1552 + ,1 + ,2081 + ,1 + ,1500 + ,1 + ,1437 + ,1 + ,1470 + ,1 + ,1849 + ,1 + ,1387 + ,1 + ,1592 + ,1 + ,1589 + ,1 + ,1798 + ,1 + ,1935 + ,1 + ,1887 + ,1 + ,2027 + ,1 + ,2080 + ,1 + ,1556 + ,1 + ,1682 + ,1 + ,1785 + ,1 + ,1869 + ,1 + ,1781 + ,1 + ,2082 + ,1 + ,2570 + ,1 + ,1862 + ,1 + ,1936 + ,1 + ,1504 + ,1 + ,1765 + ,1 + ,1607 + ,1 + ,1577 + ,1 + ,1493 + ,1 + ,1615 + ,1 + ,1700 + ,1 + ,1335 + ,1 + ,1523 + ,1 + ,1623 + ,1 + ,1540 + ,1 + ,1637 + ,1 + ,1524 + ,1 + ,1419 + ,1 + ,1821 + ,1 + ,1593 + ,1 + ,1357 + ,1 + ,1263 + ,1 + ,1750 + ,1 + ,1405 + ,1 + ,1393 + ,1 + ,1639 + ,1 + ,1679 + ,1 + ,1551 + ,1 + ,1744 + ,1 + ,1429 + ,1 + ,1784 + ,1) + ,dim=c(2 + ,222) + ,dimnames=list(c('y' + ,'x') + ,1:222)) > y <- array(NA,dim=c(2,222),dimnames=list(c('y','x'),1:222)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = '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) > 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 t 1 2560 0 1 0 0 0 0 0 0 0 0 0 0 1 2 2491 0 0 1 0 0 0 0 0 0 0 0 0 2 3 2380 0 0 0 1 0 0 0 0 0 0 0 0 3 4 2291 0 0 0 0 1 0 0 0 0 0 0 0 4 5 2079 0 0 0 0 0 1 0 0 0 0 0 0 5 6 1929 0 0 0 0 0 0 1 0 0 0 0 0 6 7 1851 0 0 0 0 0 0 0 1 0 0 0 0 7 8 1607 0 0 0 0 0 0 0 0 1 0 0 0 8 9 1661 0 0 0 0 0 0 0 0 0 1 0 0 9 10 2259 0 0 0 0 0 0 0 0 0 0 1 0 10 11 1668 0 0 0 0 0 0 0 0 0 0 0 1 11 12 2011 0 0 0 0 0 0 0 0 0 0 0 0 12 13 1944 0 1 0 0 0 0 0 0 0 0 0 0 13 14 1958 0 0 1 0 0 0 0 0 0 0 0 0 14 15 1844 0 0 0 1 0 0 0 0 0 0 0 0 15 16 1868 0 0 0 0 1 0 0 0 0 0 0 0 16 17 1701 0 0 0 0 0 1 0 0 0 0 0 0 17 18 2338 0 0 0 0 0 0 1 0 0 0 0 0 18 19 2018 0 0 0 0 0 0 0 1 0 0 0 0 19 20 1302 0 0 0 0 0 0 0 0 1 0 0 0 20 21 2168 0 0 0 0 0 0 0 0 0 1 0 0 21 22 2139 0 0 0 0 0 0 0 0 0 0 1 0 22 23 1560 0 0 0 0 0 0 0 0 0 0 0 1 23 24 2093 0 0 0 0 0 0 0 0 0 0 0 0 24 25 1973 0 1 0 0 0 0 0 0 0 0 0 0 25 26 2090 0 0 1 0 0 0 0 0 0 0 0 0 26 27 2811 0 0 0 1 0 0 0 0 0 0 0 0 27 28 1984 0 0 0 0 1 0 0 0 0 0 0 0 28 29 1849 0 0 0 0 0 1 0 0 0 0 0 0 29 30 2433 0 0 0 0 0 0 1 0 0 0 0 0 30 31 2071 0 0 0 0 0 0 0 1 0 0 0 0 31 32 1855 0 0 0 0 0 0 0 0 1 0 0 0 32 33 1756 0 0 0 0 0 0 0 0 0 1 0 0 33 34 1898 0 0 0 0 0 0 0 0 0 0 1 0 34 35 1770 0 0 0 0 0 0 0 0 0 0 0 1 35 36 1969 0 0 0 0 0 0 0 0 0 0 0 0 36 37 1769 0 1 0 0 0 0 0 0 0 0 0 0 37 38 2139 0 0 1 0 0 0 0 0 0 0 0 0 38 39 3013 0 0 0 1 0 0 0 0 0 0 0 0 39 40 2061 0 0 0 0 1 0 0 0 0 0 0 0 40 41 2132 0 0 0 0 0 1 0 0 0 0 0 0 41 42 2973 0 0 0 0 0 0 1 0 0 0 0 0 42 43 2081 0 0 0 0 0 0 0 1 0 0 0 0 43 44 2257 0 0 0 0 0 0 0 0 1 0 0 0 44 45 2075 0 0 0 0 0 0 0 0 0 1 0 0 45 46 2084 0 0 0 0 0 0 0 0 0 0 1 0 46 47 1747 0 0 0 0 0 0 0 0 0 0 0 1 47 48 2092 0 0 0 0 0 0 0 0 0 0 0 0 48 49 1919 0 1 0 0 0 0 0 0 0 0 0 0 49 50 2551 0 0 1 0 0 0 0 0 0 0 0 0 50 51 2643 0 0 0 1 0 0 0 0 0 0 0 0 51 52 2153 0 0 0 0 1 0 0 0 0 0 0 0 52 53 2496 0 0 0 0 0 1 0 0 0 0 0 0 53 54 2645 0 0 0 0 0 0 1 0 0 0 0 0 54 55 2035 0 0 0 0 0 0 0 1 0 0 0 0 55 56 2294 0 0 0 0 0 0 0 0 1 0 0 0 56 57 2205 0 0 0 0 0 0 0 0 0 1 0 0 57 58 2044 0 0 0 0 0 0 0 0 0 0 1 0 58 59 1762 0 0 0 0 0 0 0 0 0 0 0 1 59 60 1897 0 0 0 0 0 0 0 0 0 0 0 0 60 61 1821 0 1 0 0 0 0 0 0 0 0 0 0 61 62 1905 0 0 1 0 0 0 0 0 0 0 0 0 62 63 2111 0 0 0 1 0 0 0 0 0 0 0 0 63 64 1643 0 0 0 0 1 0 0 0 0 0 0 0 64 65 1956 0 0 0 0 0 1 0 0 0 0 0 0 65 66 1977 0 0 0 0 0 0 1 0 0 0 0 0 66 67 1685 0 0 0 0 0 0 0 1 0 0 0 0 67 68 1393 0 0 0 0 0 0 0 0 1 0 0 0 68 69 1574 0 0 0 0 0 0 0 0 0 1 0 0 69 70 1793 0 0 0 0 0 0 0 0 0 0 1 0 70 71 1562 0 0 0 0 0 0 0 0 0 0 0 1 71 72 1510 0 0 0 0 0 0 0 0 0 0 0 0 72 73 1675 0 1 0 0 0 0 0 0 0 0 0 0 73 74 1965 0 0 1 0 0 0 0 0 0 0 0 0 74 75 2173 0 0 0 1 0 0 0 0 0 0 0 0 75 76 2395 0 0 0 0 1 0 0 0 0 0 0 0 76 77 2197 0 0 0 0 0 1 0 0 0 0 0 0 77 78 2257 0 0 0 0 0 0 1 0 0 0 0 0 78 79 2885 0 0 0 0 0 0 0 1 0 0 0 0 79 80 1594 0 0 0 0 0 0 0 0 1 0 0 0 80 81 1950 0 0 0 0 0 0 0 0 0 1 0 0 81 82 1772 0 0 0 0 0 0 0 0 0 0 1 0 82 83 1280 0 0 0 0 0 0 0 0 0 0 0 1 83 84 1724 0 0 0 0 0 0 0 0 0 0 0 0 84 85 1473 0 1 0 0 0 0 0 0 0 0 0 0 85 86 1461 0 0 1 0 0 0 0 0 0 0 0 0 86 87 1576 0 0 0 1 0 0 0 0 0 0 0 0 87 88 1900 0 0 0 0 1 0 0 0 0 0 0 0 88 89 1618 0 0 0 0 0 1 0 0 0 0 0 0 89 90 2303 0 0 0 0 0 0 1 0 0 0 0 0 90 91 1994 0 0 0 0 0 0 0 1 0 0 0 0 91 92 1575 0 0 0 0 0 0 0 0 1 0 0 0 92 93 1893 0 0 0 0 0 0 0 0 0 1 0 0 93 94 1788 0 0 0 0 0 0 0 0 0 0 1 0 94 95 1817 0 0 0 0 0 0 0 0 0 0 0 1 95 96 3233 0 0 0 0 0 0 0 0 0 0 0 0 96 97 727 1 1 0 0 0 0 0 0 0 0 0 0 97 98 1121 1 0 1 0 0 0 0 0 0 0 0 0 98 99 1665 1 0 0 1 0 0 0 0 0 0 0 0 99 100 1401 1 0 0 0 1 0 0 0 0 0 0 0 100 101 1415 1 0 0 0 0 1 0 0 0 0 0 0 101 102 2058 1 0 0 0 0 0 1 0 0 0 0 0 102 103 1544 1 0 0 0 0 0 0 1 0 0 0 0 103 104 1379 1 0 0 0 0 0 0 0 1 0 0 0 104 105 1402 1 0 0 0 0 0 0 0 0 1 0 0 105 106 1313 1 0 0 0 0 0 0 0 0 0 1 0 106 107 1296 1 0 0 0 0 0 0 0 0 0 0 1 107 108 1398 1 0 0 0 0 0 0 0 0 0 0 0 108 109 1288 1 1 0 0 0 0 0 0 0 0 0 0 109 110 1563 1 0 1 0 0 0 0 0 0 0 0 0 110 111 1972 1 0 0 1 0 0 0 0 0 0 0 0 111 112 1496 1 0 0 0 1 0 0 0 0 0 0 0 112 113 1481 1 0 0 0 0 1 0 0 0 0 0 0 113 114 1819 1 0 0 0 0 0 1 0 0 0 0 0 114 115 1479 1 0 0 0 0 0 0 1 0 0 0 0 115 116 1635 1 0 0 0 0 0 0 0 1 0 0 0 116 117 1511 1 0 0 0 0 0 0 0 0 1 0 0 117 118 1547 1 0 0 0 0 0 0 0 0 0 1 0 118 119 1388 1 0 0 0 0 0 0 0 0 0 0 1 119 120 1958 1 0 0 0 0 0 0 0 0 0 0 0 120 121 1390 1 1 0 0 0 0 0 0 0 0 0 0 121 122 1597 1 0 1 0 0 0 0 0 0 0 0 0 122 123 1842 1 0 0 1 0 0 0 0 0 0 0 0 123 124 1396 1 0 0 0 1 0 0 0 0 0 0 0 124 125 1671 1 0 0 0 0 1 0 0 0 0 0 0 125 126 1385 1 0 0 0 0 0 1 0 0 0 0 0 126 127 1632 1 0 0 0 0 0 0 1 0 0 0 0 127 128 1313 1 0 0 0 0 0 0 0 1 0 0 0 128 129 1300 1 0 0 0 0 0 0 0 0 1 0 0 129 130 1431 1 0 0 0 0 0 0 0 0 0 1 0 130 131 1398 1 0 0 0 0 0 0 0 0 0 0 1 131 132 1198 1 0 0 0 0 0 0 0 0 0 0 0 132 133 1292 1 1 0 0 0 0 0 0 0 0 0 0 133 134 1434 1 0 1 0 0 0 0 0 0 0 0 0 134 135 1660 1 0 0 1 0 0 0 0 0 0 0 0 135 136 1837 1 0 0 0 1 0 0 0 0 0 0 0 136 137 1455 1 0 0 0 0 1 0 0 0 0 0 0 137 138 1315 1 0 0 0 0 0 1 0 0 0 0 0 138 139 1642 1 0 0 0 0 0 0 1 0 0 0 0 139 140 1069 1 0 0 0 0 0 0 0 1 0 0 0 140 141 1209 1 0 0 0 0 0 0 0 0 1 0 0 141 142 1586 1 0 0 0 0 0 0 0 0 0 1 0 142 143 1122 1 0 0 0 0 0 0 0 0 0 0 1 143 144 1063 1 0 0 0 0 0 0 0 0 0 0 0 144 145 1125 1 1 0 0 0 0 0 0 0 0 0 0 145 146 1414 1 0 1 0 0 0 0 0 0 0 0 0 146 147 1347 1 0 0 1 0 0 0 0 0 0 0 0 147 148 1403 1 0 0 0 1 0 0 0 0 0 0 0 148 149 1299 1 0 0 0 0 1 0 0 0 0 0 0 149 150 1547 1 0 0 0 0 0 1 0 0 0 0 0 150 151 1515 1 0 0 0 0 0 0 1 0 0 0 0 151 152 1247 1 0 0 0 0 0 0 0 1 0 0 0 152 153 1639 1 0 0 0 0 0 0 0 0 1 0 0 153 154 1296 1 0 0 0 0 0 0 0 0 0 1 0 154 155 1063 1 0 0 0 0 0 0 0 0 0 0 1 155 156 1282 1 0 0 0 0 0 0 0 0 0 0 0 156 157 1365 1 1 0 0 0 0 0 0 0 0 0 0 157 158 1268 1 0 1 0 0 0 0 0 0 0 0 0 158 159 1532 1 0 0 1 0 0 0 0 0 0 0 0 159 160 1455 1 0 0 0 1 0 0 0 0 0 0 0 160 161 1393 1 0 0 0 0 1 0 0 0 0 0 0 161 162 1515 1 0 0 0 0 0 1 0 0 0 0 0 162 163 1510 1 0 0 0 0 0 0 1 0 0 0 0 163 164 1225 1 0 0 0 0 0 0 0 1 0 0 0 164 165 1577 1 0 0 0 0 0 0 0 0 1 0 0 165 166 1417 1 0 0 0 0 0 0 0 0 0 1 0 166 167 1224 1 0 0 0 0 0 0 0 0 0 0 1 167 168 1693 1 0 0 0 0 0 0 0 0 0 0 0 168 169 1633 1 1 0 0 0 0 0 0 0 0 0 0 169 170 1639 1 0 1 0 0 0 0 0 0 0 0 0 170 171 1914 1 0 0 1 0 0 0 0 0 0 0 0 171 172 1586 1 0 0 0 1 0 0 0 0 0 0 0 172 173 1552 1 0 0 0 0 1 0 0 0 0 0 0 173 174 2081 1 0 0 0 0 0 1 0 0 0 0 0 174 175 1500 1 0 0 0 0 0 0 1 0 0 0 0 175 176 1437 1 0 0 0 0 0 0 0 1 0 0 0 176 177 1470 1 0 0 0 0 0 0 0 0 1 0 0 177 178 1849 1 0 0 0 0 0 0 0 0 0 1 0 178 179 1387 1 0 0 0 0 0 0 0 0 0 0 1 179 180 1592 1 0 0 0 0 0 0 0 0 0 0 0 180 181 1589 1 1 0 0 0 0 0 0 0 0 0 0 181 182 1798 1 0 1 0 0 0 0 0 0 0 0 0 182 183 1935 1 0 0 1 0 0 0 0 0 0 0 0 183 184 1887 1 0 0 0 1 0 0 0 0 0 0 0 184 185 2027 1 0 0 0 0 1 0 0 0 0 0 0 185 186 2080 1 0 0 0 0 0 1 0 0 0 0 0 186 187 1556 1 0 0 0 0 0 0 1 0 0 0 0 187 188 1682 1 0 0 0 0 0 0 0 1 0 0 0 188 189 1785 1 0 0 0 0 0 0 0 0 1 0 0 189 190 1869 1 0 0 0 0 0 0 0 0 0 1 0 190 191 1781 1 0 0 0 0 0 0 0 0 0 0 1 191 192 2082 1 0 0 0 0 0 0 0 0 0 0 0 192 193 2570 1 1 0 0 0 0 0 0 0 0 0 0 193 194 1862 1 0 1 0 0 0 0 0 0 0 0 0 194 195 1936 1 0 0 1 0 0 0 0 0 0 0 0 195 196 1504 1 0 0 0 1 0 0 0 0 0 0 0 196 197 1765 1 0 0 0 0 1 0 0 0 0 0 0 197 198 1607 1 0 0 0 0 0 1 0 0 0 0 0 198 199 1577 1 0 0 0 0 0 0 1 0 0 0 0 199 200 1493 1 0 0 0 0 0 0 0 1 0 0 0 200 201 1615 1 0 0 0 0 0 0 0 0 1 0 0 201 202 1700 1 0 0 0 0 0 0 0 0 0 1 0 202 203 1335 1 0 0 0 0 0 0 0 0 0 0 1 203 204 1523 1 0 0 0 0 0 0 0 0 0 0 0 204 205 1623 1 1 0 0 0 0 0 0 0 0 0 0 205 206 1540 1 0 1 0 0 0 0 0 0 0 0 0 206 207 1637 1 0 0 1 0 0 0 0 0 0 0 0 207 208 1524 1 0 0 0 1 0 0 0 0 0 0 0 208 209 1419 1 0 0 0 0 1 0 0 0 0 0 0 209 210 1821 1 0 0 0 0 0 1 0 0 0 0 0 210 211 1593 1 0 0 0 0 0 0 1 0 0 0 0 211 212 1357 1 0 0 0 0 0 0 0 1 0 0 0 212 213 1263 1 0 0 0 0 0 0 0 0 1 0 0 213 214 1750 1 0 0 0 0 0 0 0 0 0 1 0 214 215 1405 1 0 0 0 0 0 0 0 0 0 0 1 215 216 1393 1 0 0 0 0 0 0 0 0 0 0 0 216 217 1639 1 1 0 0 0 0 0 0 0 0 0 0 217 218 1679 1 0 1 0 0 0 0 0 0 0 0 0 218 219 1551 1 0 0 1 0 0 0 0 0 0 0 0 219 220 1744 1 0 0 0 1 0 0 0 0 0 0 0 220 221 1429 1 0 0 0 0 1 0 0 0 0 0 0 221 222 1784 1 0 0 0 0 0 1 0 0 0 0 0 222 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) x M1 M2 M3 M4 1975.7334 -576.1089 -92.2789 17.3171 230.4395 18.2461 M5 M6 M7 M8 M9 M10 -13.9473 244.7540 30.0402 -218.3345 -89.3203 -7.9173 M11 t -284.9586 0.9303 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -711.11 -152.45 -20.12 123.77 1167.96 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1975.7334 76.0872 25.967 < 2e-16 *** x -576.1089 74.6283 -7.720 4.82e-13 *** M1 -92.2789 92.9582 -0.993 0.32201 M2 17.3171 92.9328 0.186 0.85236 M3 230.4395 92.9110 2.480 0.01392 * M4 18.2461 92.8927 0.196 0.84447 M5 -13.9473 92.8780 -0.150 0.88078 M6 244.7540 92.8669 2.636 0.00903 ** M7 30.0402 94.1411 0.319 0.74997 M8 -218.3345 94.1252 -2.320 0.02133 * M9 -89.3203 94.1128 -0.949 0.34368 M10 -7.9173 94.1039 -0.084 0.93303 M11 -284.9586 94.0986 -3.028 0.00277 ** t 0.9303 0.5770 1.612 0.10840 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 282.3 on 208 degrees of freedom Multiple R-squared: 0.5055, Adjusted R-squared: 0.4746 F-statistic: 16.35 on 13 and 208 DF, p-value: < 2.2e-16 > postscript(file="/var/www/html/rcomp/tmp/11zh41229007052.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/2gkgs1229007052.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/3jj8p1229007052.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/4eond1229007052.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/5s6i91229007052.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 222 Frequency = 1 1 2 3 4 5 6 675.615304 496.088988 171.036356 293.299514 112.562672 -297.068907 7 8 9 10 11 12 -161.285332 -157.840887 -233.785332 281.881335 -33.007554 24.103557 13 14 15 16 17 18 48.452215 -48.074101 -376.126732 -140.863574 -276.600416 100.768005 19 20 21 22 23 24 -5.448420 -474.003976 262.051580 150.718246 -152.170642 94.940469 25 26 27 28 29 30 66.289127 72.762811 579.710179 -36.026663 -139.763505 184.604916 31 32 33 34 35 36 36.388491 67.832936 -161.111509 -101.444842 46.666269 -40.222620 37 38 39 40 41 42 -148.873962 110.599723 770.547091 29.810249 132.073407 713.441828 43 44 45 46 47 48 35.225403 458.669847 146.725403 73.392070 12.503181 71.614292 49 50 51 52 53 54 -10.037050 511.436634 389.384003 110.647160 484.910318 374.278739 55 56 57 58 59 60 -21.937686 484.506759 265.562314 22.228981 16.340092 -134.548797 61 62 63 64 65 66 -119.200139 -145.726454 -153.779086 -410.515928 -66.252770 -304.884349 67 68 69 70 71 72 -383.100774 -427.656330 -376.600774 -239.934107 -194.822996 -532.711885 73 74 75 76 77 78 -276.363227 -96.889543 -102.942174 330.320984 163.584141 -36.047437 79 80 81 82 83 84 805.736138 -237.819418 -11.763862 -272.097196 -487.986085 -329.874974 85 86 87 88 89 90 -489.526315 -612.052631 -711.105263 -175.842105 -426.578947 -1.210526 91 92 93 94 95 96 -96.426951 -267.982506 -79.926951 -267.260284 37.850827 1167.961938 97 98 99 100 101 102 -670.580554 -387.106869 -57.159501 -109.896343 -64.633185 318.735236 103 104 105 106 107 108 18.518811 100.963255 -5.981189 -177.314522 81.796589 -102.092300 109 110 111 112 113 114 -120.743642 43.730042 238.677411 -26.059431 -9.796274 68.572147 115 116 117 118 119 120 -57.644277 345.800167 91.855723 45.522389 162.633500 446.744611 121 122 123 124 125 126 -29.906730 66.566954 97.514322 -137.222520 169.040638 -376.590941 127 128 129 130 131 132 84.192634 12.637079 -130.307366 -81.640699 161.470412 -324.418477 133 134 135 136 137 138 -139.069819 -107.596135 -95.648766 292.614392 -58.122450 -457.754029 139 140 141 142 143 144 83.029546 -242.526010 -232.470454 62.196212 -125.692677 -470.581565 145 146 147 148 149 150 -317.232907 -138.759223 -419.811855 -152.548697 -225.285539 -236.917118 151 152 153 154 155 156 -55.133543 -75.689098 186.366457 -238.966876 -195.855765 -262.744654 157 158 159 160 161 162 -88.395996 -295.922312 -245.974943 -111.711785 -142.448627 -280.080206 163 164 165 166 167 168 -71.296631 -108.852187 113.203369 -129.129965 -46.018853 137.092258 169 170 171 172 173 174 168.440916 63.914600 124.861968 8.125126 5.388284 274.756705 175 176 177 178 179 180 -92.459720 91.984725 -4.959720 291.706947 105.818058 24.929169 181 182 183 184 185 186 113.277827 211.751512 134.698880 297.962038 469.225196 262.593617 187 188 189 190 191 192 -47.622808 325.821636 298.877192 300.543859 488.654970 503.766081 193 194 195 196 197 198 1083.114739 264.588423 124.535792 -96.201051 196.062107 -221.569472 199 200 201 202 203 204 -37.785896 125.658548 117.714104 120.380770 31.491881 -66.397008 205 206 207 208 209 210 124.951651 -68.574665 -185.627297 -87.364139 -161.100981 -18.732560 211 212 213 214 215 216 -32.948985 -21.504540 -245.448985 159.217682 90.328793 -207.560096 217 218 219 220 221 222 129.788562 59.262246 -282.790385 121.472773 -162.264070 -66.895648 > postscript(file="/var/www/html/rcomp/tmp/6soy71229007052.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 = 222 Frequency = 1 lag(myerror, k = 1) myerror 0 675.615304 NA 1 496.088988 675.615304 2 171.036356 496.088988 3 293.299514 171.036356 4 112.562672 293.299514 5 -297.068907 112.562672 6 -161.285332 -297.068907 7 -157.840887 -161.285332 8 -233.785332 -157.840887 9 281.881335 -233.785332 10 -33.007554 281.881335 11 24.103557 -33.007554 12 48.452215 24.103557 13 -48.074101 48.452215 14 -376.126732 -48.074101 15 -140.863574 -376.126732 16 -276.600416 -140.863574 17 100.768005 -276.600416 18 -5.448420 100.768005 19 -474.003976 -5.448420 20 262.051580 -474.003976 21 150.718246 262.051580 22 -152.170642 150.718246 23 94.940469 -152.170642 24 66.289127 94.940469 25 72.762811 66.289127 26 579.710179 72.762811 27 -36.026663 579.710179 28 -139.763505 -36.026663 29 184.604916 -139.763505 30 36.388491 184.604916 31 67.832936 36.388491 32 -161.111509 67.832936 33 -101.444842 -161.111509 34 46.666269 -101.444842 35 -40.222620 46.666269 36 -148.873962 -40.222620 37 110.599723 -148.873962 38 770.547091 110.599723 39 29.810249 770.547091 40 132.073407 29.810249 41 713.441828 132.073407 42 35.225403 713.441828 43 458.669847 35.225403 44 146.725403 458.669847 45 73.392070 146.725403 46 12.503181 73.392070 47 71.614292 12.503181 48 -10.037050 71.614292 49 511.436634 -10.037050 50 389.384003 511.436634 51 110.647160 389.384003 52 484.910318 110.647160 53 374.278739 484.910318 54 -21.937686 374.278739 55 484.506759 -21.937686 56 265.562314 484.506759 57 22.228981 265.562314 58 16.340092 22.228981 59 -134.548797 16.340092 60 -119.200139 -134.548797 61 -145.726454 -119.200139 62 -153.779086 -145.726454 63 -410.515928 -153.779086 64 -66.252770 -410.515928 65 -304.884349 -66.252770 66 -383.100774 -304.884349 67 -427.656330 -383.100774 68 -376.600774 -427.656330 69 -239.934107 -376.600774 70 -194.822996 -239.934107 71 -532.711885 -194.822996 72 -276.363227 -532.711885 73 -96.889543 -276.363227 74 -102.942174 -96.889543 75 330.320984 -102.942174 76 163.584141 330.320984 77 -36.047437 163.584141 78 805.736138 -36.047437 79 -237.819418 805.736138 80 -11.763862 -237.819418 81 -272.097196 -11.763862 82 -487.986085 -272.097196 83 -329.874974 -487.986085 84 -489.526315 -329.874974 85 -612.052631 -489.526315 86 -711.105263 -612.052631 87 -175.842105 -711.105263 88 -426.578947 -175.842105 89 -1.210526 -426.578947 90 -96.426951 -1.210526 91 -267.982506 -96.426951 92 -79.926951 -267.982506 93 -267.260284 -79.926951 94 37.850827 -267.260284 95 1167.961938 37.850827 96 -670.580554 1167.961938 97 -387.106869 -670.580554 98 -57.159501 -387.106869 99 -109.896343 -57.159501 100 -64.633185 -109.896343 101 318.735236 -64.633185 102 18.518811 318.735236 103 100.963255 18.518811 104 -5.981189 100.963255 105 -177.314522 -5.981189 106 81.796589 -177.314522 107 -102.092300 81.796589 108 -120.743642 -102.092300 109 43.730042 -120.743642 110 238.677411 43.730042 111 -26.059431 238.677411 112 -9.796274 -26.059431 113 68.572147 -9.796274 114 -57.644277 68.572147 115 345.800167 -57.644277 116 91.855723 345.800167 117 45.522389 91.855723 118 162.633500 45.522389 119 446.744611 162.633500 120 -29.906730 446.744611 121 66.566954 -29.906730 122 97.514322 66.566954 123 -137.222520 97.514322 124 169.040638 -137.222520 125 -376.590941 169.040638 126 84.192634 -376.590941 127 12.637079 84.192634 128 -130.307366 12.637079 129 -81.640699 -130.307366 130 161.470412 -81.640699 131 -324.418477 161.470412 132 -139.069819 -324.418477 133 -107.596135 -139.069819 134 -95.648766 -107.596135 135 292.614392 -95.648766 136 -58.122450 292.614392 137 -457.754029 -58.122450 138 83.029546 -457.754029 139 -242.526010 83.029546 140 -232.470454 -242.526010 141 62.196212 -232.470454 142 -125.692677 62.196212 143 -470.581565 -125.692677 144 -317.232907 -470.581565 145 -138.759223 -317.232907 146 -419.811855 -138.759223 147 -152.548697 -419.811855 148 -225.285539 -152.548697 149 -236.917118 -225.285539 150 -55.133543 -236.917118 151 -75.689098 -55.133543 152 186.366457 -75.689098 153 -238.966876 186.366457 154 -195.855765 -238.966876 155 -262.744654 -195.855765 156 -88.395996 -262.744654 157 -295.922312 -88.395996 158 -245.974943 -295.922312 159 -111.711785 -245.974943 160 -142.448627 -111.711785 161 -280.080206 -142.448627 162 -71.296631 -280.080206 163 -108.852187 -71.296631 164 113.203369 -108.852187 165 -129.129965 113.203369 166 -46.018853 -129.129965 167 137.092258 -46.018853 168 168.440916 137.092258 169 63.914600 168.440916 170 124.861968 63.914600 171 8.125126 124.861968 172 5.388284 8.125126 173 274.756705 5.388284 174 -92.459720 274.756705 175 91.984725 -92.459720 176 -4.959720 91.984725 177 291.706947 -4.959720 178 105.818058 291.706947 179 24.929169 105.818058 180 113.277827 24.929169 181 211.751512 113.277827 182 134.698880 211.751512 183 297.962038 134.698880 184 469.225196 297.962038 185 262.593617 469.225196 186 -47.622808 262.593617 187 325.821636 -47.622808 188 298.877192 325.821636 189 300.543859 298.877192 190 488.654970 300.543859 191 503.766081 488.654970 192 1083.114739 503.766081 193 264.588423 1083.114739 194 124.535792 264.588423 195 -96.201051 124.535792 196 196.062107 -96.201051 197 -221.569472 196.062107 198 -37.785896 -221.569472 199 125.658548 -37.785896 200 117.714104 125.658548 201 120.380770 117.714104 202 31.491881 120.380770 203 -66.397008 31.491881 204 124.951651 -66.397008 205 -68.574665 124.951651 206 -185.627297 -68.574665 207 -87.364139 -185.627297 208 -161.100981 -87.364139 209 -18.732560 -161.100981 210 -32.948985 -18.732560 211 -21.504540 -32.948985 212 -245.448985 -21.504540 213 159.217682 -245.448985 214 90.328793 159.217682 215 -207.560096 90.328793 216 129.788562 -207.560096 217 59.262246 129.788562 218 -282.790385 59.262246 219 121.472773 -282.790385 220 -162.264070 121.472773 221 -66.895648 -162.264070 222 NA -66.895648 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 496.088988 675.615304 [2,] 171.036356 496.088988 [3,] 293.299514 171.036356 [4,] 112.562672 293.299514 [5,] -297.068907 112.562672 [6,] -161.285332 -297.068907 [7,] -157.840887 -161.285332 [8,] -233.785332 -157.840887 [9,] 281.881335 -233.785332 [10,] -33.007554 281.881335 [11,] 24.103557 -33.007554 [12,] 48.452215 24.103557 [13,] -48.074101 48.452215 [14,] -376.126732 -48.074101 [15,] -140.863574 -376.126732 [16,] -276.600416 -140.863574 [17,] 100.768005 -276.600416 [18,] -5.448420 100.768005 [19,] -474.003976 -5.448420 [20,] 262.051580 -474.003976 [21,] 150.718246 262.051580 [22,] -152.170642 150.718246 [23,] 94.940469 -152.170642 [24,] 66.289127 94.940469 [25,] 72.762811 66.289127 [26,] 579.710179 72.762811 [27,] -36.026663 579.710179 [28,] -139.763505 -36.026663 [29,] 184.604916 -139.763505 [30,] 36.388491 184.604916 [31,] 67.832936 36.388491 [32,] -161.111509 67.832936 [33,] -101.444842 -161.111509 [34,] 46.666269 -101.444842 [35,] -40.222620 46.666269 [36,] -148.873962 -40.222620 [37,] 110.599723 -148.873962 [38,] 770.547091 110.599723 [39,] 29.810249 770.547091 [40,] 132.073407 29.810249 [41,] 713.441828 132.073407 [42,] 35.225403 713.441828 [43,] 458.669847 35.225403 [44,] 146.725403 458.669847 [45,] 73.392070 146.725403 [46,] 12.503181 73.392070 [47,] 71.614292 12.503181 [48,] -10.037050 71.614292 [49,] 511.436634 -10.037050 [50,] 389.384003 511.436634 [51,] 110.647160 389.384003 [52,] 484.910318 110.647160 [53,] 374.278739 484.910318 [54,] -21.937686 374.278739 [55,] 484.506759 -21.937686 [56,] 265.562314 484.506759 [57,] 22.228981 265.562314 [58,] 16.340092 22.228981 [59,] -134.548797 16.340092 [60,] -119.200139 -134.548797 [61,] -145.726454 -119.200139 [62,] -153.779086 -145.726454 [63,] -410.515928 -153.779086 [64,] -66.252770 -410.515928 [65,] -304.884349 -66.252770 [66,] -383.100774 -304.884349 [67,] -427.656330 -383.100774 [68,] -376.600774 -427.656330 [69,] -239.934107 -376.600774 [70,] -194.822996 -239.934107 [71,] -532.711885 -194.822996 [72,] -276.363227 -532.711885 [73,] -96.889543 -276.363227 [74,] -102.942174 -96.889543 [75,] 330.320984 -102.942174 [76,] 163.584141 330.320984 [77,] -36.047437 163.584141 [78,] 805.736138 -36.047437 [79,] -237.819418 805.736138 [80,] -11.763862 -237.819418 [81,] -272.097196 -11.763862 [82,] -487.986085 -272.097196 [83,] -329.874974 -487.986085 [84,] -489.526315 -329.874974 [85,] -612.052631 -489.526315 [86,] -711.105263 -612.052631 [87,] -175.842105 -711.105263 [88,] -426.578947 -175.842105 [89,] -1.210526 -426.578947 [90,] -96.426951 -1.210526 [91,] -267.982506 -96.426951 [92,] -79.926951 -267.982506 [93,] -267.260284 -79.926951 [94,] 37.850827 -267.260284 [95,] 1167.961938 37.850827 [96,] -670.580554 1167.961938 [97,] -387.106869 -670.580554 [98,] -57.159501 -387.106869 [99,] -109.896343 -57.159501 [100,] -64.633185 -109.896343 [101,] 318.735236 -64.633185 [102,] 18.518811 318.735236 [103,] 100.963255 18.518811 [104,] -5.981189 100.963255 [105,] -177.314522 -5.981189 [106,] 81.796589 -177.314522 [107,] -102.092300 81.796589 [108,] -120.743642 -102.092300 [109,] 43.730042 -120.743642 [110,] 238.677411 43.730042 [111,] -26.059431 238.677411 [112,] -9.796274 -26.059431 [113,] 68.572147 -9.796274 [114,] -57.644277 68.572147 [115,] 345.800167 -57.644277 [116,] 91.855723 345.800167 [117,] 45.522389 91.855723 [118,] 162.633500 45.522389 [119,] 446.744611 162.633500 [120,] -29.906730 446.744611 [121,] 66.566954 -29.906730 [122,] 97.514322 66.566954 [123,] -137.222520 97.514322 [124,] 169.040638 -137.222520 [125,] -376.590941 169.040638 [126,] 84.192634 -376.590941 [127,] 12.637079 84.192634 [128,] -130.307366 12.637079 [129,] -81.640699 -130.307366 [130,] 161.470412 -81.640699 [131,] -324.418477 161.470412 [132,] -139.069819 -324.418477 [133,] -107.596135 -139.069819 [134,] -95.648766 -107.596135 [135,] 292.614392 -95.648766 [136,] -58.122450 292.614392 [137,] -457.754029 -58.122450 [138,] 83.029546 -457.754029 [139,] -242.526010 83.029546 [140,] -232.470454 -242.526010 [141,] 62.196212 -232.470454 [142,] -125.692677 62.196212 [143,] -470.581565 -125.692677 [144,] -317.232907 -470.581565 [145,] -138.759223 -317.232907 [146,] -419.811855 -138.759223 [147,] -152.548697 -419.811855 [148,] -225.285539 -152.548697 [149,] -236.917118 -225.285539 [150,] -55.133543 -236.917118 [151,] -75.689098 -55.133543 [152,] 186.366457 -75.689098 [153,] -238.966876 186.366457 [154,] -195.855765 -238.966876 [155,] -262.744654 -195.855765 [156,] -88.395996 -262.744654 [157,] -295.922312 -88.395996 [158,] -245.974943 -295.922312 [159,] -111.711785 -245.974943 [160,] -142.448627 -111.711785 [161,] -280.080206 -142.448627 [162,] -71.296631 -280.080206 [163,] -108.852187 -71.296631 [164,] 113.203369 -108.852187 [165,] -129.129965 113.203369 [166,] -46.018853 -129.129965 [167,] 137.092258 -46.018853 [168,] 168.440916 137.092258 [169,] 63.914600 168.440916 [170,] 124.861968 63.914600 [171,] 8.125126 124.861968 [172,] 5.388284 8.125126 [173,] 274.756705 5.388284 [174,] -92.459720 274.756705 [175,] 91.984725 -92.459720 [176,] -4.959720 91.984725 [177,] 291.706947 -4.959720 [178,] 105.818058 291.706947 [179,] 24.929169 105.818058 [180,] 113.277827 24.929169 [181,] 211.751512 113.277827 [182,] 134.698880 211.751512 [183,] 297.962038 134.698880 [184,] 469.225196 297.962038 [185,] 262.593617 469.225196 [186,] -47.622808 262.593617 [187,] 325.821636 -47.622808 [188,] 298.877192 325.821636 [189,] 300.543859 298.877192 [190,] 488.654970 300.543859 [191,] 503.766081 488.654970 [192,] 1083.114739 503.766081 [193,] 264.588423 1083.114739 [194,] 124.535792 264.588423 [195,] -96.201051 124.535792 [196,] 196.062107 -96.201051 [197,] -221.569472 196.062107 [198,] -37.785896 -221.569472 [199,] 125.658548 -37.785896 [200,] 117.714104 125.658548 [201,] 120.380770 117.714104 [202,] 31.491881 120.380770 [203,] -66.397008 31.491881 [204,] 124.951651 -66.397008 [205,] -68.574665 124.951651 [206,] -185.627297 -68.574665 [207,] -87.364139 -185.627297 [208,] -161.100981 -87.364139 [209,] -18.732560 -161.100981 [210,] -32.948985 -18.732560 [211,] -21.504540 -32.948985 [212,] -245.448985 -21.504540 [213,] 159.217682 -245.448985 [214,] 90.328793 159.217682 [215,] -207.560096 90.328793 [216,] 129.788562 -207.560096 [217,] 59.262246 129.788562 [218,] -282.790385 59.262246 [219,] 121.472773 -282.790385 [220,] -162.264070 121.472773 [221,] -66.895648 -162.264070 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 496.088988 675.615304 2 171.036356 496.088988 3 293.299514 171.036356 4 112.562672 293.299514 5 -297.068907 112.562672 6 -161.285332 -297.068907 7 -157.840887 -161.285332 8 -233.785332 -157.840887 9 281.881335 -233.785332 10 -33.007554 281.881335 11 24.103557 -33.007554 12 48.452215 24.103557 13 -48.074101 48.452215 14 -376.126732 -48.074101 15 -140.863574 -376.126732 16 -276.600416 -140.863574 17 100.768005 -276.600416 18 -5.448420 100.768005 19 -474.003976 -5.448420 20 262.051580 -474.003976 21 150.718246 262.051580 22 -152.170642 150.718246 23 94.940469 -152.170642 24 66.289127 94.940469 25 72.762811 66.289127 26 579.710179 72.762811 27 -36.026663 579.710179 28 -139.763505 -36.026663 29 184.604916 -139.763505 30 36.388491 184.604916 31 67.832936 36.388491 32 -161.111509 67.832936 33 -101.444842 -161.111509 34 46.666269 -101.444842 35 -40.222620 46.666269 36 -148.873962 -40.222620 37 110.599723 -148.873962 38 770.547091 110.599723 39 29.810249 770.547091 40 132.073407 29.810249 41 713.441828 132.073407 42 35.225403 713.441828 43 458.669847 35.225403 44 146.725403 458.669847 45 73.392070 146.725403 46 12.503181 73.392070 47 71.614292 12.503181 48 -10.037050 71.614292 49 511.436634 -10.037050 50 389.384003 511.436634 51 110.647160 389.384003 52 484.910318 110.647160 53 374.278739 484.910318 54 -21.937686 374.278739 55 484.506759 -21.937686 56 265.562314 484.506759 57 22.228981 265.562314 58 16.340092 22.228981 59 -134.548797 16.340092 60 -119.200139 -134.548797 61 -145.726454 -119.200139 62 -153.779086 -145.726454 63 -410.515928 -153.779086 64 -66.252770 -410.515928 65 -304.884349 -66.252770 66 -383.100774 -304.884349 67 -427.656330 -383.100774 68 -376.600774 -427.656330 69 -239.934107 -376.600774 70 -194.822996 -239.934107 71 -532.711885 -194.822996 72 -276.363227 -532.711885 73 -96.889543 -276.363227 74 -102.942174 -96.889543 75 330.320984 -102.942174 76 163.584141 330.320984 77 -36.047437 163.584141 78 805.736138 -36.047437 79 -237.819418 805.736138 80 -11.763862 -237.819418 81 -272.097196 -11.763862 82 -487.986085 -272.097196 83 -329.874974 -487.986085 84 -489.526315 -329.874974 85 -612.052631 -489.526315 86 -711.105263 -612.052631 87 -175.842105 -711.105263 88 -426.578947 -175.842105 89 -1.210526 -426.578947 90 -96.426951 -1.210526 91 -267.982506 -96.426951 92 -79.926951 -267.982506 93 -267.260284 -79.926951 94 37.850827 -267.260284 95 1167.961938 37.850827 96 -670.580554 1167.961938 97 -387.106869 -670.580554 98 -57.159501 -387.106869 99 -109.896343 -57.159501 100 -64.633185 -109.896343 101 318.735236 -64.633185 102 18.518811 318.735236 103 100.963255 18.518811 104 -5.981189 100.963255 105 -177.314522 -5.981189 106 81.796589 -177.314522 107 -102.092300 81.796589 108 -120.743642 -102.092300 109 43.730042 -120.743642 110 238.677411 43.730042 111 -26.059431 238.677411 112 -9.796274 -26.059431 113 68.572147 -9.796274 114 -57.644277 68.572147 115 345.800167 -57.644277 116 91.855723 345.800167 117 45.522389 91.855723 118 162.633500 45.522389 119 446.744611 162.633500 120 -29.906730 446.744611 121 66.566954 -29.906730 122 97.514322 66.566954 123 -137.222520 97.514322 124 169.040638 -137.222520 125 -376.590941 169.040638 126 84.192634 -376.590941 127 12.637079 84.192634 128 -130.307366 12.637079 129 -81.640699 -130.307366 130 161.470412 -81.640699 131 -324.418477 161.470412 132 -139.069819 -324.418477 133 -107.596135 -139.069819 134 -95.648766 -107.596135 135 292.614392 -95.648766 136 -58.122450 292.614392 137 -457.754029 -58.122450 138 83.029546 -457.754029 139 -242.526010 83.029546 140 -232.470454 -242.526010 141 62.196212 -232.470454 142 -125.692677 62.196212 143 -470.581565 -125.692677 144 -317.232907 -470.581565 145 -138.759223 -317.232907 146 -419.811855 -138.759223 147 -152.548697 -419.811855 148 -225.285539 -152.548697 149 -236.917118 -225.285539 150 -55.133543 -236.917118 151 -75.689098 -55.133543 152 186.366457 -75.689098 153 -238.966876 186.366457 154 -195.855765 -238.966876 155 -262.744654 -195.855765 156 -88.395996 -262.744654 157 -295.922312 -88.395996 158 -245.974943 -295.922312 159 -111.711785 -245.974943 160 -142.448627 -111.711785 161 -280.080206 -142.448627 162 -71.296631 -280.080206 163 -108.852187 -71.296631 164 113.203369 -108.852187 165 -129.129965 113.203369 166 -46.018853 -129.129965 167 137.092258 -46.018853 168 168.440916 137.092258 169 63.914600 168.440916 170 124.861968 63.914600 171 8.125126 124.861968 172 5.388284 8.125126 173 274.756705 5.388284 174 -92.459720 274.756705 175 91.984725 -92.459720 176 -4.959720 91.984725 177 291.706947 -4.959720 178 105.818058 291.706947 179 24.929169 105.818058 180 113.277827 24.929169 181 211.751512 113.277827 182 134.698880 211.751512 183 297.962038 134.698880 184 469.225196 297.962038 185 262.593617 469.225196 186 -47.622808 262.593617 187 325.821636 -47.622808 188 298.877192 325.821636 189 300.543859 298.877192 190 488.654970 300.543859 191 503.766081 488.654970 192 1083.114739 503.766081 193 264.588423 1083.114739 194 124.535792 264.588423 195 -96.201051 124.535792 196 196.062107 -96.201051 197 -221.569472 196.062107 198 -37.785896 -221.569472 199 125.658548 -37.785896 200 117.714104 125.658548 201 120.380770 117.714104 202 31.491881 120.380770 203 -66.397008 31.491881 204 124.951651 -66.397008 205 -68.574665 124.951651 206 -185.627297 -68.574665 207 -87.364139 -185.627297 208 -161.100981 -87.364139 209 -18.732560 -161.100981 210 -32.948985 -18.732560 211 -21.504540 -32.948985 212 -245.448985 -21.504540 213 159.217682 -245.448985 214 90.328793 159.217682 215 -207.560096 90.328793 216 129.788562 -207.560096 217 59.262246 129.788562 218 -282.790385 59.262246 219 121.472773 -282.790385 220 -162.264070 121.472773 221 -66.895648 -162.264070 > 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/7ixja1229007052.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/8uzrk1229007053.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/9h3ct1229007053.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 > > #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/10zwa01229007053.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/11ej4k1229007053.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/12h4t81229007053.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/13zq701229007053.tab") > > system("convert tmp/11zh41229007052.ps tmp/11zh41229007052.png") > system("convert tmp/2gkgs1229007052.ps tmp/2gkgs1229007052.png") > system("convert tmp/3jj8p1229007052.ps tmp/3jj8p1229007052.png") > system("convert tmp/4eond1229007052.ps tmp/4eond1229007052.png") > system("convert tmp/5s6i91229007052.ps tmp/5s6i91229007052.png") > system("convert tmp/6soy71229007052.ps tmp/6soy71229007052.png") > system("convert tmp/7ixja1229007052.ps tmp/7ixja1229007052.png") > system("convert tmp/8uzrk1229007053.ps tmp/8uzrk1229007053.png") > system("convert tmp/9h3ct1229007053.ps tmp/9h3ct1229007053.png") > > > proc.time() user system elapsed 5.331 2.782 5.703