R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(276986
+ ,260633
+ ,291551
+ ,275383
+ ,275302
+ ,231693
+ ,238829
+ ,274215
+ ,277808
+ ,299060
+ ,286629
+ ,232313
+ ,294053
+ ,267510
+ ,309739
+ ,280733
+ ,287298
+ ,235672
+ ,256449
+ ,288997
+ ,290789
+ ,321898
+ ,291834
+ ,241380
+ ,295469
+ ,258200
+ ,306102
+ ,281480
+ ,283101
+ ,237414
+ ,274834
+ ,299340
+ ,300383
+ ,340862
+ ,318794
+ ,265740
+ ,322656
+ ,281563
+ ,323461
+ ,312579
+ ,310784
+ ,262785
+ ,273754
+ ,320036
+ ,310336
+ ,342206
+ ,320052
+ ,265582
+ ,326988
+ ,300713
+ ,346414
+ ,317325
+ ,326208
+ ,270657
+ ,278158
+ ,324584
+ ,321801
+ ,343542
+ ,354040
+ ,278179
+ ,330246
+ ,307344
+ ,375874
+ ,335309
+ ,339271
+ ,280264
+ ,293689
+ ,341161
+ ,345097
+ ,368712
+ ,369403
+ ,288384
+ ,340981
+ ,319072
+ ,374214
+ ,344529
+ ,337271
+ ,281016
+ ,282224
+ ,320984
+ ,325426
+ ,366276
+ ,380296
+ ,300727
+ ,359326
+ ,327610
+ ,383563
+ ,352405
+ ,329351
+ ,294486
+ ,333454
+ ,334339
+ ,358000
+ ,396057
+ ,386976
+ ,307155
+ ,363909
+ ,344700
+ ,397561
+ ,376791
+ ,337085
+ ,299252
+ ,323136
+ ,329091
+ ,346991
+ ,461999
+ ,436533
+ ,360372
+ ,415467
+ ,382110
+ ,432197
+ ,424254
+ ,386728
+ ,354508
+ ,375765
+ ,367986
+ ,402378
+ ,426516
+ ,433313
+ ,338461
+ ,416834
+ ,381099
+ ,445673
+ ,412408
+ ,393997
+ ,348241
+ ,380134
+ ,373688
+ ,393588
+ ,434192
+ ,430731
+ ,344468
+ ,411891
+ ,370497
+ ,437305
+ ,411270
+ ,385495
+ ,341273
+ ,384217
+ ,373223
+ ,415771
+ ,448634
+ ,454341
+ ,350297
+ ,419104
+ ,398027
+ ,456059
+ ,430052
+ ,399757
+ ,362731
+ ,384896
+ ,385349
+ ,432289
+ ,468891
+ ,442702
+ ,370178
+ ,439400
+ ,393900
+ ,468700
+ ,438800
+ ,430100
+ ,366300
+ ,391000
+ ,380900
+ ,431400
+ ,465400
+ ,471500
+ ,387500
+ ,446400
+ ,421500
+ ,504800
+ ,492071
+ ,421253
+ ,396682
+ ,428000
+ ,421900
+ ,465600
+ ,525793
+ ,499855
+ ,435287
+ ,479499
+ ,473027
+ ,554410
+ ,489574
+ ,462157
+ ,420331)
+ ,dim=c(1
+ ,186)
+ ,dimnames=list(c('Roomnights')
+ ,1:186))
> y <- array(NA,dim=c(1,186),dimnames=list(c('Roomnights'),1:186))
> 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
> 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
Roomnights M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 276986 1 0 0 0 0 0 0 0 0 0 0 1
2 260633 0 1 0 0 0 0 0 0 0 0 0 2
3 291551 0 0 1 0 0 0 0 0 0 0 0 3
4 275383 0 0 0 1 0 0 0 0 0 0 0 4
5 275302 0 0 0 0 1 0 0 0 0 0 0 5
6 231693 0 0 0 0 0 1 0 0 0 0 0 6
7 238829 0 0 0 0 0 0 1 0 0 0 0 7
8 274215 0 0 0 0 0 0 0 1 0 0 0 8
9 277808 0 0 0 0 0 0 0 0 1 0 0 9
10 299060 0 0 0 0 0 0 0 0 0 1 0 10
11 286629 0 0 0 0 0 0 0 0 0 0 1 11
12 232313 0 0 0 0 0 0 0 0 0 0 0 12
13 294053 1 0 0 0 0 0 0 0 0 0 0 13
14 267510 0 1 0 0 0 0 0 0 0 0 0 14
15 309739 0 0 1 0 0 0 0 0 0 0 0 15
16 280733 0 0 0 1 0 0 0 0 0 0 0 16
17 287298 0 0 0 0 1 0 0 0 0 0 0 17
18 235672 0 0 0 0 0 1 0 0 0 0 0 18
19 256449 0 0 0 0 0 0 1 0 0 0 0 19
20 288997 0 0 0 0 0 0 0 1 0 0 0 20
21 290789 0 0 0 0 0 0 0 0 1 0 0 21
22 321898 0 0 0 0 0 0 0 0 0 1 0 22
23 291834 0 0 0 0 0 0 0 0 0 0 1 23
24 241380 0 0 0 0 0 0 0 0 0 0 0 24
25 295469 1 0 0 0 0 0 0 0 0 0 0 25
26 258200 0 1 0 0 0 0 0 0 0 0 0 26
27 306102 0 0 1 0 0 0 0 0 0 0 0 27
28 281480 0 0 0 1 0 0 0 0 0 0 0 28
29 283101 0 0 0 0 1 0 0 0 0 0 0 29
30 237414 0 0 0 0 0 1 0 0 0 0 0 30
31 274834 0 0 0 0 0 0 1 0 0 0 0 31
32 299340 0 0 0 0 0 0 0 1 0 0 0 32
33 300383 0 0 0 0 0 0 0 0 1 0 0 33
34 340862 0 0 0 0 0 0 0 0 0 1 0 34
35 318794 0 0 0 0 0 0 0 0 0 0 1 35
36 265740 0 0 0 0 0 0 0 0 0 0 0 36
37 322656 1 0 0 0 0 0 0 0 0 0 0 37
38 281563 0 1 0 0 0 0 0 0 0 0 0 38
39 323461 0 0 1 0 0 0 0 0 0 0 0 39
40 312579 0 0 0 1 0 0 0 0 0 0 0 40
41 310784 0 0 0 0 1 0 0 0 0 0 0 41
42 262785 0 0 0 0 0 1 0 0 0 0 0 42
43 273754 0 0 0 0 0 0 1 0 0 0 0 43
44 320036 0 0 0 0 0 0 0 1 0 0 0 44
45 310336 0 0 0 0 0 0 0 0 1 0 0 45
46 342206 0 0 0 0 0 0 0 0 0 1 0 46
47 320052 0 0 0 0 0 0 0 0 0 0 1 47
48 265582 0 0 0 0 0 0 0 0 0 0 0 48
49 326988 1 0 0 0 0 0 0 0 0 0 0 49
50 300713 0 1 0 0 0 0 0 0 0 0 0 50
51 346414 0 0 1 0 0 0 0 0 0 0 0 51
52 317325 0 0 0 1 0 0 0 0 0 0 0 52
53 326208 0 0 0 0 1 0 0 0 0 0 0 53
54 270657 0 0 0 0 0 1 0 0 0 0 0 54
55 278158 0 0 0 0 0 0 1 0 0 0 0 55
56 324584 0 0 0 0 0 0 0 1 0 0 0 56
57 321801 0 0 0 0 0 0 0 0 1 0 0 57
58 343542 0 0 0 0 0 0 0 0 0 1 0 58
59 354040 0 0 0 0 0 0 0 0 0 0 1 59
60 278179 0 0 0 0 0 0 0 0 0 0 0 60
61 330246 1 0 0 0 0 0 0 0 0 0 0 61
62 307344 0 1 0 0 0 0 0 0 0 0 0 62
63 375874 0 0 1 0 0 0 0 0 0 0 0 63
64 335309 0 0 0 1 0 0 0 0 0 0 0 64
65 339271 0 0 0 0 1 0 0 0 0 0 0 65
66 280264 0 0 0 0 0 1 0 0 0 0 0 66
67 293689 0 0 0 0 0 0 1 0 0 0 0 67
68 341161 0 0 0 0 0 0 0 1 0 0 0 68
69 345097 0 0 0 0 0 0 0 0 1 0 0 69
70 368712 0 0 0 0 0 0 0 0 0 1 0 70
71 369403 0 0 0 0 0 0 0 0 0 0 1 71
72 288384 0 0 0 0 0 0 0 0 0 0 0 72
73 340981 1 0 0 0 0 0 0 0 0 0 0 73
74 319072 0 1 0 0 0 0 0 0 0 0 0 74
75 374214 0 0 1 0 0 0 0 0 0 0 0 75
76 344529 0 0 0 1 0 0 0 0 0 0 0 76
77 337271 0 0 0 0 1 0 0 0 0 0 0 77
78 281016 0 0 0 0 0 1 0 0 0 0 0 78
79 282224 0 0 0 0 0 0 1 0 0 0 0 79
80 320984 0 0 0 0 0 0 0 1 0 0 0 80
81 325426 0 0 0 0 0 0 0 0 1 0 0 81
82 366276 0 0 0 0 0 0 0 0 0 1 0 82
83 380296 0 0 0 0 0 0 0 0 0 0 1 83
84 300727 0 0 0 0 0 0 0 0 0 0 0 84
85 359326 1 0 0 0 0 0 0 0 0 0 0 85
86 327610 0 1 0 0 0 0 0 0 0 0 0 86
87 383563 0 0 1 0 0 0 0 0 0 0 0 87
88 352405 0 0 0 1 0 0 0 0 0 0 0 88
89 329351 0 0 0 0 1 0 0 0 0 0 0 89
90 294486 0 0 0 0 0 1 0 0 0 0 0 90
91 333454 0 0 0 0 0 0 1 0 0 0 0 91
92 334339 0 0 0 0 0 0 0 1 0 0 0 92
93 358000 0 0 0 0 0 0 0 0 1 0 0 93
94 396057 0 0 0 0 0 0 0 0 0 1 0 94
95 386976 0 0 0 0 0 0 0 0 0 0 1 95
96 307155 0 0 0 0 0 0 0 0 0 0 0 96
97 363909 1 0 0 0 0 0 0 0 0 0 0 97
98 344700 0 1 0 0 0 0 0 0 0 0 0 98
99 397561 0 0 1 0 0 0 0 0 0 0 0 99
100 376791 0 0 0 1 0 0 0 0 0 0 0 100
101 337085 0 0 0 0 1 0 0 0 0 0 0 101
102 299252 0 0 0 0 0 1 0 0 0 0 0 102
103 323136 0 0 0 0 0 0 1 0 0 0 0 103
104 329091 0 0 0 0 0 0 0 1 0 0 0 104
105 346991 0 0 0 0 0 0 0 0 1 0 0 105
106 461999 0 0 0 0 0 0 0 0 0 1 0 106
107 436533 0 0 0 0 0 0 0 0 0 0 1 107
108 360372 0 0 0 0 0 0 0 0 0 0 0 108
109 415467 1 0 0 0 0 0 0 0 0 0 0 109
110 382110 0 1 0 0 0 0 0 0 0 0 0 110
111 432197 0 0 1 0 0 0 0 0 0 0 0 111
112 424254 0 0 0 1 0 0 0 0 0 0 0 112
113 386728 0 0 0 0 1 0 0 0 0 0 0 113
114 354508 0 0 0 0 0 1 0 0 0 0 0 114
115 375765 0 0 0 0 0 0 1 0 0 0 0 115
116 367986 0 0 0 0 0 0 0 1 0 0 0 116
117 402378 0 0 0 0 0 0 0 0 1 0 0 117
118 426516 0 0 0 0 0 0 0 0 0 1 0 118
119 433313 0 0 0 0 0 0 0 0 0 0 1 119
120 338461 0 0 0 0 0 0 0 0 0 0 0 120
121 416834 1 0 0 0 0 0 0 0 0 0 0 121
122 381099 0 1 0 0 0 0 0 0 0 0 0 122
123 445673 0 0 1 0 0 0 0 0 0 0 0 123
124 412408 0 0 0 1 0 0 0 0 0 0 0 124
125 393997 0 0 0 0 1 0 0 0 0 0 0 125
126 348241 0 0 0 0 0 1 0 0 0 0 0 126
127 380134 0 0 0 0 0 0 1 0 0 0 0 127
128 373688 0 0 0 0 0 0 0 1 0 0 0 128
129 393588 0 0 0 0 0 0 0 0 1 0 0 129
130 434192 0 0 0 0 0 0 0 0 0 1 0 130
131 430731 0 0 0 0 0 0 0 0 0 0 1 131
132 344468 0 0 0 0 0 0 0 0 0 0 0 132
133 411891 1 0 0 0 0 0 0 0 0 0 0 133
134 370497 0 1 0 0 0 0 0 0 0 0 0 134
135 437305 0 0 1 0 0 0 0 0 0 0 0 135
136 411270 0 0 0 1 0 0 0 0 0 0 0 136
137 385495 0 0 0 0 1 0 0 0 0 0 0 137
138 341273 0 0 0 0 0 1 0 0 0 0 0 138
139 384217 0 0 0 0 0 0 1 0 0 0 0 139
140 373223 0 0 0 0 0 0 0 1 0 0 0 140
141 415771 0 0 0 0 0 0 0 0 1 0 0 141
142 448634 0 0 0 0 0 0 0 0 0 1 0 142
143 454341 0 0 0 0 0 0 0 0 0 0 1 143
144 350297 0 0 0 0 0 0 0 0 0 0 0 144
145 419104 1 0 0 0 0 0 0 0 0 0 0 145
146 398027 0 1 0 0 0 0 0 0 0 0 0 146
147 456059 0 0 1 0 0 0 0 0 0 0 0 147
148 430052 0 0 0 1 0 0 0 0 0 0 0 148
149 399757 0 0 0 0 1 0 0 0 0 0 0 149
150 362731 0 0 0 0 0 1 0 0 0 0 0 150
151 384896 0 0 0 0 0 0 1 0 0 0 0 151
152 385349 0 0 0 0 0 0 0 1 0 0 0 152
153 432289 0 0 0 0 0 0 0 0 1 0 0 153
154 468891 0 0 0 0 0 0 0 0 0 1 0 154
155 442702 0 0 0 0 0 0 0 0 0 0 1 155
156 370178 0 0 0 0 0 0 0 0 0 0 0 156
157 439400 1 0 0 0 0 0 0 0 0 0 0 157
158 393900 0 1 0 0 0 0 0 0 0 0 0 158
159 468700 0 0 1 0 0 0 0 0 0 0 0 159
160 438800 0 0 0 1 0 0 0 0 0 0 0 160
161 430100 0 0 0 0 1 0 0 0 0 0 0 161
162 366300 0 0 0 0 0 1 0 0 0 0 0 162
163 391000 0 0 0 0 0 0 1 0 0 0 0 163
164 380900 0 0 0 0 0 0 0 1 0 0 0 164
165 431400 0 0 0 0 0 0 0 0 1 0 0 165
166 465400 0 0 0 0 0 0 0 0 0 1 0 166
167 471500 0 0 0 0 0 0 0 0 0 0 1 167
168 387500 0 0 0 0 0 0 0 0 0 0 0 168
169 446400 1 0 0 0 0 0 0 0 0 0 0 169
170 421500 0 1 0 0 0 0 0 0 0 0 0 170
171 504800 0 0 1 0 0 0 0 0 0 0 0 171
172 492071 0 0 0 1 0 0 0 0 0 0 0 172
173 421253 0 0 0 0 1 0 0 0 0 0 0 173
174 396682 0 0 0 0 0 1 0 0 0 0 0 174
175 428000 0 0 0 0 0 0 1 0 0 0 0 175
176 421900 0 0 0 0 0 0 0 1 0 0 0 176
177 465600 0 0 0 0 0 0 0 0 1 0 0 177
178 525793 0 0 0 0 0 0 0 0 0 1 0 178
179 499855 0 0 0 0 0 0 0 0 0 0 1 179
180 435287 0 0 0 0 0 0 0 0 0 0 0 180
181 479499 1 0 0 0 0 0 0 0 0 0 0 181
182 473027 0 1 0 0 0 0 0 0 0 0 0 182
183 554410 0 0 1 0 0 0 0 0 0 0 0 183
184 489574 0 0 0 1 0 0 0 0 0 0 0 184
185 462157 0 0 0 0 1 0 0 0 0 0 0 185
186 420331 0 0 0 0 0 1 0 0 0 0 0 186
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
213489 58895 29578 85999 57872 39923
M6 M7 M8 M9 M10 M11
-6278 14264 28995 46700 85106 75151
t
1086
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-39671 -9413 -2296 9159 56203
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 213488.81 4498.24 47.461 < 2e-16 ***
M1 58895.18 5583.29 10.548 < 2e-16 ***
M2 29577.78 5582.93 5.298 3.53e-07 ***
M3 85999.26 5582.65 15.405 < 2e-16 ***
M4 57872.11 5582.44 10.367 < 2e-16 ***
M5 39923.40 5582.32 7.152 2.32e-11 ***
M6 -6278.30 5582.28 -1.125 0.2623
M7 14263.88 5672.60 2.515 0.0128 *
M8 28994.92 5672.24 5.112 8.39e-07 ***
M9 46699.96 5671.96 8.233 4.27e-14 ***
M10 85106.13 5671.76 15.005 < 2e-16 ***
M11 75150.96 5671.64 13.250 < 2e-16 ***
t 1085.90 21.22 51.169 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 15530 on 173 degrees of freedom
Multiple R-squared: 0.95, Adjusted R-squared: 0.9465
F-statistic: 273.9 on 12 and 173 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,] 3.422986e-02 6.845972e-02 0.9657701
[2,] 8.356235e-03 1.671247e-02 0.9916438
[3,] 4.024665e-03 8.049331e-03 0.9959753
[4,] 1.717285e-03 3.434570e-03 0.9982827
[5,] 5.117499e-04 1.023500e-03 0.9994883
[6,] 1.236120e-04 2.472241e-04 0.9998764
[7,] 1.279076e-04 2.558152e-04 0.9998721
[8,] 7.072982e-05 1.414596e-04 0.9999293
[9,] 2.119598e-05 4.239197e-05 0.9999788
[10,] 1.348712e-05 2.697424e-05 0.9999865
[11,] 3.207705e-04 6.415409e-04 0.9996792
[12,] 1.840843e-04 3.681686e-04 0.9998159
[13,] 1.161327e-04 2.322655e-04 0.9998839
[14,] 7.337192e-05 1.467438e-04 0.9999266
[15,] 3.515240e-05 7.030481e-05 0.9999648
[16,] 9.826981e-05 1.965396e-04 0.9999017
[17,] 6.278603e-05 1.255721e-04 0.9999372
[18,] 2.968515e-05 5.937030e-05 0.9999703
[19,] 7.440701e-05 1.488140e-04 0.9999256
[20,] 1.115254e-04 2.230508e-04 0.9998885
[21,] 1.317869e-04 2.635738e-04 0.9998682
[22,] 1.392775e-04 2.785550e-04 0.9998607
[23,] 6.829512e-05 1.365902e-04 0.9999317
[24,] 3.601846e-05 7.203692e-05 0.9999640
[25,] 3.143600e-05 6.287200e-05 0.9999686
[26,] 1.963644e-05 3.927287e-05 0.9999804
[27,] 1.099989e-05 2.199978e-05 0.9999890
[28,] 6.075333e-06 1.215067e-05 0.9999939
[29,] 7.696040e-06 1.539208e-05 0.9999923
[30,] 3.774679e-06 7.549358e-06 0.9999962
[31,] 1.758688e-06 3.517376e-06 0.9999982
[32,] 9.685062e-07 1.937012e-06 0.9999990
[33,] 4.734460e-07 9.468920e-07 0.9999995
[34,] 2.131054e-07 4.262108e-07 0.9999998
[35,] 1.100746e-07 2.201492e-07 0.9999999
[36,] 8.590958e-08 1.718192e-07 0.9999999
[37,] 3.879942e-08 7.759884e-08 1.0000000
[38,] 3.002472e-08 6.004944e-08 1.0000000
[39,] 1.386638e-08 2.773276e-08 1.0000000
[40,] 1.613203e-08 3.226405e-08 1.0000000
[41,] 1.404055e-08 2.808111e-08 1.0000000
[42,] 6.353121e-09 1.270624e-08 1.0000000
[43,] 7.249922e-09 1.449984e-08 1.0000000
[44,] 3.737625e-08 7.475251e-08 1.0000000
[45,] 1.789864e-08 3.579729e-08 1.0000000
[46,] 1.178209e-08 2.356418e-08 1.0000000
[47,] 5.302202e-09 1.060440e-08 1.0000000
[48,] 6.574198e-08 1.314840e-07 0.9999999
[49,] 3.664336e-08 7.328672e-08 1.0000000
[50,] 3.223685e-08 6.447371e-08 1.0000000
[51,] 1.765561e-08 3.531122e-08 1.0000000
[52,] 1.060546e-08 2.121092e-08 1.0000000
[53,] 2.119937e-08 4.239875e-08 1.0000000
[54,] 1.846559e-08 3.693118e-08 1.0000000
[55,] 9.091107e-09 1.818221e-08 1.0000000
[56,] 2.072029e-08 4.144058e-08 1.0000000
[57,] 1.181607e-08 2.363215e-08 1.0000000
[58,] 9.274512e-09 1.854902e-08 1.0000000
[59,] 4.671672e-09 9.343343e-09 1.0000000
[60,] 2.687137e-09 5.374274e-09 1.0000000
[61,] 1.344841e-09 2.689682e-09 1.0000000
[62,] 1.153224e-09 2.306449e-09 1.0000000
[63,] 1.519014e-09 3.038027e-09 1.0000000
[64,] 4.682008e-08 9.364016e-08 1.0000000
[65,] 4.088448e-07 8.176896e-07 0.9999996
[66,] 1.164804e-06 2.329608e-06 0.9999988
[67,] 1.218514e-06 2.437028e-06 0.9999988
[68,] 1.599311e-06 3.198621e-06 0.9999984
[69,] 8.990056e-07 1.798011e-06 0.9999991
[70,] 5.009028e-07 1.001806e-06 0.9999995
[71,] 2.844032e-07 5.688064e-07 0.9999997
[72,] 2.067738e-07 4.135476e-07 0.9999998
[73,] 1.530462e-07 3.060923e-07 0.9999998
[74,] 4.938626e-07 9.877251e-07 0.9999995
[75,] 3.190446e-07 6.380892e-07 0.9999997
[76,] 4.258429e-07 8.516858e-07 0.9999996
[77,] 7.752247e-07 1.550449e-06 0.9999992
[78,] 4.459965e-07 8.919929e-07 0.9999996
[79,] 3.710953e-07 7.421905e-07 0.9999996
[80,] 3.005048e-07 6.010097e-07 0.9999997
[81,] 1.871600e-07 3.743200e-07 0.9999998
[82,] 1.312549e-07 2.625098e-07 0.9999999
[83,] 7.530992e-08 1.506198e-07 0.9999999
[84,] 7.090502e-08 1.418100e-07 0.9999999
[85,] 7.210121e-08 1.442024e-07 0.9999999
[86,] 2.879191e-07 5.758382e-07 0.9999997
[87,] 3.341622e-07 6.683245e-07 0.9999997
[88,] 3.357883e-07 6.715765e-07 0.9999997
[89,] 2.248457e-06 4.496915e-06 0.9999978
[90,] 6.688778e-06 1.337756e-05 0.9999933
[91,] 4.209544e-03 8.419089e-03 0.9957905
[92,] 2.262273e-02 4.524546e-02 0.9773773
[93,] 6.366968e-02 1.273394e-01 0.9363303
[94,] 1.123025e-01 2.246049e-01 0.8876975
[95,] 1.477695e-01 2.955391e-01 0.8522305
[96,] 1.562760e-01 3.125519e-01 0.8437240
[97,] 2.858835e-01 5.717671e-01 0.7141165
[98,] 2.923004e-01 5.846007e-01 0.7076996
[99,] 4.028241e-01 8.056483e-01 0.5971759
[100,] 4.933173e-01 9.866346e-01 0.5066827
[101,] 5.357381e-01 9.285239e-01 0.4642619
[102,] 5.671663e-01 8.656674e-01 0.4328337
[103,] 5.237232e-01 9.525537e-01 0.4762768
[104,] 5.568314e-01 8.863372e-01 0.4431686
[105,] 5.241125e-01 9.517750e-01 0.4758875
[106,] 5.784023e-01 8.431955e-01 0.4215977
[107,] 5.842294e-01 8.315412e-01 0.4157706
[108,] 5.826947e-01 8.346107e-01 0.4173053
[109,] 5.598734e-01 8.802533e-01 0.4401266
[110,] 6.111662e-01 7.776675e-01 0.3888338
[111,] 6.513971e-01 6.972059e-01 0.3486029
[112,] 7.339773e-01 5.320454e-01 0.2660227
[113,] 8.259770e-01 3.480460e-01 0.1740230
[114,] 7.969227e-01 4.061547e-01 0.2030773
[115,] 7.640066e-01 4.719868e-01 0.2359934
[116,] 7.457897e-01 5.084205e-01 0.2542103
[117,] 7.236931e-01 5.526138e-01 0.2763069
[118,] 7.203531e-01 5.592937e-01 0.2796469
[119,] 6.918677e-01 6.162647e-01 0.3081323
[120,] 6.536149e-01 6.927701e-01 0.3463851
[121,] 6.036401e-01 7.927198e-01 0.3963599
[122,] 5.814911e-01 8.370178e-01 0.4185089
[123,] 5.488372e-01 9.023257e-01 0.4511628
[124,] 5.977646e-01 8.044707e-01 0.4022354
[125,] 6.497202e-01 7.005597e-01 0.3502798
[126,] 6.454694e-01 7.090612e-01 0.3545306
[127,] 5.988843e-01 8.022315e-01 0.4011157
[128,] 6.992046e-01 6.015908e-01 0.3007954
[129,] 6.609293e-01 6.781413e-01 0.3390707
[130,] 6.322458e-01 7.355083e-01 0.3677542
[131,] 6.291275e-01 7.417449e-01 0.3708725
[132,] 5.747676e-01 8.504648e-01 0.4252324
[133,] 5.201154e-01 9.597692e-01 0.4798846
[134,] 4.949908e-01 9.899816e-01 0.5050092
[135,] 5.145580e-01 9.708840e-01 0.4854420
[136,] 4.961279e-01 9.922559e-01 0.5038721
[137,] 5.831095e-01 8.337810e-01 0.4168905
[138,] 6.727515e-01 6.544969e-01 0.3272485
[139,] 6.820586e-01 6.358828e-01 0.3179414
[140,] 6.208318e-01 7.583365e-01 0.3791682
[141,] 5.578282e-01 8.843436e-01 0.4421718
[142,] 6.251597e-01 7.496806e-01 0.3748403
[143,] 5.629232e-01 8.741536e-01 0.4370768
[144,] 5.283848e-01 9.432304e-01 0.4716152
[145,] 4.541263e-01 9.082526e-01 0.5458737
[146,] 7.729689e-01 4.540623e-01 0.2270311
[147,] 7.449209e-01 5.101582e-01 0.2550791
[148,] 6.635454e-01 6.729091e-01 0.3364546
[149,] 6.085777e-01 7.828447e-01 0.3914223
[150,] 5.067911e-01 9.864178e-01 0.4932089
[151,] 5.682019e-01 8.635962e-01 0.4317981
[152,] 4.607874e-01 9.215748e-01 0.5392126
[153,] 3.918954e-01 7.837907e-01 0.6081046
[154,] 2.660039e-01 5.320078e-01 0.7339961
[155,] 2.513226e-01 5.026451e-01 0.7486774
> postscript(file="/var/wessaorg/rcomp/tmp/1qrvz1322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2al2h1322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3zqfu1322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/40opk1322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5cdds1322567616.ps",horizontal=F,onefile=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 = 186
Frequency = 1
1 2 3 4 5 6
3516.1179 15394.6179 -11194.7571 -321.5071 16460.3054 17967.1179
7 8 9 10 11 12
3475.0351 23044.1017 7846.1684 -10393.8983 -13955.6316 5793.4351
13 14 15 16 17 18
7552.3606 9240.8606 -6037.5144 -8002.2644 15425.5481 8915.3606
19 20 21 22 23 24
8064.2777 24795.3444 7796.4110 -586.6556 -21781.3890 1829.6777
25 26 27 28 29 30
-4062.3968 -13099.8968 -22705.2718 -20286.0218 -1802.2093 -2373.3968
31 32 33 34 35 36
13418.5203 22107.5870 4359.6536 5346.5870 -7852.1464 13158.9203
37 38 39 40 41 42
10093.8458 -2767.6542 -18377.0292 -2217.7792 12850.0333 9966.8458
43 44 45 46 47 48
-692.2371 29772.8296 1281.8962 -6340.1704 -19624.9038 -29.8371
49 50 51 52 53 54
1395.0884 3351.5884 -8454.7866 -10502.5366 15243.2759 4808.0884
55 56 57 58 59 60
-9318.9945 21290.0722 -283.8612 -18034.9278 1332.3388 -463.5945
61 62 63 64 65 66
-8377.6690 -3048.1690 7974.4560 -5549.2940 15275.5185 1384.3310
67 68 69 70 71 72
-6818.7519 24836.3148 9981.3815 -5895.6852 3664.5815 -3289.3519
73 74 75 76 77 78
-10673.4264 -4350.9264 -6716.3014 -9360.0514 244.7611 -10894.4264
79 80 81 82 83 84
-31314.5093 -8371.4426 -22720.3759 -21362.4426 1526.8241 -3977.1093
85 86 87 88 89 90
-5359.1838 -8843.6838 -10398.0588 -14514.8088 -20705.9963 -10455.1838
91 92 93 94 95 96
6884.7333 -8047.2000 -3177.1333 -4612.2000 -4823.9333 -10579.8667
97 98 99 100 101 102
-13806.9412 -4784.4412 -9430.8162 -3159.5662 -26002.7537 -18719.9412
103 104 105 106 107 108
-16464.0241 -26325.9574 -27216.8907 48299.0426 31702.3093 29606.3759
109 110 111 112 113 114
24720.3014 19594.8014 12174.4264 31272.6764 10609.4889 23505.3014
115 116 117 118 119 120
23134.2185 -461.7148 15139.3519 -214.7148 15451.5519 -5335.3815
121 122 123 124 125 126
13056.5440 5553.0440 12619.6690 6395.9190 4847.7315 4207.5440
127 128 129 130 131 132
14472.4612 -7790.4722 -6681.4055 -5569.4722 -161.2055 -12359.1388
133 134 135 136 137 138
-4917.2134 -18079.7134 -8779.0884 -7772.8384 -16685.0259 -15791.2134
139 140 141 142 143 144
5524.7038 -21286.2296 2470.8371 -4158.2296 10418.0371 -19560.8962
145 146 147 148 149 150
-10734.9708 -3580.4708 -3055.8458 -2021.5958 -15453.7833 -7363.9708
151 152 153 154 155 156
-6827.0536 -22190.9870 5958.0797 3068.0130 -14251.7203 -12710.6536
157 158 159 160 161 162
-3469.7282 -20738.2282 -3445.6032 -6304.3532 1858.4593 -16825.7282
163 164 165 166 167 168
-13753.8110 -39670.7444 -7961.6777 -13453.7444 1515.5223 -8419.4110
169 170 171 172 173 174
-9500.4856 -6168.9856 19623.6394 33935.8894 -20019.2981 525.5144
175 176 177 178 179 180
10215.4316 -11701.5017 13207.5649 33908.4983 16839.7649 26336.8316
181 182 183 184 185 186
10567.7571 32327.2571 56202.8821 18408.1321 7853.9446 11143.7571
> postscript(file="/var/wessaorg/rcomp/tmp/6lhxv1322567616.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 186
Frequency = 1
lag(myerror, k = 1) myerror
0 3516.1179 NA
1 15394.6179 3516.1179
2 -11194.7571 15394.6179
3 -321.5071 -11194.7571
4 16460.3054 -321.5071
5 17967.1179 16460.3054
6 3475.0351 17967.1179
7 23044.1017 3475.0351
8 7846.1684 23044.1017
9 -10393.8983 7846.1684
10 -13955.6316 -10393.8983
11 5793.4351 -13955.6316
12 7552.3606 5793.4351
13 9240.8606 7552.3606
14 -6037.5144 9240.8606
15 -8002.2644 -6037.5144
16 15425.5481 -8002.2644
17 8915.3606 15425.5481
18 8064.2777 8915.3606
19 24795.3444 8064.2777
20 7796.4110 24795.3444
21 -586.6556 7796.4110
22 -21781.3890 -586.6556
23 1829.6777 -21781.3890
24 -4062.3968 1829.6777
25 -13099.8968 -4062.3968
26 -22705.2718 -13099.8968
27 -20286.0218 -22705.2718
28 -1802.2093 -20286.0218
29 -2373.3968 -1802.2093
30 13418.5203 -2373.3968
31 22107.5870 13418.5203
32 4359.6536 22107.5870
33 5346.5870 4359.6536
34 -7852.1464 5346.5870
35 13158.9203 -7852.1464
36 10093.8458 13158.9203
37 -2767.6542 10093.8458
38 -18377.0292 -2767.6542
39 -2217.7792 -18377.0292
40 12850.0333 -2217.7792
41 9966.8458 12850.0333
42 -692.2371 9966.8458
43 29772.8296 -692.2371
44 1281.8962 29772.8296
45 -6340.1704 1281.8962
46 -19624.9038 -6340.1704
47 -29.8371 -19624.9038
48 1395.0884 -29.8371
49 3351.5884 1395.0884
50 -8454.7866 3351.5884
51 -10502.5366 -8454.7866
52 15243.2759 -10502.5366
53 4808.0884 15243.2759
54 -9318.9945 4808.0884
55 21290.0722 -9318.9945
56 -283.8612 21290.0722
57 -18034.9278 -283.8612
58 1332.3388 -18034.9278
59 -463.5945 1332.3388
60 -8377.6690 -463.5945
61 -3048.1690 -8377.6690
62 7974.4560 -3048.1690
63 -5549.2940 7974.4560
64 15275.5185 -5549.2940
65 1384.3310 15275.5185
66 -6818.7519 1384.3310
67 24836.3148 -6818.7519
68 9981.3815 24836.3148
69 -5895.6852 9981.3815
70 3664.5815 -5895.6852
71 -3289.3519 3664.5815
72 -10673.4264 -3289.3519
73 -4350.9264 -10673.4264
74 -6716.3014 -4350.9264
75 -9360.0514 -6716.3014
76 244.7611 -9360.0514
77 -10894.4264 244.7611
78 -31314.5093 -10894.4264
79 -8371.4426 -31314.5093
80 -22720.3759 -8371.4426
81 -21362.4426 -22720.3759
82 1526.8241 -21362.4426
83 -3977.1093 1526.8241
84 -5359.1838 -3977.1093
85 -8843.6838 -5359.1838
86 -10398.0588 -8843.6838
87 -14514.8088 -10398.0588
88 -20705.9963 -14514.8088
89 -10455.1838 -20705.9963
90 6884.7333 -10455.1838
91 -8047.2000 6884.7333
92 -3177.1333 -8047.2000
93 -4612.2000 -3177.1333
94 -4823.9333 -4612.2000
95 -10579.8667 -4823.9333
96 -13806.9412 -10579.8667
97 -4784.4412 -13806.9412
98 -9430.8162 -4784.4412
99 -3159.5662 -9430.8162
100 -26002.7537 -3159.5662
101 -18719.9412 -26002.7537
102 -16464.0241 -18719.9412
103 -26325.9574 -16464.0241
104 -27216.8907 -26325.9574
105 48299.0426 -27216.8907
106 31702.3093 48299.0426
107 29606.3759 31702.3093
108 24720.3014 29606.3759
109 19594.8014 24720.3014
110 12174.4264 19594.8014
111 31272.6764 12174.4264
112 10609.4889 31272.6764
113 23505.3014 10609.4889
114 23134.2185 23505.3014
115 -461.7148 23134.2185
116 15139.3519 -461.7148
117 -214.7148 15139.3519
118 15451.5519 -214.7148
119 -5335.3815 15451.5519
120 13056.5440 -5335.3815
121 5553.0440 13056.5440
122 12619.6690 5553.0440
123 6395.9190 12619.6690
124 4847.7315 6395.9190
125 4207.5440 4847.7315
126 14472.4612 4207.5440
127 -7790.4722 14472.4612
128 -6681.4055 -7790.4722
129 -5569.4722 -6681.4055
130 -161.2055 -5569.4722
131 -12359.1388 -161.2055
132 -4917.2134 -12359.1388
133 -18079.7134 -4917.2134
134 -8779.0884 -18079.7134
135 -7772.8384 -8779.0884
136 -16685.0259 -7772.8384
137 -15791.2134 -16685.0259
138 5524.7038 -15791.2134
139 -21286.2296 5524.7038
140 2470.8371 -21286.2296
141 -4158.2296 2470.8371
142 10418.0371 -4158.2296
143 -19560.8962 10418.0371
144 -10734.9708 -19560.8962
145 -3580.4708 -10734.9708
146 -3055.8458 -3580.4708
147 -2021.5958 -3055.8458
148 -15453.7833 -2021.5958
149 -7363.9708 -15453.7833
150 -6827.0536 -7363.9708
151 -22190.9870 -6827.0536
152 5958.0797 -22190.9870
153 3068.0130 5958.0797
154 -14251.7203 3068.0130
155 -12710.6536 -14251.7203
156 -3469.7282 -12710.6536
157 -20738.2282 -3469.7282
158 -3445.6032 -20738.2282
159 -6304.3532 -3445.6032
160 1858.4593 -6304.3532
161 -16825.7282 1858.4593
162 -13753.8110 -16825.7282
163 -39670.7444 -13753.8110
164 -7961.6777 -39670.7444
165 -13453.7444 -7961.6777
166 1515.5223 -13453.7444
167 -8419.4110 1515.5223
168 -9500.4856 -8419.4110
169 -6168.9856 -9500.4856
170 19623.6394 -6168.9856
171 33935.8894 19623.6394
172 -20019.2981 33935.8894
173 525.5144 -20019.2981
174 10215.4316 525.5144
175 -11701.5017 10215.4316
176 13207.5649 -11701.5017
177 33908.4983 13207.5649
178 16839.7649 33908.4983
179 26336.8316 16839.7649
180 10567.7571 26336.8316
181 32327.2571 10567.7571
182 56202.8821 32327.2571
183 18408.1321 56202.8821
184 7853.9446 18408.1321
185 11143.7571 7853.9446
186 NA 11143.7571
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 15394.6179 3516.1179
[2,] -11194.7571 15394.6179
[3,] -321.5071 -11194.7571
[4,] 16460.3054 -321.5071
[5,] 17967.1179 16460.3054
[6,] 3475.0351 17967.1179
[7,] 23044.1017 3475.0351
[8,] 7846.1684 23044.1017
[9,] -10393.8983 7846.1684
[10,] -13955.6316 -10393.8983
[11,] 5793.4351 -13955.6316
[12,] 7552.3606 5793.4351
[13,] 9240.8606 7552.3606
[14,] -6037.5144 9240.8606
[15,] -8002.2644 -6037.5144
[16,] 15425.5481 -8002.2644
[17,] 8915.3606 15425.5481
[18,] 8064.2777 8915.3606
[19,] 24795.3444 8064.2777
[20,] 7796.4110 24795.3444
[21,] -586.6556 7796.4110
[22,] -21781.3890 -586.6556
[23,] 1829.6777 -21781.3890
[24,] -4062.3968 1829.6777
[25,] -13099.8968 -4062.3968
[26,] -22705.2718 -13099.8968
[27,] -20286.0218 -22705.2718
[28,] -1802.2093 -20286.0218
[29,] -2373.3968 -1802.2093
[30,] 13418.5203 -2373.3968
[31,] 22107.5870 13418.5203
[32,] 4359.6536 22107.5870
[33,] 5346.5870 4359.6536
[34,] -7852.1464 5346.5870
[35,] 13158.9203 -7852.1464
[36,] 10093.8458 13158.9203
[37,] -2767.6542 10093.8458
[38,] -18377.0292 -2767.6542
[39,] -2217.7792 -18377.0292
[40,] 12850.0333 -2217.7792
[41,] 9966.8458 12850.0333
[42,] -692.2371 9966.8458
[43,] 29772.8296 -692.2371
[44,] 1281.8962 29772.8296
[45,] -6340.1704 1281.8962
[46,] -19624.9038 -6340.1704
[47,] -29.8371 -19624.9038
[48,] 1395.0884 -29.8371
[49,] 3351.5884 1395.0884
[50,] -8454.7866 3351.5884
[51,] -10502.5366 -8454.7866
[52,] 15243.2759 -10502.5366
[53,] 4808.0884 15243.2759
[54,] -9318.9945 4808.0884
[55,] 21290.0722 -9318.9945
[56,] -283.8612 21290.0722
[57,] -18034.9278 -283.8612
[58,] 1332.3388 -18034.9278
[59,] -463.5945 1332.3388
[60,] -8377.6690 -463.5945
[61,] -3048.1690 -8377.6690
[62,] 7974.4560 -3048.1690
[63,] -5549.2940 7974.4560
[64,] 15275.5185 -5549.2940
[65,] 1384.3310 15275.5185
[66,] -6818.7519 1384.3310
[67,] 24836.3148 -6818.7519
[68,] 9981.3815 24836.3148
[69,] -5895.6852 9981.3815
[70,] 3664.5815 -5895.6852
[71,] -3289.3519 3664.5815
[72,] -10673.4264 -3289.3519
[73,] -4350.9264 -10673.4264
[74,] -6716.3014 -4350.9264
[75,] -9360.0514 -6716.3014
[76,] 244.7611 -9360.0514
[77,] -10894.4264 244.7611
[78,] -31314.5093 -10894.4264
[79,] -8371.4426 -31314.5093
[80,] -22720.3759 -8371.4426
[81,] -21362.4426 -22720.3759
[82,] 1526.8241 -21362.4426
[83,] -3977.1093 1526.8241
[84,] -5359.1838 -3977.1093
[85,] -8843.6838 -5359.1838
[86,] -10398.0588 -8843.6838
[87,] -14514.8088 -10398.0588
[88,] -20705.9963 -14514.8088
[89,] -10455.1838 -20705.9963
[90,] 6884.7333 -10455.1838
[91,] -8047.2000 6884.7333
[92,] -3177.1333 -8047.2000
[93,] -4612.2000 -3177.1333
[94,] -4823.9333 -4612.2000
[95,] -10579.8667 -4823.9333
[96,] -13806.9412 -10579.8667
[97,] -4784.4412 -13806.9412
[98,] -9430.8162 -4784.4412
[99,] -3159.5662 -9430.8162
[100,] -26002.7537 -3159.5662
[101,] -18719.9412 -26002.7537
[102,] -16464.0241 -18719.9412
[103,] -26325.9574 -16464.0241
[104,] -27216.8907 -26325.9574
[105,] 48299.0426 -27216.8907
[106,] 31702.3093 48299.0426
[107,] 29606.3759 31702.3093
[108,] 24720.3014 29606.3759
[109,] 19594.8014 24720.3014
[110,] 12174.4264 19594.8014
[111,] 31272.6764 12174.4264
[112,] 10609.4889 31272.6764
[113,] 23505.3014 10609.4889
[114,] 23134.2185 23505.3014
[115,] -461.7148 23134.2185
[116,] 15139.3519 -461.7148
[117,] -214.7148 15139.3519
[118,] 15451.5519 -214.7148
[119,] -5335.3815 15451.5519
[120,] 13056.5440 -5335.3815
[121,] 5553.0440 13056.5440
[122,] 12619.6690 5553.0440
[123,] 6395.9190 12619.6690
[124,] 4847.7315 6395.9190
[125,] 4207.5440 4847.7315
[126,] 14472.4612 4207.5440
[127,] -7790.4722 14472.4612
[128,] -6681.4055 -7790.4722
[129,] -5569.4722 -6681.4055
[130,] -161.2055 -5569.4722
[131,] -12359.1388 -161.2055
[132,] -4917.2134 -12359.1388
[133,] -18079.7134 -4917.2134
[134,] -8779.0884 -18079.7134
[135,] -7772.8384 -8779.0884
[136,] -16685.0259 -7772.8384
[137,] -15791.2134 -16685.0259
[138,] 5524.7038 -15791.2134
[139,] -21286.2296 5524.7038
[140,] 2470.8371 -21286.2296
[141,] -4158.2296 2470.8371
[142,] 10418.0371 -4158.2296
[143,] -19560.8962 10418.0371
[144,] -10734.9708 -19560.8962
[145,] -3580.4708 -10734.9708
[146,] -3055.8458 -3580.4708
[147,] -2021.5958 -3055.8458
[148,] -15453.7833 -2021.5958
[149,] -7363.9708 -15453.7833
[150,] -6827.0536 -7363.9708
[151,] -22190.9870 -6827.0536
[152,] 5958.0797 -22190.9870
[153,] 3068.0130 5958.0797
[154,] -14251.7203 3068.0130
[155,] -12710.6536 -14251.7203
[156,] -3469.7282 -12710.6536
[157,] -20738.2282 -3469.7282
[158,] -3445.6032 -20738.2282
[159,] -6304.3532 -3445.6032
[160,] 1858.4593 -6304.3532
[161,] -16825.7282 1858.4593
[162,] -13753.8110 -16825.7282
[163,] -39670.7444 -13753.8110
[164,] -7961.6777 -39670.7444
[165,] -13453.7444 -7961.6777
[166,] 1515.5223 -13453.7444
[167,] -8419.4110 1515.5223
[168,] -9500.4856 -8419.4110
[169,] -6168.9856 -9500.4856
[170,] 19623.6394 -6168.9856
[171,] 33935.8894 19623.6394
[172,] -20019.2981 33935.8894
[173,] 525.5144 -20019.2981
[174,] 10215.4316 525.5144
[175,] -11701.5017 10215.4316
[176,] 13207.5649 -11701.5017
[177,] 33908.4983 13207.5649
[178,] 16839.7649 33908.4983
[179,] 26336.8316 16839.7649
[180,] 10567.7571 26336.8316
[181,] 32327.2571 10567.7571
[182,] 56202.8821 32327.2571
[183,] 18408.1321 56202.8821
[184,] 7853.9446 18408.1321
[185,] 11143.7571 7853.9446
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 15394.6179 3516.1179
2 -11194.7571 15394.6179
3 -321.5071 -11194.7571
4 16460.3054 -321.5071
5 17967.1179 16460.3054
6 3475.0351 17967.1179
7 23044.1017 3475.0351
8 7846.1684 23044.1017
9 -10393.8983 7846.1684
10 -13955.6316 -10393.8983
11 5793.4351 -13955.6316
12 7552.3606 5793.4351
13 9240.8606 7552.3606
14 -6037.5144 9240.8606
15 -8002.2644 -6037.5144
16 15425.5481 -8002.2644
17 8915.3606 15425.5481
18 8064.2777 8915.3606
19 24795.3444 8064.2777
20 7796.4110 24795.3444
21 -586.6556 7796.4110
22 -21781.3890 -586.6556
23 1829.6777 -21781.3890
24 -4062.3968 1829.6777
25 -13099.8968 -4062.3968
26 -22705.2718 -13099.8968
27 -20286.0218 -22705.2718
28 -1802.2093 -20286.0218
29 -2373.3968 -1802.2093
30 13418.5203 -2373.3968
31 22107.5870 13418.5203
32 4359.6536 22107.5870
33 5346.5870 4359.6536
34 -7852.1464 5346.5870
35 13158.9203 -7852.1464
36 10093.8458 13158.9203
37 -2767.6542 10093.8458
38 -18377.0292 -2767.6542
39 -2217.7792 -18377.0292
40 12850.0333 -2217.7792
41 9966.8458 12850.0333
42 -692.2371 9966.8458
43 29772.8296 -692.2371
44 1281.8962 29772.8296
45 -6340.1704 1281.8962
46 -19624.9038 -6340.1704
47 -29.8371 -19624.9038
48 1395.0884 -29.8371
49 3351.5884 1395.0884
50 -8454.7866 3351.5884
51 -10502.5366 -8454.7866
52 15243.2759 -10502.5366
53 4808.0884 15243.2759
54 -9318.9945 4808.0884
55 21290.0722 -9318.9945
56 -283.8612 21290.0722
57 -18034.9278 -283.8612
58 1332.3388 -18034.9278
59 -463.5945 1332.3388
60 -8377.6690 -463.5945
61 -3048.1690 -8377.6690
62 7974.4560 -3048.1690
63 -5549.2940 7974.4560
64 15275.5185 -5549.2940
65 1384.3310 15275.5185
66 -6818.7519 1384.3310
67 24836.3148 -6818.7519
68 9981.3815 24836.3148
69 -5895.6852 9981.3815
70 3664.5815 -5895.6852
71 -3289.3519 3664.5815
72 -10673.4264 -3289.3519
73 -4350.9264 -10673.4264
74 -6716.3014 -4350.9264
75 -9360.0514 -6716.3014
76 244.7611 -9360.0514
77 -10894.4264 244.7611
78 -31314.5093 -10894.4264
79 -8371.4426 -31314.5093
80 -22720.3759 -8371.4426
81 -21362.4426 -22720.3759
82 1526.8241 -21362.4426
83 -3977.1093 1526.8241
84 -5359.1838 -3977.1093
85 -8843.6838 -5359.1838
86 -10398.0588 -8843.6838
87 -14514.8088 -10398.0588
88 -20705.9963 -14514.8088
89 -10455.1838 -20705.9963
90 6884.7333 -10455.1838
91 -8047.2000 6884.7333
92 -3177.1333 -8047.2000
93 -4612.2000 -3177.1333
94 -4823.9333 -4612.2000
95 -10579.8667 -4823.9333
96 -13806.9412 -10579.8667
97 -4784.4412 -13806.9412
98 -9430.8162 -4784.4412
99 -3159.5662 -9430.8162
100 -26002.7537 -3159.5662
101 -18719.9412 -26002.7537
102 -16464.0241 -18719.9412
103 -26325.9574 -16464.0241
104 -27216.8907 -26325.9574
105 48299.0426 -27216.8907
106 31702.3093 48299.0426
107 29606.3759 31702.3093
108 24720.3014 29606.3759
109 19594.8014 24720.3014
110 12174.4264 19594.8014
111 31272.6764 12174.4264
112 10609.4889 31272.6764
113 23505.3014 10609.4889
114 23134.2185 23505.3014
115 -461.7148 23134.2185
116 15139.3519 -461.7148
117 -214.7148 15139.3519
118 15451.5519 -214.7148
119 -5335.3815 15451.5519
120 13056.5440 -5335.3815
121 5553.0440 13056.5440
122 12619.6690 5553.0440
123 6395.9190 12619.6690
124 4847.7315 6395.9190
125 4207.5440 4847.7315
126 14472.4612 4207.5440
127 -7790.4722 14472.4612
128 -6681.4055 -7790.4722
129 -5569.4722 -6681.4055
130 -161.2055 -5569.4722
131 -12359.1388 -161.2055
132 -4917.2134 -12359.1388
133 -18079.7134 -4917.2134
134 -8779.0884 -18079.7134
135 -7772.8384 -8779.0884
136 -16685.0259 -7772.8384
137 -15791.2134 -16685.0259
138 5524.7038 -15791.2134
139 -21286.2296 5524.7038
140 2470.8371 -21286.2296
141 -4158.2296 2470.8371
142 10418.0371 -4158.2296
143 -19560.8962 10418.0371
144 -10734.9708 -19560.8962
145 -3580.4708 -10734.9708
146 -3055.8458 -3580.4708
147 -2021.5958 -3055.8458
148 -15453.7833 -2021.5958
149 -7363.9708 -15453.7833
150 -6827.0536 -7363.9708
151 -22190.9870 -6827.0536
152 5958.0797 -22190.9870
153 3068.0130 5958.0797
154 -14251.7203 3068.0130
155 -12710.6536 -14251.7203
156 -3469.7282 -12710.6536
157 -20738.2282 -3469.7282
158 -3445.6032 -20738.2282
159 -6304.3532 -3445.6032
160 1858.4593 -6304.3532
161 -16825.7282 1858.4593
162 -13753.8110 -16825.7282
163 -39670.7444 -13753.8110
164 -7961.6777 -39670.7444
165 -13453.7444 -7961.6777
166 1515.5223 -13453.7444
167 -8419.4110 1515.5223
168 -9500.4856 -8419.4110
169 -6168.9856 -9500.4856
170 19623.6394 -6168.9856
171 33935.8894 19623.6394
172 -20019.2981 33935.8894
173 525.5144 -20019.2981
174 10215.4316 525.5144
175 -11701.5017 10215.4316
176 13207.5649 -11701.5017
177 33908.4983 13207.5649
178 16839.7649 33908.4983
179 26336.8316 16839.7649
180 10567.7571 26336.8316
181 32327.2571 10567.7571
182 56202.8821 32327.2571
183 18408.1321 56202.8821
184 7853.9446 18408.1321
185 11143.7571 7853.9446
> 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/wessaorg/rcomp/tmp/72eh31322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/8y26o1322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/9t1n41322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/10mpmm1322567616.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11g1hg1322567616.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/wessaorg/rcomp/tmp/12q7121322567616.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/wessaorg/rcomp/tmp/13kev51322567616.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/wessaorg/rcomp/tmp/14vs1x1322567616.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/wessaorg/rcomp/tmp/157i051322567616.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/wessaorg/rcomp/tmp/16l7uf1322567617.tab")
+ }
>
> try(system("convert tmp/1qrvz1322567616.ps tmp/1qrvz1322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/2al2h1322567616.ps tmp/2al2h1322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/3zqfu1322567616.ps tmp/3zqfu1322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/40opk1322567616.ps tmp/40opk1322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cdds1322567616.ps tmp/5cdds1322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/6lhxv1322567616.ps tmp/6lhxv1322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/72eh31322567616.ps tmp/72eh31322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/8y26o1322567616.ps tmp/8y26o1322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/9t1n41322567616.ps tmp/9t1n41322567616.png",intern=TRUE))
character(0)
> try(system("convert tmp/10mpmm1322567616.ps tmp/10mpmm1322567616.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.748 0.537 6.312