R version 2.6.0 (2007-10-03)
Copyright (C) 2007 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(1687
+ ,0
+ ,1508
+ ,0
+ ,1507
+ ,0
+ ,1385
+ ,0
+ ,1632
+ ,0
+ ,1511
+ ,0
+ ,1559
+ ,0
+ ,1630
+ ,0
+ ,1579
+ ,0
+ ,1653
+ ,0
+ ,2152
+ ,0
+ ,2148
+ ,0
+ ,1752
+ ,0
+ ,1765
+ ,0
+ ,1717
+ ,0
+ ,1558
+ ,0
+ ,1575
+ ,0
+ ,1520
+ ,0
+ ,1805
+ ,0
+ ,1800
+ ,0
+ ,1719
+ ,0
+ ,2008
+ ,0
+ ,2242
+ ,0
+ ,2478
+ ,0
+ ,2030
+ ,0
+ ,1655
+ ,0
+ ,1693
+ ,0
+ ,1623
+ ,0
+ ,1805
+ ,0
+ ,1746
+ ,0
+ ,1795
+ ,0
+ ,1926
+ ,0
+ ,1619
+ ,0
+ ,1992
+ ,0
+ ,2233
+ ,0
+ ,2192
+ ,0
+ ,2080
+ ,0
+ ,1768
+ ,0
+ ,1835
+ ,0
+ ,1569
+ ,0
+ ,1976
+ ,0
+ ,1853
+ ,0
+ ,1965
+ ,0
+ ,1689
+ ,0
+ ,1778
+ ,0
+ ,1976
+ ,0
+ ,2397
+ ,0
+ ,2654
+ ,0
+ ,2097
+ ,0
+ ,1963
+ ,0
+ ,1677
+ ,0
+ ,1941
+ ,0
+ ,2003
+ ,0
+ ,1813
+ ,0
+ ,2012
+ ,0
+ ,1912
+ ,0
+ ,2084
+ ,0
+ ,2080
+ ,0
+ ,2118
+ ,0
+ ,2150
+ ,0
+ ,1608
+ ,0
+ ,1503
+ ,0
+ ,1548
+ ,0
+ ,1382
+ ,0
+ ,1731
+ ,0
+ ,1798
+ ,0
+ ,1779
+ ,0
+ ,1887
+ ,0
+ ,2004
+ ,0
+ ,2077
+ ,0
+ ,2092
+ ,0
+ ,2051
+ ,0
+ ,1577
+ ,0
+ ,1356
+ ,0
+ ,1652
+ ,0
+ ,1382
+ ,0
+ ,1519
+ ,0
+ ,1421
+ ,0
+ ,1442
+ ,0
+ ,1543
+ ,0
+ ,1656
+ ,0
+ ,1561
+ ,0
+ ,1905
+ ,0
+ ,2199
+ ,0
+ ,1473
+ ,0
+ ,1655
+ ,0
+ ,1407
+ ,0
+ ,1395
+ ,0
+ ,1530
+ ,0
+ ,1309
+ ,0
+ ,1526
+ ,0
+ ,1327
+ ,0
+ ,1627
+ ,0
+ ,1748
+ ,0
+ ,1958
+ ,0
+ ,2274
+ ,0
+ ,1648
+ ,0
+ ,1401
+ ,0
+ ,1411
+ ,0
+ ,1403
+ ,0
+ ,1394
+ ,0
+ ,1520
+ ,0
+ ,1528
+ ,0
+ ,1643
+ ,0
+ ,1515
+ ,0
+ ,1685
+ ,0
+ ,2000
+ ,0
+ ,2215
+ ,0
+ ,1956
+ ,0
+ ,1462
+ ,0
+ ,1563
+ ,0
+ ,1459
+ ,0
+ ,1446
+ ,0
+ ,1622
+ ,0
+ ,1657
+ ,0
+ ,1638
+ ,0
+ ,1643
+ ,0
+ ,1683
+ ,0
+ ,2050
+ ,0
+ ,2262
+ ,0
+ ,1813
+ ,0
+ ,1445
+ ,0
+ ,1762
+ ,0
+ ,1461
+ ,0
+ ,1556
+ ,0
+ ,1431
+ ,0
+ ,1427
+ ,0
+ ,1554
+ ,0
+ ,1645
+ ,0
+ ,1653
+ ,0
+ ,2016
+ ,0
+ ,2207
+ ,0
+ ,1665
+ ,0
+ ,1361
+ ,0
+ ,1506
+ ,0
+ ,1360
+ ,0
+ ,1453
+ ,0
+ ,1522
+ ,0
+ ,1460
+ ,0
+ ,1552
+ ,0
+ ,1548
+ ,0
+ ,1827
+ ,0
+ ,1737
+ ,0
+ ,1941
+ ,0
+ ,1474
+ ,0
+ ,1458
+ ,0
+ ,1542
+ ,0
+ ,1404
+ ,0
+ ,1522
+ ,0
+ ,1385
+ ,0
+ ,1641
+ ,0
+ ,1510
+ ,0
+ ,1681
+ ,0
+ ,1938
+ ,0
+ ,1868
+ ,0
+ ,1726
+ ,0
+ ,1456
+ ,0
+ ,1445
+ ,0
+ ,1456
+ ,0
+ ,1365
+ ,0
+ ,1487
+ ,0
+ ,1558
+ ,0
+ ,1488
+ ,0
+ ,1684
+ ,0
+ ,1594
+ ,0
+ ,1850
+ ,0
+ ,1998
+ ,0
+ ,2079
+ ,0
+ ,1494
+ ,0
+ ,1057
+ ,1
+ ,1218
+ ,1
+ ,1168
+ ,1
+ ,1236
+ ,1
+ ,1076
+ ,1
+ ,1174
+ ,1
+ ,1139
+ ,1
+ ,1427
+ ,1
+ ,1487
+ ,1
+ ,1483
+ ,1
+ ,1513
+ ,1
+ ,1357
+ ,1
+ ,1165
+ ,1
+ ,1282
+ ,1
+ ,1110
+ ,1
+ ,1297
+ ,1
+ ,1185
+ ,1
+ ,1222
+ ,1
+ ,1284
+ ,1
+ ,1444
+ ,1
+ ,1575
+ ,1
+ ,1737
+ ,1
+ ,1763
+ ,1)
+ ,dim=c(2
+ ,192)
+ ,dimnames=list(c('Deaths'
+ ,'Seatbelt')
+ ,1:192))
> y <- array(NA,dim=c(2,192),dimnames=list(c('Deaths','Seatbelt'),1:192))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = '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
Deaths Seatbelt M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 1687 0 1 0 0 0 0 0 0 0 0 0 0 1
2 1508 0 0 1 0 0 0 0 0 0 0 0 0 2
3 1507 0 0 0 1 0 0 0 0 0 0 0 0 3
4 1385 0 0 0 0 1 0 0 0 0 0 0 0 4
5 1632 0 0 0 0 0 1 0 0 0 0 0 0 5
6 1511 0 0 0 0 0 0 1 0 0 0 0 0 6
7 1559 0 0 0 0 0 0 0 1 0 0 0 0 7
8 1630 0 0 0 0 0 0 0 0 1 0 0 0 8
9 1579 0 0 0 0 0 0 0 0 0 1 0 0 9
10 1653 0 0 0 0 0 0 0 0 0 0 1 0 10
11 2152 0 0 0 0 0 0 0 0 0 0 0 1 11
12 2148 0 0 0 0 0 0 0 0 0 0 0 0 12
13 1752 0 1 0 0 0 0 0 0 0 0 0 0 13
14 1765 0 0 1 0 0 0 0 0 0 0 0 0 14
15 1717 0 0 0 1 0 0 0 0 0 0 0 0 15
16 1558 0 0 0 0 1 0 0 0 0 0 0 0 16
17 1575 0 0 0 0 0 1 0 0 0 0 0 0 17
18 1520 0 0 0 0 0 0 1 0 0 0 0 0 18
19 1805 0 0 0 0 0 0 0 1 0 0 0 0 19
20 1800 0 0 0 0 0 0 0 0 1 0 0 0 20
21 1719 0 0 0 0 0 0 0 0 0 1 0 0 21
22 2008 0 0 0 0 0 0 0 0 0 0 1 0 22
23 2242 0 0 0 0 0 0 0 0 0 0 0 1 23
24 2478 0 0 0 0 0 0 0 0 0 0 0 0 24
25 2030 0 1 0 0 0 0 0 0 0 0 0 0 25
26 1655 0 0 1 0 0 0 0 0 0 0 0 0 26
27 1693 0 0 0 1 0 0 0 0 0 0 0 0 27
28 1623 0 0 0 0 1 0 0 0 0 0 0 0 28
29 1805 0 0 0 0 0 1 0 0 0 0 0 0 29
30 1746 0 0 0 0 0 0 1 0 0 0 0 0 30
31 1795 0 0 0 0 0 0 0 1 0 0 0 0 31
32 1926 0 0 0 0 0 0 0 0 1 0 0 0 32
33 1619 0 0 0 0 0 0 0 0 0 1 0 0 33
34 1992 0 0 0 0 0 0 0 0 0 0 1 0 34
35 2233 0 0 0 0 0 0 0 0 0 0 0 1 35
36 2192 0 0 0 0 0 0 0 0 0 0 0 0 36
37 2080 0 1 0 0 0 0 0 0 0 0 0 0 37
38 1768 0 0 1 0 0 0 0 0 0 0 0 0 38
39 1835 0 0 0 1 0 0 0 0 0 0 0 0 39
40 1569 0 0 0 0 1 0 0 0 0 0 0 0 40
41 1976 0 0 0 0 0 1 0 0 0 0 0 0 41
42 1853 0 0 0 0 0 0 1 0 0 0 0 0 42
43 1965 0 0 0 0 0 0 0 1 0 0 0 0 43
44 1689 0 0 0 0 0 0 0 0 1 0 0 0 44
45 1778 0 0 0 0 0 0 0 0 0 1 0 0 45
46 1976 0 0 0 0 0 0 0 0 0 0 1 0 46
47 2397 0 0 0 0 0 0 0 0 0 0 0 1 47
48 2654 0 0 0 0 0 0 0 0 0 0 0 0 48
49 2097 0 1 0 0 0 0 0 0 0 0 0 0 49
50 1963 0 0 1 0 0 0 0 0 0 0 0 0 50
51 1677 0 0 0 1 0 0 0 0 0 0 0 0 51
52 1941 0 0 0 0 1 0 0 0 0 0 0 0 52
53 2003 0 0 0 0 0 1 0 0 0 0 0 0 53
54 1813 0 0 0 0 0 0 1 0 0 0 0 0 54
55 2012 0 0 0 0 0 0 0 1 0 0 0 0 55
56 1912 0 0 0 0 0 0 0 0 1 0 0 0 56
57 2084 0 0 0 0 0 0 0 0 0 1 0 0 57
58 2080 0 0 0 0 0 0 0 0 0 0 1 0 58
59 2118 0 0 0 0 0 0 0 0 0 0 0 1 59
60 2150 0 0 0 0 0 0 0 0 0 0 0 0 60
61 1608 0 1 0 0 0 0 0 0 0 0 0 0 61
62 1503 0 0 1 0 0 0 0 0 0 0 0 0 62
63 1548 0 0 0 1 0 0 0 0 0 0 0 0 63
64 1382 0 0 0 0 1 0 0 0 0 0 0 0 64
65 1731 0 0 0 0 0 1 0 0 0 0 0 0 65
66 1798 0 0 0 0 0 0 1 0 0 0 0 0 66
67 1779 0 0 0 0 0 0 0 1 0 0 0 0 67
68 1887 0 0 0 0 0 0 0 0 1 0 0 0 68
69 2004 0 0 0 0 0 0 0 0 0 1 0 0 69
70 2077 0 0 0 0 0 0 0 0 0 0 1 0 70
71 2092 0 0 0 0 0 0 0 0 0 0 0 1 71
72 2051 0 0 0 0 0 0 0 0 0 0 0 0 72
73 1577 0 1 0 0 0 0 0 0 0 0 0 0 73
74 1356 0 0 1 0 0 0 0 0 0 0 0 0 74
75 1652 0 0 0 1 0 0 0 0 0 0 0 0 75
76 1382 0 0 0 0 1 0 0 0 0 0 0 0 76
77 1519 0 0 0 0 0 1 0 0 0 0 0 0 77
78 1421 0 0 0 0 0 0 1 0 0 0 0 0 78
79 1442 0 0 0 0 0 0 0 1 0 0 0 0 79
80 1543 0 0 0 0 0 0 0 0 1 0 0 0 80
81 1656 0 0 0 0 0 0 0 0 0 1 0 0 81
82 1561 0 0 0 0 0 0 0 0 0 0 1 0 82
83 1905 0 0 0 0 0 0 0 0 0 0 0 1 83
84 2199 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 1655 0 0 1 0 0 0 0 0 0 0 0 0 86
87 1407 0 0 0 1 0 0 0 0 0 0 0 0 87
88 1395 0 0 0 0 1 0 0 0 0 0 0 0 88
89 1530 0 0 0 0 0 1 0 0 0 0 0 0 89
90 1309 0 0 0 0 0 0 1 0 0 0 0 0 90
91 1526 0 0 0 0 0 0 0 1 0 0 0 0 91
92 1327 0 0 0 0 0 0 0 0 1 0 0 0 92
93 1627 0 0 0 0 0 0 0 0 0 1 0 0 93
94 1748 0 0 0 0 0 0 0 0 0 0 1 0 94
95 1958 0 0 0 0 0 0 0 0 0 0 0 1 95
96 2274 0 0 0 0 0 0 0 0 0 0 0 0 96
97 1648 0 1 0 0 0 0 0 0 0 0 0 0 97
98 1401 0 0 1 0 0 0 0 0 0 0 0 0 98
99 1411 0 0 0 1 0 0 0 0 0 0 0 0 99
100 1403 0 0 0 0 1 0 0 0 0 0 0 0 100
101 1394 0 0 0 0 0 1 0 0 0 0 0 0 101
102 1520 0 0 0 0 0 0 1 0 0 0 0 0 102
103 1528 0 0 0 0 0 0 0 1 0 0 0 0 103
104 1643 0 0 0 0 0 0 0 0 1 0 0 0 104
105 1515 0 0 0 0 0 0 0 0 0 1 0 0 105
106 1685 0 0 0 0 0 0 0 0 0 0 1 0 106
107 2000 0 0 0 0 0 0 0 0 0 0 0 1 107
108 2215 0 0 0 0 0 0 0 0 0 0 0 0 108
109 1956 0 1 0 0 0 0 0 0 0 0 0 0 109
110 1462 0 0 1 0 0 0 0 0 0 0 0 0 110
111 1563 0 0 0 1 0 0 0 0 0 0 0 0 111
112 1459 0 0 0 0 1 0 0 0 0 0 0 0 112
113 1446 0 0 0 0 0 1 0 0 0 0 0 0 113
114 1622 0 0 0 0 0 0 1 0 0 0 0 0 114
115 1657 0 0 0 0 0 0 0 1 0 0 0 0 115
116 1638 0 0 0 0 0 0 0 0 1 0 0 0 116
117 1643 0 0 0 0 0 0 0 0 0 1 0 0 117
118 1683 0 0 0 0 0 0 0 0 0 0 1 0 118
119 2050 0 0 0 0 0 0 0 0 0 0 0 1 119
120 2262 0 0 0 0 0 0 0 0 0 0 0 0 120
121 1813 0 1 0 0 0 0 0 0 0 0 0 0 121
122 1445 0 0 1 0 0 0 0 0 0 0 0 0 122
123 1762 0 0 0 1 0 0 0 0 0 0 0 0 123
124 1461 0 0 0 0 1 0 0 0 0 0 0 0 124
125 1556 0 0 0 0 0 1 0 0 0 0 0 0 125
126 1431 0 0 0 0 0 0 1 0 0 0 0 0 126
127 1427 0 0 0 0 0 0 0 1 0 0 0 0 127
128 1554 0 0 0 0 0 0 0 0 1 0 0 0 128
129 1645 0 0 0 0 0 0 0 0 0 1 0 0 129
130 1653 0 0 0 0 0 0 0 0 0 0 1 0 130
131 2016 0 0 0 0 0 0 0 0 0 0 0 1 131
132 2207 0 0 0 0 0 0 0 0 0 0 0 0 132
133 1665 0 1 0 0 0 0 0 0 0 0 0 0 133
134 1361 0 0 1 0 0 0 0 0 0 0 0 0 134
135 1506 0 0 0 1 0 0 0 0 0 0 0 0 135
136 1360 0 0 0 0 1 0 0 0 0 0 0 0 136
137 1453 0 0 0 0 0 1 0 0 0 0 0 0 137
138 1522 0 0 0 0 0 0 1 0 0 0 0 0 138
139 1460 0 0 0 0 0 0 0 1 0 0 0 0 139
140 1552 0 0 0 0 0 0 0 0 1 0 0 0 140
141 1548 0 0 0 0 0 0 0 0 0 1 0 0 141
142 1827 0 0 0 0 0 0 0 0 0 0 1 0 142
143 1737 0 0 0 0 0 0 0 0 0 0 0 1 143
144 1941 0 0 0 0 0 0 0 0 0 0 0 0 144
145 1474 0 1 0 0 0 0 0 0 0 0 0 0 145
146 1458 0 0 1 0 0 0 0 0 0 0 0 0 146
147 1542 0 0 0 1 0 0 0 0 0 0 0 0 147
148 1404 0 0 0 0 1 0 0 0 0 0 0 0 148
149 1522 0 0 0 0 0 1 0 0 0 0 0 0 149
150 1385 0 0 0 0 0 0 1 0 0 0 0 0 150
151 1641 0 0 0 0 0 0 0 1 0 0 0 0 151
152 1510 0 0 0 0 0 0 0 0 1 0 0 0 152
153 1681 0 0 0 0 0 0 0 0 0 1 0 0 153
154 1938 0 0 0 0 0 0 0 0 0 0 1 0 154
155 1868 0 0 0 0 0 0 0 0 0 0 0 1 155
156 1726 0 0 0 0 0 0 0 0 0 0 0 0 156
157 1456 0 1 0 0 0 0 0 0 0 0 0 0 157
158 1445 0 0 1 0 0 0 0 0 0 0 0 0 158
159 1456 0 0 0 1 0 0 0 0 0 0 0 0 159
160 1365 0 0 0 0 1 0 0 0 0 0 0 0 160
161 1487 0 0 0 0 0 1 0 0 0 0 0 0 161
162 1558 0 0 0 0 0 0 1 0 0 0 0 0 162
163 1488 0 0 0 0 0 0 0 1 0 0 0 0 163
164 1684 0 0 0 0 0 0 0 0 1 0 0 0 164
165 1594 0 0 0 0 0 0 0 0 0 1 0 0 165
166 1850 0 0 0 0 0 0 0 0 0 0 1 0 166
167 1998 0 0 0 0 0 0 0 0 0 0 0 1 167
168 2079 0 0 0 0 0 0 0 0 0 0 0 0 168
169 1494 0 1 0 0 0 0 0 0 0 0 0 0 169
170 1057 1 0 1 0 0 0 0 0 0 0 0 0 170
171 1218 1 0 0 1 0 0 0 0 0 0 0 0 171
172 1168 1 0 0 0 1 0 0 0 0 0 0 0 172
173 1236 1 0 0 0 0 1 0 0 0 0 0 0 173
174 1076 1 0 0 0 0 0 1 0 0 0 0 0 174
175 1174 1 0 0 0 0 0 0 1 0 0 0 0 175
176 1139 1 0 0 0 0 0 0 0 1 0 0 0 176
177 1427 1 0 0 0 0 0 0 0 0 1 0 0 177
178 1487 1 0 0 0 0 0 0 0 0 0 1 0 178
179 1483 1 0 0 0 0 0 0 0 0 0 0 1 179
180 1513 1 0 0 0 0 0 0 0 0 0 0 0 180
181 1357 1 1 0 0 0 0 0 0 0 0 0 0 181
182 1165 1 0 1 0 0 0 0 0 0 0 0 0 182
183 1282 1 0 0 1 0 0 0 0 0 0 0 0 183
184 1110 1 0 0 0 1 0 0 0 0 0 0 0 184
185 1297 1 0 0 0 0 1 0 0 0 0 0 0 185
186 1185 1 0 0 0 0 0 1 0 0 0 0 0 186
187 1222 1 0 0 0 0 0 0 1 0 0 0 0 187
188 1284 1 0 0 0 0 0 0 0 1 0 0 0 188
189 1444 1 0 0 0 0 0 0 0 0 1 0 0 189
190 1575 1 0 0 0 0 0 0 0 0 0 1 0 190
191 1737 1 0 0 0 0 0 0 0 0 0 0 1 191
192 1763 1 0 0 0 0 0 0 0 0 0 0 0 192
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Seatbelt M1 M2 M3 M4
2324.063 -226.385 -451.375 -635.461 -583.134 -694.556
M5 M6 M7 M8 M9 M10
-555.479 -609.464 -532.074 -515.434 -460.857 -319.717
M11 t
-118.390 -1.765
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-333.70 -105.83 4.71 85.02 414.65
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2324.0634 44.0299 52.784 < 2e-16 ***
Seatbelt -226.3850 41.0372 -5.517 1.20e-07 ***
M1 -451.3750 53.9429 -8.368 1.67e-14 ***
M2 -635.4611 53.9415 -11.781 < 2e-16 ***
M3 -583.1337 53.9313 -10.813 < 2e-16 ***
M4 -694.5563 53.9222 -12.881 < 2e-16 ***
M5 -555.4790 53.9141 -10.303 < 2e-16 ***
M6 -609.4641 53.9071 -11.306 < 2e-16 ***
M7 -532.0743 53.9012 -9.871 < 2e-16 ***
M8 -515.4344 53.8964 -9.563 < 2e-16 ***
M9 -460.8571 53.8926 -8.551 5.44e-15 ***
M10 -319.7172 53.8900 -5.933 1.52e-08 ***
M11 -118.3899 53.8884 -2.197 0.0293 *
t -1.7649 0.2406 -7.337 7.47e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 152.4 on 178 degrees of freedom
Multiple R-Squared: 0.7419, Adjusted R-squared: 0.723
F-statistic: 39.35 on 13 and 178 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/19ado1195565097.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/229pv1195565097.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/3c6ea1195565097.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/45df71195565097.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/5523s1195565097.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 = 192
Frequency = 1
1 2 3 4 5 6
-183.9235445 -177.0726091 -228.6351091 -237.4476091 -127.7601091 -193.0101091
7 8 9 10 11 12
-220.6351091 -164.5101091 -268.3226091 -333.6976091 -34.2601091 -154.8851091
13 14 15 16 17 18
-97.7452805 101.1056549 2.5431549 -43.2693451 -163.5818451 -162.8318451
19 20 21 22 23 24
46.5431549 26.6681549 -107.1443451 42.4806549 76.9181549 196.2931549
25 26 27 28 29 30
201.4329835 12.2839189 -0.2785811 42.9089189 87.5964189 84.3464189
31 32 33 34 35 36
57.7214189 173.8464189 -185.9660811 47.6589189 89.0964189 -68.5285811
37 38 39 40 41 42
272.6112475 146.4621829 162.8996829 10.0871829 279.7746829 212.5246829
43 44 45 46 47 48
248.8996829 -41.9753171 -5.7878171 52.8371829 274.2746829 414.6496829
49 50 51 52 53 54
310.7895114 362.6404468 26.0779468 403.2654468 327.9529468 193.7029468
55 56 57 58 59 60
317.0779468 202.2029468 321.3904468 178.0154468 16.4529468 -68.1720532
61 62 63 64 65 66
-157.0322246 -76.1812892 -81.7437892 -134.5562892 77.1312108 199.8812108
67 68 69 70 71 72
105.2562108 198.3812108 262.5687108 196.1937108 11.6312108 -145.9937892
73 74 75 76 77 78
-166.8539606 -202.0030252 43.4344748 -113.3780252 -113.6905252 -155.9405252
79 80 81 82 83 84
-210.5655252 -124.4405252 -64.2530252 -298.6280252 -154.1905252 23.1844748
85 86 87 88 89 90
-249.6756966 118.1752388 -180.3872612 -79.1997612 -81.5122612 -246.7622612
91 92 93 94 95 96
-105.3872612 -319.2622612 -72.0747612 -90.4497612 -80.0122612 119.3627388
97 98 99 100 101 102
-53.4974326 -114.6464972 -155.2089972 -50.0214972 -196.3339972 -14.5839972
103 104 105 106 107 108
-82.2089972 17.9160028 -162.8964972 -132.2714972 -16.8339972 81.5410028
109 110 111 112 113 114
275.6808314 -32.4682332 17.9692668 27.1567668 -123.1557332 108.5942668
115 116 117 118 119 120
67.9692668 34.0942668 -13.7182332 -113.0932332 54.3442668 149.7192668
121 122 123 124 125 126
153.8590954 -28.2899692 238.1475308 50.3350308 8.0225308 -61.2274692
127 128 129 130 131 132
-140.8524692 -28.7274692 9.4600308 -121.9149692 41.5225308 115.8975308
133 134 135 136 137 138
27.0373594 -91.1117052 3.3257948 -29.4867052 -73.7992052 50.9507948
139 140 141 142 143 144
-86.6742052 -9.5492052 -66.3617052 73.2632948 -216.2992052 -128.9242052
145 146 147 148 149 150
-142.7843767 27.0665587 60.5040587 35.6915587 16.3790587 -64.8709413
151 152 153 154 155 156
115.5040587 -30.3709413 87.8165587 205.4415587 -64.1209413 -322.7459413
157 158 159 160 161 162
-139.6061127 35.2448227 -4.3176773 17.8698227 2.5573227 129.3073227
163 164 165 166 167 168
-16.3176773 164.8073227 21.9948227 138.6198227 87.0573227 51.4323227
169 170 171 172 173 174
-80.4278487 -105.1918797 5.2456203 68.4331203 -0.8793797 -105.1293797
175 176 177 178 179 180
-82.7543797 -132.6293797 102.5581203 23.1831203 -180.3793797 -267.0043797
181 182 183 184 185 186
30.1354489 23.9863843 90.4238843 31.6113843 81.2988843 25.0488843
187 188 189 190 191 192
-13.5761157 33.5488843 140.7363843 132.3613843 94.7988843 4.1738843
> postscript(file="/var/www/html/rcomp/tmp/62vgx1195565097.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 192
Frequency = 1
lag(myerror, k = 1) myerror
0 -183.9235445 NA
1 -177.0726091 -183.9235445
2 -228.6351091 -177.0726091
3 -237.4476091 -228.6351091
4 -127.7601091 -237.4476091
5 -193.0101091 -127.7601091
6 -220.6351091 -193.0101091
7 -164.5101091 -220.6351091
8 -268.3226091 -164.5101091
9 -333.6976091 -268.3226091
10 -34.2601091 -333.6976091
11 -154.8851091 -34.2601091
12 -97.7452805 -154.8851091
13 101.1056549 -97.7452805
14 2.5431549 101.1056549
15 -43.2693451 2.5431549
16 -163.5818451 -43.2693451
17 -162.8318451 -163.5818451
18 46.5431549 -162.8318451
19 26.6681549 46.5431549
20 -107.1443451 26.6681549
21 42.4806549 -107.1443451
22 76.9181549 42.4806549
23 196.2931549 76.9181549
24 201.4329835 196.2931549
25 12.2839189 201.4329835
26 -0.2785811 12.2839189
27 42.9089189 -0.2785811
28 87.5964189 42.9089189
29 84.3464189 87.5964189
30 57.7214189 84.3464189
31 173.8464189 57.7214189
32 -185.9660811 173.8464189
33 47.6589189 -185.9660811
34 89.0964189 47.6589189
35 -68.5285811 89.0964189
36 272.6112475 -68.5285811
37 146.4621829 272.6112475
38 162.8996829 146.4621829
39 10.0871829 162.8996829
40 279.7746829 10.0871829
41 212.5246829 279.7746829
42 248.8996829 212.5246829
43 -41.9753171 248.8996829
44 -5.7878171 -41.9753171
45 52.8371829 -5.7878171
46 274.2746829 52.8371829
47 414.6496829 274.2746829
48 310.7895114 414.6496829
49 362.6404468 310.7895114
50 26.0779468 362.6404468
51 403.2654468 26.0779468
52 327.9529468 403.2654468
53 193.7029468 327.9529468
54 317.0779468 193.7029468
55 202.2029468 317.0779468
56 321.3904468 202.2029468
57 178.0154468 321.3904468
58 16.4529468 178.0154468
59 -68.1720532 16.4529468
60 -157.0322246 -68.1720532
61 -76.1812892 -157.0322246
62 -81.7437892 -76.1812892
63 -134.5562892 -81.7437892
64 77.1312108 -134.5562892
65 199.8812108 77.1312108
66 105.2562108 199.8812108
67 198.3812108 105.2562108
68 262.5687108 198.3812108
69 196.1937108 262.5687108
70 11.6312108 196.1937108
71 -145.9937892 11.6312108
72 -166.8539606 -145.9937892
73 -202.0030252 -166.8539606
74 43.4344748 -202.0030252
75 -113.3780252 43.4344748
76 -113.6905252 -113.3780252
77 -155.9405252 -113.6905252
78 -210.5655252 -155.9405252
79 -124.4405252 -210.5655252
80 -64.2530252 -124.4405252
81 -298.6280252 -64.2530252
82 -154.1905252 -298.6280252
83 23.1844748 -154.1905252
84 -249.6756966 23.1844748
85 118.1752388 -249.6756966
86 -180.3872612 118.1752388
87 -79.1997612 -180.3872612
88 -81.5122612 -79.1997612
89 -246.7622612 -81.5122612
90 -105.3872612 -246.7622612
91 -319.2622612 -105.3872612
92 -72.0747612 -319.2622612
93 -90.4497612 -72.0747612
94 -80.0122612 -90.4497612
95 119.3627388 -80.0122612
96 -53.4974326 119.3627388
97 -114.6464972 -53.4974326
98 -155.2089972 -114.6464972
99 -50.0214972 -155.2089972
100 -196.3339972 -50.0214972
101 -14.5839972 -196.3339972
102 -82.2089972 -14.5839972
103 17.9160028 -82.2089972
104 -162.8964972 17.9160028
105 -132.2714972 -162.8964972
106 -16.8339972 -132.2714972
107 81.5410028 -16.8339972
108 275.6808314 81.5410028
109 -32.4682332 275.6808314
110 17.9692668 -32.4682332
111 27.1567668 17.9692668
112 -123.1557332 27.1567668
113 108.5942668 -123.1557332
114 67.9692668 108.5942668
115 34.0942668 67.9692668
116 -13.7182332 34.0942668
117 -113.0932332 -13.7182332
118 54.3442668 -113.0932332
119 149.7192668 54.3442668
120 153.8590954 149.7192668
121 -28.2899692 153.8590954
122 238.1475308 -28.2899692
123 50.3350308 238.1475308
124 8.0225308 50.3350308
125 -61.2274692 8.0225308
126 -140.8524692 -61.2274692
127 -28.7274692 -140.8524692
128 9.4600308 -28.7274692
129 -121.9149692 9.4600308
130 41.5225308 -121.9149692
131 115.8975308 41.5225308
132 27.0373594 115.8975308
133 -91.1117052 27.0373594
134 3.3257948 -91.1117052
135 -29.4867052 3.3257948
136 -73.7992052 -29.4867052
137 50.9507948 -73.7992052
138 -86.6742052 50.9507948
139 -9.5492052 -86.6742052
140 -66.3617052 -9.5492052
141 73.2632948 -66.3617052
142 -216.2992052 73.2632948
143 -128.9242052 -216.2992052
144 -142.7843767 -128.9242052
145 27.0665587 -142.7843767
146 60.5040587 27.0665587
147 35.6915587 60.5040587
148 16.3790587 35.6915587
149 -64.8709413 16.3790587
150 115.5040587 -64.8709413
151 -30.3709413 115.5040587
152 87.8165587 -30.3709413
153 205.4415587 87.8165587
154 -64.1209413 205.4415587
155 -322.7459413 -64.1209413
156 -139.6061127 -322.7459413
157 35.2448227 -139.6061127
158 -4.3176773 35.2448227
159 17.8698227 -4.3176773
160 2.5573227 17.8698227
161 129.3073227 2.5573227
162 -16.3176773 129.3073227
163 164.8073227 -16.3176773
164 21.9948227 164.8073227
165 138.6198227 21.9948227
166 87.0573227 138.6198227
167 51.4323227 87.0573227
168 -80.4278487 51.4323227
169 -105.1918797 -80.4278487
170 5.2456203 -105.1918797
171 68.4331203 5.2456203
172 -0.8793797 68.4331203
173 -105.1293797 -0.8793797
174 -82.7543797 -105.1293797
175 -132.6293797 -82.7543797
176 102.5581203 -132.6293797
177 23.1831203 102.5581203
178 -180.3793797 23.1831203
179 -267.0043797 -180.3793797
180 30.1354489 -267.0043797
181 23.9863843 30.1354489
182 90.4238843 23.9863843
183 31.6113843 90.4238843
184 81.2988843 31.6113843
185 25.0488843 81.2988843
186 -13.5761157 25.0488843
187 33.5488843 -13.5761157
188 140.7363843 33.5488843
189 132.3613843 140.7363843
190 94.7988843 132.3613843
191 4.1738843 94.7988843
192 NA 4.1738843
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -177.0726091 -183.9235445
[2,] -228.6351091 -177.0726091
[3,] -237.4476091 -228.6351091
[4,] -127.7601091 -237.4476091
[5,] -193.0101091 -127.7601091
[6,] -220.6351091 -193.0101091
[7,] -164.5101091 -220.6351091
[8,] -268.3226091 -164.5101091
[9,] -333.6976091 -268.3226091
[10,] -34.2601091 -333.6976091
[11,] -154.8851091 -34.2601091
[12,] -97.7452805 -154.8851091
[13,] 101.1056549 -97.7452805
[14,] 2.5431549 101.1056549
[15,] -43.2693451 2.5431549
[16,] -163.5818451 -43.2693451
[17,] -162.8318451 -163.5818451
[18,] 46.5431549 -162.8318451
[19,] 26.6681549 46.5431549
[20,] -107.1443451 26.6681549
[21,] 42.4806549 -107.1443451
[22,] 76.9181549 42.4806549
[23,] 196.2931549 76.9181549
[24,] 201.4329835 196.2931549
[25,] 12.2839189 201.4329835
[26,] -0.2785811 12.2839189
[27,] 42.9089189 -0.2785811
[28,] 87.5964189 42.9089189
[29,] 84.3464189 87.5964189
[30,] 57.7214189 84.3464189
[31,] 173.8464189 57.7214189
[32,] -185.9660811 173.8464189
[33,] 47.6589189 -185.9660811
[34,] 89.0964189 47.6589189
[35,] -68.5285811 89.0964189
[36,] 272.6112475 -68.5285811
[37,] 146.4621829 272.6112475
[38,] 162.8996829 146.4621829
[39,] 10.0871829 162.8996829
[40,] 279.7746829 10.0871829
[41,] 212.5246829 279.7746829
[42,] 248.8996829 212.5246829
[43,] -41.9753171 248.8996829
[44,] -5.7878171 -41.9753171
[45,] 52.8371829 -5.7878171
[46,] 274.2746829 52.8371829
[47,] 414.6496829 274.2746829
[48,] 310.7895114 414.6496829
[49,] 362.6404468 310.7895114
[50,] 26.0779468 362.6404468
[51,] 403.2654468 26.0779468
[52,] 327.9529468 403.2654468
[53,] 193.7029468 327.9529468
[54,] 317.0779468 193.7029468
[55,] 202.2029468 317.0779468
[56,] 321.3904468 202.2029468
[57,] 178.0154468 321.3904468
[58,] 16.4529468 178.0154468
[59,] -68.1720532 16.4529468
[60,] -157.0322246 -68.1720532
[61,] -76.1812892 -157.0322246
[62,] -81.7437892 -76.1812892
[63,] -134.5562892 -81.7437892
[64,] 77.1312108 -134.5562892
[65,] 199.8812108 77.1312108
[66,] 105.2562108 199.8812108
[67,] 198.3812108 105.2562108
[68,] 262.5687108 198.3812108
[69,] 196.1937108 262.5687108
[70,] 11.6312108 196.1937108
[71,] -145.9937892 11.6312108
[72,] -166.8539606 -145.9937892
[73,] -202.0030252 -166.8539606
[74,] 43.4344748 -202.0030252
[75,] -113.3780252 43.4344748
[76,] -113.6905252 -113.3780252
[77,] -155.9405252 -113.6905252
[78,] -210.5655252 -155.9405252
[79,] -124.4405252 -210.5655252
[80,] -64.2530252 -124.4405252
[81,] -298.6280252 -64.2530252
[82,] -154.1905252 -298.6280252
[83,] 23.1844748 -154.1905252
[84,] -249.6756966 23.1844748
[85,] 118.1752388 -249.6756966
[86,] -180.3872612 118.1752388
[87,] -79.1997612 -180.3872612
[88,] -81.5122612 -79.1997612
[89,] -246.7622612 -81.5122612
[90,] -105.3872612 -246.7622612
[91,] -319.2622612 -105.3872612
[92,] -72.0747612 -319.2622612
[93,] -90.4497612 -72.0747612
[94,] -80.0122612 -90.4497612
[95,] 119.3627388 -80.0122612
[96,] -53.4974326 119.3627388
[97,] -114.6464972 -53.4974326
[98,] -155.2089972 -114.6464972
[99,] -50.0214972 -155.2089972
[100,] -196.3339972 -50.0214972
[101,] -14.5839972 -196.3339972
[102,] -82.2089972 -14.5839972
[103,] 17.9160028 -82.2089972
[104,] -162.8964972 17.9160028
[105,] -132.2714972 -162.8964972
[106,] -16.8339972 -132.2714972
[107,] 81.5410028 -16.8339972
[108,] 275.6808314 81.5410028
[109,] -32.4682332 275.6808314
[110,] 17.9692668 -32.4682332
[111,] 27.1567668 17.9692668
[112,] -123.1557332 27.1567668
[113,] 108.5942668 -123.1557332
[114,] 67.9692668 108.5942668
[115,] 34.0942668 67.9692668
[116,] -13.7182332 34.0942668
[117,] -113.0932332 -13.7182332
[118,] 54.3442668 -113.0932332
[119,] 149.7192668 54.3442668
[120,] 153.8590954 149.7192668
[121,] -28.2899692 153.8590954
[122,] 238.1475308 -28.2899692
[123,] 50.3350308 238.1475308
[124,] 8.0225308 50.3350308
[125,] -61.2274692 8.0225308
[126,] -140.8524692 -61.2274692
[127,] -28.7274692 -140.8524692
[128,] 9.4600308 -28.7274692
[129,] -121.9149692 9.4600308
[130,] 41.5225308 -121.9149692
[131,] 115.8975308 41.5225308
[132,] 27.0373594 115.8975308
[133,] -91.1117052 27.0373594
[134,] 3.3257948 -91.1117052
[135,] -29.4867052 3.3257948
[136,] -73.7992052 -29.4867052
[137,] 50.9507948 -73.7992052
[138,] -86.6742052 50.9507948
[139,] -9.5492052 -86.6742052
[140,] -66.3617052 -9.5492052
[141,] 73.2632948 -66.3617052
[142,] -216.2992052 73.2632948
[143,] -128.9242052 -216.2992052
[144,] -142.7843767 -128.9242052
[145,] 27.0665587 -142.7843767
[146,] 60.5040587 27.0665587
[147,] 35.6915587 60.5040587
[148,] 16.3790587 35.6915587
[149,] -64.8709413 16.3790587
[150,] 115.5040587 -64.8709413
[151,] -30.3709413 115.5040587
[152,] 87.8165587 -30.3709413
[153,] 205.4415587 87.8165587
[154,] -64.1209413 205.4415587
[155,] -322.7459413 -64.1209413
[156,] -139.6061127 -322.7459413
[157,] 35.2448227 -139.6061127
[158,] -4.3176773 35.2448227
[159,] 17.8698227 -4.3176773
[160,] 2.5573227 17.8698227
[161,] 129.3073227 2.5573227
[162,] -16.3176773 129.3073227
[163,] 164.8073227 -16.3176773
[164,] 21.9948227 164.8073227
[165,] 138.6198227 21.9948227
[166,] 87.0573227 138.6198227
[167,] 51.4323227 87.0573227
[168,] -80.4278487 51.4323227
[169,] -105.1918797 -80.4278487
[170,] 5.2456203 -105.1918797
[171,] 68.4331203 5.2456203
[172,] -0.8793797 68.4331203
[173,] -105.1293797 -0.8793797
[174,] -82.7543797 -105.1293797
[175,] -132.6293797 -82.7543797
[176,] 102.5581203 -132.6293797
[177,] 23.1831203 102.5581203
[178,] -180.3793797 23.1831203
[179,] -267.0043797 -180.3793797
[180,] 30.1354489 -267.0043797
[181,] 23.9863843 30.1354489
[182,] 90.4238843 23.9863843
[183,] 31.6113843 90.4238843
[184,] 81.2988843 31.6113843
[185,] 25.0488843 81.2988843
[186,] -13.5761157 25.0488843
[187,] 33.5488843 -13.5761157
[188,] 140.7363843 33.5488843
[189,] 132.3613843 140.7363843
[190,] 94.7988843 132.3613843
[191,] 4.1738843 94.7988843
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -177.0726091 -183.9235445
2 -228.6351091 -177.0726091
3 -237.4476091 -228.6351091
4 -127.7601091 -237.4476091
5 -193.0101091 -127.7601091
6 -220.6351091 -193.0101091
7 -164.5101091 -220.6351091
8 -268.3226091 -164.5101091
9 -333.6976091 -268.3226091
10 -34.2601091 -333.6976091
11 -154.8851091 -34.2601091
12 -97.7452805 -154.8851091
13 101.1056549 -97.7452805
14 2.5431549 101.1056549
15 -43.2693451 2.5431549
16 -163.5818451 -43.2693451
17 -162.8318451 -163.5818451
18 46.5431549 -162.8318451
19 26.6681549 46.5431549
20 -107.1443451 26.6681549
21 42.4806549 -107.1443451
22 76.9181549 42.4806549
23 196.2931549 76.9181549
24 201.4329835 196.2931549
25 12.2839189 201.4329835
26 -0.2785811 12.2839189
27 42.9089189 -0.2785811
28 87.5964189 42.9089189
29 84.3464189 87.5964189
30 57.7214189 84.3464189
31 173.8464189 57.7214189
32 -185.9660811 173.8464189
33 47.6589189 -185.9660811
34 89.0964189 47.6589189
35 -68.5285811 89.0964189
36 272.6112475 -68.5285811
37 146.4621829 272.6112475
38 162.8996829 146.4621829
39 10.0871829 162.8996829
40 279.7746829 10.0871829
41 212.5246829 279.7746829
42 248.8996829 212.5246829
43 -41.9753171 248.8996829
44 -5.7878171 -41.9753171
45 52.8371829 -5.7878171
46 274.2746829 52.8371829
47 414.6496829 274.2746829
48 310.7895114 414.6496829
49 362.6404468 310.7895114
50 26.0779468 362.6404468
51 403.2654468 26.0779468
52 327.9529468 403.2654468
53 193.7029468 327.9529468
54 317.0779468 193.7029468
55 202.2029468 317.0779468
56 321.3904468 202.2029468
57 178.0154468 321.3904468
58 16.4529468 178.0154468
59 -68.1720532 16.4529468
60 -157.0322246 -68.1720532
61 -76.1812892 -157.0322246
62 -81.7437892 -76.1812892
63 -134.5562892 -81.7437892
64 77.1312108 -134.5562892
65 199.8812108 77.1312108
66 105.2562108 199.8812108
67 198.3812108 105.2562108
68 262.5687108 198.3812108
69 196.1937108 262.5687108
70 11.6312108 196.1937108
71 -145.9937892 11.6312108
72 -166.8539606 -145.9937892
73 -202.0030252 -166.8539606
74 43.4344748 -202.0030252
75 -113.3780252 43.4344748
76 -113.6905252 -113.3780252
77 -155.9405252 -113.6905252
78 -210.5655252 -155.9405252
79 -124.4405252 -210.5655252
80 -64.2530252 -124.4405252
81 -298.6280252 -64.2530252
82 -154.1905252 -298.6280252
83 23.1844748 -154.1905252
84 -249.6756966 23.1844748
85 118.1752388 -249.6756966
86 -180.3872612 118.1752388
87 -79.1997612 -180.3872612
88 -81.5122612 -79.1997612
89 -246.7622612 -81.5122612
90 -105.3872612 -246.7622612
91 -319.2622612 -105.3872612
92 -72.0747612 -319.2622612
93 -90.4497612 -72.0747612
94 -80.0122612 -90.4497612
95 119.3627388 -80.0122612
96 -53.4974326 119.3627388
97 -114.6464972 -53.4974326
98 -155.2089972 -114.6464972
99 -50.0214972 -155.2089972
100 -196.3339972 -50.0214972
101 -14.5839972 -196.3339972
102 -82.2089972 -14.5839972
103 17.9160028 -82.2089972
104 -162.8964972 17.9160028
105 -132.2714972 -162.8964972
106 -16.8339972 -132.2714972
107 81.5410028 -16.8339972
108 275.6808314 81.5410028
109 -32.4682332 275.6808314
110 17.9692668 -32.4682332
111 27.1567668 17.9692668
112 -123.1557332 27.1567668
113 108.5942668 -123.1557332
114 67.9692668 108.5942668
115 34.0942668 67.9692668
116 -13.7182332 34.0942668
117 -113.0932332 -13.7182332
118 54.3442668 -113.0932332
119 149.7192668 54.3442668
120 153.8590954 149.7192668
121 -28.2899692 153.8590954
122 238.1475308 -28.2899692
123 50.3350308 238.1475308
124 8.0225308 50.3350308
125 -61.2274692 8.0225308
126 -140.8524692 -61.2274692
127 -28.7274692 -140.8524692
128 9.4600308 -28.7274692
129 -121.9149692 9.4600308
130 41.5225308 -121.9149692
131 115.8975308 41.5225308
132 27.0373594 115.8975308
133 -91.1117052 27.0373594
134 3.3257948 -91.1117052
135 -29.4867052 3.3257948
136 -73.7992052 -29.4867052
137 50.9507948 -73.7992052
138 -86.6742052 50.9507948
139 -9.5492052 -86.6742052
140 -66.3617052 -9.5492052
141 73.2632948 -66.3617052
142 -216.2992052 73.2632948
143 -128.9242052 -216.2992052
144 -142.7843767 -128.9242052
145 27.0665587 -142.7843767
146 60.5040587 27.0665587
147 35.6915587 60.5040587
148 16.3790587 35.6915587
149 -64.8709413 16.3790587
150 115.5040587 -64.8709413
151 -30.3709413 115.5040587
152 87.8165587 -30.3709413
153 205.4415587 87.8165587
154 -64.1209413 205.4415587
155 -322.7459413 -64.1209413
156 -139.6061127 -322.7459413
157 35.2448227 -139.6061127
158 -4.3176773 35.2448227
159 17.8698227 -4.3176773
160 2.5573227 17.8698227
161 129.3073227 2.5573227
162 -16.3176773 129.3073227
163 164.8073227 -16.3176773
164 21.9948227 164.8073227
165 138.6198227 21.9948227
166 87.0573227 138.6198227
167 51.4323227 87.0573227
168 -80.4278487 51.4323227
169 -105.1918797 -80.4278487
170 5.2456203 -105.1918797
171 68.4331203 5.2456203
172 -0.8793797 68.4331203
173 -105.1293797 -0.8793797
174 -82.7543797 -105.1293797
175 -132.6293797 -82.7543797
176 102.5581203 -132.6293797
177 23.1831203 102.5581203
178 -180.3793797 23.1831203
179 -267.0043797 -180.3793797
180 30.1354489 -267.0043797
181 23.9863843 30.1354489
182 90.4238843 23.9863843
183 31.6113843 90.4238843
184 81.2988843 31.6113843
185 25.0488843 81.2988843
186 -13.5761157 25.0488843
187 33.5488843 -13.5761157
188 140.7363843 33.5488843
189 132.3613843 140.7363843
190 94.7988843 132.3613843
191 4.1738843 94.7988843
> 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/72qkw1195565097.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/83ekz1195565097.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/9jj4i1195565097.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
> 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/10xteh1195565098.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/118ot51195565098.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/1252nf1195565098.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/132s731195565098.tab")
>
> system("convert tmp/19ado1195565097.ps tmp/19ado1195565097.png")
> system("convert tmp/229pv1195565097.ps tmp/229pv1195565097.png")
> system("convert tmp/3c6ea1195565097.ps tmp/3c6ea1195565097.png")
> system("convert tmp/45df71195565097.ps tmp/45df71195565097.png")
> system("convert tmp/5523s1195565097.ps tmp/5523s1195565097.png")
> system("convert tmp/62vgx1195565097.ps tmp/62vgx1195565097.png")
> system("convert tmp/72qkw1195565097.ps tmp/72qkw1195565097.png")
> system("convert tmp/83ekz1195565097.ps tmp/83ekz1195565097.png")
> system("convert tmp/9jj4i1195565097.ps tmp/9jj4i1195565097.png")
>
>
> proc.time()
user system elapsed
3.392 1.781 4.261