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(170650
+ ,334
+ ,95556
+ ,86621
+ ,223
+ ,54565
+ ,122154
+ ,395
+ ,63016
+ ,152521
+ ,876
+ ,79774
+ ,86318
+ ,189
+ ,31258
+ ,37257
+ ,111
+ ,52491
+ ,316392
+ ,1317
+ ,91256
+ ,32750
+ ,102
+ ,22807
+ ,116502
+ ,580
+ ,77411
+ ,130554
+ ,421
+ ,48821
+ ,173368
+ ,539
+ ,52295
+ ,128294
+ ,359
+ ,63262
+ ,111635
+ ,463
+ ,50466
+ ,193105
+ ,694
+ ,62932
+ ,143900
+ ,396
+ ,38439
+ ,262290
+ ,1184
+ ,70817
+ ,181110
+ ,486
+ ,105965
+ ,202871
+ ,788
+ ,73795
+ ,113853
+ ,338
+ ,82043
+ ,159968
+ ,486
+ ,74349
+ ,174585
+ ,476
+ ,82204
+ ,291865
+ ,828
+ ,55709
+ ,96067
+ ,280
+ ,37137
+ ,110856
+ ,334
+ ,70780
+ ,146342
+ ,850
+ ,55027
+ ,146853
+ ,710
+ ,56699
+ ,166051
+ ,721
+ ,65911
+ ,172853
+ ,408
+ ,56316
+ ,106888
+ ,406
+ ,26982
+ ,193791
+ ,591
+ ,54628
+ ,189408
+ ,596
+ ,96750
+ ,136021
+ ,411
+ ,53009
+ ,215469
+ ,541
+ ,64664
+ ,75339
+ ,207
+ ,36990
+ ,247979
+ ,859
+ ,85224
+ ,167255
+ ,669
+ ,37048
+ ,266277
+ ,753
+ ,59635
+ ,122024
+ ,368
+ ,42051
+ ,80964
+ ,216
+ ,26998
+ ,214975
+ ,782
+ ,63717
+ ,225469
+ ,1094
+ ,55071
+ ,123008
+ ,464
+ ,40001
+ ,140190
+ ,474
+ ,54506
+ ,81106
+ ,300
+ ,35838
+ ,93125
+ ,836
+ ,50838
+ ,318604
+ ,1443
+ ,86997
+ ,78800
+ ,330
+ ,33032
+ ,158835
+ ,477
+ ,61704
+ ,228655
+ ,1042
+ ,117986
+ ,131108
+ ,646
+ ,56733
+ ,128744
+ ,343
+ ,55064
+ ,24188
+ ,218
+ ,5950
+ ,265554
+ ,598
+ ,84607
+ ,65029
+ ,255
+ ,32551
+ ,98066
+ ,434
+ ,31701
+ ,173587
+ ,654
+ ,71170
+ ,180360
+ ,482
+ ,101773
+ ,197266
+ ,753
+ ,101653
+ ,212179
+ ,693
+ ,81493
+ ,146062
+ ,478
+ ,55901
+ ,250805
+ ,843
+ ,109104
+ ,209228
+ ,832
+ ,114425
+ ,145696
+ ,710
+ ,36311
+ ,182854
+ ,613
+ ,70027
+ ,142064
+ ,390
+ ,73713
+ ,122105
+ ,332
+ ,40671
+ ,118675
+ ,421
+ ,89041
+ ,145285
+ ,636
+ ,57231
+ ,155015
+ ,576
+ ,68608
+ ,96487
+ ,410
+ ,59155
+ ,118807
+ ,468
+ ,55827
+ ,69471
+ ,364
+ ,22618
+ ,126630
+ ,449
+ ,58425
+ ,146344
+ ,530
+ ,65724
+ ,110652
+ ,373
+ ,56979
+ ,197814
+ ,618
+ ,72369
+ ,206788
+ ,640
+ ,79194
+ ,112604
+ ,283
+ ,202316
+ ,91921
+ ,297
+ ,44970
+ ,124190
+ ,457
+ ,49319
+ ,103304
+ ,453
+ ,36252
+ ,287032
+ ,883
+ ,75741
+ ,132798
+ ,570
+ ,38417
+ ,143272
+ ,355
+ ,64102
+ ,80953
+ ,437
+ ,56622
+ ,109237
+ ,641
+ ,15430
+ ,98875
+ ,252
+ ,72571
+ ,226212
+ ,944
+ ,67271
+ ,175829
+ ,559
+ ,43460
+ ,118217
+ ,736
+ ,99501
+ ,140433
+ ,465
+ ,28340
+ ,152193
+ ,450
+ ,76013
+ ,121798
+ ,429
+ ,37361
+ ,169631
+ ,736
+ ,48204
+ ,187732
+ ,586
+ ,76168
+ ,130533
+ ,387
+ ,85168
+ ,142339
+ ,397
+ ,125410
+ ,202077
+ ,575
+ ,123328
+ ,209419
+ ,728
+ ,83038
+ ,252260
+ ,943
+ ,120087
+ ,163066
+ ,447
+ ,91939
+ ,190562
+ ,617
+ ,103646
+ ,106351
+ ,341
+ ,29467
+ ,43287
+ ,214
+ ,43750
+ ,127493
+ ,507
+ ,34497
+ ,130005
+ ,451
+ ,66477
+ ,149006
+ ,616
+ ,71181
+ ,197727
+ ,694
+ ,74482
+ ,74112
+ ,215
+ ,174949
+ ,94968
+ ,360
+ ,46765
+ ,191351
+ ,422
+ ,90257
+ ,145048
+ ,442
+ ,51370
+ ,22938
+ ,154
+ ,1168
+ ,125927
+ ,474
+ ,51360
+ ,61857
+ ,192
+ ,25162
+ ,98969
+ ,340
+ ,21067
+ ,259571
+ ,832
+ ,58233
+ ,21054
+ ,146
+ ,855
+ ,174409
+ ,597
+ ,85903
+ ,31414
+ ,200
+ ,14116
+ ,193178
+ ,777
+ ,57637
+ ,137544
+ ,388
+ ,94137
+ ,77166
+ ,248
+ ,62147
+ ,82724
+ ,371
+ ,62832
+ ,38214
+ ,276
+ ,8773
+ ,90961
+ ,298
+ ,63785
+ ,197612
+ ,624
+ ,65196
+ ,137107
+ ,313
+ ,73087
+ ,251103
+ ,1040
+ ,72631
+ ,209835
+ ,609
+ ,86281
+ ,263825
+ ,819
+ ,162365
+ ,139144
+ ,344
+ ,56530
+ ,76470
+ ,312
+ ,35606
+ ,197114
+ ,642
+ ,70111
+ ,291962
+ ,1074
+ ,92046
+ ,51025
+ ,226
+ ,63989
+ ,254843
+ ,1176
+ ,104911
+ ,104554
+ ,510
+ ,43448
+ ,168059
+ ,391
+ ,60029
+ ,136745
+ ,534
+ ,38650
+ ,84092
+ ,256
+ ,47261
+ ,251448
+ ,1159
+ ,73586
+ ,152366
+ ,446
+ ,83042
+ ,173260
+ ,716
+ ,37238
+ ,204966
+ ,594
+ ,63958
+ ,83932
+ ,414
+ ,78956
+ ,139409
+ ,678
+ ,99518
+ ,185455
+ ,537
+ ,111436
+ ,0
+ ,0
+ ,0
+ ,14688
+ ,85
+ ,6023
+ ,98
+ ,0
+ ,0
+ ,455
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,137891
+ ,450
+ ,42564
+ ,185368
+ ,582
+ ,38885
+ ,0
+ ,0
+ ,0
+ ,203
+ ,0
+ ,0
+ ,7199
+ ,74
+ ,1644
+ ,46660
+ ,259
+ ,6179
+ ,17547
+ ,69
+ ,3926
+ ,73567
+ ,187
+ ,23238
+ ,969
+ ,0
+ ,0
+ ,105477
+ ,341
+ ,49288)
+ ,dim=c(3
+ ,164)
+ ,dimnames=list(c('Time_RFC'
+ ,'Compendium_Views'
+ ,'Characters')
+ ,1:164))
> y <- array(NA,dim=c(3,164),dimnames=list(c('Time_RFC','Compendium_Views','Characters'),1:164))
> 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 = 'Do not include Seasonal Dummies'
> par1 = '3'
> 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
Characters Time_RFC Compendium_Views t
1 95556 170650 334 1
2 54565 86621 223 2
3 63016 122154 395 3
4 79774 152521 876 4
5 31258 86318 189 5
6 52491 37257 111 6
7 91256 316392 1317 7
8 22807 32750 102 8
9 77411 116502 580 9
10 48821 130554 421 10
11 52295 173368 539 11
12 63262 128294 359 12
13 50466 111635 463 13
14 62932 193105 694 14
15 38439 143900 396 15
16 70817 262290 1184 16
17 105965 181110 486 17
18 73795 202871 788 18
19 82043 113853 338 19
20 74349 159968 486 20
21 82204 174585 476 21
22 55709 291865 828 22
23 37137 96067 280 23
24 70780 110856 334 24
25 55027 146342 850 25
26 56699 146853 710 26
27 65911 166051 721 27
28 56316 172853 408 28
29 26982 106888 406 29
30 54628 193791 591 30
31 96750 189408 596 31
32 53009 136021 411 32
33 64664 215469 541 33
34 36990 75339 207 34
35 85224 247979 859 35
36 37048 167255 669 36
37 59635 266277 753 37
38 42051 122024 368 38
39 26998 80964 216 39
40 63717 214975 782 40
41 55071 225469 1094 41
42 40001 123008 464 42
43 54506 140190 474 43
44 35838 81106 300 44
45 50838 93125 836 45
46 86997 318604 1443 46
47 33032 78800 330 47
48 61704 158835 477 48
49 117986 228655 1042 49
50 56733 131108 646 50
51 55064 128744 343 51
52 5950 24188 218 52
53 84607 265554 598 53
54 32551 65029 255 54
55 31701 98066 434 55
56 71170 173587 654 56
57 101773 180360 482 57
58 101653 197266 753 58
59 81493 212179 693 59
60 55901 146062 478 60
61 109104 250805 843 61
62 114425 209228 832 62
63 36311 145696 710 63
64 70027 182854 613 64
65 73713 142064 390 65
66 40671 122105 332 66
67 89041 118675 421 67
68 57231 145285 636 68
69 68608 155015 576 69
70 59155 96487 410 70
71 55827 118807 468 71
72 22618 69471 364 72
73 58425 126630 449 73
74 65724 146344 530 74
75 56979 110652 373 75
76 72369 197814 618 76
77 79194 206788 640 77
78 202316 112604 283 78
79 44970 91921 297 79
80 49319 124190 457 80
81 36252 103304 453 81
82 75741 287032 883 82
83 38417 132798 570 83
84 64102 143272 355 84
85 56622 80953 437 85
86 15430 109237 641 86
87 72571 98875 252 87
88 67271 226212 944 88
89 43460 175829 559 89
90 99501 118217 736 90
91 28340 140433 465 91
92 76013 152193 450 92
93 37361 121798 429 93
94 48204 169631 736 94
95 76168 187732 586 95
96 85168 130533 387 96
97 125410 142339 397 97
98 123328 202077 575 98
99 83038 209419 728 99
100 120087 252260 943 100
101 91939 163066 447 101
102 103646 190562 617 102
103 29467 106351 341 103
104 43750 43287 214 104
105 34497 127493 507 105
106 66477 130005 451 106
107 71181 149006 616 107
108 74482 197727 694 108
109 174949 74112 215 109
110 46765 94968 360 110
111 90257 191351 422 111
112 51370 145048 442 112
113 1168 22938 154 113
114 51360 125927 474 114
115 25162 61857 192 115
116 21067 98969 340 116
117 58233 259571 832 117
118 855 21054 146 118
119 85903 174409 597 119
120 14116 31414 200 120
121 57637 193178 777 121
122 94137 137544 388 122
123 62147 77166 248 123
124 62832 82724 371 124
125 8773 38214 276 125
126 63785 90961 298 126
127 65196 197612 624 127
128 73087 137107 313 128
129 72631 251103 1040 129
130 86281 209835 609 130
131 162365 263825 819 131
132 56530 139144 344 132
133 35606 76470 312 133
134 70111 197114 642 134
135 92046 291962 1074 135
136 63989 51025 226 136
137 104911 254843 1176 137
138 43448 104554 510 138
139 60029 168059 391 139
140 38650 136745 534 140
141 47261 84092 256 141
142 73586 251448 1159 142
143 83042 152366 446 143
144 37238 173260 716 144
145 63958 204966 594 145
146 78956 83932 414 146
147 99518 139409 678 147
148 111436 185455 537 148
149 0 0 0 149
150 6023 14688 85 150
151 0 98 0 151
152 0 455 0 152
153 0 0 0 153
154 0 0 0 154
155 42564 137891 450 155
156 38885 185368 582 156
157 0 0 0 157
158 0 203 0 158
159 1644 7199 74 159
160 6179 46660 259 160
161 3926 17547 69 161
162 23238 73567 187 162
163 0 969 0 163
164 49288 105477 341 164
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Time_RFC Compendium_Views t
20240.3666 0.3842 -26.9450 -12.0325
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-54101 -17229 -5750 10788 147373
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.024e+04 6.575e+03 3.078 0.00245 **
Time_RFC 3.842e-01 6.193e-02 6.205 4.51e-09 ***
Compendium_Views -2.694e+01 1.602e+01 -1.682 0.09456 .
t -1.203e+01 4.472e+01 -0.269 0.78821
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 26120 on 160 degrees of freedom
Multiple R-squared: 0.4036, Adjusted R-squared: 0.3925
F-statistic: 36.1 on 3 and 160 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,] 2.611215e-01 5.222431e-01 7.388785e-01
[2,] 1.313431e-01 2.626863e-01 8.686569e-01
[3,] 2.265975e-01 4.531950e-01 7.734025e-01
[4,] 1.330721e-01 2.661443e-01 8.669279e-01
[5,] 7.409438e-02 1.481888e-01 9.259056e-01
[6,] 6.413355e-02 1.282671e-01 9.358664e-01
[7,] 3.526680e-02 7.053360e-02 9.647332e-01
[8,] 1.825570e-02 3.651141e-02 9.817443e-01
[9,] 1.036271e-02 2.072543e-02 9.896373e-01
[10,] 5.128774e-03 1.025755e-02 9.948712e-01
[11,] 7.052129e-02 1.410426e-01 9.294787e-01
[12,] 4.631700e-02 9.263401e-02 9.536830e-01
[13,] 6.243365e-02 1.248673e-01 9.375664e-01
[14,] 4.226210e-02 8.452421e-02 9.577379e-01
[15,] 2.895101e-02 5.790201e-02 9.710490e-01
[16,] 5.778576e-02 1.155715e-01 9.422142e-01
[17,] 4.600979e-02 9.201959e-02 9.539902e-01
[18,] 3.813679e-02 7.627359e-02 9.618632e-01
[19,] 2.569419e-02 5.138838e-02 9.743058e-01
[20,] 1.664113e-02 3.328227e-02 9.833589e-01
[21,] 1.061442e-02 2.122884e-02 9.893856e-01
[22,] 7.079837e-03 1.415967e-02 9.929202e-01
[23,] 7.395568e-03 1.479114e-02 9.926044e-01
[24,] 5.039910e-03 1.007982e-02 9.949601e-01
[25,] 9.130303e-03 1.826061e-02 9.908697e-01
[26,] 5.847743e-03 1.169549e-02 9.941523e-01
[27,] 3.946090e-03 7.892181e-03 9.960539e-01
[28,] 2.506015e-03 5.012030e-03 9.974940e-01
[29,] 1.762406e-03 3.524813e-03 9.982376e-01
[30,] 1.740697e-03 3.481394e-03 9.982593e-01
[31,] 1.688024e-03 3.376048e-03 9.983120e-01
[32,] 1.083725e-03 2.167449e-03 9.989163e-01
[33,] 7.632140e-04 1.526428e-03 9.992368e-01
[34,] 4.915350e-04 9.830701e-04 9.995085e-01
[35,] 3.238872e-04 6.477743e-04 9.996761e-01
[36,] 1.987306e-04 3.974612e-04 9.998013e-01
[37,] 1.297590e-04 2.595181e-04 9.998702e-01
[38,] 7.542012e-05 1.508402e-04 9.999246e-01
[39,] 5.727936e-05 1.145587e-04 9.999427e-01
[40,] 3.756606e-05 7.513212e-05 9.999624e-01
[41,] 2.128448e-05 4.256897e-05 9.999787e-01
[42,] 1.518844e-05 3.037688e-05 9.999848e-01
[43,] 2.149417e-04 4.298834e-04 9.997851e-01
[44,] 1.352317e-04 2.704635e-04 9.998648e-01
[45,] 8.930261e-05 1.786052e-04 9.999107e-01
[46,] 8.578662e-05 1.715732e-04 9.999142e-01
[47,] 7.839314e-05 1.567863e-04 9.999216e-01
[48,] 4.734981e-05 9.469963e-05 9.999527e-01
[49,] 3.147604e-05 6.295207e-05 9.999685e-01
[50,] 2.415404e-05 4.830808e-05 9.999758e-01
[51,] 8.898045e-05 1.779609e-04 9.999110e-01
[52,] 1.765375e-04 3.530750e-04 9.998235e-01
[53,] 1.250920e-04 2.501841e-04 9.998749e-01
[54,] 8.146784e-05 1.629357e-04 9.999185e-01
[55,] 9.696176e-05 1.939235e-04 9.999030e-01
[56,] 2.487672e-04 4.975344e-04 9.997512e-01
[57,] 2.420800e-04 4.841600e-04 9.997579e-01
[58,] 1.602888e-04 3.205777e-04 9.998397e-01
[59,] 1.187773e-04 2.375546e-04 9.998812e-01
[60,] 1.007569e-04 2.015137e-04 9.998992e-01
[61,] 1.716966e-04 3.433933e-04 9.998283e-01
[62,] 1.095682e-04 2.191365e-04 9.998904e-01
[63,] 6.999653e-05 1.399931e-04 9.999300e-01
[64,] 4.614120e-05 9.228239e-05 9.999539e-01
[65,] 2.819007e-05 5.638014e-05 9.999718e-01
[66,] 2.491901e-05 4.983802e-05 9.999751e-01
[67,] 1.528882e-05 3.057765e-05 9.999847e-01
[68,] 9.328514e-06 1.865703e-05 9.999907e-01
[69,] 5.608985e-06 1.121797e-05 9.999944e-01
[70,] 3.661161e-06 7.322322e-06 9.999963e-01
[71,] 2.317659e-06 4.635318e-06 9.999977e-01
[72,] 1.787747e-01 3.575494e-01 8.212253e-01
[73,] 1.555978e-01 3.111955e-01 8.444022e-01
[74,] 1.366905e-01 2.733809e-01 8.633095e-01
[75,] 1.257140e-01 2.514281e-01 8.742860e-01
[76,] 1.479319e-01 2.958638e-01 8.520681e-01
[77,] 1.448872e-01 2.897744e-01 8.551128e-01
[78,] 1.245881e-01 2.491762e-01 8.754119e-01
[79,] 1.054960e-01 2.109921e-01 8.945040e-01
[80,] 1.275018e-01 2.550037e-01 8.724982e-01
[81,] 1.109792e-01 2.219583e-01 8.890208e-01
[82,] 1.033989e-01 2.067979e-01 8.966011e-01
[83,] 1.267904e-01 2.535807e-01 8.732096e-01
[84,] 1.940839e-01 3.881678e-01 8.059161e-01
[85,] 2.496012e-01 4.992024e-01 7.503988e-01
[86,] 2.181837e-01 4.363675e-01 7.818163e-01
[87,] 2.231783e-01 4.463566e-01 7.768217e-01
[88,] 2.221833e-01 4.443665e-01 7.778167e-01
[89,] 2.003831e-01 4.007662e-01 7.996169e-01
[90,] 1.831655e-01 3.663310e-01 8.168345e-01
[91,] 2.920563e-01 5.841127e-01 7.079437e-01
[92,] 3.179909e-01 6.359817e-01 6.820091e-01
[93,] 2.824295e-01 5.648590e-01 7.175705e-01
[94,] 2.720139e-01 5.440277e-01 7.279861e-01
[95,] 2.423622e-01 4.847244e-01 7.576378e-01
[96,] 2.249095e-01 4.498191e-01 7.750905e-01
[97,] 2.433121e-01 4.866242e-01 7.566879e-01
[98,] 2.094617e-01 4.189234e-01 7.905383e-01
[99,] 2.199427e-01 4.398853e-01 7.800573e-01
[100,] 1.865971e-01 3.731941e-01 8.134029e-01
[101,] 1.566290e-01 3.132580e-01 8.433710e-01
[102,] 1.351159e-01 2.702318e-01 8.648841e-01
[103,] 9.646791e-01 7.064185e-02 3.532092e-02
[104,] 9.551287e-01 8.974252e-02 4.487126e-02
[105,] 9.424254e-01 1.151492e-01 5.757458e-02
[106,] 9.337714e-01 1.324573e-01 6.622865e-02
[107,] 9.362946e-01 1.274109e-01 6.370544e-02
[108,] 9.210207e-01 1.579587e-01 7.897933e-02
[109,] 9.106691e-01 1.786618e-01 8.933089e-02
[110,] 9.247537e-01 1.504927e-01 7.524634e-02
[111,] 9.681002e-01 6.379957e-02 3.189979e-02
[112,] 9.726758e-01 5.464849e-02 2.732424e-02
[113,] 9.636305e-01 7.273904e-02 3.636952e-02
[114,] 9.605753e-01 7.884938e-02 3.942469e-02
[115,] 9.645029e-01 7.099414e-02 3.549707e-02
[116,] 9.621723e-01 7.565543e-02 3.782771e-02
[117,] 9.523471e-01 9.530582e-02 4.765291e-02
[118,] 9.431327e-01 1.137347e-01 5.686733e-02
[119,] 9.445209e-01 1.109583e-01 5.547913e-02
[120,] 9.298476e-01 1.403049e-01 7.015244e-02
[121,] 9.269621e-01 1.460758e-01 7.303789e-02
[122,] 9.045195e-01 1.909609e-01 9.548045e-02
[123,] 9.149202e-01 1.701597e-01 8.507983e-02
[124,] 8.918517e-01 2.162966e-01 1.081483e-01
[125,] 9.775225e-01 4.495498e-02 2.247749e-02
[126,] 9.688096e-01 6.238073e-02 3.119037e-02
[127,] 9.590644e-01 8.187114e-02 4.093557e-02
[128,] 9.472493e-01 1.055014e-01 5.275072e-02
[129,] 9.412061e-01 1.175879e-01 5.879393e-02
[130,] 9.486527e-01 1.026947e-01 5.134733e-02
[131,] 9.308262e-01 1.383476e-01 6.917381e-02
[132,] 9.066029e-01 1.867942e-01 9.339708e-02
[133,] 8.835756e-01 2.328489e-01 1.164244e-01
[134,] 8.826371e-01 2.347258e-01 1.173629e-01
[135,] 8.428749e-01 3.142502e-01 1.571251e-01
[136,] 8.787147e-01 2.425706e-01 1.212853e-01
[137,] 8.657835e-01 2.684330e-01 1.342165e-01
[138,] 9.792224e-01 4.155522e-02 2.077761e-02
[139,] 9.830213e-01 3.395736e-02 1.697868e-02
[140,] 9.825634e-01 3.487311e-02 1.743656e-02
[141,] 9.947822e-01 1.043566e-02 5.217829e-03
[142,] 9.999950e-01 1.006650e-05 5.033249e-06
[143,] 9.999818e-01 3.636256e-05 1.818128e-05
[144,] 9.999535e-01 9.303621e-05 4.651811e-05
[145,] 9.998439e-01 3.122800e-04 1.561400e-04
[146,] 9.994931e-01 1.013845e-03 5.069227e-04
[147,] 9.984680e-01 3.064041e-03 1.532021e-03
[148,] 9.958688e-01 8.262393e-03 4.131196e-03
[149,] 9.946511e-01 1.069771e-02 5.348855e-03
[150,] 9.932569e-01 1.348617e-02 6.743085e-03
[151,] 9.728803e-01 5.423940e-02 2.711970e-02
> postscript(file="/var/wessaorg/rcomp/tmp/15r671321954879.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/2xyzb1321954879.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/39bmz1321954879.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/48t2r1321954879.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/5ip3y1321954879.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 = 164
Frequency = 1
1 2 3 4 5 6
18757.37964 7074.50279 6519.00420 24581.46147 -16996.10474 20998.23170
7 8 9 10 11 12
-14982.87991 -7172.45554 28142.71905 -10118.78331 -19903.93314 3544.06805
13 14 15 16 17 18
-36.63358 -12638.03653 -26242.26070 -18109.32171 29435.42263 -2946.53100
19 20 21 22 23 24
27392.20585 5979.04115 7960.24400 -54101.31627 -12194.44725 17233.14425
25 26 27 28 29 30
1760.77009 -523.83614 1620.02493 -19010.28865 -23040.00727 -23788.43336
31 32 33 34 35 36
20164.43104 -8036.13730 -23393.05541 -6211.62450 -6732.01181 -28998.44082
37 38 39 40 41 42
-42183.86571 -14702.42191 -18062.28589 -17572.28061 -21831.59577 -14495.66444
43 44 45 46 47 48
-6311.12821 -6953.30857 17883.08656 -16227.47869 -8028.81379 -6136.21425
49 50 51 52 53 54
38554.34991 4124.26474 -4788.69056 -17084.58099 -20918.01156 -5155.14192
55 56 57 58 59 60
-13863.97234 2527.05115 25905.11941 26603.33869 -891.44024 -6860.03088
61 62 63 64 65 66
15943.86213 36955.88723 -20022.07288 -3185.14877 10177.15150 -16746.65387
67 68 69 70 71 72
35351.40988 -877.91622 5155.80091 13730.54490 3401.23365 -13641.33386
73 74 75 76 77 78
2505.46490 4424.20712 5175.03860 -6312.20721 -2330.52103 147373.06090
79 80 81 82 83 84
-1636.52056 -5363.21179 -10500.80253 -30008.38100 -16491.83908 -612.46204
85 86 87 88 89 90
18074.27068 -28476.66130 22176.23795 -13393.29996 -28207.10522 54751.79881
91 92 93 94 95 96
-32235.44284 10526.79795 -17000.15535 -16252.18956 727.04045 26354.95098
97 98 99 100 101 102
62342.14084 42114.87555 3138.42457 29531.56123 22302.45561 28037.17318
103 104 105 106 107 108
-21209.69065 13894.80194 -19806.28381 9711.62981 11572.70884 -1732.92232
109 110 111 112 113 114
133336.82946 1058.25125 9199.03654 -11345.74455 -22376.78135 -3122.46118
115 116 117 118 119 120
-12288.89540 -26643.78188 -37917.92738 -22121.27763 16166.39313 -11361.87166
121 122 123 124 125 126
-14437.17821 32969.86082 20419.01061 22294.68823 -17209.69840 18139.81801
127 128 129 130 131 132
-12632.26493 10139.09515 -14517.27454 3388.13949 64397.70233 -6317.17030
133 134 135 136 137 138
-4009.75887 -6956.67868 -9813.45664 31868.96154 20086.45629 -1563.38342
139 140 141 142 143 144
-12577.71869 -18059.58594 3303.93534 -10331.96376 17995.20210 -28549.85742
145 146 147 148 149 150
-17287.70166 39377.87882 45749.11018 36187.36510 -18447.52604 -15765.83300
151 152 153 154 155 156
-18461.11621 -18586.25603 -18399.39609 -18387.36360 -16668.80970 -35021.42338
157 158 159 160 161 162
-18351.26614 -18417.23360 -17455.39049 -23085.88431 -19260.12617 -18281.49883
163 164
-18651.39607 -318.88653
> postscript(file="/var/wessaorg/rcomp/tmp/6yg8n1321954879.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 = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 18757.37964 NA
1 7074.50279 18757.37964
2 6519.00420 7074.50279
3 24581.46147 6519.00420
4 -16996.10474 24581.46147
5 20998.23170 -16996.10474
6 -14982.87991 20998.23170
7 -7172.45554 -14982.87991
8 28142.71905 -7172.45554
9 -10118.78331 28142.71905
10 -19903.93314 -10118.78331
11 3544.06805 -19903.93314
12 -36.63358 3544.06805
13 -12638.03653 -36.63358
14 -26242.26070 -12638.03653
15 -18109.32171 -26242.26070
16 29435.42263 -18109.32171
17 -2946.53100 29435.42263
18 27392.20585 -2946.53100
19 5979.04115 27392.20585
20 7960.24400 5979.04115
21 -54101.31627 7960.24400
22 -12194.44725 -54101.31627
23 17233.14425 -12194.44725
24 1760.77009 17233.14425
25 -523.83614 1760.77009
26 1620.02493 -523.83614
27 -19010.28865 1620.02493
28 -23040.00727 -19010.28865
29 -23788.43336 -23040.00727
30 20164.43104 -23788.43336
31 -8036.13730 20164.43104
32 -23393.05541 -8036.13730
33 -6211.62450 -23393.05541
34 -6732.01181 -6211.62450
35 -28998.44082 -6732.01181
36 -42183.86571 -28998.44082
37 -14702.42191 -42183.86571
38 -18062.28589 -14702.42191
39 -17572.28061 -18062.28589
40 -21831.59577 -17572.28061
41 -14495.66444 -21831.59577
42 -6311.12821 -14495.66444
43 -6953.30857 -6311.12821
44 17883.08656 -6953.30857
45 -16227.47869 17883.08656
46 -8028.81379 -16227.47869
47 -6136.21425 -8028.81379
48 38554.34991 -6136.21425
49 4124.26474 38554.34991
50 -4788.69056 4124.26474
51 -17084.58099 -4788.69056
52 -20918.01156 -17084.58099
53 -5155.14192 -20918.01156
54 -13863.97234 -5155.14192
55 2527.05115 -13863.97234
56 25905.11941 2527.05115
57 26603.33869 25905.11941
58 -891.44024 26603.33869
59 -6860.03088 -891.44024
60 15943.86213 -6860.03088
61 36955.88723 15943.86213
62 -20022.07288 36955.88723
63 -3185.14877 -20022.07288
64 10177.15150 -3185.14877
65 -16746.65387 10177.15150
66 35351.40988 -16746.65387
67 -877.91622 35351.40988
68 5155.80091 -877.91622
69 13730.54490 5155.80091
70 3401.23365 13730.54490
71 -13641.33386 3401.23365
72 2505.46490 -13641.33386
73 4424.20712 2505.46490
74 5175.03860 4424.20712
75 -6312.20721 5175.03860
76 -2330.52103 -6312.20721
77 147373.06090 -2330.52103
78 -1636.52056 147373.06090
79 -5363.21179 -1636.52056
80 -10500.80253 -5363.21179
81 -30008.38100 -10500.80253
82 -16491.83908 -30008.38100
83 -612.46204 -16491.83908
84 18074.27068 -612.46204
85 -28476.66130 18074.27068
86 22176.23795 -28476.66130
87 -13393.29996 22176.23795
88 -28207.10522 -13393.29996
89 54751.79881 -28207.10522
90 -32235.44284 54751.79881
91 10526.79795 -32235.44284
92 -17000.15535 10526.79795
93 -16252.18956 -17000.15535
94 727.04045 -16252.18956
95 26354.95098 727.04045
96 62342.14084 26354.95098
97 42114.87555 62342.14084
98 3138.42457 42114.87555
99 29531.56123 3138.42457
100 22302.45561 29531.56123
101 28037.17318 22302.45561
102 -21209.69065 28037.17318
103 13894.80194 -21209.69065
104 -19806.28381 13894.80194
105 9711.62981 -19806.28381
106 11572.70884 9711.62981
107 -1732.92232 11572.70884
108 133336.82946 -1732.92232
109 1058.25125 133336.82946
110 9199.03654 1058.25125
111 -11345.74455 9199.03654
112 -22376.78135 -11345.74455
113 -3122.46118 -22376.78135
114 -12288.89540 -3122.46118
115 -26643.78188 -12288.89540
116 -37917.92738 -26643.78188
117 -22121.27763 -37917.92738
118 16166.39313 -22121.27763
119 -11361.87166 16166.39313
120 -14437.17821 -11361.87166
121 32969.86082 -14437.17821
122 20419.01061 32969.86082
123 22294.68823 20419.01061
124 -17209.69840 22294.68823
125 18139.81801 -17209.69840
126 -12632.26493 18139.81801
127 10139.09515 -12632.26493
128 -14517.27454 10139.09515
129 3388.13949 -14517.27454
130 64397.70233 3388.13949
131 -6317.17030 64397.70233
132 -4009.75887 -6317.17030
133 -6956.67868 -4009.75887
134 -9813.45664 -6956.67868
135 31868.96154 -9813.45664
136 20086.45629 31868.96154
137 -1563.38342 20086.45629
138 -12577.71869 -1563.38342
139 -18059.58594 -12577.71869
140 3303.93534 -18059.58594
141 -10331.96376 3303.93534
142 17995.20210 -10331.96376
143 -28549.85742 17995.20210
144 -17287.70166 -28549.85742
145 39377.87882 -17287.70166
146 45749.11018 39377.87882
147 36187.36510 45749.11018
148 -18447.52604 36187.36510
149 -15765.83300 -18447.52604
150 -18461.11621 -15765.83300
151 -18586.25603 -18461.11621
152 -18399.39609 -18586.25603
153 -18387.36360 -18399.39609
154 -16668.80970 -18387.36360
155 -35021.42338 -16668.80970
156 -18351.26614 -35021.42338
157 -18417.23360 -18351.26614
158 -17455.39049 -18417.23360
159 -23085.88431 -17455.39049
160 -19260.12617 -23085.88431
161 -18281.49883 -19260.12617
162 -18651.39607 -18281.49883
163 -318.88653 -18651.39607
164 NA -318.88653
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 7074.50279 18757.37964
[2,] 6519.00420 7074.50279
[3,] 24581.46147 6519.00420
[4,] -16996.10474 24581.46147
[5,] 20998.23170 -16996.10474
[6,] -14982.87991 20998.23170
[7,] -7172.45554 -14982.87991
[8,] 28142.71905 -7172.45554
[9,] -10118.78331 28142.71905
[10,] -19903.93314 -10118.78331
[11,] 3544.06805 -19903.93314
[12,] -36.63358 3544.06805
[13,] -12638.03653 -36.63358
[14,] -26242.26070 -12638.03653
[15,] -18109.32171 -26242.26070
[16,] 29435.42263 -18109.32171
[17,] -2946.53100 29435.42263
[18,] 27392.20585 -2946.53100
[19,] 5979.04115 27392.20585
[20,] 7960.24400 5979.04115
[21,] -54101.31627 7960.24400
[22,] -12194.44725 -54101.31627
[23,] 17233.14425 -12194.44725
[24,] 1760.77009 17233.14425
[25,] -523.83614 1760.77009
[26,] 1620.02493 -523.83614
[27,] -19010.28865 1620.02493
[28,] -23040.00727 -19010.28865
[29,] -23788.43336 -23040.00727
[30,] 20164.43104 -23788.43336
[31,] -8036.13730 20164.43104
[32,] -23393.05541 -8036.13730
[33,] -6211.62450 -23393.05541
[34,] -6732.01181 -6211.62450
[35,] -28998.44082 -6732.01181
[36,] -42183.86571 -28998.44082
[37,] -14702.42191 -42183.86571
[38,] -18062.28589 -14702.42191
[39,] -17572.28061 -18062.28589
[40,] -21831.59577 -17572.28061
[41,] -14495.66444 -21831.59577
[42,] -6311.12821 -14495.66444
[43,] -6953.30857 -6311.12821
[44,] 17883.08656 -6953.30857
[45,] -16227.47869 17883.08656
[46,] -8028.81379 -16227.47869
[47,] -6136.21425 -8028.81379
[48,] 38554.34991 -6136.21425
[49,] 4124.26474 38554.34991
[50,] -4788.69056 4124.26474
[51,] -17084.58099 -4788.69056
[52,] -20918.01156 -17084.58099
[53,] -5155.14192 -20918.01156
[54,] -13863.97234 -5155.14192
[55,] 2527.05115 -13863.97234
[56,] 25905.11941 2527.05115
[57,] 26603.33869 25905.11941
[58,] -891.44024 26603.33869
[59,] -6860.03088 -891.44024
[60,] 15943.86213 -6860.03088
[61,] 36955.88723 15943.86213
[62,] -20022.07288 36955.88723
[63,] -3185.14877 -20022.07288
[64,] 10177.15150 -3185.14877
[65,] -16746.65387 10177.15150
[66,] 35351.40988 -16746.65387
[67,] -877.91622 35351.40988
[68,] 5155.80091 -877.91622
[69,] 13730.54490 5155.80091
[70,] 3401.23365 13730.54490
[71,] -13641.33386 3401.23365
[72,] 2505.46490 -13641.33386
[73,] 4424.20712 2505.46490
[74,] 5175.03860 4424.20712
[75,] -6312.20721 5175.03860
[76,] -2330.52103 -6312.20721
[77,] 147373.06090 -2330.52103
[78,] -1636.52056 147373.06090
[79,] -5363.21179 -1636.52056
[80,] -10500.80253 -5363.21179
[81,] -30008.38100 -10500.80253
[82,] -16491.83908 -30008.38100
[83,] -612.46204 -16491.83908
[84,] 18074.27068 -612.46204
[85,] -28476.66130 18074.27068
[86,] 22176.23795 -28476.66130
[87,] -13393.29996 22176.23795
[88,] -28207.10522 -13393.29996
[89,] 54751.79881 -28207.10522
[90,] -32235.44284 54751.79881
[91,] 10526.79795 -32235.44284
[92,] -17000.15535 10526.79795
[93,] -16252.18956 -17000.15535
[94,] 727.04045 -16252.18956
[95,] 26354.95098 727.04045
[96,] 62342.14084 26354.95098
[97,] 42114.87555 62342.14084
[98,] 3138.42457 42114.87555
[99,] 29531.56123 3138.42457
[100,] 22302.45561 29531.56123
[101,] 28037.17318 22302.45561
[102,] -21209.69065 28037.17318
[103,] 13894.80194 -21209.69065
[104,] -19806.28381 13894.80194
[105,] 9711.62981 -19806.28381
[106,] 11572.70884 9711.62981
[107,] -1732.92232 11572.70884
[108,] 133336.82946 -1732.92232
[109,] 1058.25125 133336.82946
[110,] 9199.03654 1058.25125
[111,] -11345.74455 9199.03654
[112,] -22376.78135 -11345.74455
[113,] -3122.46118 -22376.78135
[114,] -12288.89540 -3122.46118
[115,] -26643.78188 -12288.89540
[116,] -37917.92738 -26643.78188
[117,] -22121.27763 -37917.92738
[118,] 16166.39313 -22121.27763
[119,] -11361.87166 16166.39313
[120,] -14437.17821 -11361.87166
[121,] 32969.86082 -14437.17821
[122,] 20419.01061 32969.86082
[123,] 22294.68823 20419.01061
[124,] -17209.69840 22294.68823
[125,] 18139.81801 -17209.69840
[126,] -12632.26493 18139.81801
[127,] 10139.09515 -12632.26493
[128,] -14517.27454 10139.09515
[129,] 3388.13949 -14517.27454
[130,] 64397.70233 3388.13949
[131,] -6317.17030 64397.70233
[132,] -4009.75887 -6317.17030
[133,] -6956.67868 -4009.75887
[134,] -9813.45664 -6956.67868
[135,] 31868.96154 -9813.45664
[136,] 20086.45629 31868.96154
[137,] -1563.38342 20086.45629
[138,] -12577.71869 -1563.38342
[139,] -18059.58594 -12577.71869
[140,] 3303.93534 -18059.58594
[141,] -10331.96376 3303.93534
[142,] 17995.20210 -10331.96376
[143,] -28549.85742 17995.20210
[144,] -17287.70166 -28549.85742
[145,] 39377.87882 -17287.70166
[146,] 45749.11018 39377.87882
[147,] 36187.36510 45749.11018
[148,] -18447.52604 36187.36510
[149,] -15765.83300 -18447.52604
[150,] -18461.11621 -15765.83300
[151,] -18586.25603 -18461.11621
[152,] -18399.39609 -18586.25603
[153,] -18387.36360 -18399.39609
[154,] -16668.80970 -18387.36360
[155,] -35021.42338 -16668.80970
[156,] -18351.26614 -35021.42338
[157,] -18417.23360 -18351.26614
[158,] -17455.39049 -18417.23360
[159,] -23085.88431 -17455.39049
[160,] -19260.12617 -23085.88431
[161,] -18281.49883 -19260.12617
[162,] -18651.39607 -18281.49883
[163,] -318.88653 -18651.39607
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 7074.50279 18757.37964
2 6519.00420 7074.50279
3 24581.46147 6519.00420
4 -16996.10474 24581.46147
5 20998.23170 -16996.10474
6 -14982.87991 20998.23170
7 -7172.45554 -14982.87991
8 28142.71905 -7172.45554
9 -10118.78331 28142.71905
10 -19903.93314 -10118.78331
11 3544.06805 -19903.93314
12 -36.63358 3544.06805
13 -12638.03653 -36.63358
14 -26242.26070 -12638.03653
15 -18109.32171 -26242.26070
16 29435.42263 -18109.32171
17 -2946.53100 29435.42263
18 27392.20585 -2946.53100
19 5979.04115 27392.20585
20 7960.24400 5979.04115
21 -54101.31627 7960.24400
22 -12194.44725 -54101.31627
23 17233.14425 -12194.44725
24 1760.77009 17233.14425
25 -523.83614 1760.77009
26 1620.02493 -523.83614
27 -19010.28865 1620.02493
28 -23040.00727 -19010.28865
29 -23788.43336 -23040.00727
30 20164.43104 -23788.43336
31 -8036.13730 20164.43104
32 -23393.05541 -8036.13730
33 -6211.62450 -23393.05541
34 -6732.01181 -6211.62450
35 -28998.44082 -6732.01181
36 -42183.86571 -28998.44082
37 -14702.42191 -42183.86571
38 -18062.28589 -14702.42191
39 -17572.28061 -18062.28589
40 -21831.59577 -17572.28061
41 -14495.66444 -21831.59577
42 -6311.12821 -14495.66444
43 -6953.30857 -6311.12821
44 17883.08656 -6953.30857
45 -16227.47869 17883.08656
46 -8028.81379 -16227.47869
47 -6136.21425 -8028.81379
48 38554.34991 -6136.21425
49 4124.26474 38554.34991
50 -4788.69056 4124.26474
51 -17084.58099 -4788.69056
52 -20918.01156 -17084.58099
53 -5155.14192 -20918.01156
54 -13863.97234 -5155.14192
55 2527.05115 -13863.97234
56 25905.11941 2527.05115
57 26603.33869 25905.11941
58 -891.44024 26603.33869
59 -6860.03088 -891.44024
60 15943.86213 -6860.03088
61 36955.88723 15943.86213
62 -20022.07288 36955.88723
63 -3185.14877 -20022.07288
64 10177.15150 -3185.14877
65 -16746.65387 10177.15150
66 35351.40988 -16746.65387
67 -877.91622 35351.40988
68 5155.80091 -877.91622
69 13730.54490 5155.80091
70 3401.23365 13730.54490
71 -13641.33386 3401.23365
72 2505.46490 -13641.33386
73 4424.20712 2505.46490
74 5175.03860 4424.20712
75 -6312.20721 5175.03860
76 -2330.52103 -6312.20721
77 147373.06090 -2330.52103
78 -1636.52056 147373.06090
79 -5363.21179 -1636.52056
80 -10500.80253 -5363.21179
81 -30008.38100 -10500.80253
82 -16491.83908 -30008.38100
83 -612.46204 -16491.83908
84 18074.27068 -612.46204
85 -28476.66130 18074.27068
86 22176.23795 -28476.66130
87 -13393.29996 22176.23795
88 -28207.10522 -13393.29996
89 54751.79881 -28207.10522
90 -32235.44284 54751.79881
91 10526.79795 -32235.44284
92 -17000.15535 10526.79795
93 -16252.18956 -17000.15535
94 727.04045 -16252.18956
95 26354.95098 727.04045
96 62342.14084 26354.95098
97 42114.87555 62342.14084
98 3138.42457 42114.87555
99 29531.56123 3138.42457
100 22302.45561 29531.56123
101 28037.17318 22302.45561
102 -21209.69065 28037.17318
103 13894.80194 -21209.69065
104 -19806.28381 13894.80194
105 9711.62981 -19806.28381
106 11572.70884 9711.62981
107 -1732.92232 11572.70884
108 133336.82946 -1732.92232
109 1058.25125 133336.82946
110 9199.03654 1058.25125
111 -11345.74455 9199.03654
112 -22376.78135 -11345.74455
113 -3122.46118 -22376.78135
114 -12288.89540 -3122.46118
115 -26643.78188 -12288.89540
116 -37917.92738 -26643.78188
117 -22121.27763 -37917.92738
118 16166.39313 -22121.27763
119 -11361.87166 16166.39313
120 -14437.17821 -11361.87166
121 32969.86082 -14437.17821
122 20419.01061 32969.86082
123 22294.68823 20419.01061
124 -17209.69840 22294.68823
125 18139.81801 -17209.69840
126 -12632.26493 18139.81801
127 10139.09515 -12632.26493
128 -14517.27454 10139.09515
129 3388.13949 -14517.27454
130 64397.70233 3388.13949
131 -6317.17030 64397.70233
132 -4009.75887 -6317.17030
133 -6956.67868 -4009.75887
134 -9813.45664 -6956.67868
135 31868.96154 -9813.45664
136 20086.45629 31868.96154
137 -1563.38342 20086.45629
138 -12577.71869 -1563.38342
139 -18059.58594 -12577.71869
140 3303.93534 -18059.58594
141 -10331.96376 3303.93534
142 17995.20210 -10331.96376
143 -28549.85742 17995.20210
144 -17287.70166 -28549.85742
145 39377.87882 -17287.70166
146 45749.11018 39377.87882
147 36187.36510 45749.11018
148 -18447.52604 36187.36510
149 -15765.83300 -18447.52604
150 -18461.11621 -15765.83300
151 -18586.25603 -18461.11621
152 -18399.39609 -18586.25603
153 -18387.36360 -18399.39609
154 -16668.80970 -18387.36360
155 -35021.42338 -16668.80970
156 -18351.26614 -35021.42338
157 -18417.23360 -18351.26614
158 -17455.39049 -18417.23360
159 -23085.88431 -17455.39049
160 -19260.12617 -23085.88431
161 -18281.49883 -19260.12617
162 -18651.39607 -18281.49883
163 -318.88653 -18651.39607
> 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/7ysbk1321954879.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/8p2uu1321954879.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/9t12r1321954879.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/1001291321954879.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/11dp9l1321954879.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/12jbd11321954879.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/131gzz1321954879.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/14w7nv1321954879.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/150zfp1321954879.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/161akv1321954879.tab")
+ }
>
> try(system("convert tmp/15r671321954879.ps tmp/15r671321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xyzb1321954879.ps tmp/2xyzb1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/39bmz1321954879.ps tmp/39bmz1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/48t2r1321954879.ps tmp/48t2r1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ip3y1321954879.ps tmp/5ip3y1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/6yg8n1321954879.ps tmp/6yg8n1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ysbk1321954879.ps tmp/7ysbk1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/8p2uu1321954879.ps tmp/8p2uu1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/9t12r1321954879.ps tmp/9t12r1321954879.png",intern=TRUE))
character(0)
> try(system("convert tmp/1001291321954879.ps tmp/1001291321954879.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.716 0.688 5.454