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(413.491
+ ,399.153
+ ,385.939
+ ,373.917
+ ,364.635
+ ,364.696
+ ,418.358
+ ,428.212
+ ,423.730
+ ,420.677
+ ,417.428
+ ,423.245
+ ,423.113
+ ,418.873
+ ,405.733
+ ,397.812
+ ,389.918
+ ,391.116
+ ,443.814
+ ,460.373
+ ,455.422
+ ,456.288
+ ,452.233
+ ,459.256
+ ,461.146
+ ,451.391
+ ,443.101
+ ,438.810
+ ,430.457
+ ,435.721
+ ,488.280
+ ,505.814
+ ,502.338
+ ,500.910
+ ,501.434
+ ,515.476
+ ,520.862
+ ,519.517
+ ,511.805
+ ,508.607
+ ,505.327
+ ,511.435
+ ,570.158
+ ,591.665
+ ,593.572
+ ,586.346
+ ,586.063
+ ,591.504
+ ,594.033
+ ,585.597
+ ,572.450
+ ,562.917
+ ,554.675
+ ,553.997
+ ,601.310
+ ,622.255
+ ,616.735
+ ,606.480
+ ,595.079
+ ,598.588
+ ,599.917
+ ,591.573
+ ,575.489
+ ,567.223
+ ,555.338
+ ,555.252
+ ,608.249
+ ,630.859
+ ,628.632
+ ,624.435
+ ,609.670
+ ,615.830
+ ,621.170
+ ,604.212
+ ,584.348
+ ,573.717
+ ,555.234
+ ,544.897
+ ,598.866
+ ,620.081
+ ,607.699
+ ,589.960
+ ,578.665
+ ,580.166
+ ,579.457
+ ,571.560
+ ,560.460
+ ,551.397
+ ,536.763
+ ,540.562
+ ,588.184
+ ,607.049
+ ,598.968
+ ,577.644
+ ,562.640
+ ,565.867
+ ,561.274
+ ,554.144
+ ,539.900
+ ,526.271
+ ,511.841
+ ,505.282
+ ,554.083
+ ,584.225
+ ,568.858
+ ,539.516
+ ,521.612
+ ,525.562
+ ,526.519
+ ,515.713
+ ,503.454
+ ,489.301
+ ,479.020
+ ,475.102
+ ,523.682
+ ,551.528
+ ,531.626
+ ,511.037
+ ,492.417
+ ,492.188
+ ,492.865
+ ,480.961
+ ,461.935
+ ,456.608
+ ,441.977
+ ,439.148
+ ,488.180
+ ,520.564
+ ,501.492
+ ,485.025
+ ,464.196
+ ,460.170
+ ,467.037
+ ,460.070
+ ,447.988
+ ,442.867
+ ,436.087
+ ,431.328
+ ,484.015
+ ,509.673
+ ,512.927
+ ,502.831
+ ,470.984
+ ,471.067
+ ,476.049
+ ,474.605
+ ,470.439
+ ,461.251
+ ,454.724
+ ,455.626
+ ,516.847
+ ,525.192
+ ,522.975
+ ,518.585
+ ,509.239
+ ,512.238
+ ,519.164
+ ,517.009
+ ,509.933
+ ,509.127
+ ,500.857
+ ,506.971
+ ,569.323
+ ,579.714
+ ,577.992
+ ,565.464
+ ,547.344
+ ,554.788
+ ,562.325
+ ,560.854
+ ,555.332
+ ,543.599
+ ,536.662
+ ,542.722
+ ,593.530
+ ,610.763
+ ,612.613
+ ,611.324
+ ,594.167
+ ,595.454
+ ,590.865
+ ,589.379
+ ,584.428
+ ,573.100
+ ,567.456
+ ,569.028
+ ,620.735
+ ,628.884
+ ,628.232
+ ,612.117
+ ,595.404
+ ,597.141
+ ,593.408
+ ,590.072
+ ,579.799
+ ,574.205
+ ,572.775
+ ,572.942
+ ,619.567
+ ,625.809
+ ,619.916
+ ,587.625
+ ,565.742
+ ,557.274
+ ,560.576
+ ,548.854
+ ,531.673
+ ,525.919
+ ,511.038
+ ,498.662
+ ,555.362
+ ,564.591
+ ,541.657
+ ,527.070
+ ,509.846
+ ,514.258
+ ,516.922
+ ,507.561
+ ,492.622
+ ,490.243
+ ,469.357
+ ,477.580
+ ,528.379
+ ,533.590
+ ,517.945
+ ,506.174
+ ,501.866
+ ,516.141
+ ,528.222
+ ,532.638
+ ,536.322
+ ,536.535
+ ,523.597
+ ,536.214
+ ,586.570
+ ,596.594
+ ,580.523
+ ,564.478
+ ,557.560
+ ,575.093
+ ,580.112
+ ,574.761
+ ,563.250
+ ,551.531
+ ,537.034
+ ,544.686
+ ,600.991
+ ,604.378
+ ,586.111
+ ,563.668
+ ,548.604
+ ,551.174
+ ,555.654)
+ ,dim=c(1
+ ,253)
+ ,dimnames=list(c('Unemployment')
+ ,1:253))
> y <- array(NA,dim=c(1,253),dimnames=list(c('Unemployment'),1:253))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Include Monthly Dummies'
> par1 = '1'
> 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
Unemployment M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 413.491 1 0 0 0 0 0 0 0 0 0 0
2 399.153 0 1 0 0 0 0 0 0 0 0 0
3 385.939 0 0 1 0 0 0 0 0 0 0 0
4 373.917 0 0 0 1 0 0 0 0 0 0 0
5 364.635 0 0 0 0 1 0 0 0 0 0 0
6 364.696 0 0 0 0 0 1 0 0 0 0 0
7 418.358 0 0 0 0 0 0 1 0 0 0 0
8 428.212 0 0 0 0 0 0 0 1 0 0 0
9 423.730 0 0 0 0 0 0 0 0 1 0 0
10 420.677 0 0 0 0 0 0 0 0 0 1 0
11 417.428 0 0 0 0 0 0 0 0 0 0 1
12 423.245 0 0 0 0 0 0 0 0 0 0 0
13 423.113 1 0 0 0 0 0 0 0 0 0 0
14 418.873 0 1 0 0 0 0 0 0 0 0 0
15 405.733 0 0 1 0 0 0 0 0 0 0 0
16 397.812 0 0 0 1 0 0 0 0 0 0 0
17 389.918 0 0 0 0 1 0 0 0 0 0 0
18 391.116 0 0 0 0 0 1 0 0 0 0 0
19 443.814 0 0 0 0 0 0 1 0 0 0 0
20 460.373 0 0 0 0 0 0 0 1 0 0 0
21 455.422 0 0 0 0 0 0 0 0 1 0 0
22 456.288 0 0 0 0 0 0 0 0 0 1 0
23 452.233 0 0 0 0 0 0 0 0 0 0 1
24 459.256 0 0 0 0 0 0 0 0 0 0 0
25 461.146 1 0 0 0 0 0 0 0 0 0 0
26 451.391 0 1 0 0 0 0 0 0 0 0 0
27 443.101 0 0 1 0 0 0 0 0 0 0 0
28 438.810 0 0 0 1 0 0 0 0 0 0 0
29 430.457 0 0 0 0 1 0 0 0 0 0 0
30 435.721 0 0 0 0 0 1 0 0 0 0 0
31 488.280 0 0 0 0 0 0 1 0 0 0 0
32 505.814 0 0 0 0 0 0 0 1 0 0 0
33 502.338 0 0 0 0 0 0 0 0 1 0 0
34 500.910 0 0 0 0 0 0 0 0 0 1 0
35 501.434 0 0 0 0 0 0 0 0 0 0 1
36 515.476 0 0 0 0 0 0 0 0 0 0 0
37 520.862 1 0 0 0 0 0 0 0 0 0 0
38 519.517 0 1 0 0 0 0 0 0 0 0 0
39 511.805 0 0 1 0 0 0 0 0 0 0 0
40 508.607 0 0 0 1 0 0 0 0 0 0 0
41 505.327 0 0 0 0 1 0 0 0 0 0 0
42 511.435 0 0 0 0 0 1 0 0 0 0 0
43 570.158 0 0 0 0 0 0 1 0 0 0 0
44 591.665 0 0 0 0 0 0 0 1 0 0 0
45 593.572 0 0 0 0 0 0 0 0 1 0 0
46 586.346 0 0 0 0 0 0 0 0 0 1 0
47 586.063 0 0 0 0 0 0 0 0 0 0 1
48 591.504 0 0 0 0 0 0 0 0 0 0 0
49 594.033 1 0 0 0 0 0 0 0 0 0 0
50 585.597 0 1 0 0 0 0 0 0 0 0 0
51 572.450 0 0 1 0 0 0 0 0 0 0 0
52 562.917 0 0 0 1 0 0 0 0 0 0 0
53 554.675 0 0 0 0 1 0 0 0 0 0 0
54 553.997 0 0 0 0 0 1 0 0 0 0 0
55 601.310 0 0 0 0 0 0 1 0 0 0 0
56 622.255 0 0 0 0 0 0 0 1 0 0 0
57 616.735 0 0 0 0 0 0 0 0 1 0 0
58 606.480 0 0 0 0 0 0 0 0 0 1 0
59 595.079 0 0 0 0 0 0 0 0 0 0 1
60 598.588 0 0 0 0 0 0 0 0 0 0 0
61 599.917 1 0 0 0 0 0 0 0 0 0 0
62 591.573 0 1 0 0 0 0 0 0 0 0 0
63 575.489 0 0 1 0 0 0 0 0 0 0 0
64 567.223 0 0 0 1 0 0 0 0 0 0 0
65 555.338 0 0 0 0 1 0 0 0 0 0 0
66 555.252 0 0 0 0 0 1 0 0 0 0 0
67 608.249 0 0 0 0 0 0 1 0 0 0 0
68 630.859 0 0 0 0 0 0 0 1 0 0 0
69 628.632 0 0 0 0 0 0 0 0 1 0 0
70 624.435 0 0 0 0 0 0 0 0 0 1 0
71 609.670 0 0 0 0 0 0 0 0 0 0 1
72 615.830 0 0 0 0 0 0 0 0 0 0 0
73 621.170 1 0 0 0 0 0 0 0 0 0 0
74 604.212 0 1 0 0 0 0 0 0 0 0 0
75 584.348 0 0 1 0 0 0 0 0 0 0 0
76 573.717 0 0 0 1 0 0 0 0 0 0 0
77 555.234 0 0 0 0 1 0 0 0 0 0 0
78 544.897 0 0 0 0 0 1 0 0 0 0 0
79 598.866 0 0 0 0 0 0 1 0 0 0 0
80 620.081 0 0 0 0 0 0 0 1 0 0 0
81 607.699 0 0 0 0 0 0 0 0 1 0 0
82 589.960 0 0 0 0 0 0 0 0 0 1 0
83 578.665 0 0 0 0 0 0 0 0 0 0 1
84 580.166 0 0 0 0 0 0 0 0 0 0 0
85 579.457 1 0 0 0 0 0 0 0 0 0 0
86 571.560 0 1 0 0 0 0 0 0 0 0 0
87 560.460 0 0 1 0 0 0 0 0 0 0 0
88 551.397 0 0 0 1 0 0 0 0 0 0 0
89 536.763 0 0 0 0 1 0 0 0 0 0 0
90 540.562 0 0 0 0 0 1 0 0 0 0 0
91 588.184 0 0 0 0 0 0 1 0 0 0 0
92 607.049 0 0 0 0 0 0 0 1 0 0 0
93 598.968 0 0 0 0 0 0 0 0 1 0 0
94 577.644 0 0 0 0 0 0 0 0 0 1 0
95 562.640 0 0 0 0 0 0 0 0 0 0 1
96 565.867 0 0 0 0 0 0 0 0 0 0 0
97 561.274 1 0 0 0 0 0 0 0 0 0 0
98 554.144 0 1 0 0 0 0 0 0 0 0 0
99 539.900 0 0 1 0 0 0 0 0 0 0 0
100 526.271 0 0 0 1 0 0 0 0 0 0 0
101 511.841 0 0 0 0 1 0 0 0 0 0 0
102 505.282 0 0 0 0 0 1 0 0 0 0 0
103 554.083 0 0 0 0 0 0 1 0 0 0 0
104 584.225 0 0 0 0 0 0 0 1 0 0 0
105 568.858 0 0 0 0 0 0 0 0 1 0 0
106 539.516 0 0 0 0 0 0 0 0 0 1 0
107 521.612 0 0 0 0 0 0 0 0 0 0 1
108 525.562 0 0 0 0 0 0 0 0 0 0 0
109 526.519 1 0 0 0 0 0 0 0 0 0 0
110 515.713 0 1 0 0 0 0 0 0 0 0 0
111 503.454 0 0 1 0 0 0 0 0 0 0 0
112 489.301 0 0 0 1 0 0 0 0 0 0 0
113 479.020 0 0 0 0 1 0 0 0 0 0 0
114 475.102 0 0 0 0 0 1 0 0 0 0 0
115 523.682 0 0 0 0 0 0 1 0 0 0 0
116 551.528 0 0 0 0 0 0 0 1 0 0 0
117 531.626 0 0 0 0 0 0 0 0 1 0 0
118 511.037 0 0 0 0 0 0 0 0 0 1 0
119 492.417 0 0 0 0 0 0 0 0 0 0 1
120 492.188 0 0 0 0 0 0 0 0 0 0 0
121 492.865 1 0 0 0 0 0 0 0 0 0 0
122 480.961 0 1 0 0 0 0 0 0 0 0 0
123 461.935 0 0 1 0 0 0 0 0 0 0 0
124 456.608 0 0 0 1 0 0 0 0 0 0 0
125 441.977 0 0 0 0 1 0 0 0 0 0 0
126 439.148 0 0 0 0 0 1 0 0 0 0 0
127 488.180 0 0 0 0 0 0 1 0 0 0 0
128 520.564 0 0 0 0 0 0 0 1 0 0 0
129 501.492 0 0 0 0 0 0 0 0 1 0 0
130 485.025 0 0 0 0 0 0 0 0 0 1 0
131 464.196 0 0 0 0 0 0 0 0 0 0 1
132 460.170 0 0 0 0 0 0 0 0 0 0 0
133 467.037 1 0 0 0 0 0 0 0 0 0 0
134 460.070 0 1 0 0 0 0 0 0 0 0 0
135 447.988 0 0 1 0 0 0 0 0 0 0 0
136 442.867 0 0 0 1 0 0 0 0 0 0 0
137 436.087 0 0 0 0 1 0 0 0 0 0 0
138 431.328 0 0 0 0 0 1 0 0 0 0 0
139 484.015 0 0 0 0 0 0 1 0 0 0 0
140 509.673 0 0 0 0 0 0 0 1 0 0 0
141 512.927 0 0 0 0 0 0 0 0 1 0 0
142 502.831 0 0 0 0 0 0 0 0 0 1 0
143 470.984 0 0 0 0 0 0 0 0 0 0 1
144 471.067 0 0 0 0 0 0 0 0 0 0 0
145 476.049 1 0 0 0 0 0 0 0 0 0 0
146 474.605 0 1 0 0 0 0 0 0 0 0 0
147 470.439 0 0 1 0 0 0 0 0 0 0 0
148 461.251 0 0 0 1 0 0 0 0 0 0 0
149 454.724 0 0 0 0 1 0 0 0 0 0 0
150 455.626 0 0 0 0 0 1 0 0 0 0 0
151 516.847 0 0 0 0 0 0 1 0 0 0 0
152 525.192 0 0 0 0 0 0 0 1 0 0 0
153 522.975 0 0 0 0 0 0 0 0 1 0 0
154 518.585 0 0 0 0 0 0 0 0 0 1 0
155 509.239 0 0 0 0 0 0 0 0 0 0 1
156 512.238 0 0 0 0 0 0 0 0 0 0 0
157 519.164 1 0 0 0 0 0 0 0 0 0 0
158 517.009 0 1 0 0 0 0 0 0 0 0 0
159 509.933 0 0 1 0 0 0 0 0 0 0 0
160 509.127 0 0 0 1 0 0 0 0 0 0 0
161 500.857 0 0 0 0 1 0 0 0 0 0 0
162 506.971 0 0 0 0 0 1 0 0 0 0 0
163 569.323 0 0 0 0 0 0 1 0 0 0 0
164 579.714 0 0 0 0 0 0 0 1 0 0 0
165 577.992 0 0 0 0 0 0 0 0 1 0 0
166 565.464 0 0 0 0 0 0 0 0 0 1 0
167 547.344 0 0 0 0 0 0 0 0 0 0 1
168 554.788 0 0 0 0 0 0 0 0 0 0 0
169 562.325 1 0 0 0 0 0 0 0 0 0 0
170 560.854 0 1 0 0 0 0 0 0 0 0 0
171 555.332 0 0 1 0 0 0 0 0 0 0 0
172 543.599 0 0 0 1 0 0 0 0 0 0 0
173 536.662 0 0 0 0 1 0 0 0 0 0 0
174 542.722 0 0 0 0 0 1 0 0 0 0 0
175 593.530 0 0 0 0 0 0 1 0 0 0 0
176 610.763 0 0 0 0 0 0 0 1 0 0 0
177 612.613 0 0 0 0 0 0 0 0 1 0 0
178 611.324 0 0 0 0 0 0 0 0 0 1 0
179 594.167 0 0 0 0 0 0 0 0 0 0 1
180 595.454 0 0 0 0 0 0 0 0 0 0 0
181 590.865 1 0 0 0 0 0 0 0 0 0 0
182 589.379 0 1 0 0 0 0 0 0 0 0 0
183 584.428 0 0 1 0 0 0 0 0 0 0 0
184 573.100 0 0 0 1 0 0 0 0 0 0 0
185 567.456 0 0 0 0 1 0 0 0 0 0 0
186 569.028 0 0 0 0 0 1 0 0 0 0 0
187 620.735 0 0 0 0 0 0 1 0 0 0 0
188 628.884 0 0 0 0 0 0 0 1 0 0 0
189 628.232 0 0 0 0 0 0 0 0 1 0 0
190 612.117 0 0 0 0 0 0 0 0 0 1 0
191 595.404 0 0 0 0 0 0 0 0 0 0 1
192 597.141 0 0 0 0 0 0 0 0 0 0 0
193 593.408 1 0 0 0 0 0 0 0 0 0 0
194 590.072 0 1 0 0 0 0 0 0 0 0 0
195 579.799 0 0 1 0 0 0 0 0 0 0 0
196 574.205 0 0 0 1 0 0 0 0 0 0 0
197 572.775 0 0 0 0 1 0 0 0 0 0 0
198 572.942 0 0 0 0 0 1 0 0 0 0 0
199 619.567 0 0 0 0 0 0 1 0 0 0 0
200 625.809 0 0 0 0 0 0 0 1 0 0 0
201 619.916 0 0 0 0 0 0 0 0 1 0 0
202 587.625 0 0 0 0 0 0 0 0 0 1 0
203 565.742 0 0 0 0 0 0 0 0 0 0 1
204 557.274 0 0 0 0 0 0 0 0 0 0 0
205 560.576 1 0 0 0 0 0 0 0 0 0 0
206 548.854 0 1 0 0 0 0 0 0 0 0 0
207 531.673 0 0 1 0 0 0 0 0 0 0 0
208 525.919 0 0 0 1 0 0 0 0 0 0 0
209 511.038 0 0 0 0 1 0 0 0 0 0 0
210 498.662 0 0 0 0 0 1 0 0 0 0 0
211 555.362 0 0 0 0 0 0 1 0 0 0 0
212 564.591 0 0 0 0 0 0 0 1 0 0 0
213 541.657 0 0 0 0 0 0 0 0 1 0 0
214 527.070 0 0 0 0 0 0 0 0 0 1 0
215 509.846 0 0 0 0 0 0 0 0 0 0 1
216 514.258 0 0 0 0 0 0 0 0 0 0 0
217 516.922 1 0 0 0 0 0 0 0 0 0 0
218 507.561 0 1 0 0 0 0 0 0 0 0 0
219 492.622 0 0 1 0 0 0 0 0 0 0 0
220 490.243 0 0 0 1 0 0 0 0 0 0 0
221 469.357 0 0 0 0 1 0 0 0 0 0 0
222 477.580 0 0 0 0 0 1 0 0 0 0 0
223 528.379 0 0 0 0 0 0 1 0 0 0 0
224 533.590 0 0 0 0 0 0 0 1 0 0 0
225 517.945 0 0 0 0 0 0 0 0 1 0 0
226 506.174 0 0 0 0 0 0 0 0 0 1 0
227 501.866 0 0 0 0 0 0 0 0 0 0 1
228 516.141 0 0 0 0 0 0 0 0 0 0 0
229 528.222 1 0 0 0 0 0 0 0 0 0 0
230 532.638 0 1 0 0 0 0 0 0 0 0 0
231 536.322 0 0 1 0 0 0 0 0 0 0 0
232 536.535 0 0 0 1 0 0 0 0 0 0 0
233 523.597 0 0 0 0 1 0 0 0 0 0 0
234 536.214 0 0 0 0 0 1 0 0 0 0 0
235 586.570 0 0 0 0 0 0 1 0 0 0 0
236 596.594 0 0 0 0 0 0 0 1 0 0 0
237 580.523 0 0 0 0 0 0 0 0 1 0 0
238 564.478 0 0 0 0 0 0 0 0 0 1 0
239 557.560 0 0 0 0 0 0 0 0 0 0 1
240 575.093 0 0 0 0 0 0 0 0 0 0 0
241 580.112 1 0 0 0 0 0 0 0 0 0 0
242 574.761 0 1 0 0 0 0 0 0 0 0 0
243 563.250 0 0 1 0 0 0 0 0 0 0 0
244 551.531 0 0 0 1 0 0 0 0 0 0 0
245 537.034 0 0 0 0 1 0 0 0 0 0 0
246 544.686 0 0 0 0 0 1 0 0 0 0 0
247 600.991 0 0 0 0 0 0 1 0 0 0 0
248 604.378 0 0 0 0 0 0 0 1 0 0 0
249 586.111 0 0 0 0 0 0 0 0 1 0 0
250 563.668 0 0 0 0 0 0 0 0 0 1 0
251 548.604 0 0 0 0 0 0 0 0 0 0 1
252 551.174 0 0 0 0 0 0 0 0 0 0 0
253 555.654 1 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
536.785 -2.958 -10.666 -21.718 -29.406 -39.891
M6 M7 M8 M9 M10 M11
-39.024 13.619 29.968 21.785 8.818 -4.299
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-138.54 -42.13 14.86 46.93 87.34
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 536.785 12.644 42.455 <2e-16 ***
M1 -2.958 17.676 -0.167 0.8672
M2 -10.666 17.881 -0.597 0.5514
M3 -21.718 17.881 -1.215 0.2257
M4 -29.406 17.881 -1.645 0.1014
M5 -39.891 17.881 -2.231 0.0266 *
M6 -39.024 17.881 -2.182 0.0300 *
M7 13.619 17.881 0.762 0.4470
M8 29.968 17.881 1.676 0.0950 .
M9 21.785 17.881 1.218 0.2243
M10 8.818 17.881 0.493 0.6224
M11 -4.299 17.881 -0.240 0.8102
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 57.94 on 241 degrees of freedom
Multiple R-squared: 0.1303, Adjusted R-squared: 0.09065
F-statistic: 3.284 on 11 and 241 DF, p-value: 0.0003259
> 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.018691278 3.738256e-02 9.813087e-01
[2,] 0.010093067 2.018613e-02 9.899069e-01
[3,] 0.005861750 1.172350e-02 9.941382e-01
[4,] 0.003631501 7.263002e-03 9.963685e-01
[5,] 0.002168627 4.337254e-03 9.978314e-01
[6,] 0.001838210 3.676420e-03 9.981618e-01
[7,] 0.001483171 2.966342e-03 9.985168e-01
[8,] 0.001383930 2.767860e-03 9.986161e-01
[9,] 0.001197731 2.395462e-03 9.988023e-01
[10,] 0.001071851 2.143702e-03 9.989281e-01
[11,] 0.001653535 3.307070e-03 9.983465e-01
[12,] 0.002252041 4.504081e-03 9.977480e-01
[13,] 0.003487408 6.974816e-03 9.965126e-01
[14,] 0.006086256 1.217251e-02 9.939137e-01
[15,] 0.009529548 1.905910e-02 9.904705e-01
[16,] 0.015681216 3.136243e-02 9.843188e-01
[17,] 0.023240611 4.648122e-02 9.767594e-01
[18,] 0.035783515 7.156703e-02 9.642165e-01
[19,] 0.052196302 1.043926e-01 9.478037e-01
[20,] 0.069838481 1.396770e-01 9.301615e-01
[21,] 0.093915249 1.878305e-01 9.060848e-01
[22,] 0.133387835 2.667757e-01 8.666122e-01
[23,] 0.229397015 4.587940e-01 7.706030e-01
[24,] 0.367686266 7.353725e-01 6.323137e-01
[25,] 0.519202323 9.615954e-01 4.807977e-01
[26,] 0.666455956 6.670881e-01 3.335440e-01
[27,] 0.791244422 4.175112e-01 2.087556e-01
[28,] 0.880866257 2.382675e-01 1.191337e-01
[29,] 0.939728366 1.205433e-01 6.027163e-02
[30,] 0.973672719 5.265456e-02 2.632728e-02
[31,] 0.990097956 1.980409e-02 9.902044e-03
[32,] 0.995920179 8.159643e-03 4.079821e-03
[33,] 0.998446157 3.107686e-03 1.553843e-03
[34,] 0.999370605 1.258789e-03 6.293946e-04
[35,] 0.999827145 3.457096e-04 1.728548e-04
[36,] 0.999950735 9.853057e-05 4.926529e-05
[37,] 0.999984725 3.055012e-05 1.527506e-05
[38,] 0.999994817 1.036627e-05 5.183137e-06
[39,] 0.999998184 3.631670e-06 1.815835e-06
[40,] 0.999999288 1.424146e-06 7.120729e-07
[41,] 0.999999660 6.793746e-07 3.396873e-07
[42,] 0.999999853 2.948482e-07 1.474241e-07
[43,] 0.999999933 1.349044e-07 6.745222e-08
[44,] 0.999999965 6.986897e-08 3.493449e-08
[45,] 0.999999979 4.176647e-08 2.088323e-08
[46,] 0.999999986 2.705664e-08 1.352832e-08
[47,] 0.999999993 1.305529e-08 6.527647e-09
[48,] 0.999999997 6.561908e-09 3.280954e-09
[49,] 0.999999998 3.824413e-09 1.912206e-09
[50,] 0.999999999 2.304463e-09 1.152231e-09
[51,] 0.999999999 1.521055e-09 7.605276e-10
[52,] 0.999999999 1.060436e-09 5.302182e-10
[53,] 1.000000000 7.440788e-10 3.720394e-10
[54,] 1.000000000 4.556575e-10 2.278288e-10
[55,] 1.000000000 2.541967e-10 1.270984e-10
[56,] 1.000000000 1.214322e-10 6.071610e-11
[57,] 1.000000000 6.676644e-11 3.338322e-11
[58,] 1.000000000 3.527927e-11 1.763963e-11
[59,] 1.000000000 1.247575e-11 6.237875e-12
[60,] 1.000000000 6.071747e-12 3.035874e-12
[61,] 1.000000000 3.848649e-12 1.924324e-12
[62,] 1.000000000 2.667261e-12 1.333631e-12
[63,] 1.000000000 2.333403e-12 1.166701e-12
[64,] 1.000000000 2.650081e-12 1.325041e-12
[65,] 1.000000000 2.941855e-12 1.470928e-12
[66,] 1.000000000 2.983658e-12 1.491829e-12
[67,] 1.000000000 3.408153e-12 1.704077e-12
[68,] 1.000000000 4.420862e-12 2.210431e-12
[69,] 1.000000000 5.639814e-12 2.819907e-12
[70,] 1.000000000 7.574084e-12 3.787042e-12
[71,] 1.000000000 9.525786e-12 4.762893e-12
[72,] 1.000000000 1.201011e-11 6.005057e-12
[73,] 1.000000000 1.504940e-11 7.524698e-12
[74,] 1.000000000 1.928554e-11 9.642772e-12
[75,] 1.000000000 2.648842e-11 1.324421e-11
[76,] 1.000000000 3.457644e-11 1.728822e-11
[77,] 1.000000000 4.878763e-11 2.439381e-11
[78,] 1.000000000 6.650487e-11 3.325243e-11
[79,] 1.000000000 9.092112e-11 4.546056e-11
[80,] 1.000000000 1.398867e-10 6.994336e-11
[81,] 1.000000000 2.185408e-10 1.092704e-10
[82,] 1.000000000 3.429794e-10 1.714897e-10
[83,] 1.000000000 5.472062e-10 2.736031e-10
[84,] 1.000000000 8.641700e-10 4.320850e-10
[85,] 0.999999999 1.396589e-09 6.982943e-10
[86,] 0.999999999 2.343873e-09 1.171937e-09
[87,] 0.999999998 3.993534e-09 1.996767e-09
[88,] 0.999999997 6.925899e-09 3.462949e-09
[89,] 0.999999994 1.197234e-08 5.986168e-09
[90,] 0.999999990 1.970118e-08 9.850589e-09
[91,] 0.999999983 3.328229e-08 1.664114e-08
[92,] 0.999999972 5.640299e-08 2.820150e-08
[93,] 0.999999953 9.351416e-08 4.675708e-08
[94,] 0.999999923 1.534556e-07 7.672778e-08
[95,] 0.999999874 2.522696e-07 1.261348e-07
[96,] 0.999999797 4.066017e-07 2.033009e-07
[97,] 0.999999678 6.448453e-07 3.224226e-07
[98,] 0.999999510 9.802626e-07 4.901313e-07
[99,] 0.999999259 1.481200e-06 7.405999e-07
[100,] 0.999998926 2.148594e-06 1.074297e-06
[101,] 0.999998502 2.996200e-06 1.498100e-06
[102,] 0.999997735 4.529302e-06 2.264651e-06
[103,] 0.999996826 6.347875e-06 3.173938e-06
[104,] 0.999995834 8.332592e-06 4.166296e-06
[105,] 0.999994798 1.040420e-05 5.202102e-06
[106,] 0.999993830 1.234054e-05 6.170271e-06
[107,] 0.999992582 1.483669e-05 7.418345e-06
[108,] 0.999991644 1.671270e-05 8.356349e-06
[109,] 0.999991725 1.655071e-05 8.275354e-06
[110,] 0.999991631 1.673797e-05 8.368987e-06
[111,] 0.999992122 1.575657e-05 7.878284e-06
[112,] 0.999993171 1.365745e-05 6.828726e-06
[113,] 0.999994577 1.084530e-05 5.422648e-06
[114,] 0.999994145 1.170992e-05 5.854961e-06
[115,] 0.999994692 1.061513e-05 5.307566e-06
[116,] 0.999995458 9.083722e-06 4.541861e-06
[117,] 0.999996597 6.805515e-06 3.402757e-06
[118,] 0.999997915 4.169005e-06 2.084502e-06
[119,] 0.999998563 2.874065e-06 1.437033e-06
[120,] 0.999999058 1.883545e-06 9.417726e-07
[121,] 0.999999442 1.115698e-06 5.578489e-07
[122,] 0.999999666 6.676517e-07 3.338259e-07
[123,] 0.999999788 4.230942e-07 2.115471e-07
[124,] 0.999999895 2.107385e-07 1.053693e-07
[125,] 0.999999952 9.614899e-08 4.807449e-08
[126,] 0.999999968 6.460786e-08 3.230393e-08
[127,] 0.999999971 5.756104e-08 2.878052e-08
[128,] 0.999999972 5.566678e-08 2.783339e-08
[129,] 0.999999983 3.350560e-08 1.675280e-08
[130,] 0.999999992 1.681154e-08 8.405770e-09
[131,] 0.999999996 8.820315e-09 4.410158e-09
[132,] 0.999999998 4.921963e-09 2.460982e-09
[133,] 0.999999998 3.069074e-09 1.534537e-09
[134,] 0.999999999 1.676654e-09 8.383269e-10
[135,] 0.999999999 1.008102e-09 5.040509e-10
[136,] 1.000000000 5.312130e-10 2.656065e-10
[137,] 1.000000000 3.539805e-10 1.769903e-10
[138,] 1.000000000 2.197859e-10 1.098929e-10
[139,] 1.000000000 1.711899e-10 8.559497e-11
[140,] 1.000000000 1.829491e-10 9.147454e-11
[141,] 1.000000000 2.214121e-10 1.107060e-10
[142,] 1.000000000 2.538417e-10 1.269208e-10
[143,] 1.000000000 3.166374e-10 1.583187e-10
[144,] 1.000000000 4.051768e-10 2.025884e-10
[145,] 1.000000000 5.317910e-10 2.658955e-10
[146,] 1.000000000 7.728439e-10 3.864220e-10
[147,] 0.999999999 1.168227e-09 5.841134e-10
[148,] 0.999999999 1.807024e-09 9.035122e-10
[149,] 0.999999998 3.057645e-09 1.528822e-09
[150,] 0.999999997 5.377982e-09 2.688991e-09
[151,] 0.999999995 9.746451e-09 4.873226e-09
[152,] 0.999999991 1.772127e-08 8.860633e-09
[153,] 0.999999984 3.213916e-08 1.606958e-08
[154,] 0.999999971 5.771938e-08 2.885969e-08
[155,] 0.999999950 9.957557e-08 4.978778e-08
[156,] 0.999999917 1.667480e-07 8.337400e-08
[157,] 0.999999866 2.688059e-07 1.344030e-07
[158,] 0.999999779 4.417274e-07 2.208637e-07
[159,] 0.999999646 7.081188e-07 3.540594e-07
[160,] 0.999999454 1.092576e-06 5.462880e-07
[161,] 0.999999149 1.701612e-06 8.508058e-07
[162,] 0.999998735 2.529414e-06 1.264707e-06
[163,] 0.999998437 3.126856e-06 1.563428e-06
[164,] 0.999998611 2.778766e-06 1.389383e-06
[165,] 0.999998655 2.690830e-06 1.345415e-06
[166,] 0.999998580 2.839669e-06 1.419834e-06
[167,] 0.999998281 3.438069e-06 1.719035e-06
[168,] 0.999998050 3.899797e-06 1.949898e-06
[169,] 0.999998014 3.971207e-06 1.985604e-06
[170,] 0.999997724 4.551708e-06 2.275854e-06
[171,] 0.999997719 4.561362e-06 2.280681e-06
[172,] 0.999997651 4.697097e-06 2.348549e-06
[173,] 0.999997541 4.917132e-06 2.458566e-06
[174,] 0.999997369 5.262370e-06 2.631185e-06
[175,] 0.999998020 3.960034e-06 1.980017e-06
[176,] 0.999998638 2.723268e-06 1.361634e-06
[177,] 0.999998975 2.049138e-06 1.024569e-06
[178,] 0.999999141 1.717155e-06 8.585774e-07
[179,] 0.999999106 1.788263e-06 8.941317e-07
[180,] 0.999999145 1.710169e-06 8.550847e-07
[181,] 0.999999183 1.634845e-06 8.174226e-07
[182,] 0.999999215 1.569459e-06 7.847295e-07
[183,] 0.999999527 9.458806e-07 4.729403e-07
[184,] 0.999999687 6.254255e-07 3.127128e-07
[185,] 0.999999742 5.159123e-07 2.579562e-07
[186,] 0.999999778 4.442853e-07 2.221426e-07
[187,] 0.999999884 2.323045e-07 1.161522e-07
[188,] 0.999999888 2.243854e-07 1.121927e-07
[189,] 0.999999848 3.031517e-07 1.515758e-07
[190,] 0.999999704 5.912116e-07 2.956058e-07
[191,] 0.999999414 1.171812e-06 5.859058e-07
[192,] 0.999998792 2.415560e-06 1.207780e-06
[193,] 0.999997447 5.105084e-06 2.552542e-06
[194,] 0.999994698 1.060479e-05 5.302393e-06
[195,] 0.999989128 2.174389e-05 1.087194e-05
[196,] 0.999980417 3.916571e-05 1.958286e-05
[197,] 0.999963589 7.282124e-05 3.641062e-05
[198,] 0.999931475 1.370502e-04 6.852509e-05
[199,] 0.999879624 2.407515e-04 1.203757e-04
[200,] 0.999786914 4.261719e-04 2.130859e-04
[201,] 0.999658002 6.839952e-04 3.419976e-04
[202,] 0.999502911 9.941789e-04 4.970895e-04
[203,] 0.999327164 1.345671e-03 6.728356e-04
[204,] 0.999181951 1.636099e-03 8.180494e-04
[205,] 0.999219266 1.561469e-03 7.807344e-04
[206,] 0.999205601 1.588799e-03 7.943995e-04
[207,] 0.999351376 1.297248e-03 6.486238e-04
[208,] 0.999529392 9.412156e-04 4.706078e-04
[209,] 0.999720610 5.587797e-04 2.793899e-04
[210,] 0.999872942 2.541160e-04 1.270580e-04
[211,] 0.999954893 9.021358e-05 4.510679e-05
[212,] 0.999982760 3.447948e-05 1.723974e-05
[213,] 0.999992851 1.429874e-05 7.149371e-06
[214,] 0.999997376 5.248074e-06 2.624037e-06
[215,] 0.999998824 2.351217e-06 1.175608e-06
[216,] 0.999999619 7.610340e-07 3.805170e-07
[217,] 0.999999528 9.432718e-07 4.716359e-07
[218,] 0.999998293 3.414599e-06 1.707299e-06
[219,] 0.999993082 1.383677e-05 6.918384e-06
[220,] 0.999964013 7.197448e-05 3.598724e-05
[221,] 0.999862003 2.759948e-04 1.379974e-04
[222,] 0.999277938 1.444124e-03 7.220621e-04
[223,] 0.996199652 7.600695e-03 3.800348e-03
[224,] 0.980774213 3.845157e-02 1.922579e-02
> postscript(file="/var/wessaorg/rcomp/tmp/189i41322602643.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/22c9m1322602643.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/3uah11322602643.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/4rx9w1322602643.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/5wpi11322602643.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 = 253
Frequency = 1
1 2 3 4 5 6
-120.3354091 -126.9659048 -129.1276667 -133.4619048 -132.2589048 -133.0643333
7 8 9 10 11 12
-132.0459524 -138.5410000 -134.8396667 -124.9255714 -115.0573810 -113.5397619
13 14 15 16 17 18
-110.7134091 -107.2459048 -109.3336667 -109.5669048 -106.9759048 -106.6443333
19 20 21 22 23 24
-106.5899524 -106.3800000 -103.1476667 -89.3145714 -80.2523810 -77.5287619
25 26 27 28 29 30
-72.6804091 -74.7279048 -71.9656667 -68.5689048 -66.4369048 -62.0393333
31 32 33 34 35 36
-62.1239524 -60.9390000 -56.2316667 -44.6925714 -31.0513810 -21.3087619
37 38 39 40 41 42
-12.9644091 -6.6019048 -3.2616667 1.2280952 8.4330952 13.6746667
43 44 45 46 47 48
19.7540476 24.9120000 35.0023333 40.7434286 53.5776190 54.7192381
49 50 51 52 53 54
60.2065909 59.4780952 57.3833333 55.5380952 57.7810952 56.2366667
55 56 57 58 59 60
50.9060476 55.5020000 58.1653333 60.8774286 62.5936190 61.8032381
61 62 63 64 65 66
66.0905909 65.4540952 60.4223333 59.8440952 58.4440952 57.4916667
67 68 69 70 71 72
57.8450476 64.1060000 70.0623333 78.8324286 77.1846190 79.0452381
73 74 75 76 77 78
87.3435909 78.0930952 69.2813333 66.3380952 58.3400952 47.1366667
79 80 81 82 83 84
48.4620476 53.3280000 49.1293333 44.3574286 46.1796190 43.3812381
85 86 87 88 89 90
45.6305909 45.4410952 45.3933333 44.0180952 39.8690952 42.8016667
91 92 93 94 95 96
37.7800476 40.2960000 40.3983333 32.0414286 30.1546190 29.0822381
97 98 99 100 101 102
27.4475909 28.0250952 24.8333333 18.8920952 14.9470952 7.5216667
103 104 105 106 107 108
3.6790476 17.4720000 10.2883333 -6.0865714 -10.8733810 -11.2227619
109 110 111 112 113 114
-7.3074091 -10.4059048 -11.6126667 -18.0779048 -17.8739048 -22.6583333
115 116 117 118 119 120
-26.7219524 -15.2250000 -26.9436667 -34.5655714 -40.0683810 -44.5967619
121 122 123 124 125 126
-40.9614091 -45.1579048 -53.1316667 -50.7709048 -54.9169048 -58.6123333
127 128 129 130 131 132
-62.2239524 -46.1890000 -57.0776667 -60.5775714 -68.2893810 -76.6147619
133 134 135 136 137 138
-66.7894091 -66.0489048 -67.0786667 -64.5119048 -60.8069048 -66.4323333
139 140 141 142 143 144
-66.3889524 -57.0800000 -45.6426667 -42.7715714 -61.5013810 -65.7177619
145 146 147 148 149 150
-57.7774091 -51.5139048 -44.6276667 -46.1279048 -42.1699048 -42.1343333
151 152 153 154 155 156
-33.5569524 -41.5610000 -35.5946667 -27.0175714 -23.2463810 -24.5467619
157 158 159 160 161 162
-14.6624091 -9.1099048 -5.1336667 1.7480952 3.9630952 9.2106667
163 164 165 166 167 168
18.9190476 12.9610000 19.4223333 19.8614286 14.8586190 18.0032381
169 170 171 172 173 174
28.4985909 34.7350952 40.2653333 36.2200952 39.7680952 44.9616667
175 176 177 178 179 180
43.1260476 44.0100000 54.0433333 65.7214286 61.6816190 58.6692381
181 182 183 184 185 186
57.0385909 63.2600952 69.3613333 65.7210952 70.5620952 71.2676667
187 188 189 190 191 192
70.3310476 62.1310000 69.6623333 66.5144286 62.9186190 60.3562381
193 194 195 196 197 198
59.5815909 63.9530952 64.7323333 66.8260952 75.8810952 75.1816667
199 200 201 202 203 204
69.1630476 59.0560000 61.3463333 42.0224286 33.2566190 20.4892381
205 206 207 208 209 210
26.7495909 22.7350952 16.6063333 18.5400952 14.1440952 0.9016667
211 212 213 214 215 216
4.9580476 -2.1620000 -16.9126667 -18.5325714 -22.6393810 -22.5267619
217 218 219 220 221 222
-16.9044091 -18.5579048 -22.4446667 -17.1359048 -27.5369048 -20.1803333
223 224 225 226 227 228
-22.0249524 -33.1630000 -40.6246667 -39.4285714 -30.6193810 -20.6437619
229 230 231 232 233 234
-5.6044091 6.5190952 21.2553333 29.1560952 26.7030952 38.4536667
235 236 237 238 239 240
36.1660476 29.8410000 21.9533333 18.8754286 25.0746190 38.3082381
241 242 243 244 245 246
46.2855909 48.6420952 48.1833333 44.1520952 40.1400952 46.9256667
247 248 249 250 251 252
50.5870476 37.6250000 27.5413333 18.0654286 16.1186190 14.3892381
253
21.8275909
> postscript(file="/var/wessaorg/rcomp/tmp/61rf11322602643.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 = 253
Frequency = 1
lag(myerror, k = 1) myerror
0 -120.3354091 NA
1 -126.9659048 -120.3354091
2 -129.1276667 -126.9659048
3 -133.4619048 -129.1276667
4 -132.2589048 -133.4619048
5 -133.0643333 -132.2589048
6 -132.0459524 -133.0643333
7 -138.5410000 -132.0459524
8 -134.8396667 -138.5410000
9 -124.9255714 -134.8396667
10 -115.0573810 -124.9255714
11 -113.5397619 -115.0573810
12 -110.7134091 -113.5397619
13 -107.2459048 -110.7134091
14 -109.3336667 -107.2459048
15 -109.5669048 -109.3336667
16 -106.9759048 -109.5669048
17 -106.6443333 -106.9759048
18 -106.5899524 -106.6443333
19 -106.3800000 -106.5899524
20 -103.1476667 -106.3800000
21 -89.3145714 -103.1476667
22 -80.2523810 -89.3145714
23 -77.5287619 -80.2523810
24 -72.6804091 -77.5287619
25 -74.7279048 -72.6804091
26 -71.9656667 -74.7279048
27 -68.5689048 -71.9656667
28 -66.4369048 -68.5689048
29 -62.0393333 -66.4369048
30 -62.1239524 -62.0393333
31 -60.9390000 -62.1239524
32 -56.2316667 -60.9390000
33 -44.6925714 -56.2316667
34 -31.0513810 -44.6925714
35 -21.3087619 -31.0513810
36 -12.9644091 -21.3087619
37 -6.6019048 -12.9644091
38 -3.2616667 -6.6019048
39 1.2280952 -3.2616667
40 8.4330952 1.2280952
41 13.6746667 8.4330952
42 19.7540476 13.6746667
43 24.9120000 19.7540476
44 35.0023333 24.9120000
45 40.7434286 35.0023333
46 53.5776190 40.7434286
47 54.7192381 53.5776190
48 60.2065909 54.7192381
49 59.4780952 60.2065909
50 57.3833333 59.4780952
51 55.5380952 57.3833333
52 57.7810952 55.5380952
53 56.2366667 57.7810952
54 50.9060476 56.2366667
55 55.5020000 50.9060476
56 58.1653333 55.5020000
57 60.8774286 58.1653333
58 62.5936190 60.8774286
59 61.8032381 62.5936190
60 66.0905909 61.8032381
61 65.4540952 66.0905909
62 60.4223333 65.4540952
63 59.8440952 60.4223333
64 58.4440952 59.8440952
65 57.4916667 58.4440952
66 57.8450476 57.4916667
67 64.1060000 57.8450476
68 70.0623333 64.1060000
69 78.8324286 70.0623333
70 77.1846190 78.8324286
71 79.0452381 77.1846190
72 87.3435909 79.0452381
73 78.0930952 87.3435909
74 69.2813333 78.0930952
75 66.3380952 69.2813333
76 58.3400952 66.3380952
77 47.1366667 58.3400952
78 48.4620476 47.1366667
79 53.3280000 48.4620476
80 49.1293333 53.3280000
81 44.3574286 49.1293333
82 46.1796190 44.3574286
83 43.3812381 46.1796190
84 45.6305909 43.3812381
85 45.4410952 45.6305909
86 45.3933333 45.4410952
87 44.0180952 45.3933333
88 39.8690952 44.0180952
89 42.8016667 39.8690952
90 37.7800476 42.8016667
91 40.2960000 37.7800476
92 40.3983333 40.2960000
93 32.0414286 40.3983333
94 30.1546190 32.0414286
95 29.0822381 30.1546190
96 27.4475909 29.0822381
97 28.0250952 27.4475909
98 24.8333333 28.0250952
99 18.8920952 24.8333333
100 14.9470952 18.8920952
101 7.5216667 14.9470952
102 3.6790476 7.5216667
103 17.4720000 3.6790476
104 10.2883333 17.4720000
105 -6.0865714 10.2883333
106 -10.8733810 -6.0865714
107 -11.2227619 -10.8733810
108 -7.3074091 -11.2227619
109 -10.4059048 -7.3074091
110 -11.6126667 -10.4059048
111 -18.0779048 -11.6126667
112 -17.8739048 -18.0779048
113 -22.6583333 -17.8739048
114 -26.7219524 -22.6583333
115 -15.2250000 -26.7219524
116 -26.9436667 -15.2250000
117 -34.5655714 -26.9436667
118 -40.0683810 -34.5655714
119 -44.5967619 -40.0683810
120 -40.9614091 -44.5967619
121 -45.1579048 -40.9614091
122 -53.1316667 -45.1579048
123 -50.7709048 -53.1316667
124 -54.9169048 -50.7709048
125 -58.6123333 -54.9169048
126 -62.2239524 -58.6123333
127 -46.1890000 -62.2239524
128 -57.0776667 -46.1890000
129 -60.5775714 -57.0776667
130 -68.2893810 -60.5775714
131 -76.6147619 -68.2893810
132 -66.7894091 -76.6147619
133 -66.0489048 -66.7894091
134 -67.0786667 -66.0489048
135 -64.5119048 -67.0786667
136 -60.8069048 -64.5119048
137 -66.4323333 -60.8069048
138 -66.3889524 -66.4323333
139 -57.0800000 -66.3889524
140 -45.6426667 -57.0800000
141 -42.7715714 -45.6426667
142 -61.5013810 -42.7715714
143 -65.7177619 -61.5013810
144 -57.7774091 -65.7177619
145 -51.5139048 -57.7774091
146 -44.6276667 -51.5139048
147 -46.1279048 -44.6276667
148 -42.1699048 -46.1279048
149 -42.1343333 -42.1699048
150 -33.5569524 -42.1343333
151 -41.5610000 -33.5569524
152 -35.5946667 -41.5610000
153 -27.0175714 -35.5946667
154 -23.2463810 -27.0175714
155 -24.5467619 -23.2463810
156 -14.6624091 -24.5467619
157 -9.1099048 -14.6624091
158 -5.1336667 -9.1099048
159 1.7480952 -5.1336667
160 3.9630952 1.7480952
161 9.2106667 3.9630952
162 18.9190476 9.2106667
163 12.9610000 18.9190476
164 19.4223333 12.9610000
165 19.8614286 19.4223333
166 14.8586190 19.8614286
167 18.0032381 14.8586190
168 28.4985909 18.0032381
169 34.7350952 28.4985909
170 40.2653333 34.7350952
171 36.2200952 40.2653333
172 39.7680952 36.2200952
173 44.9616667 39.7680952
174 43.1260476 44.9616667
175 44.0100000 43.1260476
176 54.0433333 44.0100000
177 65.7214286 54.0433333
178 61.6816190 65.7214286
179 58.6692381 61.6816190
180 57.0385909 58.6692381
181 63.2600952 57.0385909
182 69.3613333 63.2600952
183 65.7210952 69.3613333
184 70.5620952 65.7210952
185 71.2676667 70.5620952
186 70.3310476 71.2676667
187 62.1310000 70.3310476
188 69.6623333 62.1310000
189 66.5144286 69.6623333
190 62.9186190 66.5144286
191 60.3562381 62.9186190
192 59.5815909 60.3562381
193 63.9530952 59.5815909
194 64.7323333 63.9530952
195 66.8260952 64.7323333
196 75.8810952 66.8260952
197 75.1816667 75.8810952
198 69.1630476 75.1816667
199 59.0560000 69.1630476
200 61.3463333 59.0560000
201 42.0224286 61.3463333
202 33.2566190 42.0224286
203 20.4892381 33.2566190
204 26.7495909 20.4892381
205 22.7350952 26.7495909
206 16.6063333 22.7350952
207 18.5400952 16.6063333
208 14.1440952 18.5400952
209 0.9016667 14.1440952
210 4.9580476 0.9016667
211 -2.1620000 4.9580476
212 -16.9126667 -2.1620000
213 -18.5325714 -16.9126667
214 -22.6393810 -18.5325714
215 -22.5267619 -22.6393810
216 -16.9044091 -22.5267619
217 -18.5579048 -16.9044091
218 -22.4446667 -18.5579048
219 -17.1359048 -22.4446667
220 -27.5369048 -17.1359048
221 -20.1803333 -27.5369048
222 -22.0249524 -20.1803333
223 -33.1630000 -22.0249524
224 -40.6246667 -33.1630000
225 -39.4285714 -40.6246667
226 -30.6193810 -39.4285714
227 -20.6437619 -30.6193810
228 -5.6044091 -20.6437619
229 6.5190952 -5.6044091
230 21.2553333 6.5190952
231 29.1560952 21.2553333
232 26.7030952 29.1560952
233 38.4536667 26.7030952
234 36.1660476 38.4536667
235 29.8410000 36.1660476
236 21.9533333 29.8410000
237 18.8754286 21.9533333
238 25.0746190 18.8754286
239 38.3082381 25.0746190
240 46.2855909 38.3082381
241 48.6420952 46.2855909
242 48.1833333 48.6420952
243 44.1520952 48.1833333
244 40.1400952 44.1520952
245 46.9256667 40.1400952
246 50.5870476 46.9256667
247 37.6250000 50.5870476
248 27.5413333 37.6250000
249 18.0654286 27.5413333
250 16.1186190 18.0654286
251 14.3892381 16.1186190
252 21.8275909 14.3892381
253 NA 21.8275909
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -126.9659048 -120.3354091
[2,] -129.1276667 -126.9659048
[3,] -133.4619048 -129.1276667
[4,] -132.2589048 -133.4619048
[5,] -133.0643333 -132.2589048
[6,] -132.0459524 -133.0643333
[7,] -138.5410000 -132.0459524
[8,] -134.8396667 -138.5410000
[9,] -124.9255714 -134.8396667
[10,] -115.0573810 -124.9255714
[11,] -113.5397619 -115.0573810
[12,] -110.7134091 -113.5397619
[13,] -107.2459048 -110.7134091
[14,] -109.3336667 -107.2459048
[15,] -109.5669048 -109.3336667
[16,] -106.9759048 -109.5669048
[17,] -106.6443333 -106.9759048
[18,] -106.5899524 -106.6443333
[19,] -106.3800000 -106.5899524
[20,] -103.1476667 -106.3800000
[21,] -89.3145714 -103.1476667
[22,] -80.2523810 -89.3145714
[23,] -77.5287619 -80.2523810
[24,] -72.6804091 -77.5287619
[25,] -74.7279048 -72.6804091
[26,] -71.9656667 -74.7279048
[27,] -68.5689048 -71.9656667
[28,] -66.4369048 -68.5689048
[29,] -62.0393333 -66.4369048
[30,] -62.1239524 -62.0393333
[31,] -60.9390000 -62.1239524
[32,] -56.2316667 -60.9390000
[33,] -44.6925714 -56.2316667
[34,] -31.0513810 -44.6925714
[35,] -21.3087619 -31.0513810
[36,] -12.9644091 -21.3087619
[37,] -6.6019048 -12.9644091
[38,] -3.2616667 -6.6019048
[39,] 1.2280952 -3.2616667
[40,] 8.4330952 1.2280952
[41,] 13.6746667 8.4330952
[42,] 19.7540476 13.6746667
[43,] 24.9120000 19.7540476
[44,] 35.0023333 24.9120000
[45,] 40.7434286 35.0023333
[46,] 53.5776190 40.7434286
[47,] 54.7192381 53.5776190
[48,] 60.2065909 54.7192381
[49,] 59.4780952 60.2065909
[50,] 57.3833333 59.4780952
[51,] 55.5380952 57.3833333
[52,] 57.7810952 55.5380952
[53,] 56.2366667 57.7810952
[54,] 50.9060476 56.2366667
[55,] 55.5020000 50.9060476
[56,] 58.1653333 55.5020000
[57,] 60.8774286 58.1653333
[58,] 62.5936190 60.8774286
[59,] 61.8032381 62.5936190
[60,] 66.0905909 61.8032381
[61,] 65.4540952 66.0905909
[62,] 60.4223333 65.4540952
[63,] 59.8440952 60.4223333
[64,] 58.4440952 59.8440952
[65,] 57.4916667 58.4440952
[66,] 57.8450476 57.4916667
[67,] 64.1060000 57.8450476
[68,] 70.0623333 64.1060000
[69,] 78.8324286 70.0623333
[70,] 77.1846190 78.8324286
[71,] 79.0452381 77.1846190
[72,] 87.3435909 79.0452381
[73,] 78.0930952 87.3435909
[74,] 69.2813333 78.0930952
[75,] 66.3380952 69.2813333
[76,] 58.3400952 66.3380952
[77,] 47.1366667 58.3400952
[78,] 48.4620476 47.1366667
[79,] 53.3280000 48.4620476
[80,] 49.1293333 53.3280000
[81,] 44.3574286 49.1293333
[82,] 46.1796190 44.3574286
[83,] 43.3812381 46.1796190
[84,] 45.6305909 43.3812381
[85,] 45.4410952 45.6305909
[86,] 45.3933333 45.4410952
[87,] 44.0180952 45.3933333
[88,] 39.8690952 44.0180952
[89,] 42.8016667 39.8690952
[90,] 37.7800476 42.8016667
[91,] 40.2960000 37.7800476
[92,] 40.3983333 40.2960000
[93,] 32.0414286 40.3983333
[94,] 30.1546190 32.0414286
[95,] 29.0822381 30.1546190
[96,] 27.4475909 29.0822381
[97,] 28.0250952 27.4475909
[98,] 24.8333333 28.0250952
[99,] 18.8920952 24.8333333
[100,] 14.9470952 18.8920952
[101,] 7.5216667 14.9470952
[102,] 3.6790476 7.5216667
[103,] 17.4720000 3.6790476
[104,] 10.2883333 17.4720000
[105,] -6.0865714 10.2883333
[106,] -10.8733810 -6.0865714
[107,] -11.2227619 -10.8733810
[108,] -7.3074091 -11.2227619
[109,] -10.4059048 -7.3074091
[110,] -11.6126667 -10.4059048
[111,] -18.0779048 -11.6126667
[112,] -17.8739048 -18.0779048
[113,] -22.6583333 -17.8739048
[114,] -26.7219524 -22.6583333
[115,] -15.2250000 -26.7219524
[116,] -26.9436667 -15.2250000
[117,] -34.5655714 -26.9436667
[118,] -40.0683810 -34.5655714
[119,] -44.5967619 -40.0683810
[120,] -40.9614091 -44.5967619
[121,] -45.1579048 -40.9614091
[122,] -53.1316667 -45.1579048
[123,] -50.7709048 -53.1316667
[124,] -54.9169048 -50.7709048
[125,] -58.6123333 -54.9169048
[126,] -62.2239524 -58.6123333
[127,] -46.1890000 -62.2239524
[128,] -57.0776667 -46.1890000
[129,] -60.5775714 -57.0776667
[130,] -68.2893810 -60.5775714
[131,] -76.6147619 -68.2893810
[132,] -66.7894091 -76.6147619
[133,] -66.0489048 -66.7894091
[134,] -67.0786667 -66.0489048
[135,] -64.5119048 -67.0786667
[136,] -60.8069048 -64.5119048
[137,] -66.4323333 -60.8069048
[138,] -66.3889524 -66.4323333
[139,] -57.0800000 -66.3889524
[140,] -45.6426667 -57.0800000
[141,] -42.7715714 -45.6426667
[142,] -61.5013810 -42.7715714
[143,] -65.7177619 -61.5013810
[144,] -57.7774091 -65.7177619
[145,] -51.5139048 -57.7774091
[146,] -44.6276667 -51.5139048
[147,] -46.1279048 -44.6276667
[148,] -42.1699048 -46.1279048
[149,] -42.1343333 -42.1699048
[150,] -33.5569524 -42.1343333
[151,] -41.5610000 -33.5569524
[152,] -35.5946667 -41.5610000
[153,] -27.0175714 -35.5946667
[154,] -23.2463810 -27.0175714
[155,] -24.5467619 -23.2463810
[156,] -14.6624091 -24.5467619
[157,] -9.1099048 -14.6624091
[158,] -5.1336667 -9.1099048
[159,] 1.7480952 -5.1336667
[160,] 3.9630952 1.7480952
[161,] 9.2106667 3.9630952
[162,] 18.9190476 9.2106667
[163,] 12.9610000 18.9190476
[164,] 19.4223333 12.9610000
[165,] 19.8614286 19.4223333
[166,] 14.8586190 19.8614286
[167,] 18.0032381 14.8586190
[168,] 28.4985909 18.0032381
[169,] 34.7350952 28.4985909
[170,] 40.2653333 34.7350952
[171,] 36.2200952 40.2653333
[172,] 39.7680952 36.2200952
[173,] 44.9616667 39.7680952
[174,] 43.1260476 44.9616667
[175,] 44.0100000 43.1260476
[176,] 54.0433333 44.0100000
[177,] 65.7214286 54.0433333
[178,] 61.6816190 65.7214286
[179,] 58.6692381 61.6816190
[180,] 57.0385909 58.6692381
[181,] 63.2600952 57.0385909
[182,] 69.3613333 63.2600952
[183,] 65.7210952 69.3613333
[184,] 70.5620952 65.7210952
[185,] 71.2676667 70.5620952
[186,] 70.3310476 71.2676667
[187,] 62.1310000 70.3310476
[188,] 69.6623333 62.1310000
[189,] 66.5144286 69.6623333
[190,] 62.9186190 66.5144286
[191,] 60.3562381 62.9186190
[192,] 59.5815909 60.3562381
[193,] 63.9530952 59.5815909
[194,] 64.7323333 63.9530952
[195,] 66.8260952 64.7323333
[196,] 75.8810952 66.8260952
[197,] 75.1816667 75.8810952
[198,] 69.1630476 75.1816667
[199,] 59.0560000 69.1630476
[200,] 61.3463333 59.0560000
[201,] 42.0224286 61.3463333
[202,] 33.2566190 42.0224286
[203,] 20.4892381 33.2566190
[204,] 26.7495909 20.4892381
[205,] 22.7350952 26.7495909
[206,] 16.6063333 22.7350952
[207,] 18.5400952 16.6063333
[208,] 14.1440952 18.5400952
[209,] 0.9016667 14.1440952
[210,] 4.9580476 0.9016667
[211,] -2.1620000 4.9580476
[212,] -16.9126667 -2.1620000
[213,] -18.5325714 -16.9126667
[214,] -22.6393810 -18.5325714
[215,] -22.5267619 -22.6393810
[216,] -16.9044091 -22.5267619
[217,] -18.5579048 -16.9044091
[218,] -22.4446667 -18.5579048
[219,] -17.1359048 -22.4446667
[220,] -27.5369048 -17.1359048
[221,] -20.1803333 -27.5369048
[222,] -22.0249524 -20.1803333
[223,] -33.1630000 -22.0249524
[224,] -40.6246667 -33.1630000
[225,] -39.4285714 -40.6246667
[226,] -30.6193810 -39.4285714
[227,] -20.6437619 -30.6193810
[228,] -5.6044091 -20.6437619
[229,] 6.5190952 -5.6044091
[230,] 21.2553333 6.5190952
[231,] 29.1560952 21.2553333
[232,] 26.7030952 29.1560952
[233,] 38.4536667 26.7030952
[234,] 36.1660476 38.4536667
[235,] 29.8410000 36.1660476
[236,] 21.9533333 29.8410000
[237,] 18.8754286 21.9533333
[238,] 25.0746190 18.8754286
[239,] 38.3082381 25.0746190
[240,] 46.2855909 38.3082381
[241,] 48.6420952 46.2855909
[242,] 48.1833333 48.6420952
[243,] 44.1520952 48.1833333
[244,] 40.1400952 44.1520952
[245,] 46.9256667 40.1400952
[246,] 50.5870476 46.9256667
[247,] 37.6250000 50.5870476
[248,] 27.5413333 37.6250000
[249,] 18.0654286 27.5413333
[250,] 16.1186190 18.0654286
[251,] 14.3892381 16.1186190
[252,] 21.8275909 14.3892381
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -126.9659048 -120.3354091
2 -129.1276667 -126.9659048
3 -133.4619048 -129.1276667
4 -132.2589048 -133.4619048
5 -133.0643333 -132.2589048
6 -132.0459524 -133.0643333
7 -138.5410000 -132.0459524
8 -134.8396667 -138.5410000
9 -124.9255714 -134.8396667
10 -115.0573810 -124.9255714
11 -113.5397619 -115.0573810
12 -110.7134091 -113.5397619
13 -107.2459048 -110.7134091
14 -109.3336667 -107.2459048
15 -109.5669048 -109.3336667
16 -106.9759048 -109.5669048
17 -106.6443333 -106.9759048
18 -106.5899524 -106.6443333
19 -106.3800000 -106.5899524
20 -103.1476667 -106.3800000
21 -89.3145714 -103.1476667
22 -80.2523810 -89.3145714
23 -77.5287619 -80.2523810
24 -72.6804091 -77.5287619
25 -74.7279048 -72.6804091
26 -71.9656667 -74.7279048
27 -68.5689048 -71.9656667
28 -66.4369048 -68.5689048
29 -62.0393333 -66.4369048
30 -62.1239524 -62.0393333
31 -60.9390000 -62.1239524
32 -56.2316667 -60.9390000
33 -44.6925714 -56.2316667
34 -31.0513810 -44.6925714
35 -21.3087619 -31.0513810
36 -12.9644091 -21.3087619
37 -6.6019048 -12.9644091
38 -3.2616667 -6.6019048
39 1.2280952 -3.2616667
40 8.4330952 1.2280952
41 13.6746667 8.4330952
42 19.7540476 13.6746667
43 24.9120000 19.7540476
44 35.0023333 24.9120000
45 40.7434286 35.0023333
46 53.5776190 40.7434286
47 54.7192381 53.5776190
48 60.2065909 54.7192381
49 59.4780952 60.2065909
50 57.3833333 59.4780952
51 55.5380952 57.3833333
52 57.7810952 55.5380952
53 56.2366667 57.7810952
54 50.9060476 56.2366667
55 55.5020000 50.9060476
56 58.1653333 55.5020000
57 60.8774286 58.1653333
58 62.5936190 60.8774286
59 61.8032381 62.5936190
60 66.0905909 61.8032381
61 65.4540952 66.0905909
62 60.4223333 65.4540952
63 59.8440952 60.4223333
64 58.4440952 59.8440952
65 57.4916667 58.4440952
66 57.8450476 57.4916667
67 64.1060000 57.8450476
68 70.0623333 64.1060000
69 78.8324286 70.0623333
70 77.1846190 78.8324286
71 79.0452381 77.1846190
72 87.3435909 79.0452381
73 78.0930952 87.3435909
74 69.2813333 78.0930952
75 66.3380952 69.2813333
76 58.3400952 66.3380952
77 47.1366667 58.3400952
78 48.4620476 47.1366667
79 53.3280000 48.4620476
80 49.1293333 53.3280000
81 44.3574286 49.1293333
82 46.1796190 44.3574286
83 43.3812381 46.1796190
84 45.6305909 43.3812381
85 45.4410952 45.6305909
86 45.3933333 45.4410952
87 44.0180952 45.3933333
88 39.8690952 44.0180952
89 42.8016667 39.8690952
90 37.7800476 42.8016667
91 40.2960000 37.7800476
92 40.3983333 40.2960000
93 32.0414286 40.3983333
94 30.1546190 32.0414286
95 29.0822381 30.1546190
96 27.4475909 29.0822381
97 28.0250952 27.4475909
98 24.8333333 28.0250952
99 18.8920952 24.8333333
100 14.9470952 18.8920952
101 7.5216667 14.9470952
102 3.6790476 7.5216667
103 17.4720000 3.6790476
104 10.2883333 17.4720000
105 -6.0865714 10.2883333
106 -10.8733810 -6.0865714
107 -11.2227619 -10.8733810
108 -7.3074091 -11.2227619
109 -10.4059048 -7.3074091
110 -11.6126667 -10.4059048
111 -18.0779048 -11.6126667
112 -17.8739048 -18.0779048
113 -22.6583333 -17.8739048
114 -26.7219524 -22.6583333
115 -15.2250000 -26.7219524
116 -26.9436667 -15.2250000
117 -34.5655714 -26.9436667
118 -40.0683810 -34.5655714
119 -44.5967619 -40.0683810
120 -40.9614091 -44.5967619
121 -45.1579048 -40.9614091
122 -53.1316667 -45.1579048
123 -50.7709048 -53.1316667
124 -54.9169048 -50.7709048
125 -58.6123333 -54.9169048
126 -62.2239524 -58.6123333
127 -46.1890000 -62.2239524
128 -57.0776667 -46.1890000
129 -60.5775714 -57.0776667
130 -68.2893810 -60.5775714
131 -76.6147619 -68.2893810
132 -66.7894091 -76.6147619
133 -66.0489048 -66.7894091
134 -67.0786667 -66.0489048
135 -64.5119048 -67.0786667
136 -60.8069048 -64.5119048
137 -66.4323333 -60.8069048
138 -66.3889524 -66.4323333
139 -57.0800000 -66.3889524
140 -45.6426667 -57.0800000
141 -42.7715714 -45.6426667
142 -61.5013810 -42.7715714
143 -65.7177619 -61.5013810
144 -57.7774091 -65.7177619
145 -51.5139048 -57.7774091
146 -44.6276667 -51.5139048
147 -46.1279048 -44.6276667
148 -42.1699048 -46.1279048
149 -42.1343333 -42.1699048
150 -33.5569524 -42.1343333
151 -41.5610000 -33.5569524
152 -35.5946667 -41.5610000
153 -27.0175714 -35.5946667
154 -23.2463810 -27.0175714
155 -24.5467619 -23.2463810
156 -14.6624091 -24.5467619
157 -9.1099048 -14.6624091
158 -5.1336667 -9.1099048
159 1.7480952 -5.1336667
160 3.9630952 1.7480952
161 9.2106667 3.9630952
162 18.9190476 9.2106667
163 12.9610000 18.9190476
164 19.4223333 12.9610000
165 19.8614286 19.4223333
166 14.8586190 19.8614286
167 18.0032381 14.8586190
168 28.4985909 18.0032381
169 34.7350952 28.4985909
170 40.2653333 34.7350952
171 36.2200952 40.2653333
172 39.7680952 36.2200952
173 44.9616667 39.7680952
174 43.1260476 44.9616667
175 44.0100000 43.1260476
176 54.0433333 44.0100000
177 65.7214286 54.0433333
178 61.6816190 65.7214286
179 58.6692381 61.6816190
180 57.0385909 58.6692381
181 63.2600952 57.0385909
182 69.3613333 63.2600952
183 65.7210952 69.3613333
184 70.5620952 65.7210952
185 71.2676667 70.5620952
186 70.3310476 71.2676667
187 62.1310000 70.3310476
188 69.6623333 62.1310000
189 66.5144286 69.6623333
190 62.9186190 66.5144286
191 60.3562381 62.9186190
192 59.5815909 60.3562381
193 63.9530952 59.5815909
194 64.7323333 63.9530952
195 66.8260952 64.7323333
196 75.8810952 66.8260952
197 75.1816667 75.8810952
198 69.1630476 75.1816667
199 59.0560000 69.1630476
200 61.3463333 59.0560000
201 42.0224286 61.3463333
202 33.2566190 42.0224286
203 20.4892381 33.2566190
204 26.7495909 20.4892381
205 22.7350952 26.7495909
206 16.6063333 22.7350952
207 18.5400952 16.6063333
208 14.1440952 18.5400952
209 0.9016667 14.1440952
210 4.9580476 0.9016667
211 -2.1620000 4.9580476
212 -16.9126667 -2.1620000
213 -18.5325714 -16.9126667
214 -22.6393810 -18.5325714
215 -22.5267619 -22.6393810
216 -16.9044091 -22.5267619
217 -18.5579048 -16.9044091
218 -22.4446667 -18.5579048
219 -17.1359048 -22.4446667
220 -27.5369048 -17.1359048
221 -20.1803333 -27.5369048
222 -22.0249524 -20.1803333
223 -33.1630000 -22.0249524
224 -40.6246667 -33.1630000
225 -39.4285714 -40.6246667
226 -30.6193810 -39.4285714
227 -20.6437619 -30.6193810
228 -5.6044091 -20.6437619
229 6.5190952 -5.6044091
230 21.2553333 6.5190952
231 29.1560952 21.2553333
232 26.7030952 29.1560952
233 38.4536667 26.7030952
234 36.1660476 38.4536667
235 29.8410000 36.1660476
236 21.9533333 29.8410000
237 18.8754286 21.9533333
238 25.0746190 18.8754286
239 38.3082381 25.0746190
240 46.2855909 38.3082381
241 48.6420952 46.2855909
242 48.1833333 48.6420952
243 44.1520952 48.1833333
244 40.1400952 44.1520952
245 46.9256667 40.1400952
246 50.5870476 46.9256667
247 37.6250000 50.5870476
248 27.5413333 37.6250000
249 18.0654286 27.5413333
250 16.1186190 18.0654286
251 14.3892381 16.1186190
252 21.8275909 14.3892381
> 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/7jxxe1322602643.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/8kubt1322602643.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/94ty61322602643.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/1067t01322602643.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/11ha291322602643.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/127b641322602643.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/130p521322602643.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/14gk3z1322602643.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/15i0e31322602643.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/16vpwz1322602643.tab")
+ }
>
> try(system("convert tmp/189i41322602643.ps tmp/189i41322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/22c9m1322602643.ps tmp/22c9m1322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/3uah11322602643.ps tmp/3uah11322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/4rx9w1322602643.ps tmp/4rx9w1322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wpi11322602643.ps tmp/5wpi11322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/61rf11322602643.ps tmp/61rf11322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/7jxxe1322602643.ps tmp/7jxxe1322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/8kubt1322602643.ps tmp/8kubt1322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/94ty61322602643.ps tmp/94ty61322602643.png",intern=TRUE))
character(0)
> try(system("convert tmp/1067t01322602643.ps tmp/1067t01322602643.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.709 0.535 7.437