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(1507
+ ,0
+ ,1508
+ ,1687
+ ,1385
+ ,0
+ ,1507
+ ,1508
+ ,1632
+ ,0
+ ,1385
+ ,1507
+ ,1511
+ ,0
+ ,1632
+ ,1385
+ ,1559
+ ,0
+ ,1511
+ ,1632
+ ,1630
+ ,0
+ ,1559
+ ,1511
+ ,1579
+ ,0
+ ,1630
+ ,1559
+ ,1653
+ ,0
+ ,1579
+ ,1630
+ ,2152
+ ,0
+ ,1653
+ ,1579
+ ,2148
+ ,0
+ ,2152
+ ,1653
+ ,1752
+ ,0
+ ,2148
+ ,2152
+ ,1765
+ ,0
+ ,1752
+ ,2148
+ ,1717
+ ,0
+ ,1765
+ ,1752
+ ,1558
+ ,0
+ ,1717
+ ,1765
+ ,1575
+ ,0
+ ,1558
+ ,1717
+ ,1520
+ ,0
+ ,1575
+ ,1558
+ ,1805
+ ,0
+ ,1520
+ ,1575
+ ,1800
+ ,0
+ ,1805
+ ,1520
+ ,1719
+ ,0
+ ,1800
+ ,1805
+ ,2008
+ ,0
+ ,1719
+ ,1800
+ ,2242
+ ,0
+ ,2008
+ ,1719
+ ,2478
+ ,0
+ ,2242
+ ,2008
+ ,2030
+ ,0
+ ,2478
+ ,2242
+ ,1655
+ ,0
+ ,2030
+ ,2478
+ ,1693
+ ,0
+ ,1655
+ ,2030
+ ,1623
+ ,0
+ ,1693
+ ,1655
+ ,1805
+ ,0
+ ,1623
+ ,1693
+ ,1746
+ ,0
+ ,1805
+ ,1623
+ ,1795
+ ,0
+ ,1746
+ ,1805
+ ,1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1357
+ ,1110
+ ,1
+ ,1282
+ ,1165
+ ,1297
+ ,1
+ ,1110
+ ,1282
+ ,1185
+ ,1
+ ,1297
+ ,1110
+ ,1222
+ ,1
+ ,1185
+ ,1297
+ ,1284
+ ,1
+ ,1222
+ ,1185
+ ,1444
+ ,1
+ ,1284
+ ,1222
+ ,1575
+ ,1
+ ,1444
+ ,1284
+ ,1737
+ ,1
+ ,1575
+ ,1444
+ ,1763
+ ,1
+ ,1737
+ ,1575)
+ ,dim=c(4
+ ,190)
+ ,dimnames=list(c('Y'
+ ,'X'
+ ,'Y1'
+ ,'Y2')
+ ,1:190))
> y <- array(NA,dim=c(4,190),dimnames=list(c('Y','X','Y1','Y2'),1:190))
> 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)
> 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 Y1 Y2 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 1507 0 1508 1687 1 0 0 0 0 0 0 0 0 0 0 1
2 1385 0 1507 1508 0 1 0 0 0 0 0 0 0 0 0 2
3 1632 0 1385 1507 0 0 1 0 0 0 0 0 0 0 0 3
4 1511 0 1632 1385 0 0 0 1 0 0 0 0 0 0 0 4
5 1559 0 1511 1632 0 0 0 0 1 0 0 0 0 0 0 5
6 1630 0 1559 1511 0 0 0 0 0 1 0 0 0 0 0 6
7 1579 0 1630 1559 0 0 0 0 0 0 1 0 0 0 0 7
8 1653 0 1579 1630 0 0 0 0 0 0 0 1 0 0 0 8
9 2152 0 1653 1579 0 0 0 0 0 0 0 0 1 0 0 9
10 2148 0 2152 1653 0 0 0 0 0 0 0 0 0 1 0 10
11 1752 0 2148 2152 0 0 0 0 0 0 0 0 0 0 1 11
12 1765 0 1752 2148 0 0 0 0 0 0 0 0 0 0 0 12
13 1717 0 1765 1752 1 0 0 0 0 0 0 0 0 0 0 13
14 1558 0 1717 1765 0 1 0 0 0 0 0 0 0 0 0 14
15 1575 0 1558 1717 0 0 1 0 0 0 0 0 0 0 0 15
16 1520 0 1575 1558 0 0 0 1 0 0 0 0 0 0 0 16
17 1805 0 1520 1575 0 0 0 0 1 0 0 0 0 0 0 17
18 1800 0 1805 1520 0 0 0 0 0 1 0 0 0 0 0 18
19 1719 0 1800 1805 0 0 0 0 0 0 1 0 0 0 0 19
20 2008 0 1719 1800 0 0 0 0 0 0 0 1 0 0 0 20
21 2242 0 2008 1719 0 0 0 0 0 0 0 0 1 0 0 21
22 2478 0 2242 2008 0 0 0 0 0 0 0 0 0 1 0 22
23 2030 0 2478 2242 0 0 0 0 0 0 0 0 0 0 1 23
24 1655 0 2030 2478 0 0 0 0 0 0 0 0 0 0 0 24
25 1693 0 1655 2030 1 0 0 0 0 0 0 0 0 0 0 25
26 1623 0 1693 1655 0 1 0 0 0 0 0 0 0 0 0 26
27 1805 0 1623 1693 0 0 1 0 0 0 0 0 0 0 0 27
28 1746 0 1805 1623 0 0 0 1 0 0 0 0 0 0 0 28
29 1795 0 1746 1805 0 0 0 0 1 0 0 0 0 0 0 29
30 1926 0 1795 1746 0 0 0 0 0 1 0 0 0 0 0 30
31 1619 0 1926 1795 0 0 0 0 0 0 1 0 0 0 0 31
32 1992 0 1619 1926 0 0 0 0 0 0 0 1 0 0 0 32
33 2233 0 1992 1619 0 0 0 0 0 0 0 0 1 0 0 33
34 2192 0 2233 1992 0 0 0 0 0 0 0 0 0 1 0 34
35 2080 0 2192 2233 0 0 0 0 0 0 0 0 0 0 1 35
36 1768 0 2080 2192 0 0 0 0 0 0 0 0 0 0 0 36
37 1835 0 1768 2080 1 0 0 0 0 0 0 0 0 0 0 37
38 1569 0 1835 1768 0 1 0 0 0 0 0 0 0 0 0 38
39 1976 0 1569 1835 0 0 1 0 0 0 0 0 0 0 0 39
40 1853 0 1976 1569 0 0 0 1 0 0 0 0 0 0 0 40
41 1965 0 1853 1976 0 0 0 0 1 0 0 0 0 0 0 41
42 1689 0 1965 1853 0 0 0 0 0 1 0 0 0 0 0 42
43 1778 0 1689 1965 0 0 0 0 0 0 1 0 0 0 0 43
44 1976 0 1778 1689 0 0 0 0 0 0 0 1 0 0 0 44
45 2397 0 1976 1778 0 0 0 0 0 0 0 0 1 0 0 45
46 2654 0 2397 1976 0 0 0 0 0 0 0 0 0 1 0 46
47 2097 0 2654 2397 0 0 0 0 0 0 0 0 0 0 1 47
48 1963 0 2097 2654 0 0 0 0 0 0 0 0 0 0 0 48
49 1677 0 1963 2097 1 0 0 0 0 0 0 0 0 0 0 49
50 1941 0 1677 1963 0 1 0 0 0 0 0 0 0 0 0 50
51 2003 0 1941 1677 0 0 1 0 0 0 0 0 0 0 0 51
52 1813 0 2003 1941 0 0 0 1 0 0 0 0 0 0 0 52
53 2012 0 1813 2003 0 0 0 0 1 0 0 0 0 0 0 53
54 1912 0 2012 1813 0 0 0 0 0 1 0 0 0 0 0 54
55 2084 0 1912 2012 0 0 0 0 0 0 1 0 0 0 0 55
56 2080 0 2084 1912 0 0 0 0 0 0 0 1 0 0 0 56
57 2118 0 2080 2084 0 0 0 0 0 0 0 0 1 0 0 57
58 2150 0 2118 2080 0 0 0 0 0 0 0 0 0 1 0 58
59 1608 0 2150 2118 0 0 0 0 0 0 0 0 0 0 1 59
60 1503 0 1608 2150 0 0 0 0 0 0 0 0 0 0 0 60
61 1548 0 1503 1608 1 0 0 0 0 0 0 0 0 0 0 61
62 1382 0 1548 1503 0 1 0 0 0 0 0 0 0 0 0 62
63 1731 0 1382 1548 0 0 1 0 0 0 0 0 0 0 0 63
64 1798 0 1731 1382 0 0 0 1 0 0 0 0 0 0 0 64
65 1779 0 1798 1731 0 0 0 0 1 0 0 0 0 0 0 65
66 1887 0 1779 1798 0 0 0 0 0 1 0 0 0 0 0 66
67 2004 0 1887 1779 0 0 0 0 0 0 1 0 0 0 0 67
68 2077 0 2004 1887 0 0 0 0 0 0 0 1 0 0 0 68
69 2092 0 2077 2004 0 0 0 0 0 0 0 0 1 0 0 69
70 2051 0 2092 2077 0 0 0 0 0 0 0 0 0 1 0 70
71 1577 0 2051 2092 0 0 0 0 0 0 0 0 0 0 1 71
72 1356 0 1577 2051 0 0 0 0 0 0 0 0 0 0 0 72
73 1652 0 1356 1577 1 0 0 0 0 0 0 0 0 0 0 73
74 1382 0 1652 1356 0 1 0 0 0 0 0 0 0 0 0 74
75 1519 0 1382 1652 0 0 1 0 0 0 0 0 0 0 0 75
76 1421 0 1519 1382 0 0 0 1 0 0 0 0 0 0 0 76
77 1442 0 1421 1519 0 0 0 0 1 0 0 0 0 0 0 77
78 1543 0 1442 1421 0 0 0 0 0 1 0 0 0 0 0 78
79 1656 0 1543 1442 0 0 0 0 0 0 1 0 0 0 0 79
80 1561 0 1656 1543 0 0 0 0 0 0 0 1 0 0 0 80
81 1905 0 1561 1656 0 0 0 0 0 0 0 0 1 0 0 81
82 2199 0 1905 1561 0 0 0 0 0 0 0 0 0 1 0 82
83 1473 0 2199 1905 0 0 0 0 0 0 0 0 0 0 1 83
84 1655 0 1473 2199 0 0 0 0 0 0 0 0 0 0 0 84
85 1407 0 1655 1473 1 0 0 0 0 0 0 0 0 0 0 85
86 1395 0 1407 1655 0 1 0 0 0 0 0 0 0 0 0 86
87 1530 0 1395 1407 0 0 1 0 0 0 0 0 0 0 0 87
88 1309 0 1530 1395 0 0 0 1 0 0 0 0 0 0 0 88
89 1526 0 1309 1530 0 0 0 0 1 0 0 0 0 0 0 89
90 1327 0 1526 1309 0 0 0 0 0 1 0 0 0 0 0 90
91 1627 0 1327 1526 0 0 0 0 0 0 1 0 0 0 0 91
92 1748 0 1627 1327 0 0 0 0 0 0 0 1 0 0 0 92
93 1958 0 1748 1627 0 0 0 0 0 0 0 0 1 0 0 93
94 2274 0 1958 1748 0 0 0 0 0 0 0 0 0 1 0 94
95 1648 0 2274 1958 0 0 0 0 0 0 0 0 0 0 1 95
96 1401 0 1648 2274 0 0 0 0 0 0 0 0 0 0 0 96
97 1411 0 1401 1648 1 0 0 0 0 0 0 0 0 0 0 97
98 1403 0 1411 1401 0 1 0 0 0 0 0 0 0 0 0 98
99 1394 0 1403 1411 0 0 1 0 0 0 0 0 0 0 0 99
100 1520 0 1394 1403 0 0 0 1 0 0 0 0 0 0 0 100
101 1528 0 1520 1394 0 0 0 0 1 0 0 0 0 0 0 101
102 1643 0 1528 1520 0 0 0 0 0 1 0 0 0 0 0 102
103 1515 0 1643 1528 0 0 0 0 0 0 1 0 0 0 0 103
104 1685 0 1515 1643 0 0 0 0 0 0 0 1 0 0 0 104
105 2000 0 1685 1515 0 0 0 0 0 0 0 0 1 0 0 105
106 2215 0 2000 1685 0 0 0 0 0 0 0 0 0 1 0 106
107 1956 0 2215 2000 0 0 0 0 0 0 0 0 0 0 1 107
108 1462 0 1956 2215 0 0 0 0 0 0 0 0 0 0 0 108
109 1563 0 1462 1956 1 0 0 0 0 0 0 0 0 0 0 109
110 1459 0 1563 1462 0 1 0 0 0 0 0 0 0 0 0 110
111 1446 0 1459 1563 0 0 1 0 0 0 0 0 0 0 0 111
112 1622 0 1446 1459 0 0 0 1 0 0 0 0 0 0 0 112
113 1657 0 1622 1446 0 0 0 0 1 0 0 0 0 0 0 113
114 1638 0 1657 1622 0 0 0 0 0 1 0 0 0 0 0 114
115 1643 0 1638 1657 0 0 0 0 0 0 1 0 0 0 0 115
116 1683 0 1643 1638 0 0 0 0 0 0 0 1 0 0 0 116
117 2050 0 1683 1643 0 0 0 0 0 0 0 0 1 0 0 117
118 2262 0 2050 1683 0 0 0 0 0 0 0 0 0 1 0 118
119 1813 0 2262 2050 0 0 0 0 0 0 0 0 0 0 1 119
120 1445 0 1813 2262 0 0 0 0 0 0 0 0 0 0 0 120
121 1762 0 1445 1813 1 0 0 0 0 0 0 0 0 0 0 121
122 1461 0 1762 1445 0 1 0 0 0 0 0 0 0 0 0 122
123 1556 0 1461 1762 0 0 1 0 0 0 0 0 0 0 0 123
124 1431 0 1556 1461 0 0 0 1 0 0 0 0 0 0 0 124
125 1427 0 1431 1556 0 0 0 0 1 0 0 0 0 0 0 125
126 1554 0 1427 1431 0 0 0 0 0 1 0 0 0 0 0 126
127 1645 0 1554 1427 0 0 0 0 0 0 1 0 0 0 0 127
128 1653 0 1645 1554 0 0 0 0 0 0 0 1 0 0 0 128
129 2016 0 1653 1645 0 0 0 0 0 0 0 0 1 0 0 129
130 2207 0 2016 1653 0 0 0 0 0 0 0 0 0 1 0 130
131 1665 0 2207 2016 0 0 0 0 0 0 0 0 0 0 1 131
132 1361 0 1665 2207 0 0 0 0 0 0 0 0 0 0 0 132
133 1506 0 1361 1665 1 0 0 0 0 0 0 0 0 0 0 133
134 1360 0 1506 1361 0 1 0 0 0 0 0 0 0 0 0 134
135 1453 0 1360 1506 0 0 1 0 0 0 0 0 0 0 0 135
136 1522 0 1453 1360 0 0 0 1 0 0 0 0 0 0 0 136
137 1460 0 1522 1453 0 0 0 0 1 0 0 0 0 0 0 137
138 1552 0 1460 1522 0 0 0 0 0 1 0 0 0 0 0 138
139 1548 0 1552 1460 0 0 0 0 0 0 1 0 0 0 0 139
140 1827 0 1548 1552 0 0 0 0 0 0 0 1 0 0 0 140
141 1737 0 1827 1548 0 0 0 0 0 0 0 0 1 0 0 141
142 1941 0 1737 1827 0 0 0 0 0 0 0 0 0 1 0 142
143 1474 0 1941 1737 0 0 0 0 0 0 0 0 0 0 1 143
144 1458 0 1474 1941 0 0 0 0 0 0 0 0 0 0 0 144
145 1542 0 1458 1474 1 0 0 0 0 0 0 0 0 0 0 145
146 1404 0 1542 1458 0 1 0 0 0 0 0 0 0 0 0 146
147 1522 0 1404 1542 0 0 1 0 0 0 0 0 0 0 0 147
148 1385 0 1522 1404 0 0 0 1 0 0 0 0 0 0 0 148
149 1641 0 1385 1522 0 0 0 0 1 0 0 0 0 0 0 149
150 1510 0 1641 1385 0 0 0 0 0 1 0 0 0 0 0 150
151 1681 0 1510 1641 0 0 0 0 0 0 1 0 0 0 0 151
152 1938 0 1681 1510 0 0 0 0 0 0 0 1 0 0 0 152
153 1868 0 1938 1681 0 0 0 0 0 0 0 0 1 0 0 153
154 1726 0 1868 1938 0 0 0 0 0 0 0 0 0 1 0 154
155 1456 0 1726 1868 0 0 0 0 0 0 0 0 0 0 1 155
156 1445 0 1456 1726 0 0 0 0 0 0 0 0 0 0 0 156
157 1456 0 1445 1456 1 0 0 0 0 0 0 0 0 0 0 157
158 1365 0 1456 1445 0 1 0 0 0 0 0 0 0 0 0 158
159 1487 0 1365 1456 0 0 1 0 0 0 0 0 0 0 0 159
160 1558 0 1487 1365 0 0 0 1 0 0 0 0 0 0 0 160
161 1488 0 1558 1487 0 0 0 0 1 0 0 0 0 0 0 161
162 1684 0 1488 1558 0 0 0 0 0 1 0 0 0 0 0 162
163 1594 0 1684 1488 0 0 0 0 0 0 1 0 0 0 0 163
164 1850 0 1594 1684 0 0 0 0 0 0 0 1 0 0 0 164
165 1998 0 1850 1594 0 0 0 0 0 0 0 0 1 0 0 165
166 2079 0 1998 1850 0 0 0 0 0 0 0 0 0 1 0 166
167 1494 0 2079 1998 0 0 0 0 0 0 0 0 0 0 1 167
168 1057 1 1494 2079 0 0 0 0 0 0 0 0 0 0 0 168
169 1218 1 1057 1494 1 0 0 0 0 0 0 0 0 0 0 169
170 1168 1 1218 1057 0 1 0 0 0 0 0 0 0 0 0 170
171 1236 1 1168 1218 0 0 1 0 0 0 0 0 0 0 0 171
172 1076 1 1236 1168 0 0 0 1 0 0 0 0 0 0 0 172
173 1174 1 1076 1236 0 0 0 0 1 0 0 0 0 0 0 173
174 1139 1 1174 1076 0 0 0 0 0 1 0 0 0 0 0 174
175 1427 1 1139 1174 0 0 0 0 0 0 1 0 0 0 0 175
176 1487 1 1427 1139 0 0 0 0 0 0 0 1 0 0 0 176
177 1483 1 1487 1427 0 0 0 0 0 0 0 0 1 0 0 177
178 1513 1 1483 1487 0 0 0 0 0 0 0 0 0 1 0 178
179 1357 1 1513 1483 0 0 0 0 0 0 0 0 0 0 1 179
180 1165 1 1357 1513 0 0 0 0 0 0 0 0 0 0 0 180
181 1282 1 1165 1357 1 0 0 0 0 0 0 0 0 0 0 181
182 1110 1 1282 1165 0 1 0 0 0 0 0 0 0 0 0 182
183 1297 1 1110 1282 0 0 1 0 0 0 0 0 0 0 0 183
184 1185 1 1297 1110 0 0 0 1 0 0 0 0 0 0 0 184
185 1222 1 1185 1297 0 0 0 0 1 0 0 0 0 0 0 185
186 1284 1 1222 1185 0 0 0 0 0 1 0 0 0 0 0 186
187 1444 1 1284 1222 0 0 0 0 0 0 1 0 0 0 0 187
188 1575 1 1444 1284 0 0 0 0 0 0 0 1 0 0 0 188
189 1737 1 1575 1444 0 0 0 0 0 0 0 0 1 0 0 189
190 1763 1 1737 1575 0 0 0 0 0 0 0 0 0 1 0 190
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 Y2 M1 M2
432.6740 -85.6152 0.4123 0.2087 221.7085 130.1641
M3 M4 M5 M6 M7 M8
304.3217 216.3298 287.0120 283.0861 314.7176 429.9532
M9 M10 M11 t
561.7713 567.7695 38.9219 -0.7380
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-335.444 -91.096 -1.289 85.222 313.936
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 432.67402 157.02555 2.755 0.00649 **
X -85.61519 37.53598 -2.281 0.02377 *
Y1 0.41225 0.07423 5.554 1.03e-07 ***
Y2 0.20875 0.07334 2.846 0.00495 **
M1 221.70845 53.51067 4.143 5.34e-05 ***
M2 130.16410 62.33018 2.088 0.03823 *
M3 304.32166 58.79007 5.176 6.19e-07 ***
M4 216.32977 65.82042 3.287 0.00123 **
M5 287.01204 58.27794 4.925 1.95e-06 ***
M6 283.08605 61.98534 4.567 9.33e-06 ***
M7 314.71759 58.64146 5.367 2.53e-07 ***
M8 429.95325 59.01186 7.286 1.07e-11 ***
M9 561.77128 60.37181 9.305 < 2e-16 ***
M10 567.76945 61.58903 9.219 < 2e-16 ***
M11 38.92187 59.89609 0.650 0.51666
t -0.73795 0.23971 -3.078 0.00242 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 126.8 on 174 degrees of freedom
Multiple R-squared: 0.8251, Adjusted R-squared: 0.81
F-statistic: 54.71 on 15 and 174 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.2837474 0.5674947905 0.7162526047
[2,] 0.4438423 0.8876845967 0.5561577016
[3,] 0.3413175 0.6826350357 0.6586824822
[4,] 0.4119831 0.8239661852 0.5880169074
[5,] 0.3366149 0.6732298475 0.6633850763
[6,] 0.4308048 0.8616096689 0.5691951655
[7,] 0.3837439 0.7674878380 0.6162560810
[8,] 0.3247392 0.6494783205 0.6752608398
[9,] 0.2435779 0.4871557947 0.7564221026
[10,] 0.1775834 0.3551668241 0.8224165879
[11,] 0.1406328 0.2812655030 0.8593672485
[12,] 0.1018587 0.2037174080 0.8981412960
[13,] 0.1936480 0.3872960750 0.8063519625
[14,] 0.1434814 0.2869628361 0.8565185820
[15,] 0.1420717 0.2841434793 0.8579282604
[16,] 0.2416082 0.4832164796 0.7583917602
[17,] 0.2284588 0.4569176126 0.7715411937
[18,] 0.1922849 0.3845697406 0.8077151297
[19,] 0.1481663 0.2963326821 0.8518336589
[20,] 0.1441327 0.2882653295 0.8558673352
[21,] 0.1573498 0.3146995973 0.8426502014
[22,] 0.1325853 0.2651706834 0.8674146583
[23,] 0.1056907 0.2113813739 0.8943093131
[24,] 0.2339885 0.4679770324 0.7660114838
[25,] 0.1935894 0.3871788223 0.8064105888
[26,] 0.1615964 0.3231927612 0.8384036194
[27,] 0.1543147 0.3086294640 0.8456852680
[28,] 0.2404136 0.4808271114 0.7595864443
[29,] 0.2077959 0.4155918816 0.7922040592
[30,] 0.1900846 0.3801692956 0.8099153522
[31,] 0.2754419 0.5508838673 0.7245580663
[32,] 0.3792643 0.7585286042 0.6207356979
[33,] 0.3706347 0.7412693679 0.6293653160
[34,] 0.3323260 0.6646519655 0.6676740173
[35,] 0.3292921 0.6585841337 0.6707079332
[36,] 0.2985664 0.5971328522 0.7014335739
[37,] 0.3663700 0.7327400743 0.6336299628
[38,] 0.3280344 0.6560688011 0.6719655995
[39,] 0.5673338 0.8653323318 0.4326661659
[40,] 0.8063170 0.3873659081 0.1936829540
[41,] 0.9309329 0.1381342393 0.0690671197
[42,] 0.9230418 0.1539163869 0.0769581935
[43,] 0.9043442 0.1913115620 0.0956557810
[44,] 0.8987146 0.2025707954 0.1012853977
[45,] 0.8966098 0.2067804132 0.1033902066
[46,] 0.9210145 0.1579710866 0.0789855433
[47,] 0.9162243 0.1675514625 0.0837757313
[48,] 0.9205827 0.1588345797 0.0794172899
[49,] 0.9469445 0.1061109397 0.0530554699
[50,] 0.9512110 0.0975780779 0.0487890390
[51,] 0.9691176 0.0617648625 0.0308824312
[52,] 0.9775432 0.0449136068 0.0224568034
[53,] 0.9782845 0.0434309107 0.0217154554
[54,] 0.9771670 0.0456659741 0.0228329871
[55,] 0.9819476 0.0361047134 0.0180523567
[56,] 0.9795138 0.0409723245 0.0204861623
[57,] 0.9783364 0.0433271084 0.0216635542
[58,] 0.9741632 0.0516735102 0.0258367551
[59,] 0.9730731 0.0538538965 0.0269269483
[60,] 0.9651863 0.0696274806 0.0348137403
[61,] 0.9580767 0.0838465739 0.0419232870
[62,] 0.9767145 0.0465710331 0.0232855166
[63,] 0.9699720 0.0600559230 0.0300279615
[64,] 0.9734159 0.0531682248 0.0265841124
[65,] 0.9840884 0.0318232011 0.0159116005
[66,] 0.9915562 0.0168875589 0.0084437795
[67,] 0.9932283 0.0135433572 0.0067716786
[68,] 0.9907740 0.0184519540 0.0092259770
[69,] 0.9877728 0.0244544444 0.0122272222
[70,] 0.9914322 0.0171356373 0.0085678186
[71,] 0.9885424 0.0229151877 0.0114575939
[72,] 0.9950062 0.0099876112 0.0049938056
[73,] 0.9943311 0.0113377227 0.0056688613
[74,] 0.9932675 0.0134649937 0.0067324968
[75,] 0.9909865 0.0180269996 0.0090134998
[76,] 0.9936320 0.0127360811 0.0063680406
[77,] 0.9922934 0.0154132635 0.0077066317
[78,] 0.9913249 0.0173502977 0.0086751488
[79,] 0.9918519 0.0162962881 0.0081481441
[80,] 0.9894616 0.0210768963 0.0105384481
[81,] 0.9914413 0.0171173317 0.0085586659
[82,] 0.9895171 0.0209658769 0.0104829385
[83,] 0.9865729 0.0268542644 0.0134271322
[84,] 0.9831473 0.0337053477 0.0168526738
[85,] 0.9874660 0.0250680878 0.0125340439
[86,] 0.9861259 0.0277482975 0.0138741487
[87,] 0.9821297 0.0357406120 0.0178703060
[88,] 0.9808913 0.0382174973 0.0191087487
[89,] 0.9937194 0.0125612715 0.0062806358
[90,] 0.9932421 0.0135157964 0.0067578982
[91,] 0.9906920 0.0186160846 0.0093080423
[92,] 0.9875689 0.0248622313 0.0124311156
[93,] 0.9880623 0.0238754851 0.0119377426
[94,] 0.9899735 0.0200530624 0.0100265312
[95,] 0.9876521 0.0246957741 0.0123478871
[96,] 0.9835773 0.0328454419 0.0164227210
[97,] 0.9785503 0.0428993287 0.0214496644
[98,] 0.9799728 0.0400543879 0.0200271939
[99,] 0.9805463 0.0389074644 0.0194537322
[100,] 0.9890929 0.0218141034 0.0109070517
[101,] 0.9928149 0.0143702827 0.0071851414
[102,] 0.9908858 0.0182283467 0.0091141733
[103,] 0.9974868 0.0050264565 0.0025132282
[104,] 0.9965443 0.0069113437 0.0034556719
[105,] 0.9958361 0.0083277639 0.0041638820
[106,] 0.9941917 0.0116166120 0.0058083060
[107,] 0.9927394 0.0145212861 0.0072606431
[108,] 0.9901772 0.0196455905 0.0098227953
[109,] 0.9870060 0.0259879657 0.0129939828
[110,] 0.9897325 0.0205349788 0.0102674894
[111,] 0.9925597 0.0148806648 0.0074403324
[112,] 0.9988990 0.0022020946 0.0011010473
[113,] 0.9996273 0.0007454266 0.0003727133
[114,] 0.9994382 0.0011235649 0.0005617825
[115,] 0.9991741 0.0016518791 0.0008259395
[116,] 0.9986951 0.0026098581 0.0013049290
[117,] 0.9979860 0.0040279563 0.0020139781
[118,] 0.9983339 0.0033321846 0.0016660923
[119,] 0.9974875 0.0050250131 0.0025125065
[120,] 0.9967998 0.0064003702 0.0032001851
[121,] 0.9953651 0.0092697438 0.0046348719
[122,] 0.9938825 0.0122350091 0.0061175046
[123,] 0.9947800 0.0104399779 0.0052199889
[124,] 0.9941262 0.0117476811 0.0058738406
[125,] 0.9910618 0.0178764070 0.0089382035
[126,] 0.9893243 0.0213513251 0.0106756626
[127,] 0.9864675 0.0270650644 0.0135325322
[128,] 0.9810203 0.0379593891 0.0189796946
[129,] 0.9733474 0.0533052239 0.0266526119
[130,] 0.9627476 0.0745048283 0.0372524141
[131,] 0.9815225 0.0369550004 0.0184775002
[132,] 0.9727003 0.0545993118 0.0272996559
[133,] 0.9666744 0.0666511315 0.0333255657
[134,] 0.9842507 0.0314986651 0.0157493325
[135,] 0.9797351 0.0405297981 0.0202648991
[136,] 0.9888918 0.0222164359 0.0111082180
[137,] 0.9843895 0.0312210207 0.0156105104
[138,] 0.9766782 0.0466435676 0.0233217838
[139,] 0.9707602 0.0584796554 0.0292398277
[140,] 0.9655430 0.0689139036 0.0344569518
[141,] 0.9657919 0.0684162666 0.0342081333
[142,] 0.9523013 0.0953973029 0.0476986514
[143,] 0.9261498 0.1477004686 0.0738502343
[144,] 0.9397457 0.1205086436 0.0602543218
[145,] 0.9468973 0.1062054489 0.0531027245
[146,] 0.9149152 0.1701696449 0.0850848225
[147,] 0.8746593 0.2506814257 0.1253407128
[148,] 0.9700296 0.0599407775 0.0299703887
[149,] 0.9412070 0.1175859200 0.0587929600
[150,] 0.8941077 0.2117846995 0.1058923497
[151,] 0.8344948 0.3310104114 0.1655052057
[152,] 0.8478285 0.3043429395 0.1521714698
[153,] 0.7095157 0.5809685091 0.2904842546
> postscript(file="/var/www/html/rcomp/tmp/1dk3n1258727037.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/29a0c1258727037.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/3k9f31258727037.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/48lc11258727037.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/5xckn1258727037.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 = 190
Frequency = 1
1 2 3 4 5 6
-120.4826249 -112.4220145 11.6620864 -96.9674036 -120.5899857 -39.4556096
7 8 9 10 11 12
-160.6391667 -194.9330993 153.1262367 -77.2960547 -46.2272000 170.5201257
13 14 15 16 17 18
-21.1451158 -70.7883619 -151.6396726 -91.7270782 142.4538314 36.1066287
19 20 21 22 23 24
-133.2191241 75.7194726 76.4067064 150.3506644 85.7970591 -114.1181490
25 26 27 28 29 30
-48.9739713 35.9235216 65.4292181 34.7412837 0.1276429 127.9073344
31 32 33 34 35 36
-274.2202000 83.4979092 103.7330706 -119.7436542 264.4358030 46.8267560
37 38 39 40 41 42
44.8593194 -91.3497278 237.9039975 91.3737373 99.1758416 -192.6565283
43 44 45 46 47 48
-44.1479426 60.2784539 249.9934743 286.8421185 65.5951422 147.2318726
49 50 51 52 53 54
-188.2234891 313.9357568 153.3833194 -28.5562847 165.8851891 28.1729131
55 56 57 58 59 60
168.9636759 0.4332030 -126.9026647 -114.9935379 -148.5325855 2.8888363
61 62 63 64 65 66
-16.6531191 -87.0036011 147.6172188 194.1227912 4.7041073 111.2146985
67 68 69 70 71 72
156.7639257 44.4876447 -126.1105777 -193.7932772 -124.4365726 -101.8097413
73 74 75 76 77 78
163.2748210 -90.3364964 -77.2372500 -86.6239865 -123.7660291 -6.3020246
79 80 81 82 83 84
29.7830239 -247.3829996 -18.8875868 147.8680231 -241.5586801 218.0252352
85 86 87 88 89 90
-174.4237687 -29.8948143 -11.5976583 -197.0170989 12.9655747 -224.6960546
91 92 93 94 95 96
81.1503553 5.5175344 -28.0699162 170.8379454 -99.6859914 -114.9199323
97 98 99 100 101 102
-93.3869409 38.3338016 -142.8752692 77.2348430 -34.7747158 55.2888386
103 104 105 106 107 108
-152.6839307 -68.4192709 72.1373635 116.5298800 232.7249452 -159.7225060
109 110 111 112 113 114
-21.9736639 27.7929561 -136.8358976 154.9631226 50.1758690 -15.3288735
115 116 117 118 119 120
-40.6958525 -113.2885989 105.0974292 152.1901024 68.7669871 -118.7259940
121 122 123 124 125 126
222.7411560 -39.8414057 -60.3460177 -72.9468790 -115.1906158 44.2159538
127 128 129 130 131 132
52.8011253 -117.7227854 91.9029607 126.3246134 -40.6061764 -121.3758269
133 134 135 136 137 138
41.1207255 -8.9141097 -59.4132543 90.4543153 -89.3491624 18.4708449
139 140 141 142 143 144
-41.4076651 105.5387468 -229.7251453 -52.1234648 -54.8503104 118.7472681
145 146 147 148 149 150
85.8585577 8.8515266 -7.2119665 -75.3207332 142.5813514 -60.6930824
151 152 153 154 155 156
79.9788621 179.3318584 -163.3935042 -335.4444245 -2.7064303 166.9042614
157 158 159 160 161 162
17.8307521 16.8745046 0.6737509 129.1047715 -65.5769314 149.1236085
163 164 165 166 167 168
-37.9593064 99.7310492 29.9013986 -8.8121028 -128.5139641 -215.9791300
169 170 171 172 173 174
26.3233808 93.4560860 -24.9594062 -113.8253841 -34.0040178 -71.3411257
175 176 177 178 179 180
179.7367767 13.8161848 -206.1187970 -192.2549387 169.7979743 75.5069241
181 182 183 184 185 186
83.2539814 -4.6176220 55.4468012 -9.0100162 -34.8179496 39.9724783
187 188 189 190
135.7954432 73.3946971 16.9095519 -56.4818925
> postscript(file="/var/www/html/rcomp/tmp/6btt21258727037.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 = 190
Frequency = 1
lag(myerror, k = 1) myerror
0 -120.4826249 NA
1 -112.4220145 -120.4826249
2 11.6620864 -112.4220145
3 -96.9674036 11.6620864
4 -120.5899857 -96.9674036
5 -39.4556096 -120.5899857
6 -160.6391667 -39.4556096
7 -194.9330993 -160.6391667
8 153.1262367 -194.9330993
9 -77.2960547 153.1262367
10 -46.2272000 -77.2960547
11 170.5201257 -46.2272000
12 -21.1451158 170.5201257
13 -70.7883619 -21.1451158
14 -151.6396726 -70.7883619
15 -91.7270782 -151.6396726
16 142.4538314 -91.7270782
17 36.1066287 142.4538314
18 -133.2191241 36.1066287
19 75.7194726 -133.2191241
20 76.4067064 75.7194726
21 150.3506644 76.4067064
22 85.7970591 150.3506644
23 -114.1181490 85.7970591
24 -48.9739713 -114.1181490
25 35.9235216 -48.9739713
26 65.4292181 35.9235216
27 34.7412837 65.4292181
28 0.1276429 34.7412837
29 127.9073344 0.1276429
30 -274.2202000 127.9073344
31 83.4979092 -274.2202000
32 103.7330706 83.4979092
33 -119.7436542 103.7330706
34 264.4358030 -119.7436542
35 46.8267560 264.4358030
36 44.8593194 46.8267560
37 -91.3497278 44.8593194
38 237.9039975 -91.3497278
39 91.3737373 237.9039975
40 99.1758416 91.3737373
41 -192.6565283 99.1758416
42 -44.1479426 -192.6565283
43 60.2784539 -44.1479426
44 249.9934743 60.2784539
45 286.8421185 249.9934743
46 65.5951422 286.8421185
47 147.2318726 65.5951422
48 -188.2234891 147.2318726
49 313.9357568 -188.2234891
50 153.3833194 313.9357568
51 -28.5562847 153.3833194
52 165.8851891 -28.5562847
53 28.1729131 165.8851891
54 168.9636759 28.1729131
55 0.4332030 168.9636759
56 -126.9026647 0.4332030
57 -114.9935379 -126.9026647
58 -148.5325855 -114.9935379
59 2.8888363 -148.5325855
60 -16.6531191 2.8888363
61 -87.0036011 -16.6531191
62 147.6172188 -87.0036011
63 194.1227912 147.6172188
64 4.7041073 194.1227912
65 111.2146985 4.7041073
66 156.7639257 111.2146985
67 44.4876447 156.7639257
68 -126.1105777 44.4876447
69 -193.7932772 -126.1105777
70 -124.4365726 -193.7932772
71 -101.8097413 -124.4365726
72 163.2748210 -101.8097413
73 -90.3364964 163.2748210
74 -77.2372500 -90.3364964
75 -86.6239865 -77.2372500
76 -123.7660291 -86.6239865
77 -6.3020246 -123.7660291
78 29.7830239 -6.3020246
79 -247.3829996 29.7830239
80 -18.8875868 -247.3829996
81 147.8680231 -18.8875868
82 -241.5586801 147.8680231
83 218.0252352 -241.5586801
84 -174.4237687 218.0252352
85 -29.8948143 -174.4237687
86 -11.5976583 -29.8948143
87 -197.0170989 -11.5976583
88 12.9655747 -197.0170989
89 -224.6960546 12.9655747
90 81.1503553 -224.6960546
91 5.5175344 81.1503553
92 -28.0699162 5.5175344
93 170.8379454 -28.0699162
94 -99.6859914 170.8379454
95 -114.9199323 -99.6859914
96 -93.3869409 -114.9199323
97 38.3338016 -93.3869409
98 -142.8752692 38.3338016
99 77.2348430 -142.8752692
100 -34.7747158 77.2348430
101 55.2888386 -34.7747158
102 -152.6839307 55.2888386
103 -68.4192709 -152.6839307
104 72.1373635 -68.4192709
105 116.5298800 72.1373635
106 232.7249452 116.5298800
107 -159.7225060 232.7249452
108 -21.9736639 -159.7225060
109 27.7929561 -21.9736639
110 -136.8358976 27.7929561
111 154.9631226 -136.8358976
112 50.1758690 154.9631226
113 -15.3288735 50.1758690
114 -40.6958525 -15.3288735
115 -113.2885989 -40.6958525
116 105.0974292 -113.2885989
117 152.1901024 105.0974292
118 68.7669871 152.1901024
119 -118.7259940 68.7669871
120 222.7411560 -118.7259940
121 -39.8414057 222.7411560
122 -60.3460177 -39.8414057
123 -72.9468790 -60.3460177
124 -115.1906158 -72.9468790
125 44.2159538 -115.1906158
126 52.8011253 44.2159538
127 -117.7227854 52.8011253
128 91.9029607 -117.7227854
129 126.3246134 91.9029607
130 -40.6061764 126.3246134
131 -121.3758269 -40.6061764
132 41.1207255 -121.3758269
133 -8.9141097 41.1207255
134 -59.4132543 -8.9141097
135 90.4543153 -59.4132543
136 -89.3491624 90.4543153
137 18.4708449 -89.3491624
138 -41.4076651 18.4708449
139 105.5387468 -41.4076651
140 -229.7251453 105.5387468
141 -52.1234648 -229.7251453
142 -54.8503104 -52.1234648
143 118.7472681 -54.8503104
144 85.8585577 118.7472681
145 8.8515266 85.8585577
146 -7.2119665 8.8515266
147 -75.3207332 -7.2119665
148 142.5813514 -75.3207332
149 -60.6930824 142.5813514
150 79.9788621 -60.6930824
151 179.3318584 79.9788621
152 -163.3935042 179.3318584
153 -335.4444245 -163.3935042
154 -2.7064303 -335.4444245
155 166.9042614 -2.7064303
156 17.8307521 166.9042614
157 16.8745046 17.8307521
158 0.6737509 16.8745046
159 129.1047715 0.6737509
160 -65.5769314 129.1047715
161 149.1236085 -65.5769314
162 -37.9593064 149.1236085
163 99.7310492 -37.9593064
164 29.9013986 99.7310492
165 -8.8121028 29.9013986
166 -128.5139641 -8.8121028
167 -215.9791300 -128.5139641
168 26.3233808 -215.9791300
169 93.4560860 26.3233808
170 -24.9594062 93.4560860
171 -113.8253841 -24.9594062
172 -34.0040178 -113.8253841
173 -71.3411257 -34.0040178
174 179.7367767 -71.3411257
175 13.8161848 179.7367767
176 -206.1187970 13.8161848
177 -192.2549387 -206.1187970
178 169.7979743 -192.2549387
179 75.5069241 169.7979743
180 83.2539814 75.5069241
181 -4.6176220 83.2539814
182 55.4468012 -4.6176220
183 -9.0100162 55.4468012
184 -34.8179496 -9.0100162
185 39.9724783 -34.8179496
186 135.7954432 39.9724783
187 73.3946971 135.7954432
188 16.9095519 73.3946971
189 -56.4818925 16.9095519
190 NA -56.4818925
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -112.4220145 -120.4826249
[2,] 11.6620864 -112.4220145
[3,] -96.9674036 11.6620864
[4,] -120.5899857 -96.9674036
[5,] -39.4556096 -120.5899857
[6,] -160.6391667 -39.4556096
[7,] -194.9330993 -160.6391667
[8,] 153.1262367 -194.9330993
[9,] -77.2960547 153.1262367
[10,] -46.2272000 -77.2960547
[11,] 170.5201257 -46.2272000
[12,] -21.1451158 170.5201257
[13,] -70.7883619 -21.1451158
[14,] -151.6396726 -70.7883619
[15,] -91.7270782 -151.6396726
[16,] 142.4538314 -91.7270782
[17,] 36.1066287 142.4538314
[18,] -133.2191241 36.1066287
[19,] 75.7194726 -133.2191241
[20,] 76.4067064 75.7194726
[21,] 150.3506644 76.4067064
[22,] 85.7970591 150.3506644
[23,] -114.1181490 85.7970591
[24,] -48.9739713 -114.1181490
[25,] 35.9235216 -48.9739713
[26,] 65.4292181 35.9235216
[27,] 34.7412837 65.4292181
[28,] 0.1276429 34.7412837
[29,] 127.9073344 0.1276429
[30,] -274.2202000 127.9073344
[31,] 83.4979092 -274.2202000
[32,] 103.7330706 83.4979092
[33,] -119.7436542 103.7330706
[34,] 264.4358030 -119.7436542
[35,] 46.8267560 264.4358030
[36,] 44.8593194 46.8267560
[37,] -91.3497278 44.8593194
[38,] 237.9039975 -91.3497278
[39,] 91.3737373 237.9039975
[40,] 99.1758416 91.3737373
[41,] -192.6565283 99.1758416
[42,] -44.1479426 -192.6565283
[43,] 60.2784539 -44.1479426
[44,] 249.9934743 60.2784539
[45,] 286.8421185 249.9934743
[46,] 65.5951422 286.8421185
[47,] 147.2318726 65.5951422
[48,] -188.2234891 147.2318726
[49,] 313.9357568 -188.2234891
[50,] 153.3833194 313.9357568
[51,] -28.5562847 153.3833194
[52,] 165.8851891 -28.5562847
[53,] 28.1729131 165.8851891
[54,] 168.9636759 28.1729131
[55,] 0.4332030 168.9636759
[56,] -126.9026647 0.4332030
[57,] -114.9935379 -126.9026647
[58,] -148.5325855 -114.9935379
[59,] 2.8888363 -148.5325855
[60,] -16.6531191 2.8888363
[61,] -87.0036011 -16.6531191
[62,] 147.6172188 -87.0036011
[63,] 194.1227912 147.6172188
[64,] 4.7041073 194.1227912
[65,] 111.2146985 4.7041073
[66,] 156.7639257 111.2146985
[67,] 44.4876447 156.7639257
[68,] -126.1105777 44.4876447
[69,] -193.7932772 -126.1105777
[70,] -124.4365726 -193.7932772
[71,] -101.8097413 -124.4365726
[72,] 163.2748210 -101.8097413
[73,] -90.3364964 163.2748210
[74,] -77.2372500 -90.3364964
[75,] -86.6239865 -77.2372500
[76,] -123.7660291 -86.6239865
[77,] -6.3020246 -123.7660291
[78,] 29.7830239 -6.3020246
[79,] -247.3829996 29.7830239
[80,] -18.8875868 -247.3829996
[81,] 147.8680231 -18.8875868
[82,] -241.5586801 147.8680231
[83,] 218.0252352 -241.5586801
[84,] -174.4237687 218.0252352
[85,] -29.8948143 -174.4237687
[86,] -11.5976583 -29.8948143
[87,] -197.0170989 -11.5976583
[88,] 12.9655747 -197.0170989
[89,] -224.6960546 12.9655747
[90,] 81.1503553 -224.6960546
[91,] 5.5175344 81.1503553
[92,] -28.0699162 5.5175344
[93,] 170.8379454 -28.0699162
[94,] -99.6859914 170.8379454
[95,] -114.9199323 -99.6859914
[96,] -93.3869409 -114.9199323
[97,] 38.3338016 -93.3869409
[98,] -142.8752692 38.3338016
[99,] 77.2348430 -142.8752692
[100,] -34.7747158 77.2348430
[101,] 55.2888386 -34.7747158
[102,] -152.6839307 55.2888386
[103,] -68.4192709 -152.6839307
[104,] 72.1373635 -68.4192709
[105,] 116.5298800 72.1373635
[106,] 232.7249452 116.5298800
[107,] -159.7225060 232.7249452
[108,] -21.9736639 -159.7225060
[109,] 27.7929561 -21.9736639
[110,] -136.8358976 27.7929561
[111,] 154.9631226 -136.8358976
[112,] 50.1758690 154.9631226
[113,] -15.3288735 50.1758690
[114,] -40.6958525 -15.3288735
[115,] -113.2885989 -40.6958525
[116,] 105.0974292 -113.2885989
[117,] 152.1901024 105.0974292
[118,] 68.7669871 152.1901024
[119,] -118.7259940 68.7669871
[120,] 222.7411560 -118.7259940
[121,] -39.8414057 222.7411560
[122,] -60.3460177 -39.8414057
[123,] -72.9468790 -60.3460177
[124,] -115.1906158 -72.9468790
[125,] 44.2159538 -115.1906158
[126,] 52.8011253 44.2159538
[127,] -117.7227854 52.8011253
[128,] 91.9029607 -117.7227854
[129,] 126.3246134 91.9029607
[130,] -40.6061764 126.3246134
[131,] -121.3758269 -40.6061764
[132,] 41.1207255 -121.3758269
[133,] -8.9141097 41.1207255
[134,] -59.4132543 -8.9141097
[135,] 90.4543153 -59.4132543
[136,] -89.3491624 90.4543153
[137,] 18.4708449 -89.3491624
[138,] -41.4076651 18.4708449
[139,] 105.5387468 -41.4076651
[140,] -229.7251453 105.5387468
[141,] -52.1234648 -229.7251453
[142,] -54.8503104 -52.1234648
[143,] 118.7472681 -54.8503104
[144,] 85.8585577 118.7472681
[145,] 8.8515266 85.8585577
[146,] -7.2119665 8.8515266
[147,] -75.3207332 -7.2119665
[148,] 142.5813514 -75.3207332
[149,] -60.6930824 142.5813514
[150,] 79.9788621 -60.6930824
[151,] 179.3318584 79.9788621
[152,] -163.3935042 179.3318584
[153,] -335.4444245 -163.3935042
[154,] -2.7064303 -335.4444245
[155,] 166.9042614 -2.7064303
[156,] 17.8307521 166.9042614
[157,] 16.8745046 17.8307521
[158,] 0.6737509 16.8745046
[159,] 129.1047715 0.6737509
[160,] -65.5769314 129.1047715
[161,] 149.1236085 -65.5769314
[162,] -37.9593064 149.1236085
[163,] 99.7310492 -37.9593064
[164,] 29.9013986 99.7310492
[165,] -8.8121028 29.9013986
[166,] -128.5139641 -8.8121028
[167,] -215.9791300 -128.5139641
[168,] 26.3233808 -215.9791300
[169,] 93.4560860 26.3233808
[170,] -24.9594062 93.4560860
[171,] -113.8253841 -24.9594062
[172,] -34.0040178 -113.8253841
[173,] -71.3411257 -34.0040178
[174,] 179.7367767 -71.3411257
[175,] 13.8161848 179.7367767
[176,] -206.1187970 13.8161848
[177,] -192.2549387 -206.1187970
[178,] 169.7979743 -192.2549387
[179,] 75.5069241 169.7979743
[180,] 83.2539814 75.5069241
[181,] -4.6176220 83.2539814
[182,] 55.4468012 -4.6176220
[183,] -9.0100162 55.4468012
[184,] -34.8179496 -9.0100162
[185,] 39.9724783 -34.8179496
[186,] 135.7954432 39.9724783
[187,] 73.3946971 135.7954432
[188,] 16.9095519 73.3946971
[189,] -56.4818925 16.9095519
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -112.4220145 -120.4826249
2 11.6620864 -112.4220145
3 -96.9674036 11.6620864
4 -120.5899857 -96.9674036
5 -39.4556096 -120.5899857
6 -160.6391667 -39.4556096
7 -194.9330993 -160.6391667
8 153.1262367 -194.9330993
9 -77.2960547 153.1262367
10 -46.2272000 -77.2960547
11 170.5201257 -46.2272000
12 -21.1451158 170.5201257
13 -70.7883619 -21.1451158
14 -151.6396726 -70.7883619
15 -91.7270782 -151.6396726
16 142.4538314 -91.7270782
17 36.1066287 142.4538314
18 -133.2191241 36.1066287
19 75.7194726 -133.2191241
20 76.4067064 75.7194726
21 150.3506644 76.4067064
22 85.7970591 150.3506644
23 -114.1181490 85.7970591
24 -48.9739713 -114.1181490
25 35.9235216 -48.9739713
26 65.4292181 35.9235216
27 34.7412837 65.4292181
28 0.1276429 34.7412837
29 127.9073344 0.1276429
30 -274.2202000 127.9073344
31 83.4979092 -274.2202000
32 103.7330706 83.4979092
33 -119.7436542 103.7330706
34 264.4358030 -119.7436542
35 46.8267560 264.4358030
36 44.8593194 46.8267560
37 -91.3497278 44.8593194
38 237.9039975 -91.3497278
39 91.3737373 237.9039975
40 99.1758416 91.3737373
41 -192.6565283 99.1758416
42 -44.1479426 -192.6565283
43 60.2784539 -44.1479426
44 249.9934743 60.2784539
45 286.8421185 249.9934743
46 65.5951422 286.8421185
47 147.2318726 65.5951422
48 -188.2234891 147.2318726
49 313.9357568 -188.2234891
50 153.3833194 313.9357568
51 -28.5562847 153.3833194
52 165.8851891 -28.5562847
53 28.1729131 165.8851891
54 168.9636759 28.1729131
55 0.4332030 168.9636759
56 -126.9026647 0.4332030
57 -114.9935379 -126.9026647
58 -148.5325855 -114.9935379
59 2.8888363 -148.5325855
60 -16.6531191 2.8888363
61 -87.0036011 -16.6531191
62 147.6172188 -87.0036011
63 194.1227912 147.6172188
64 4.7041073 194.1227912
65 111.2146985 4.7041073
66 156.7639257 111.2146985
67 44.4876447 156.7639257
68 -126.1105777 44.4876447
69 -193.7932772 -126.1105777
70 -124.4365726 -193.7932772
71 -101.8097413 -124.4365726
72 163.2748210 -101.8097413
73 -90.3364964 163.2748210
74 -77.2372500 -90.3364964
75 -86.6239865 -77.2372500
76 -123.7660291 -86.6239865
77 -6.3020246 -123.7660291
78 29.7830239 -6.3020246
79 -247.3829996 29.7830239
80 -18.8875868 -247.3829996
81 147.8680231 -18.8875868
82 -241.5586801 147.8680231
83 218.0252352 -241.5586801
84 -174.4237687 218.0252352
85 -29.8948143 -174.4237687
86 -11.5976583 -29.8948143
87 -197.0170989 -11.5976583
88 12.9655747 -197.0170989
89 -224.6960546 12.9655747
90 81.1503553 -224.6960546
91 5.5175344 81.1503553
92 -28.0699162 5.5175344
93 170.8379454 -28.0699162
94 -99.6859914 170.8379454
95 -114.9199323 -99.6859914
96 -93.3869409 -114.9199323
97 38.3338016 -93.3869409
98 -142.8752692 38.3338016
99 77.2348430 -142.8752692
100 -34.7747158 77.2348430
101 55.2888386 -34.7747158
102 -152.6839307 55.2888386
103 -68.4192709 -152.6839307
104 72.1373635 -68.4192709
105 116.5298800 72.1373635
106 232.7249452 116.5298800
107 -159.7225060 232.7249452
108 -21.9736639 -159.7225060
109 27.7929561 -21.9736639
110 -136.8358976 27.7929561
111 154.9631226 -136.8358976
112 50.1758690 154.9631226
113 -15.3288735 50.1758690
114 -40.6958525 -15.3288735
115 -113.2885989 -40.6958525
116 105.0974292 -113.2885989
117 152.1901024 105.0974292
118 68.7669871 152.1901024
119 -118.7259940 68.7669871
120 222.7411560 -118.7259940
121 -39.8414057 222.7411560
122 -60.3460177 -39.8414057
123 -72.9468790 -60.3460177
124 -115.1906158 -72.9468790
125 44.2159538 -115.1906158
126 52.8011253 44.2159538
127 -117.7227854 52.8011253
128 91.9029607 -117.7227854
129 126.3246134 91.9029607
130 -40.6061764 126.3246134
131 -121.3758269 -40.6061764
132 41.1207255 -121.3758269
133 -8.9141097 41.1207255
134 -59.4132543 -8.9141097
135 90.4543153 -59.4132543
136 -89.3491624 90.4543153
137 18.4708449 -89.3491624
138 -41.4076651 18.4708449
139 105.5387468 -41.4076651
140 -229.7251453 105.5387468
141 -52.1234648 -229.7251453
142 -54.8503104 -52.1234648
143 118.7472681 -54.8503104
144 85.8585577 118.7472681
145 8.8515266 85.8585577
146 -7.2119665 8.8515266
147 -75.3207332 -7.2119665
148 142.5813514 -75.3207332
149 -60.6930824 142.5813514
150 79.9788621 -60.6930824
151 179.3318584 79.9788621
152 -163.3935042 179.3318584
153 -335.4444245 -163.3935042
154 -2.7064303 -335.4444245
155 166.9042614 -2.7064303
156 17.8307521 166.9042614
157 16.8745046 17.8307521
158 0.6737509 16.8745046
159 129.1047715 0.6737509
160 -65.5769314 129.1047715
161 149.1236085 -65.5769314
162 -37.9593064 149.1236085
163 99.7310492 -37.9593064
164 29.9013986 99.7310492
165 -8.8121028 29.9013986
166 -128.5139641 -8.8121028
167 -215.9791300 -128.5139641
168 26.3233808 -215.9791300
169 93.4560860 26.3233808
170 -24.9594062 93.4560860
171 -113.8253841 -24.9594062
172 -34.0040178 -113.8253841
173 -71.3411257 -34.0040178
174 179.7367767 -71.3411257
175 13.8161848 179.7367767
176 -206.1187970 13.8161848
177 -192.2549387 -206.1187970
178 169.7979743 -192.2549387
179 75.5069241 169.7979743
180 83.2539814 75.5069241
181 -4.6176220 83.2539814
182 55.4468012 -4.6176220
183 -9.0100162 55.4468012
184 -34.8179496 -9.0100162
185 39.9724783 -34.8179496
186 135.7954432 39.9724783
187 73.3946971 135.7954432
188 16.9095519 73.3946971
189 -56.4818925 16.9095519
> 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/7a7691258727037.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/85egv1258727037.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/9fd2x1258727037.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/103jq21258727037.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/11v8l01258727037.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/12omai1258727037.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/13zjah1258727037.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/14mmwl1258727037.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/159znt1258727037.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/16ng0q1258727038.tab")
+ }
>
> system("convert tmp/1dk3n1258727037.ps tmp/1dk3n1258727037.png")
> system("convert tmp/29a0c1258727037.ps tmp/29a0c1258727037.png")
> system("convert tmp/3k9f31258727037.ps tmp/3k9f31258727037.png")
> system("convert tmp/48lc11258727037.ps tmp/48lc11258727037.png")
> system("convert tmp/5xckn1258727037.ps tmp/5xckn1258727037.png")
> system("convert tmp/6btt21258727037.ps tmp/6btt21258727037.png")
> system("convert tmp/7a7691258727037.ps tmp/7a7691258727037.png")
> system("convert tmp/85egv1258727037.ps tmp/85egv1258727037.png")
> system("convert tmp/9fd2x1258727037.ps tmp/9fd2x1258727037.png")
> system("convert tmp/103jq21258727037.ps tmp/103jq21258727037.png")
>
>
> proc.time()
user system elapsed
5.009 1.817 10.241