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(140824
+ ,186099
+ ,38
+ ,165
+ ,110459
+ ,113854
+ ,34
+ ,135
+ ,105079
+ ,99776
+ ,42
+ ,121
+ ,112098
+ ,106194
+ ,38
+ ,148
+ ,43929
+ ,100792
+ ,27
+ ,73
+ ,76173
+ ,47552
+ ,35
+ ,49
+ ,187326
+ ,250931
+ ,33
+ ,185
+ ,22807
+ ,6853
+ ,18
+ ,5
+ ,144408
+ ,115466
+ ,34
+ ,125
+ ,66485
+ ,110896
+ ,33
+ ,93
+ ,79089
+ ,169351
+ ,42
+ ,154
+ ,81625
+ ,94853
+ ,55
+ ,98
+ ,68788
+ ,72591
+ ,35
+ ,70
+ ,103297
+ ,101345
+ ,51
+ ,148
+ ,69446
+ ,113713
+ ,42
+ ,100
+ ,114948
+ ,165354
+ ,59
+ ,150
+ ,167949
+ ,164263
+ ,36
+ ,197
+ ,125081
+ ,135213
+ ,39
+ ,114
+ ,125818
+ ,111669
+ ,29
+ ,169
+ ,136588
+ ,134163
+ ,46
+ ,200
+ ,112431
+ ,140303
+ ,45
+ ,148
+ ,103037
+ ,150773
+ ,39
+ ,140
+ ,82317
+ ,111848
+ ,25
+ ,74
+ ,118906
+ ,102509
+ ,52
+ ,128
+ ,83515
+ ,96785
+ ,41
+ ,140
+ ,104581
+ ,116136
+ ,38
+ ,116
+ ,103129
+ ,158376
+ ,41
+ ,147
+ ,83243
+ ,153990
+ ,39
+ ,132
+ ,37110
+ ,64057
+ ,32
+ ,70
+ ,113344
+ ,230054
+ ,41
+ ,144
+ ,139165
+ ,184531
+ ,45
+ ,155
+ ,86652
+ ,114198
+ ,46
+ ,165
+ ,112302
+ ,198299
+ ,48
+ ,161
+ ,69652
+ ,33750
+ ,37
+ ,31
+ ,119442
+ ,189723
+ ,39
+ ,199
+ ,69867
+ ,100826
+ ,42
+ ,78
+ ,101629
+ ,188355
+ ,41
+ ,121
+ ,70168
+ ,104470
+ ,36
+ ,112
+ ,31081
+ ,58391
+ ,17
+ ,41
+ ,103925
+ ,164808
+ ,39
+ ,158
+ ,92622
+ ,134097
+ ,37
+ ,123
+ ,79011
+ ,80238
+ ,38
+ ,104
+ ,93487
+ ,133252
+ ,36
+ ,94
+ ,64520
+ ,54518
+ ,42
+ ,73
+ ,93473
+ ,121850
+ ,45
+ ,52
+ ,114360
+ ,79367
+ ,38
+ ,71
+ ,33032
+ ,56968
+ ,26
+ ,21
+ ,96125
+ ,106314
+ ,52
+ ,155
+ ,151911
+ ,191889
+ ,47
+ ,174
+ ,89256
+ ,104864
+ ,45
+ ,136
+ ,95671
+ ,160791
+ ,40
+ ,128
+ ,5950
+ ,15049
+ ,4
+ ,7
+ ,149695
+ ,191179
+ ,44
+ ,165
+ ,32551
+ ,25109
+ ,18
+ ,21
+ ,31701
+ ,45824
+ ,14
+ ,35
+ ,100087
+ ,129711
+ ,37
+ ,137
+ ,169707
+ ,210012
+ ,56
+ ,174
+ ,150491
+ ,194679
+ ,36
+ ,257
+ ,120192
+ ,197680
+ ,41
+ ,207
+ ,95893
+ ,81180
+ ,36
+ ,103
+ ,151715
+ ,197765
+ ,46
+ ,171
+ ,176225
+ ,214738
+ ,28
+ ,279
+ ,59900
+ ,96252
+ ,42
+ ,83
+ ,104767
+ ,124527
+ ,38
+ ,130
+ ,114799
+ ,153242
+ ,37
+ ,131
+ ,72128
+ ,145707
+ ,30
+ ,126
+ ,143592
+ ,113963
+ ,35
+ ,158
+ ,89626
+ ,134904
+ ,44
+ ,138
+ ,131072
+ ,114268
+ ,36
+ ,200
+ ,126817
+ ,94333
+ ,28
+ ,104
+ ,81351
+ ,102204
+ ,45
+ ,111
+ ,22618
+ ,23824
+ ,23
+ ,26
+ ,88977
+ ,111563
+ ,45
+ ,115
+ ,92059
+ ,91313
+ ,38
+ ,127
+ ,81897
+ ,89770
+ ,38
+ ,140
+ ,108146
+ ,100125
+ ,42
+ ,121
+ ,126372
+ ,165278
+ ,36
+ ,183
+ ,249771
+ ,181712
+ ,41
+ ,68
+ ,71154
+ ,80906
+ ,38
+ ,112
+ ,71571
+ ,75881
+ ,37
+ ,103
+ ,55918
+ ,83963
+ ,28
+ ,63
+ ,160141
+ ,175721
+ ,45
+ ,166
+ ,38692
+ ,68580
+ ,26
+ ,38
+ ,102812
+ ,136323
+ ,44
+ ,163
+ ,56622
+ ,55792
+ ,8
+ ,59
+ ,15986
+ ,25157
+ ,27
+ ,27
+ ,123534
+ ,100922
+ ,35
+ ,108
+ ,108535
+ ,118845
+ ,37
+ ,88
+ ,93879
+ ,170492
+ ,57
+ ,92
+ ,144551
+ ,81716
+ ,41
+ ,170
+ ,56750
+ ,115750
+ ,37
+ ,98
+ ,127654
+ ,105590
+ ,38
+ ,205
+ ,65594
+ ,92795
+ ,31
+ ,96
+ ,59938
+ ,82390
+ ,36
+ ,107
+ ,146975
+ ,135599
+ ,36
+ ,150
+ ,143372
+ ,111542
+ ,36
+ ,123
+ ,168553
+ ,162519
+ ,35
+ ,176
+ ,183500
+ ,211381
+ ,39
+ ,213
+ ,165986
+ ,189944
+ ,58
+ ,208
+ ,184923
+ ,226168
+ ,30
+ ,307
+ ,140358
+ ,117495
+ ,45
+ ,125
+ ,149959
+ ,195894
+ ,41
+ ,208
+ ,57224
+ ,80684
+ ,36
+ ,73
+ ,43750
+ ,19630
+ ,19
+ ,49
+ ,48029
+ ,88634
+ ,23
+ ,82
+ ,104978
+ ,139292
+ ,40
+ ,206
+ ,100046
+ ,128602
+ ,40
+ ,112
+ ,101047
+ ,135848
+ ,40
+ ,139
+ ,197426
+ ,178377
+ ,30
+ ,60
+ ,160902
+ ,106330
+ ,41
+ ,70
+ ,147172
+ ,178303
+ ,40
+ ,112
+ ,109432
+ ,116938
+ ,45
+ ,142
+ ,1168
+ ,5841
+ ,1
+ ,11
+ ,83248
+ ,106020
+ ,36
+ ,130
+ ,25162
+ ,24610
+ ,11
+ ,31
+ ,45724
+ ,74151
+ ,45
+ ,132
+ ,110529
+ ,232241
+ ,38
+ ,219
+ ,855
+ ,6622
+ ,0
+ ,4
+ ,101382
+ ,127097
+ ,30
+ ,102
+ ,14116
+ ,13155
+ ,8
+ ,39
+ ,89506
+ ,160501
+ ,39
+ ,125
+ ,135356
+ ,91502
+ ,44
+ ,121
+ ,116066
+ ,24469
+ ,44
+ ,42
+ ,144244
+ ,88229
+ ,29
+ ,111
+ ,8773
+ ,13983
+ ,8
+ ,16
+ ,102153
+ ,80716
+ ,39
+ ,70
+ ,117440
+ ,157384
+ ,47
+ ,162
+ ,104128
+ ,122975
+ ,48
+ ,173
+ ,134238
+ ,191469
+ ,46
+ ,171
+ ,134047
+ ,231257
+ ,48
+ ,172
+ ,279488
+ ,258287
+ ,50
+ ,254
+ ,79756
+ ,122531
+ ,40
+ ,90
+ ,66089
+ ,61394
+ ,36
+ ,50
+ ,102070
+ ,86480
+ ,40
+ ,113
+ ,146760
+ ,195791
+ ,46
+ ,187
+ ,154771
+ ,18284
+ ,39
+ ,16
+ ,165933
+ ,147581
+ ,42
+ ,175
+ ,64593
+ ,72558
+ ,39
+ ,90
+ ,92280
+ ,147341
+ ,41
+ ,140
+ ,67150
+ ,114651
+ ,42
+ ,145
+ ,128692
+ ,100187
+ ,32
+ ,141
+ ,124089
+ ,130332
+ ,39
+ ,125
+ ,125386
+ ,134218
+ ,35
+ ,241
+ ,37238
+ ,10901
+ ,21
+ ,16
+ ,140015
+ ,145758
+ ,45
+ ,175
+ ,150047
+ ,75767
+ ,50
+ ,132
+ ,154451
+ ,134969
+ ,36
+ ,154
+ ,156349
+ ,169216
+ ,44
+ ,198
+ ,0
+ ,0
+ ,0
+ ,0
+ ,6023
+ ,7953
+ ,0
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,84601
+ ,105406
+ ,37
+ ,125
+ ,68946
+ ,174586
+ ,47
+ ,174
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1644
+ ,4245
+ ,0
+ ,6
+ ,6179
+ ,21509
+ ,5
+ ,13
+ ,3926
+ ,7670
+ ,1
+ ,3
+ ,52789
+ ,15673
+ ,43
+ ,35
+ ,0
+ ,0
+ ,0
+ ,0
+ ,100350
+ ,75882
+ ,31
+ ,80)
+ ,dim=c(4
+ ,164)
+ ,dimnames=list(c('Grootte'
+ ,'Tijd'
+ ,'Review'
+ ,'Hyperlinks')
+ ,1:164))
> y <- array(NA,dim=c(4,164),dimnames=list(c('Grootte','Tijd','Review','Hyperlinks'),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 = 'No Linear Trend'
> par2 = 'Do not include Seasonal 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
Grootte Tijd Review Hyperlinks
1 140824 186099 38 165
2 110459 113854 34 135
3 105079 99776 42 121
4 112098 106194 38 148
5 43929 100792 27 73
6 76173 47552 35 49
7 187326 250931 33 185
8 22807 6853 18 5
9 144408 115466 34 125
10 66485 110896 33 93
11 79089 169351 42 154
12 81625 94853 55 98
13 68788 72591 35 70
14 103297 101345 51 148
15 69446 113713 42 100
16 114948 165354 59 150
17 167949 164263 36 197
18 125081 135213 39 114
19 125818 111669 29 169
20 136588 134163 46 200
21 112431 140303 45 148
22 103037 150773 39 140
23 82317 111848 25 74
24 118906 102509 52 128
25 83515 96785 41 140
26 104581 116136 38 116
27 103129 158376 41 147
28 83243 153990 39 132
29 37110 64057 32 70
30 113344 230054 41 144
31 139165 184531 45 155
32 86652 114198 46 165
33 112302 198299 48 161
34 69652 33750 37 31
35 119442 189723 39 199
36 69867 100826 42 78
37 101629 188355 41 121
38 70168 104470 36 112
39 31081 58391 17 41
40 103925 164808 39 158
41 92622 134097 37 123
42 79011 80238 38 104
43 93487 133252 36 94
44 64520 54518 42 73
45 93473 121850 45 52
46 114360 79367 38 71
47 33032 56968 26 21
48 96125 106314 52 155
49 151911 191889 47 174
50 89256 104864 45 136
51 95671 160791 40 128
52 5950 15049 4 7
53 149695 191179 44 165
54 32551 25109 18 21
55 31701 45824 14 35
56 100087 129711 37 137
57 169707 210012 56 174
58 150491 194679 36 257
59 120192 197680 41 207
60 95893 81180 36 103
61 151715 197765 46 171
62 176225 214738 28 279
63 59900 96252 42 83
64 104767 124527 38 130
65 114799 153242 37 131
66 72128 145707 30 126
67 143592 113963 35 158
68 89626 134904 44 138
69 131072 114268 36 200
70 126817 94333 28 104
71 81351 102204 45 111
72 22618 23824 23 26
73 88977 111563 45 115
74 92059 91313 38 127
75 81897 89770 38 140
76 108146 100125 42 121
77 126372 165278 36 183
78 249771 181712 41 68
79 71154 80906 38 112
80 71571 75881 37 103
81 55918 83963 28 63
82 160141 175721 45 166
83 38692 68580 26 38
84 102812 136323 44 163
85 56622 55792 8 59
86 15986 25157 27 27
87 123534 100922 35 108
88 108535 118845 37 88
89 93879 170492 57 92
90 144551 81716 41 170
91 56750 115750 37 98
92 127654 105590 38 205
93 65594 92795 31 96
94 59938 82390 36 107
95 146975 135599 36 150
96 143372 111542 36 123
97 168553 162519 35 176
98 183500 211381 39 213
99 165986 189944 58 208
100 184923 226168 30 307
101 140358 117495 45 125
102 149959 195894 41 208
103 57224 80684 36 73
104 43750 19630 19 49
105 48029 88634 23 82
106 104978 139292 40 206
107 100046 128602 40 112
108 101047 135848 40 139
109 197426 178377 30 60
110 160902 106330 41 70
111 147172 178303 40 112
112 109432 116938 45 142
113 1168 5841 1 11
114 83248 106020 36 130
115 25162 24610 11 31
116 45724 74151 45 132
117 110529 232241 38 219
118 855 6622 0 4
119 101382 127097 30 102
120 14116 13155 8 39
121 89506 160501 39 125
122 135356 91502 44 121
123 116066 24469 44 42
124 144244 88229 29 111
125 8773 13983 8 16
126 102153 80716 39 70
127 117440 157384 47 162
128 104128 122975 48 173
129 134238 191469 46 171
130 134047 231257 48 172
131 279488 258287 50 254
132 79756 122531 40 90
133 66089 61394 36 50
134 102070 86480 40 113
135 146760 195791 46 187
136 154771 18284 39 16
137 165933 147581 42 175
138 64593 72558 39 90
139 92280 147341 41 140
140 67150 114651 42 145
141 128692 100187 32 141
142 124089 130332 39 125
143 125386 134218 35 241
144 37238 10901 21 16
145 140015 145758 45 175
146 150047 75767 50 132
147 154451 134969 36 154
148 156349 169216 44 198
149 0 0 0 0
150 6023 7953 0 5
151 0 0 0 0
152 0 0 0 0
153 0 0 0 0
154 0 0 0 0
155 84601 105406 37 125
156 68946 174586 47 174
157 0 0 0 0
158 0 0 0 0
159 1644 4245 0 6
160 6179 21509 5 13
161 3926 7670 1 3
162 52789 15673 43 35
163 0 0 0 0
164 100350 75882 31 80
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Tijd Review Hyperlinks
3784.51 0.36 836.90 200.38
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-71893 -18858 -3785 12330 132628
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.785e+03 6.181e+03 0.612 0.54122
Tijd 3.600e-01 7.439e-02 4.840 3.04e-06 ***
Review 8.369e+02 2.351e+02 3.559 0.00049 ***
Hyperlinks 2.004e+02 6.996e+01 2.864 0.00474 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 29540 on 160 degrees of freedom
Multiple R-squared: 0.6833, Adjusted R-squared: 0.6774
F-statistic: 115.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,] 3.019405e-01 6.038810e-01 0.6980595014
[2,] 2.595145e-01 5.190291e-01 0.7404854709
[3,] 3.661560e-01 7.323120e-01 0.6338439862
[4,] 3.514789e-01 7.029577e-01 0.6485211453
[5,] 5.952097e-01 8.095805e-01 0.4047902629
[6,] 5.066111e-01 9.867778e-01 0.4933889051
[7,] 4.044060e-01 8.088121e-01 0.5955939610
[8,] 3.186773e-01 6.373545e-01 0.6813227263
[9,] 2.605596e-01 5.211192e-01 0.7394404044
[10,] 1.961833e-01 3.923667e-01 0.8038166514
[11,] 1.474034e-01 2.948068e-01 0.8525966006
[12,] 1.475842e-01 2.951683e-01 0.8524158459
[13,] 1.149441e-01 2.298882e-01 0.8850558849
[14,] 8.471312e-02 1.694262e-01 0.9152868849
[15,] 5.831289e-02 1.166258e-01 0.9416871097
[16,] 4.408459e-02 8.816918e-02 0.9559154095
[17,] 2.882042e-02 5.764084e-02 0.9711795820
[18,] 2.620082e-02 5.240163e-02 0.9737991850
[19,] 2.453864e-02 4.907728e-02 0.9754613620
[20,] 1.622674e-02 3.245347e-02 0.9837732649
[21,] 1.318541e-02 2.637082e-02 0.9868145884
[22,] 1.526231e-02 3.052462e-02 0.9847376882
[23,] 1.628178e-02 3.256356e-02 0.9837182190
[24,] 1.281757e-02 2.563513e-02 0.9871824336
[25,] 9.467757e-03 1.893551e-02 0.9905322426
[26,] 1.270355e-02 2.540710e-02 0.9872964483
[27,] 1.072107e-02 2.144214e-02 0.9892789306
[28,] 1.324000e-02 2.648001e-02 0.9867599951
[29,] 1.393482e-02 2.786964e-02 0.9860651819
[30,] 9.821569e-03 1.964314e-02 0.9901784307
[31,] 7.225157e-03 1.445031e-02 0.9927748432
[32,] 6.474963e-03 1.294993e-02 0.9935250373
[33,] 5.654140e-03 1.130828e-02 0.9943458595
[34,] 4.623238e-03 9.246477e-03 0.9953767617
[35,] 3.171156e-03 6.342311e-03 0.9968288444
[36,] 2.051377e-03 4.102754e-03 0.9979486228
[37,] 1.386557e-03 2.773115e-03 0.9986134425
[38,] 8.768801e-04 1.753760e-03 0.9991231199
[39,] 9.439835e-04 1.887967e-03 0.9990560165
[40,] 2.287747e-03 4.575494e-03 0.9977122530
[41,] 1.675650e-03 3.351300e-03 0.9983243501
[42,] 1.261418e-03 2.522835e-03 0.9987385824
[43,] 1.004755e-03 2.009511e-03 0.9989952447
[44,] 7.186994e-04 1.437399e-03 0.9992813006
[45,] 5.578021e-04 1.115604e-03 0.9994421979
[46,] 4.323843e-04 8.647685e-04 0.9995676157
[47,] 3.440120e-04 6.880239e-04 0.9996559880
[48,] 2.117907e-04 4.235815e-04 0.9997882093
[49,] 1.367144e-04 2.734289e-04 0.9998632856
[50,] 8.494601e-05 1.698920e-04 0.9999150540
[51,] 8.303470e-05 1.660694e-04 0.9999169653
[52,] 5.440160e-05 1.088032e-04 0.9999455984
[53,] 5.950441e-05 1.190088e-04 0.9999404956
[54,] 4.255083e-05 8.510165e-05 0.9999574492
[55,] 3.034094e-05 6.068189e-05 0.9999696591
[56,] 1.942407e-05 3.884813e-05 0.9999805759
[57,] 1.848359e-05 3.696717e-05 0.9999815164
[58,] 1.093326e-05 2.186652e-05 0.9999890667
[59,] 6.612955e-06 1.322591e-05 0.9999933870
[60,] 9.008855e-06 1.801771e-05 0.9999909911
[61,] 1.624836e-05 3.249672e-05 0.9999837516
[62,] 1.484221e-05 2.968443e-05 0.9999851578
[63,] 9.637678e-06 1.927536e-05 0.9999903623
[64,] 2.867315e-05 5.734629e-05 0.9999713269
[65,] 2.077074e-05 4.154148e-05 0.9999792293
[66,] 1.439668e-05 2.879336e-05 0.9999856033
[67,] 9.719993e-06 1.943999e-05 0.9999902800
[68,] 5.689330e-06 1.137866e-05 0.9999943107
[69,] 4.019885e-06 8.039770e-06 0.9999959801
[70,] 2.653072e-06 5.306144e-06 0.9999973469
[71,] 1.527401e-06 3.054802e-06 0.9999984726
[72,] 3.617076e-02 7.234153e-02 0.9638292374
[73,] 3.021471e-02 6.042942e-02 0.9697852924
[74,] 2.423128e-02 4.846255e-02 0.9757687235
[75,] 1.984210e-02 3.968420e-02 0.9801578975
[76,] 1.809762e-02 3.619524e-02 0.9819023808
[77,] 1.559656e-02 3.119313e-02 0.9844034356
[78,] 1.332327e-02 2.664653e-02 0.9866767331
[79,] 1.047654e-02 2.095307e-02 0.9895234632
[80,] 9.823835e-03 1.964767e-02 0.9901761652
[81,] 1.082645e-02 2.165289e-02 0.9891735532
[82,] 8.592571e-03 1.718514e-02 0.9914074291
[83,] 1.157825e-02 2.315649e-02 0.9884217544
[84,] 1.727711e-02 3.455423e-02 0.9827228871
[85,] 2.336972e-02 4.673945e-02 0.9766302761
[86,] 1.918616e-02 3.837232e-02 0.9808138419
[87,] 1.635994e-02 3.271987e-02 0.9836400645
[88,] 1.569794e-02 3.139588e-02 0.9843020587
[89,] 1.715766e-02 3.431532e-02 0.9828423378
[90,] 2.409149e-02 4.818299e-02 0.9759085052
[91,] 3.093951e-02 6.187902e-02 0.9690604924
[92,] 3.016824e-02 6.033648e-02 0.9698317624
[93,] 2.356404e-02 4.712809e-02 0.9764359553
[94,] 2.635976e-02 5.271952e-02 0.9736402379
[95,] 2.683770e-02 5.367540e-02 0.9731622983
[96,] 2.072312e-02 4.144624e-02 0.9792768801
[97,] 2.024887e-02 4.049775e-02 0.9797511251
[98,] 1.538244e-02 3.076489e-02 0.9846175566
[99,] 1.419710e-02 2.839420e-02 0.9858029003
[100,] 1.208172e-02 2.416344e-02 0.9879182781
[101,] 9.525629e-03 1.905126e-02 0.9904743715
[102,] 7.590887e-03 1.518177e-02 0.9924091131
[103,] 5.903440e-02 1.180688e-01 0.9409656002
[104,] 1.357004e-01 2.714007e-01 0.8642996386
[105,] 1.301363e-01 2.602725e-01 0.8698637431
[106,] 1.088978e-01 2.177955e-01 0.8911022495
[107,] 8.970140e-02 1.794028e-01 0.9102986007
[108,] 7.766935e-02 1.553387e-01 0.9223306500
[109,] 6.164554e-02 1.232911e-01 0.9383544625
[110,] 1.356339e-01 2.712677e-01 0.8643661484
[111,] 1.733365e-01 3.466729e-01 0.8266635487
[112,] 1.444037e-01 2.888074e-01 0.8555963189
[113,] 1.204459e-01 2.408918e-01 0.8795541239
[114,] 1.006370e-01 2.012740e-01 0.8993630043
[115,] 9.604618e-02 1.920924e-01 0.9039538154
[116,] 9.504663e-02 1.900933e-01 0.9049533746
[117,] 1.265840e-01 2.531681e-01 0.8734159653
[118,] 2.140955e-01 4.281910e-01 0.7859044798
[119,] 1.814111e-01 3.628221e-01 0.8185889490
[120,] 1.590670e-01 3.181340e-01 0.8409330174
[121,] 1.391805e-01 2.783611e-01 0.8608194722
[122,] 1.415238e-01 2.830476e-01 0.8584761838
[123,] 1.162189e-01 2.324378e-01 0.8837810897
[124,] 1.072708e-01 2.145417e-01 0.8927291712
[125,] 5.865998e-01 8.268004e-01 0.4134001975
[126,] 5.434407e-01 9.131185e-01 0.4565592512
[127,] 4.971810e-01 9.943620e-01 0.5028189792
[128,] 4.416057e-01 8.832114e-01 0.5583942863
[129,] 3.938069e-01 7.876138e-01 0.6061930918
[130,] 8.758107e-01 2.483786e-01 0.1241892865
[131,] 9.118339e-01 1.763322e-01 0.0881660803
[132,] 9.004499e-01 1.991003e-01 0.0995501341
[133,] 8.784668e-01 2.430665e-01 0.1215332454
[134,] 9.435501e-01 1.128997e-01 0.0564498747
[135,] 9.441966e-01 1.116068e-01 0.0558034162
[136,] 9.388098e-01 1.223804e-01 0.0611901773
[137,] 9.937168e-01 1.256634e-02 0.0062831700
[138,] 9.907951e-01 1.840989e-02 0.0092049442
[139,] 9.840068e-01 3.198638e-02 0.0159931913
[140,] 9.791516e-01 4.169676e-02 0.0208483786
[141,] 9.940620e-01 1.187591e-02 0.0059379566
[142,] 9.949647e-01 1.007066e-02 0.0050353322
[143,] 9.896102e-01 2.077969e-02 0.0103898426
[144,] 9.796765e-01 4.064695e-02 0.0203234741
[145,] 9.612225e-01 7.755498e-02 0.0387774880
[146,] 9.293993e-01 1.412015e-01 0.0706007331
[147,] 8.777818e-01 2.444365e-01 0.1222182255
[148,] 7.996376e-01 4.007248e-01 0.2003624206
[149,] 6.988984e-01 6.022033e-01 0.3011016322
[150,] 9.993492e-01 1.301688e-03 0.0006508442
[151,] 9.951226e-01 9.754886e-03 0.0048774430
> postscript(file="/var/wessaorg/rcomp/tmp/12qdm1323886977.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/2z75y1323886977.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/3737q1323886977.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/4y2m51323886977.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/5wbui1323886977.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
5175.87809 10179.31223 5977.69911 8623.52621 -33366.40054 16158.78254
7 8 9 10 11 12
28514.16622 489.12701 45551.73866 -23476.99482 -51673.00458 -21974.99916
13 14 15 16 17 18
-4448.63370 -9311.49654 -30464.94223 -27800.86771 35423.95562 17135.09899
19 20 21 22 23 24
23696.63441 5929.32365 -9181.65094 -15720.59524 2514.67167 9049.08939
25 26 27 28 29 30
-17479.75659 3939.30919 -21442.26164 -35069.75259 -30543.52953 -36431.49194
31 32 33 34 35 36
226.83477 -29805.70552 -35305.86825 16539.73746 -25160.56655 -20996.08595
37 38 39 40 41 42
-28525.42246 -23798.40428 -16168.16263 -23492.24195 -15051.71117 -6302.23797
43 44 45 46 47 48
-7234.64390 -8669.48949 -2259.99793 35972.79606 -17229.44089 -20511.97199
49 50 51 52 53 54
4842.84241 -17193.44632 -25125.62801 -8002.68139 7196.56431 454.59981
55 56 57 58 59 60
-7310.84111 -8812.95807 8582.10375 -5007.00048 -30552.05682 12114.81032
61 62 63 64 65 66
3969.41364 15792.32536 -30318.25173 -1700.88640 -1370.27405 -34468.32487
67 68 69 70 71 72
37827.48331 -27202.23522 15944.91784 44798.34786 -19131.36049 -14202.18389
73 74 75 76 77 78
-15676.27811 -1850.11935 -14061.51961 8919.05286 -3713.17715 132628.18546
79 80 81 82 83 84
-16002.75016 -11136.35865 -14151.78786 22170.43963 -19156.38670 -19536.53883
85 86 87 88 89 90
14233.86267 -24862.08052 32483.35314 13365.49531 -37423.93539 42970.02725
91 92 93 94 95 96
-39309.02458 12975.45789 -16778.63581 -25077.32145 34187.25249 44655.39633
97 98 99 100 101 102
41700.65874 28294.88041 3599.29933 13090.94236 31565.32043 -342.44238
103 104 105 106 107 108
-20364.29495 7178.66326 -23345.08545 -23708.05046 -5955.97144 -12973.85440
109 110 111 112 113 114
92292.80729 70497.29958 23276.77902 -2566.56759 -7760.43527 -14883.22754
115 116 117 118 119 120
-2900.19987 -48866.70650 -52551.45430 -6115.06274 6294.66889 -8914.50365
121 122 123 124 125 126
-29748.18642 37559.67958 58232.58408 62183.35060 -9946.91531 22643.60563
127 128 129 130 131 132
-14801.20968 -18766.41046 -11240.91367 -27630.49095 89974.46031 -19651.99715
133 134 135 136 137 138
54.13346 11032.32493 -3480.95149 108558.62958 38800.65696 -15986.91893
139 140 141 142 143 144
-26915.82144 -42115.62781 33804.21929 15696.19354 -4302.01409 8747.91031
145 146 147 148 149 150
11028.25815 50689.98552 41088.55365 15145.17896 -3784.51410 -1626.62409
151 152 153 154 155 156
-3784.51410 -3784.51410 -3784.51410 -3784.51410 -13144.19272 -71892.76790
157 158 159 160 161 162
-3784.51410 -3784.51410 -4871.05525 -12138.56599 -4057.88778 361.84803
163 164
-3784.51410 27272.38735
> postscript(file="/var/wessaorg/rcomp/tmp/6j1il1323886977.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 5175.87809 NA
1 10179.31223 5175.87809
2 5977.69911 10179.31223
3 8623.52621 5977.69911
4 -33366.40054 8623.52621
5 16158.78254 -33366.40054
6 28514.16622 16158.78254
7 489.12701 28514.16622
8 45551.73866 489.12701
9 -23476.99482 45551.73866
10 -51673.00458 -23476.99482
11 -21974.99916 -51673.00458
12 -4448.63370 -21974.99916
13 -9311.49654 -4448.63370
14 -30464.94223 -9311.49654
15 -27800.86771 -30464.94223
16 35423.95562 -27800.86771
17 17135.09899 35423.95562
18 23696.63441 17135.09899
19 5929.32365 23696.63441
20 -9181.65094 5929.32365
21 -15720.59524 -9181.65094
22 2514.67167 -15720.59524
23 9049.08939 2514.67167
24 -17479.75659 9049.08939
25 3939.30919 -17479.75659
26 -21442.26164 3939.30919
27 -35069.75259 -21442.26164
28 -30543.52953 -35069.75259
29 -36431.49194 -30543.52953
30 226.83477 -36431.49194
31 -29805.70552 226.83477
32 -35305.86825 -29805.70552
33 16539.73746 -35305.86825
34 -25160.56655 16539.73746
35 -20996.08595 -25160.56655
36 -28525.42246 -20996.08595
37 -23798.40428 -28525.42246
38 -16168.16263 -23798.40428
39 -23492.24195 -16168.16263
40 -15051.71117 -23492.24195
41 -6302.23797 -15051.71117
42 -7234.64390 -6302.23797
43 -8669.48949 -7234.64390
44 -2259.99793 -8669.48949
45 35972.79606 -2259.99793
46 -17229.44089 35972.79606
47 -20511.97199 -17229.44089
48 4842.84241 -20511.97199
49 -17193.44632 4842.84241
50 -25125.62801 -17193.44632
51 -8002.68139 -25125.62801
52 7196.56431 -8002.68139
53 454.59981 7196.56431
54 -7310.84111 454.59981
55 -8812.95807 -7310.84111
56 8582.10375 -8812.95807
57 -5007.00048 8582.10375
58 -30552.05682 -5007.00048
59 12114.81032 -30552.05682
60 3969.41364 12114.81032
61 15792.32536 3969.41364
62 -30318.25173 15792.32536
63 -1700.88640 -30318.25173
64 -1370.27405 -1700.88640
65 -34468.32487 -1370.27405
66 37827.48331 -34468.32487
67 -27202.23522 37827.48331
68 15944.91784 -27202.23522
69 44798.34786 15944.91784
70 -19131.36049 44798.34786
71 -14202.18389 -19131.36049
72 -15676.27811 -14202.18389
73 -1850.11935 -15676.27811
74 -14061.51961 -1850.11935
75 8919.05286 -14061.51961
76 -3713.17715 8919.05286
77 132628.18546 -3713.17715
78 -16002.75016 132628.18546
79 -11136.35865 -16002.75016
80 -14151.78786 -11136.35865
81 22170.43963 -14151.78786
82 -19156.38670 22170.43963
83 -19536.53883 -19156.38670
84 14233.86267 -19536.53883
85 -24862.08052 14233.86267
86 32483.35314 -24862.08052
87 13365.49531 32483.35314
88 -37423.93539 13365.49531
89 42970.02725 -37423.93539
90 -39309.02458 42970.02725
91 12975.45789 -39309.02458
92 -16778.63581 12975.45789
93 -25077.32145 -16778.63581
94 34187.25249 -25077.32145
95 44655.39633 34187.25249
96 41700.65874 44655.39633
97 28294.88041 41700.65874
98 3599.29933 28294.88041
99 13090.94236 3599.29933
100 31565.32043 13090.94236
101 -342.44238 31565.32043
102 -20364.29495 -342.44238
103 7178.66326 -20364.29495
104 -23345.08545 7178.66326
105 -23708.05046 -23345.08545
106 -5955.97144 -23708.05046
107 -12973.85440 -5955.97144
108 92292.80729 -12973.85440
109 70497.29958 92292.80729
110 23276.77902 70497.29958
111 -2566.56759 23276.77902
112 -7760.43527 -2566.56759
113 -14883.22754 -7760.43527
114 -2900.19987 -14883.22754
115 -48866.70650 -2900.19987
116 -52551.45430 -48866.70650
117 -6115.06274 -52551.45430
118 6294.66889 -6115.06274
119 -8914.50365 6294.66889
120 -29748.18642 -8914.50365
121 37559.67958 -29748.18642
122 58232.58408 37559.67958
123 62183.35060 58232.58408
124 -9946.91531 62183.35060
125 22643.60563 -9946.91531
126 -14801.20968 22643.60563
127 -18766.41046 -14801.20968
128 -11240.91367 -18766.41046
129 -27630.49095 -11240.91367
130 89974.46031 -27630.49095
131 -19651.99715 89974.46031
132 54.13346 -19651.99715
133 11032.32493 54.13346
134 -3480.95149 11032.32493
135 108558.62958 -3480.95149
136 38800.65696 108558.62958
137 -15986.91893 38800.65696
138 -26915.82144 -15986.91893
139 -42115.62781 -26915.82144
140 33804.21929 -42115.62781
141 15696.19354 33804.21929
142 -4302.01409 15696.19354
143 8747.91031 -4302.01409
144 11028.25815 8747.91031
145 50689.98552 11028.25815
146 41088.55365 50689.98552
147 15145.17896 41088.55365
148 -3784.51410 15145.17896
149 -1626.62409 -3784.51410
150 -3784.51410 -1626.62409
151 -3784.51410 -3784.51410
152 -3784.51410 -3784.51410
153 -3784.51410 -3784.51410
154 -13144.19272 -3784.51410
155 -71892.76790 -13144.19272
156 -3784.51410 -71892.76790
157 -3784.51410 -3784.51410
158 -4871.05525 -3784.51410
159 -12138.56599 -4871.05525
160 -4057.88778 -12138.56599
161 361.84803 -4057.88778
162 -3784.51410 361.84803
163 27272.38735 -3784.51410
164 NA 27272.38735
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 10179.31223 5175.87809
[2,] 5977.69911 10179.31223
[3,] 8623.52621 5977.69911
[4,] -33366.40054 8623.52621
[5,] 16158.78254 -33366.40054
[6,] 28514.16622 16158.78254
[7,] 489.12701 28514.16622
[8,] 45551.73866 489.12701
[9,] -23476.99482 45551.73866
[10,] -51673.00458 -23476.99482
[11,] -21974.99916 -51673.00458
[12,] -4448.63370 -21974.99916
[13,] -9311.49654 -4448.63370
[14,] -30464.94223 -9311.49654
[15,] -27800.86771 -30464.94223
[16,] 35423.95562 -27800.86771
[17,] 17135.09899 35423.95562
[18,] 23696.63441 17135.09899
[19,] 5929.32365 23696.63441
[20,] -9181.65094 5929.32365
[21,] -15720.59524 -9181.65094
[22,] 2514.67167 -15720.59524
[23,] 9049.08939 2514.67167
[24,] -17479.75659 9049.08939
[25,] 3939.30919 -17479.75659
[26,] -21442.26164 3939.30919
[27,] -35069.75259 -21442.26164
[28,] -30543.52953 -35069.75259
[29,] -36431.49194 -30543.52953
[30,] 226.83477 -36431.49194
[31,] -29805.70552 226.83477
[32,] -35305.86825 -29805.70552
[33,] 16539.73746 -35305.86825
[34,] -25160.56655 16539.73746
[35,] -20996.08595 -25160.56655
[36,] -28525.42246 -20996.08595
[37,] -23798.40428 -28525.42246
[38,] -16168.16263 -23798.40428
[39,] -23492.24195 -16168.16263
[40,] -15051.71117 -23492.24195
[41,] -6302.23797 -15051.71117
[42,] -7234.64390 -6302.23797
[43,] -8669.48949 -7234.64390
[44,] -2259.99793 -8669.48949
[45,] 35972.79606 -2259.99793
[46,] -17229.44089 35972.79606
[47,] -20511.97199 -17229.44089
[48,] 4842.84241 -20511.97199
[49,] -17193.44632 4842.84241
[50,] -25125.62801 -17193.44632
[51,] -8002.68139 -25125.62801
[52,] 7196.56431 -8002.68139
[53,] 454.59981 7196.56431
[54,] -7310.84111 454.59981
[55,] -8812.95807 -7310.84111
[56,] 8582.10375 -8812.95807
[57,] -5007.00048 8582.10375
[58,] -30552.05682 -5007.00048
[59,] 12114.81032 -30552.05682
[60,] 3969.41364 12114.81032
[61,] 15792.32536 3969.41364
[62,] -30318.25173 15792.32536
[63,] -1700.88640 -30318.25173
[64,] -1370.27405 -1700.88640
[65,] -34468.32487 -1370.27405
[66,] 37827.48331 -34468.32487
[67,] -27202.23522 37827.48331
[68,] 15944.91784 -27202.23522
[69,] 44798.34786 15944.91784
[70,] -19131.36049 44798.34786
[71,] -14202.18389 -19131.36049
[72,] -15676.27811 -14202.18389
[73,] -1850.11935 -15676.27811
[74,] -14061.51961 -1850.11935
[75,] 8919.05286 -14061.51961
[76,] -3713.17715 8919.05286
[77,] 132628.18546 -3713.17715
[78,] -16002.75016 132628.18546
[79,] -11136.35865 -16002.75016
[80,] -14151.78786 -11136.35865
[81,] 22170.43963 -14151.78786
[82,] -19156.38670 22170.43963
[83,] -19536.53883 -19156.38670
[84,] 14233.86267 -19536.53883
[85,] -24862.08052 14233.86267
[86,] 32483.35314 -24862.08052
[87,] 13365.49531 32483.35314
[88,] -37423.93539 13365.49531
[89,] 42970.02725 -37423.93539
[90,] -39309.02458 42970.02725
[91,] 12975.45789 -39309.02458
[92,] -16778.63581 12975.45789
[93,] -25077.32145 -16778.63581
[94,] 34187.25249 -25077.32145
[95,] 44655.39633 34187.25249
[96,] 41700.65874 44655.39633
[97,] 28294.88041 41700.65874
[98,] 3599.29933 28294.88041
[99,] 13090.94236 3599.29933
[100,] 31565.32043 13090.94236
[101,] -342.44238 31565.32043
[102,] -20364.29495 -342.44238
[103,] 7178.66326 -20364.29495
[104,] -23345.08545 7178.66326
[105,] -23708.05046 -23345.08545
[106,] -5955.97144 -23708.05046
[107,] -12973.85440 -5955.97144
[108,] 92292.80729 -12973.85440
[109,] 70497.29958 92292.80729
[110,] 23276.77902 70497.29958
[111,] -2566.56759 23276.77902
[112,] -7760.43527 -2566.56759
[113,] -14883.22754 -7760.43527
[114,] -2900.19987 -14883.22754
[115,] -48866.70650 -2900.19987
[116,] -52551.45430 -48866.70650
[117,] -6115.06274 -52551.45430
[118,] 6294.66889 -6115.06274
[119,] -8914.50365 6294.66889
[120,] -29748.18642 -8914.50365
[121,] 37559.67958 -29748.18642
[122,] 58232.58408 37559.67958
[123,] 62183.35060 58232.58408
[124,] -9946.91531 62183.35060
[125,] 22643.60563 -9946.91531
[126,] -14801.20968 22643.60563
[127,] -18766.41046 -14801.20968
[128,] -11240.91367 -18766.41046
[129,] -27630.49095 -11240.91367
[130,] 89974.46031 -27630.49095
[131,] -19651.99715 89974.46031
[132,] 54.13346 -19651.99715
[133,] 11032.32493 54.13346
[134,] -3480.95149 11032.32493
[135,] 108558.62958 -3480.95149
[136,] 38800.65696 108558.62958
[137,] -15986.91893 38800.65696
[138,] -26915.82144 -15986.91893
[139,] -42115.62781 -26915.82144
[140,] 33804.21929 -42115.62781
[141,] 15696.19354 33804.21929
[142,] -4302.01409 15696.19354
[143,] 8747.91031 -4302.01409
[144,] 11028.25815 8747.91031
[145,] 50689.98552 11028.25815
[146,] 41088.55365 50689.98552
[147,] 15145.17896 41088.55365
[148,] -3784.51410 15145.17896
[149,] -1626.62409 -3784.51410
[150,] -3784.51410 -1626.62409
[151,] -3784.51410 -3784.51410
[152,] -3784.51410 -3784.51410
[153,] -3784.51410 -3784.51410
[154,] -13144.19272 -3784.51410
[155,] -71892.76790 -13144.19272
[156,] -3784.51410 -71892.76790
[157,] -3784.51410 -3784.51410
[158,] -4871.05525 -3784.51410
[159,] -12138.56599 -4871.05525
[160,] -4057.88778 -12138.56599
[161,] 361.84803 -4057.88778
[162,] -3784.51410 361.84803
[163,] 27272.38735 -3784.51410
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 10179.31223 5175.87809
2 5977.69911 10179.31223
3 8623.52621 5977.69911
4 -33366.40054 8623.52621
5 16158.78254 -33366.40054
6 28514.16622 16158.78254
7 489.12701 28514.16622
8 45551.73866 489.12701
9 -23476.99482 45551.73866
10 -51673.00458 -23476.99482
11 -21974.99916 -51673.00458
12 -4448.63370 -21974.99916
13 -9311.49654 -4448.63370
14 -30464.94223 -9311.49654
15 -27800.86771 -30464.94223
16 35423.95562 -27800.86771
17 17135.09899 35423.95562
18 23696.63441 17135.09899
19 5929.32365 23696.63441
20 -9181.65094 5929.32365
21 -15720.59524 -9181.65094
22 2514.67167 -15720.59524
23 9049.08939 2514.67167
24 -17479.75659 9049.08939
25 3939.30919 -17479.75659
26 -21442.26164 3939.30919
27 -35069.75259 -21442.26164
28 -30543.52953 -35069.75259
29 -36431.49194 -30543.52953
30 226.83477 -36431.49194
31 -29805.70552 226.83477
32 -35305.86825 -29805.70552
33 16539.73746 -35305.86825
34 -25160.56655 16539.73746
35 -20996.08595 -25160.56655
36 -28525.42246 -20996.08595
37 -23798.40428 -28525.42246
38 -16168.16263 -23798.40428
39 -23492.24195 -16168.16263
40 -15051.71117 -23492.24195
41 -6302.23797 -15051.71117
42 -7234.64390 -6302.23797
43 -8669.48949 -7234.64390
44 -2259.99793 -8669.48949
45 35972.79606 -2259.99793
46 -17229.44089 35972.79606
47 -20511.97199 -17229.44089
48 4842.84241 -20511.97199
49 -17193.44632 4842.84241
50 -25125.62801 -17193.44632
51 -8002.68139 -25125.62801
52 7196.56431 -8002.68139
53 454.59981 7196.56431
54 -7310.84111 454.59981
55 -8812.95807 -7310.84111
56 8582.10375 -8812.95807
57 -5007.00048 8582.10375
58 -30552.05682 -5007.00048
59 12114.81032 -30552.05682
60 3969.41364 12114.81032
61 15792.32536 3969.41364
62 -30318.25173 15792.32536
63 -1700.88640 -30318.25173
64 -1370.27405 -1700.88640
65 -34468.32487 -1370.27405
66 37827.48331 -34468.32487
67 -27202.23522 37827.48331
68 15944.91784 -27202.23522
69 44798.34786 15944.91784
70 -19131.36049 44798.34786
71 -14202.18389 -19131.36049
72 -15676.27811 -14202.18389
73 -1850.11935 -15676.27811
74 -14061.51961 -1850.11935
75 8919.05286 -14061.51961
76 -3713.17715 8919.05286
77 132628.18546 -3713.17715
78 -16002.75016 132628.18546
79 -11136.35865 -16002.75016
80 -14151.78786 -11136.35865
81 22170.43963 -14151.78786
82 -19156.38670 22170.43963
83 -19536.53883 -19156.38670
84 14233.86267 -19536.53883
85 -24862.08052 14233.86267
86 32483.35314 -24862.08052
87 13365.49531 32483.35314
88 -37423.93539 13365.49531
89 42970.02725 -37423.93539
90 -39309.02458 42970.02725
91 12975.45789 -39309.02458
92 -16778.63581 12975.45789
93 -25077.32145 -16778.63581
94 34187.25249 -25077.32145
95 44655.39633 34187.25249
96 41700.65874 44655.39633
97 28294.88041 41700.65874
98 3599.29933 28294.88041
99 13090.94236 3599.29933
100 31565.32043 13090.94236
101 -342.44238 31565.32043
102 -20364.29495 -342.44238
103 7178.66326 -20364.29495
104 -23345.08545 7178.66326
105 -23708.05046 -23345.08545
106 -5955.97144 -23708.05046
107 -12973.85440 -5955.97144
108 92292.80729 -12973.85440
109 70497.29958 92292.80729
110 23276.77902 70497.29958
111 -2566.56759 23276.77902
112 -7760.43527 -2566.56759
113 -14883.22754 -7760.43527
114 -2900.19987 -14883.22754
115 -48866.70650 -2900.19987
116 -52551.45430 -48866.70650
117 -6115.06274 -52551.45430
118 6294.66889 -6115.06274
119 -8914.50365 6294.66889
120 -29748.18642 -8914.50365
121 37559.67958 -29748.18642
122 58232.58408 37559.67958
123 62183.35060 58232.58408
124 -9946.91531 62183.35060
125 22643.60563 -9946.91531
126 -14801.20968 22643.60563
127 -18766.41046 -14801.20968
128 -11240.91367 -18766.41046
129 -27630.49095 -11240.91367
130 89974.46031 -27630.49095
131 -19651.99715 89974.46031
132 54.13346 -19651.99715
133 11032.32493 54.13346
134 -3480.95149 11032.32493
135 108558.62958 -3480.95149
136 38800.65696 108558.62958
137 -15986.91893 38800.65696
138 -26915.82144 -15986.91893
139 -42115.62781 -26915.82144
140 33804.21929 -42115.62781
141 15696.19354 33804.21929
142 -4302.01409 15696.19354
143 8747.91031 -4302.01409
144 11028.25815 8747.91031
145 50689.98552 11028.25815
146 41088.55365 50689.98552
147 15145.17896 41088.55365
148 -3784.51410 15145.17896
149 -1626.62409 -3784.51410
150 -3784.51410 -1626.62409
151 -3784.51410 -3784.51410
152 -3784.51410 -3784.51410
153 -3784.51410 -3784.51410
154 -13144.19272 -3784.51410
155 -71892.76790 -13144.19272
156 -3784.51410 -71892.76790
157 -3784.51410 -3784.51410
158 -4871.05525 -3784.51410
159 -12138.56599 -4871.05525
160 -4057.88778 -12138.56599
161 361.84803 -4057.88778
162 -3784.51410 361.84803
163 27272.38735 -3784.51410
> 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/7ruxq1323886977.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/8ye001323886977.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/95dn41323886977.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/10ls2t1323886977.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/11wajv1323886977.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/12d6191323886977.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/13hvs01323886977.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/14wamo1323886977.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/155ke31323886977.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/16ye431323886977.tab")
+ }
>
> try(system("convert tmp/12qdm1323886977.ps tmp/12qdm1323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/2z75y1323886977.ps tmp/2z75y1323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/3737q1323886977.ps tmp/3737q1323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/4y2m51323886977.ps tmp/4y2m51323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wbui1323886977.ps tmp/5wbui1323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/6j1il1323886977.ps tmp/6j1il1323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ruxq1323886977.ps tmp/7ruxq1323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ye001323886977.ps tmp/8ye001323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/95dn41323886977.ps tmp/95dn41323886977.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ls2t1323886977.ps tmp/10ls2t1323886977.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.890 0.618 5.539