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(95556
+ ,114468
+ ,70
+ ,127
+ ,54565
+ ,88594
+ ,44
+ ,90
+ ,63016
+ ,74151
+ ,36
+ ,68
+ ,79774
+ ,77921
+ ,119
+ ,111
+ ,31258
+ ,53212
+ ,30
+ ,51
+ ,52491
+ ,34956
+ ,23
+ ,33
+ ,91256
+ ,149703
+ ,46
+ ,123
+ ,22807
+ ,6853
+ ,39
+ ,5
+ ,77411
+ ,58907
+ ,58
+ ,63
+ ,48821
+ ,67067
+ ,51
+ ,66
+ ,52295
+ ,110563
+ ,65
+ ,99
+ ,63262
+ ,58126
+ ,40
+ ,72
+ ,50466
+ ,57113
+ ,42
+ ,55
+ ,62932
+ ,77993
+ ,76
+ ,116
+ ,38439
+ ,68091
+ ,31
+ ,71
+ ,70817
+ ,124676
+ ,83
+ ,125
+ ,105965
+ ,109522
+ ,36
+ ,123
+ ,73795
+ ,75865
+ ,62
+ ,74
+ ,82043
+ ,79746
+ ,28
+ ,116
+ ,74349
+ ,77844
+ ,38
+ ,117
+ ,82204
+ ,98681
+ ,70
+ ,98
+ ,55709
+ ,105531
+ ,76
+ ,101
+ ,37137
+ ,51428
+ ,33
+ ,43
+ ,70780
+ ,65703
+ ,40
+ ,103
+ ,55027
+ ,72562
+ ,126
+ ,107
+ ,56699
+ ,81728
+ ,56
+ ,77
+ ,65911
+ ,95580
+ ,63
+ ,87
+ ,56316
+ ,98278
+ ,46
+ ,99
+ ,26982
+ ,46629
+ ,35
+ ,46
+ ,54628
+ ,115189
+ ,108
+ ,96
+ ,96750
+ ,124865
+ ,34
+ ,92
+ ,53009
+ ,59392
+ ,54
+ ,96
+ ,64664
+ ,127818
+ ,35
+ ,96
+ ,36990
+ ,17821
+ ,23
+ ,15
+ ,85224
+ ,154076
+ ,46
+ ,147
+ ,37048
+ ,64881
+ ,49
+ ,56
+ ,59635
+ ,136506
+ ,56
+ ,81
+ ,42051
+ ,66524
+ ,38
+ ,69
+ ,26998
+ ,45988
+ ,19
+ ,34
+ ,63717
+ ,107445
+ ,29
+ ,98
+ ,55071
+ ,102772
+ ,26
+ ,82
+ ,40001
+ ,46657
+ ,52
+ ,64
+ ,54506
+ ,97563
+ ,54
+ ,61
+ ,35838
+ ,36663
+ ,45
+ ,45
+ ,50838
+ ,55369
+ ,56
+ ,37
+ ,86997
+ ,77921
+ ,596
+ ,64
+ ,33032
+ ,56968
+ ,57
+ ,21
+ ,61704
+ ,77519
+ ,55
+ ,104
+ ,117986
+ ,129805
+ ,99
+ ,126
+ ,56733
+ ,72761
+ ,51
+ ,104
+ ,55064
+ ,81278
+ ,21
+ ,87
+ ,5950
+ ,15049
+ ,20
+ ,7
+ ,84607
+ ,113935
+ ,58
+ ,130
+ ,32551
+ ,25109
+ ,21
+ ,21
+ ,31701
+ ,45824
+ ,66
+ ,35
+ ,71170
+ ,89644
+ ,47
+ ,97
+ ,101773
+ ,109011
+ ,55
+ ,103
+ ,101653
+ ,134245
+ ,158
+ ,210
+ ,81493
+ ,136692
+ ,46
+ ,151
+ ,55901
+ ,50741
+ ,45
+ ,57
+ ,109104
+ ,149510
+ ,46
+ ,117
+ ,114425
+ ,147888
+ ,117
+ ,152
+ ,36311
+ ,54987
+ ,56
+ ,52
+ ,70027
+ ,74467
+ ,30
+ ,83
+ ,73713
+ ,100033
+ ,45
+ ,87
+ ,40671
+ ,85505
+ ,38
+ ,80
+ ,89041
+ ,62426
+ ,33
+ ,88
+ ,57231
+ ,82932
+ ,61
+ ,83
+ ,68608
+ ,72002
+ ,63
+ ,120
+ ,59155
+ ,65469
+ ,41
+ ,76
+ ,55827
+ ,63572
+ ,33
+ ,70
+ ,22618
+ ,23824
+ ,36
+ ,26
+ ,58425
+ ,73831
+ ,35
+ ,66
+ ,65724
+ ,63551
+ ,73
+ ,89
+ ,56979
+ ,56756
+ ,46
+ ,100
+ ,72369
+ ,81399
+ ,54
+ ,98
+ ,79194
+ ,117881
+ ,24
+ ,109
+ ,202316
+ ,70711
+ ,27
+ ,51
+ ,44970
+ ,50495
+ ,32
+ ,82
+ ,49319
+ ,53845
+ ,52
+ ,65
+ ,36252
+ ,51390
+ ,31
+ ,46
+ ,75741
+ ,104953
+ ,89
+ ,104
+ ,38417
+ ,65983
+ ,36
+ ,36
+ ,64102
+ ,76839
+ ,37
+ ,123
+ ,56622
+ ,55792
+ ,31
+ ,59
+ ,15430
+ ,25155
+ ,142
+ ,27
+ ,72571
+ ,55291
+ ,44
+ ,84
+ ,67271
+ ,84279
+ ,222
+ ,61
+ ,43460
+ ,99692
+ ,52
+ ,46
+ ,99501
+ ,59633
+ ,51
+ ,125
+ ,28340
+ ,63249
+ ,45
+ ,58
+ ,76013
+ ,82928
+ ,51
+ ,152
+ ,37361
+ ,50000
+ ,64
+ ,52
+ ,48204
+ ,69455
+ ,66
+ ,85
+ ,76168
+ ,84068
+ ,81
+ ,95
+ ,85168
+ ,76195
+ ,43
+ ,78
+ ,125410
+ ,114634
+ ,45
+ ,144
+ ,123328
+ ,139357
+ ,35
+ ,149
+ ,83038
+ ,110044
+ ,97
+ ,101
+ ,120087
+ ,155118
+ ,41
+ ,205
+ ,91939
+ ,83061
+ ,44
+ ,61
+ ,103646
+ ,127122
+ ,61
+ ,145
+ ,29467
+ ,45653
+ ,35
+ ,28
+ ,43750
+ ,19630
+ ,43
+ ,49
+ ,34497
+ ,67229
+ ,57
+ ,68
+ ,66477
+ ,86060
+ ,32
+ ,142
+ ,71181
+ ,88003
+ ,66
+ ,82
+ ,74482
+ ,95815
+ ,32
+ ,105
+ ,174949
+ ,85499
+ ,24
+ ,52
+ ,46765
+ ,27220
+ ,55
+ ,56
+ ,90257
+ ,109882
+ ,38
+ ,81
+ ,51370
+ ,72579
+ ,43
+ ,100
+ ,1168
+ ,5841
+ ,9
+ ,11
+ ,51360
+ ,68369
+ ,36
+ ,87
+ ,25162
+ ,24610
+ ,25
+ ,31
+ ,21067
+ ,30995
+ ,78
+ ,67
+ ,58233
+ ,150662
+ ,42
+ ,150
+ ,855
+ ,6622
+ ,2
+ ,4
+ ,85903
+ ,93694
+ ,46
+ ,75
+ ,14116
+ ,13155
+ ,22
+ ,39
+ ,57637
+ ,111908
+ ,131
+ ,88
+ ,94137
+ ,57550
+ ,51
+ ,67
+ ,62147
+ ,16356
+ ,67
+ ,24
+ ,62832
+ ,40174
+ ,38
+ ,58
+ ,8773
+ ,13983
+ ,52
+ ,16
+ ,63785
+ ,52316
+ ,64
+ ,49
+ ,65196
+ ,99585
+ ,75
+ ,109
+ ,73087
+ ,86271
+ ,37
+ ,124
+ ,72631
+ ,131012
+ ,107
+ ,115
+ ,86281
+ ,130274
+ ,84
+ ,128
+ ,162365
+ ,159051
+ ,68
+ ,159
+ ,56530
+ ,76506
+ ,30
+ ,75
+ ,35606
+ ,49145
+ ,31
+ ,30
+ ,70111
+ ,66398
+ ,109
+ ,83
+ ,92046
+ ,127546
+ ,108
+ ,135
+ ,63989
+ ,6802
+ ,33
+ ,8
+ ,104911
+ ,99509
+ ,106
+ ,115
+ ,43448
+ ,43106
+ ,50
+ ,60
+ ,60029
+ ,108303
+ ,52
+ ,99
+ ,38650
+ ,64167
+ ,134
+ ,98
+ ,47261
+ ,8579
+ ,39
+ ,36
+ ,73586
+ ,97811
+ ,78
+ ,93
+ ,83042
+ ,84365
+ ,40
+ ,158
+ ,37238
+ ,10901
+ ,37
+ ,16
+ ,63958
+ ,91346
+ ,41
+ ,100
+ ,78956
+ ,33660
+ ,95
+ ,49
+ ,99518
+ ,93634
+ ,37
+ ,89
+ ,111436
+ ,109348
+ ,38
+ ,153
+ ,0
+ ,0
+ ,0
+ ,0
+ ,6023
+ ,7953
+ ,0
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,42564
+ ,63538
+ ,36
+ ,80
+ ,38885
+ ,108281
+ ,65
+ ,122
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1644
+ ,4245
+ ,0
+ ,6
+ ,6179
+ ,21509
+ ,7
+ ,13
+ ,3926
+ ,7670
+ ,3
+ ,3
+ ,23238
+ ,10641
+ ,53
+ ,18
+ ,0
+ ,0
+ ,0
+ ,0
+ ,49288
+ ,41243
+ ,25
+ ,49)
+ ,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 95556 114468 70 127
2 54565 88594 44 90
3 63016 74151 36 68
4 79774 77921 119 111
5 31258 53212 30 51
6 52491 34956 23 33
7 91256 149703 46 123
8 22807 6853 39 5
9 77411 58907 58 63
10 48821 67067 51 66
11 52295 110563 65 99
12 63262 58126 40 72
13 50466 57113 42 55
14 62932 77993 76 116
15 38439 68091 31 71
16 70817 124676 83 125
17 105965 109522 36 123
18 73795 75865 62 74
19 82043 79746 28 116
20 74349 77844 38 117
21 82204 98681 70 98
22 55709 105531 76 101
23 37137 51428 33 43
24 70780 65703 40 103
25 55027 72562 126 107
26 56699 81728 56 77
27 65911 95580 63 87
28 56316 98278 46 99
29 26982 46629 35 46
30 54628 115189 108 96
31 96750 124865 34 92
32 53009 59392 54 96
33 64664 127818 35 96
34 36990 17821 23 15
35 85224 154076 46 147
36 37048 64881 49 56
37 59635 136506 56 81
38 42051 66524 38 69
39 26998 45988 19 34
40 63717 107445 29 98
41 55071 102772 26 82
42 40001 46657 52 64
43 54506 97563 54 61
44 35838 36663 45 45
45 50838 55369 56 37
46 86997 77921 596 64
47 33032 56968 57 21
48 61704 77519 55 104
49 117986 129805 99 126
50 56733 72761 51 104
51 55064 81278 21 87
52 5950 15049 20 7
53 84607 113935 58 130
54 32551 25109 21 21
55 31701 45824 66 35
56 71170 89644 47 97
57 101773 109011 55 103
58 101653 134245 158 210
59 81493 136692 46 151
60 55901 50741 45 57
61 109104 149510 46 117
62 114425 147888 117 152
63 36311 54987 56 52
64 70027 74467 30 83
65 73713 100033 45 87
66 40671 85505 38 80
67 89041 62426 33 88
68 57231 82932 61 83
69 68608 72002 63 120
70 59155 65469 41 76
71 55827 63572 33 70
72 22618 23824 36 26
73 58425 73831 35 66
74 65724 63551 73 89
75 56979 56756 46 100
76 72369 81399 54 98
77 79194 117881 24 109
78 202316 70711 27 51
79 44970 50495 32 82
80 49319 53845 52 65
81 36252 51390 31 46
82 75741 104953 89 104
83 38417 65983 36 36
84 64102 76839 37 123
85 56622 55792 31 59
86 15430 25155 142 27
87 72571 55291 44 84
88 67271 84279 222 61
89 43460 99692 52 46
90 99501 59633 51 125
91 28340 63249 45 58
92 76013 82928 51 152
93 37361 50000 64 52
94 48204 69455 66 85
95 76168 84068 81 95
96 85168 76195 43 78
97 125410 114634 45 144
98 123328 139357 35 149
99 83038 110044 97 101
100 120087 155118 41 205
101 91939 83061 44 61
102 103646 127122 61 145
103 29467 45653 35 28
104 43750 19630 43 49
105 34497 67229 57 68
106 66477 86060 32 142
107 71181 88003 66 82
108 74482 95815 32 105
109 174949 85499 24 52
110 46765 27220 55 56
111 90257 109882 38 81
112 51370 72579 43 100
113 1168 5841 9 11
114 51360 68369 36 87
115 25162 24610 25 31
116 21067 30995 78 67
117 58233 150662 42 150
118 855 6622 2 4
119 85903 93694 46 75
120 14116 13155 22 39
121 57637 111908 131 88
122 94137 57550 51 67
123 62147 16356 67 24
124 62832 40174 38 58
125 8773 13983 52 16
126 63785 52316 64 49
127 65196 99585 75 109
128 73087 86271 37 124
129 72631 131012 107 115
130 86281 130274 84 128
131 162365 159051 68 159
132 56530 76506 30 75
133 35606 49145 31 30
134 70111 66398 109 83
135 92046 127546 108 135
136 63989 6802 33 8
137 104911 99509 106 115
138 43448 43106 50 60
139 60029 108303 52 99
140 38650 64167 134 98
141 47261 8579 39 36
142 73586 97811 78 93
143 83042 84365 40 158
144 37238 10901 37 16
145 63958 91346 41 100
146 78956 33660 95 49
147 99518 93634 37 89
148 111436 109348 38 153
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 42564 63538 36 80
156 38885 108281 65 122
157 0 0 0 0
158 0 0 0 0
159 1644 4245 0 6
160 6179 21509 7 13
161 3926 7670 3 3
162 23238 10641 53 18
163 0 0 0 0
164 49288 41243 25 49
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Tijd Review Hyperlinks
1.277e+04 3.701e-01 3.457e+01 2.389e+02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-47573 -13074 -4523 8194 150265
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.277e+04 3.806e+03 3.355 0.000992 ***
Tijd 3.701e-01 8.892e-02 4.162 5.15e-05 ***
Review 3.457e+01 3.440e+01 1.005 0.316384
Hyperlinks 2.389e+02 8.044e+01 2.970 0.003440 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 22590 on 160 degrees of freedom
Multiple R-squared: 0.5536, Adjusted R-squared: 0.5452
F-statistic: 66.14 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.048689e-01 6.097378e-01 0.6951310796
[2,] 1.644733e-01 3.289466e-01 0.8355266834
[3,] 1.881230e-01 3.762460e-01 0.8118769865
[4,] 1.264158e-01 2.528316e-01 0.8735841790
[5,] 1.456378e-01 2.912756e-01 0.8543621974
[6,] 8.651214e-02 1.730243e-01 0.9134878578
[7,] 4.871271e-02 9.742542e-02 0.9512872899
[8,] 4.768627e-02 9.537254e-02 0.9523137282
[9,] 4.291463e-02 8.582926e-02 0.9570853696
[10,] 3.177817e-02 6.355633e-02 0.9682218334
[11,] 4.628179e-02 9.256357e-02 0.9537182150
[12,] 4.100328e-02 8.200655e-02 0.9589967235
[13,] 2.513021e-02 5.026042e-02 0.9748697876
[14,] 1.596212e-02 3.192425e-02 0.9840378755
[15,] 1.135204e-02 2.270408e-02 0.9886479592
[16,] 1.025365e-02 2.050729e-02 0.9897463541
[17,] 6.417679e-03 1.283536e-02 0.9935823210
[18,] 3.684218e-03 7.368436e-03 0.9963157818
[19,] 2.701885e-03 5.403770e-03 0.9972981150
[20,] 1.502294e-03 3.004588e-03 0.9984977060
[21,] 8.137942e-04 1.627588e-03 0.9991862058
[22,] 6.971279e-04 1.394256e-03 0.9993028721
[23,] 6.717849e-04 1.343570e-03 0.9993282151
[24,] 4.417560e-04 8.835120e-04 0.9995582440
[25,] 7.636373e-04 1.527275e-03 0.9992363627
[26,] 5.277694e-04 1.055539e-03 0.9994722306
[27,] 3.903095e-04 7.806189e-04 0.9996096905
[28,] 2.455411e-04 4.910821e-04 0.9997544589
[29,] 1.863898e-04 3.727796e-04 0.9998136102
[30,] 1.327731e-04 2.655463e-04 0.9998672269
[31,] 8.555912e-05 1.711182e-04 0.9999144409
[32,] 6.524923e-05 1.304985e-04 0.9999347508
[33,] 4.768904e-05 9.537808e-05 0.9999523110
[34,] 2.967353e-05 5.934707e-05 0.9999703265
[35,] 1.930796e-05 3.861592e-05 0.9999806920
[36,] 1.171411e-05 2.342822e-05 0.9999882859
[37,] 6.584751e-06 1.316950e-05 0.9999934152
[38,] 3.420838e-06 6.841676e-06 0.9999965792
[39,] 2.605236e-06 5.210472e-06 0.9999973948
[40,] 3.288938e-06 6.577877e-06 0.9999967111
[41,] 1.722041e-06 3.444082e-06 0.9999982780
[42,] 9.254643e-07 1.850929e-06 0.9999990745
[43,] 4.527367e-06 9.054735e-06 0.9999954726
[44,] 2.904710e-06 5.809420e-06 0.9999970953
[45,] 1.633423e-06 3.266846e-06 0.9999983666
[46,] 1.305586e-06 2.611173e-06 0.9999986944
[47,] 6.755086e-07 1.351017e-06 0.9999993245
[48,] 3.655815e-07 7.311629e-07 0.9999996344
[49,] 1.992351e-07 3.984703e-07 0.9999998008
[50,] 1.027965e-07 2.055930e-07 0.9999998972
[51,] 2.924929e-07 5.849859e-07 0.9999997075
[52,] 2.816160e-07 5.632320e-07 0.9999997184
[53,] 2.125694e-07 4.251388e-07 0.9999997874
[54,] 1.317468e-07 2.634935e-07 0.9999998683
[55,] 1.848287e-07 3.696573e-07 0.9999998152
[56,] 1.317740e-07 2.635481e-07 0.9999998682
[57,] 8.047168e-08 1.609434e-07 0.9999999195
[58,] 5.243827e-08 1.048765e-07 0.9999999476
[59,] 2.883065e-08 5.766131e-08 0.9999999712
[60,] 3.724379e-08 7.448757e-08 0.9999999628
[61,] 1.324091e-07 2.648182e-07 0.9999998676
[62,] 7.374117e-08 1.474823e-07 0.9999999263
[63,] 3.794482e-08 7.588963e-08 0.9999999621
[64,] 1.959302e-08 3.918604e-08 0.9999999804
[65,] 9.921636e-09 1.984327e-08 0.9999999901
[66,] 5.359120e-09 1.071824e-08 0.9999999946
[67,] 2.738374e-09 5.476748e-09 0.9999999973
[68,] 1.400657e-09 2.801314e-09 0.9999999986
[69,] 6.827518e-10 1.365504e-09 0.9999999993
[70,] 3.429921e-10 6.859841e-10 0.9999999997
[71,] 1.742602e-10 3.485204e-10 0.9999999998
[72,] 3.158949e-01 6.317898e-01 0.6841050944
[73,] 2.810201e-01 5.620402e-01 0.7189798917
[74,] 2.440479e-01 4.880958e-01 0.7559521227
[75,] 2.147729e-01 4.295457e-01 0.7852271490
[76,] 1.842906e-01 3.685811e-01 0.8157094446
[77,] 1.610212e-01 3.220424e-01 0.8389787821
[78,] 1.376197e-01 2.752393e-01 0.8623803302
[79,] 1.162303e-01 2.324606e-01 0.8837696875
[80,] 1.095743e-01 2.191486e-01 0.8904257006
[81,] 1.010040e-01 2.020081e-01 0.8989959631
[82,] 8.246436e-02 1.649287e-01 0.9175356415
[83,] 8.035132e-02 1.607026e-01 0.9196486770
[84,] 1.048701e-01 2.097402e-01 0.8951298808
[85,] 1.090537e-01 2.181073e-01 0.8909463322
[86,] 9.026576e-02 1.805315e-01 0.9097342430
[87,] 7.604493e-02 1.520899e-01 0.9239550749
[88,] 6.585900e-02 1.317180e-01 0.9341410028
[89,] 5.341664e-02 1.068333e-01 0.9465833577
[90,] 5.371065e-02 1.074213e-01 0.9462893542
[91,] 7.273781e-02 1.454756e-01 0.9272621877
[92,] 7.182312e-02 1.436462e-01 0.9281768825
[93,] 5.796615e-02 1.159323e-01 0.9420338520
[94,] 4.603337e-02 9.206674e-02 0.9539666282
[95,] 5.468493e-02 1.093699e-01 0.9453150681
[96,] 4.411676e-02 8.823352e-02 0.9558832385
[97,] 3.616092e-02 7.232185e-02 0.9638390755
[98,] 2.994385e-02 5.988770e-02 0.9700561519
[99,] 2.966956e-02 5.933912e-02 0.9703304418
[100,] 2.404815e-02 4.809630e-02 0.9759518493
[101,] 1.825216e-02 3.650432e-02 0.9817478394
[102,] 1.358447e-02 2.716895e-02 0.9864155258
[103,] 7.751704e-01 4.496592e-01 0.2248296002
[104,] 7.405164e-01 5.189672e-01 0.2594836122
[105,] 7.364159e-01 5.271681e-01 0.2635840663
[106,] 7.085927e-01 5.828145e-01 0.2914072681
[107,] 6.853494e-01 6.293013e-01 0.3146506278
[108,] 6.447200e-01 7.105600e-01 0.3552800155
[109,] 5.985400e-01 8.029200e-01 0.4014600032
[110,] 6.260709e-01 7.478582e-01 0.3739291240
[111,] 7.472756e-01 5.054488e-01 0.2527243924
[112,] 7.195631e-01 5.608737e-01 0.2804368573
[113,] 7.189793e-01 5.620414e-01 0.2810206802
[114,] 6.967759e-01 6.064481e-01 0.3032240544
[115,] 7.049939e-01 5.900121e-01 0.2950060648
[116,] 8.068578e-01 3.862843e-01 0.1931421514
[117,] 8.491625e-01 3.016749e-01 0.1508374639
[118,] 8.440689e-01 3.118623e-01 0.1559311415
[119,] 8.250275e-01 3.499450e-01 0.1749725235
[120,] 8.127754e-01 3.744492e-01 0.1872245925
[121,] 7.899667e-01 4.200665e-01 0.2100332678
[122,] 7.480682e-01 5.038635e-01 0.2519317550
[123,] 7.530434e-01 4.939133e-01 0.2469566342
[124,] 7.233683e-01 5.532634e-01 0.2766316842
[125,] 8.990706e-01 2.018588e-01 0.1009293824
[126,] 8.703647e-01 2.592705e-01 0.1296352691
[127,] 8.360071e-01 3.279857e-01 0.1639928534
[128,] 7.951766e-01 4.096467e-01 0.2048233701
[129,] 7.505838e-01 4.988324e-01 0.2494162128
[130,] 9.048164e-01 1.903672e-01 0.0951835992
[131,] 9.085012e-01 1.829977e-01 0.0914988463
[132,] 8.769648e-01 2.460704e-01 0.1230352070
[133,] 8.488760e-01 3.022481e-01 0.1511240423
[134,] 9.597499e-01 8.050018e-02 0.0402500905
[135,] 9.506084e-01 9.878312e-02 0.0493915625
[136,] 9.305692e-01 1.388617e-01 0.0694308479
[137,] 9.055215e-01 1.889570e-01 0.0944784872
[138,] 8.853486e-01 2.293028e-01 0.1146513952
[139,] 8.432131e-01 3.135738e-01 0.1567869236
[140,] 9.193041e-01 1.613918e-01 0.0806958764
[141,] 9.995845e-01 8.309504e-04 0.0004154752
[142,] 9.995938e-01 8.124027e-04 0.0004062013
[143,] 9.989932e-01 2.013508e-03 0.0010067538
[144,] 9.976263e-01 4.747320e-03 0.0023736600
[145,] 9.944392e-01 1.112163e-02 0.0055608168
[146,] 9.875500e-01 2.490004e-02 0.0124500180
[147,] 9.734996e-01 5.300075e-02 0.0265003744
[148,] 9.467099e-01 1.065803e-01 0.0532901306
[149,] 8.931657e-01 2.136686e-01 0.1068342826
[150,] 9.995403e-01 9.194807e-04 0.0004597404
[151,] 9.961276e-01 7.744788e-03 0.0038723938
> postscript(file="/var/wessaorg/rcomp/tmp/1zps81321900729.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/26dsp1321900729.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/3s4ve1321900729.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/4m7sa1321900729.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/5n4vs1321900729.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
7670.32510 -14007.90478 5320.06855 7541.17092 -14420.68748 18110.16037
7 8 9 10 11 12
-7883.35172 4961.79668 25790.14533 -6294.21027 -27283.69392 10402.36097
13 14 15 16 17 18
1973.30446 -9035.44496 -17558.22627 -20817.82744 22040.57867 13132.60558
19 20 21 22 23 24
11086.19912 3511.45262 7088.36077 -22865.62913 -6074.05606 7710.69733
25 26 27 28 29 30
-14509.10608 -6642.30058 -5187.25997 -18059.72523 -15238.98081 -27432.39264
31 32 33 34 35 36
14622.69178 -6536.58982 -19546.23457 13250.18617 -21267.08952 -14800.17684
37 38 39 40 41 42
-24932.82445 -13130.54687 -11565.91633 -13224.44876 -16215.14507 -7118.14105
43 44 45 46 47 48
-10803.68118 -2801.80322 6806.81597 9502.42106 -7803.15280 -6495.33063
49 50 51 52 53 54
23661.14118 -9567.32339 -9289.78121 -14749.14769 -3383.28191 4749.98520
55 56 57 58 59 60
-8665.90507 432.56109 22158.75167 -16421.71558 -19520.61120 9184.80347
61 62 63 64 65 66
11469.43955 6574.88419 -11162.24855 8838.12383 1589.13664 -24162.43111
67 68 69 70 71 72
31009.78677 -8162.06801 -1648.60995 2587.88749 1671.81348 -6420.51554
73 74 75 76 77 78
1359.84655 5654.78440 -2270.14291 4201.79121 -4064.35273 150265.40700
79 80 81 82 83 84
-7178.13135 -699.00075 -7592.53943 -3785.82984 -8611.66947 -7762.44136
85 86 87 88 89 90
8042.83689 -18004.35955 17755.45035 1069.41195 -18984.96531 33041.97919
91 92 93 94 95 96
-23243.75571 -5516.64899 -8543.33661 -12852.45873 6796.41024 24084.73386
97 98 99 100 101 102
34265.92583 22186.24726 2067.33999 -472.75288 32341.57366 7088.65019
103 104 105 106 107 108
-8092.69465 10526.92504 -21363.36862 -13165.88748 3977.42235 68.33090
109 110 111 112 113 114
117290.82902 8646.09411 16163.81157 -13630.83408 -16698.98128 -8735.27226
115 116 117 118 119 120
-4981.58679 -21871.82068 -47573.12315 -15386.74083 18957.09445 -13596.04295
121 122 123 124 125 126
-22093.18393 42304.72040 35278.18966 20029.28219 -14787.95847 17740.29822
127 128 129 130 131 132
-13054.86511 -2506.70738 -19789.22981 -8176.65762 50405.60292 -3502.26040
133 134 135 136 137 138
-3585.44196 9177.08998 -3904.08591 45653.40344 24183.22343 -1332.35119
139 140 141 142 143 144
-18263.95866 -25905.98669 21371.33241 -289.77371 -72.52195 15336.10276
145 146 147 148 149 150
-7918.54083 38743.40309 29560.89552 20339.97673 -12766.50808 -10881.04112
151 152 153 154 155 156
-12766.50808 -12766.50808 -12766.50808 -12766.50808 -14071.26483 -45343.81203
157 158 159 160 161 162
-12766.50808 -12766.50808 -14126.76746 -17894.67371 -12499.23460 401.40967
163 164
-12766.50808 8689.15567
> postscript(file="/var/wessaorg/rcomp/tmp/60j171321900729.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 7670.32510 NA
1 -14007.90478 7670.32510
2 5320.06855 -14007.90478
3 7541.17092 5320.06855
4 -14420.68748 7541.17092
5 18110.16037 -14420.68748
6 -7883.35172 18110.16037
7 4961.79668 -7883.35172
8 25790.14533 4961.79668
9 -6294.21027 25790.14533
10 -27283.69392 -6294.21027
11 10402.36097 -27283.69392
12 1973.30446 10402.36097
13 -9035.44496 1973.30446
14 -17558.22627 -9035.44496
15 -20817.82744 -17558.22627
16 22040.57867 -20817.82744
17 13132.60558 22040.57867
18 11086.19912 13132.60558
19 3511.45262 11086.19912
20 7088.36077 3511.45262
21 -22865.62913 7088.36077
22 -6074.05606 -22865.62913
23 7710.69733 -6074.05606
24 -14509.10608 7710.69733
25 -6642.30058 -14509.10608
26 -5187.25997 -6642.30058
27 -18059.72523 -5187.25997
28 -15238.98081 -18059.72523
29 -27432.39264 -15238.98081
30 14622.69178 -27432.39264
31 -6536.58982 14622.69178
32 -19546.23457 -6536.58982
33 13250.18617 -19546.23457
34 -21267.08952 13250.18617
35 -14800.17684 -21267.08952
36 -24932.82445 -14800.17684
37 -13130.54687 -24932.82445
38 -11565.91633 -13130.54687
39 -13224.44876 -11565.91633
40 -16215.14507 -13224.44876
41 -7118.14105 -16215.14507
42 -10803.68118 -7118.14105
43 -2801.80322 -10803.68118
44 6806.81597 -2801.80322
45 9502.42106 6806.81597
46 -7803.15280 9502.42106
47 -6495.33063 -7803.15280
48 23661.14118 -6495.33063
49 -9567.32339 23661.14118
50 -9289.78121 -9567.32339
51 -14749.14769 -9289.78121
52 -3383.28191 -14749.14769
53 4749.98520 -3383.28191
54 -8665.90507 4749.98520
55 432.56109 -8665.90507
56 22158.75167 432.56109
57 -16421.71558 22158.75167
58 -19520.61120 -16421.71558
59 9184.80347 -19520.61120
60 11469.43955 9184.80347
61 6574.88419 11469.43955
62 -11162.24855 6574.88419
63 8838.12383 -11162.24855
64 1589.13664 8838.12383
65 -24162.43111 1589.13664
66 31009.78677 -24162.43111
67 -8162.06801 31009.78677
68 -1648.60995 -8162.06801
69 2587.88749 -1648.60995
70 1671.81348 2587.88749
71 -6420.51554 1671.81348
72 1359.84655 -6420.51554
73 5654.78440 1359.84655
74 -2270.14291 5654.78440
75 4201.79121 -2270.14291
76 -4064.35273 4201.79121
77 150265.40700 -4064.35273
78 -7178.13135 150265.40700
79 -699.00075 -7178.13135
80 -7592.53943 -699.00075
81 -3785.82984 -7592.53943
82 -8611.66947 -3785.82984
83 -7762.44136 -8611.66947
84 8042.83689 -7762.44136
85 -18004.35955 8042.83689
86 17755.45035 -18004.35955
87 1069.41195 17755.45035
88 -18984.96531 1069.41195
89 33041.97919 -18984.96531
90 -23243.75571 33041.97919
91 -5516.64899 -23243.75571
92 -8543.33661 -5516.64899
93 -12852.45873 -8543.33661
94 6796.41024 -12852.45873
95 24084.73386 6796.41024
96 34265.92583 24084.73386
97 22186.24726 34265.92583
98 2067.33999 22186.24726
99 -472.75288 2067.33999
100 32341.57366 -472.75288
101 7088.65019 32341.57366
102 -8092.69465 7088.65019
103 10526.92504 -8092.69465
104 -21363.36862 10526.92504
105 -13165.88748 -21363.36862
106 3977.42235 -13165.88748
107 68.33090 3977.42235
108 117290.82902 68.33090
109 8646.09411 117290.82902
110 16163.81157 8646.09411
111 -13630.83408 16163.81157
112 -16698.98128 -13630.83408
113 -8735.27226 -16698.98128
114 -4981.58679 -8735.27226
115 -21871.82068 -4981.58679
116 -47573.12315 -21871.82068
117 -15386.74083 -47573.12315
118 18957.09445 -15386.74083
119 -13596.04295 18957.09445
120 -22093.18393 -13596.04295
121 42304.72040 -22093.18393
122 35278.18966 42304.72040
123 20029.28219 35278.18966
124 -14787.95847 20029.28219
125 17740.29822 -14787.95847
126 -13054.86511 17740.29822
127 -2506.70738 -13054.86511
128 -19789.22981 -2506.70738
129 -8176.65762 -19789.22981
130 50405.60292 -8176.65762
131 -3502.26040 50405.60292
132 -3585.44196 -3502.26040
133 9177.08998 -3585.44196
134 -3904.08591 9177.08998
135 45653.40344 -3904.08591
136 24183.22343 45653.40344
137 -1332.35119 24183.22343
138 -18263.95866 -1332.35119
139 -25905.98669 -18263.95866
140 21371.33241 -25905.98669
141 -289.77371 21371.33241
142 -72.52195 -289.77371
143 15336.10276 -72.52195
144 -7918.54083 15336.10276
145 38743.40309 -7918.54083
146 29560.89552 38743.40309
147 20339.97673 29560.89552
148 -12766.50808 20339.97673
149 -10881.04112 -12766.50808
150 -12766.50808 -10881.04112
151 -12766.50808 -12766.50808
152 -12766.50808 -12766.50808
153 -12766.50808 -12766.50808
154 -14071.26483 -12766.50808
155 -45343.81203 -14071.26483
156 -12766.50808 -45343.81203
157 -12766.50808 -12766.50808
158 -14126.76746 -12766.50808
159 -17894.67371 -14126.76746
160 -12499.23460 -17894.67371
161 401.40967 -12499.23460
162 -12766.50808 401.40967
163 8689.15567 -12766.50808
164 NA 8689.15567
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -14007.90478 7670.32510
[2,] 5320.06855 -14007.90478
[3,] 7541.17092 5320.06855
[4,] -14420.68748 7541.17092
[5,] 18110.16037 -14420.68748
[6,] -7883.35172 18110.16037
[7,] 4961.79668 -7883.35172
[8,] 25790.14533 4961.79668
[9,] -6294.21027 25790.14533
[10,] -27283.69392 -6294.21027
[11,] 10402.36097 -27283.69392
[12,] 1973.30446 10402.36097
[13,] -9035.44496 1973.30446
[14,] -17558.22627 -9035.44496
[15,] -20817.82744 -17558.22627
[16,] 22040.57867 -20817.82744
[17,] 13132.60558 22040.57867
[18,] 11086.19912 13132.60558
[19,] 3511.45262 11086.19912
[20,] 7088.36077 3511.45262
[21,] -22865.62913 7088.36077
[22,] -6074.05606 -22865.62913
[23,] 7710.69733 -6074.05606
[24,] -14509.10608 7710.69733
[25,] -6642.30058 -14509.10608
[26,] -5187.25997 -6642.30058
[27,] -18059.72523 -5187.25997
[28,] -15238.98081 -18059.72523
[29,] -27432.39264 -15238.98081
[30,] 14622.69178 -27432.39264
[31,] -6536.58982 14622.69178
[32,] -19546.23457 -6536.58982
[33,] 13250.18617 -19546.23457
[34,] -21267.08952 13250.18617
[35,] -14800.17684 -21267.08952
[36,] -24932.82445 -14800.17684
[37,] -13130.54687 -24932.82445
[38,] -11565.91633 -13130.54687
[39,] -13224.44876 -11565.91633
[40,] -16215.14507 -13224.44876
[41,] -7118.14105 -16215.14507
[42,] -10803.68118 -7118.14105
[43,] -2801.80322 -10803.68118
[44,] 6806.81597 -2801.80322
[45,] 9502.42106 6806.81597
[46,] -7803.15280 9502.42106
[47,] -6495.33063 -7803.15280
[48,] 23661.14118 -6495.33063
[49,] -9567.32339 23661.14118
[50,] -9289.78121 -9567.32339
[51,] -14749.14769 -9289.78121
[52,] -3383.28191 -14749.14769
[53,] 4749.98520 -3383.28191
[54,] -8665.90507 4749.98520
[55,] 432.56109 -8665.90507
[56,] 22158.75167 432.56109
[57,] -16421.71558 22158.75167
[58,] -19520.61120 -16421.71558
[59,] 9184.80347 -19520.61120
[60,] 11469.43955 9184.80347
[61,] 6574.88419 11469.43955
[62,] -11162.24855 6574.88419
[63,] 8838.12383 -11162.24855
[64,] 1589.13664 8838.12383
[65,] -24162.43111 1589.13664
[66,] 31009.78677 -24162.43111
[67,] -8162.06801 31009.78677
[68,] -1648.60995 -8162.06801
[69,] 2587.88749 -1648.60995
[70,] 1671.81348 2587.88749
[71,] -6420.51554 1671.81348
[72,] 1359.84655 -6420.51554
[73,] 5654.78440 1359.84655
[74,] -2270.14291 5654.78440
[75,] 4201.79121 -2270.14291
[76,] -4064.35273 4201.79121
[77,] 150265.40700 -4064.35273
[78,] -7178.13135 150265.40700
[79,] -699.00075 -7178.13135
[80,] -7592.53943 -699.00075
[81,] -3785.82984 -7592.53943
[82,] -8611.66947 -3785.82984
[83,] -7762.44136 -8611.66947
[84,] 8042.83689 -7762.44136
[85,] -18004.35955 8042.83689
[86,] 17755.45035 -18004.35955
[87,] 1069.41195 17755.45035
[88,] -18984.96531 1069.41195
[89,] 33041.97919 -18984.96531
[90,] -23243.75571 33041.97919
[91,] -5516.64899 -23243.75571
[92,] -8543.33661 -5516.64899
[93,] -12852.45873 -8543.33661
[94,] 6796.41024 -12852.45873
[95,] 24084.73386 6796.41024
[96,] 34265.92583 24084.73386
[97,] 22186.24726 34265.92583
[98,] 2067.33999 22186.24726
[99,] -472.75288 2067.33999
[100,] 32341.57366 -472.75288
[101,] 7088.65019 32341.57366
[102,] -8092.69465 7088.65019
[103,] 10526.92504 -8092.69465
[104,] -21363.36862 10526.92504
[105,] -13165.88748 -21363.36862
[106,] 3977.42235 -13165.88748
[107,] 68.33090 3977.42235
[108,] 117290.82902 68.33090
[109,] 8646.09411 117290.82902
[110,] 16163.81157 8646.09411
[111,] -13630.83408 16163.81157
[112,] -16698.98128 -13630.83408
[113,] -8735.27226 -16698.98128
[114,] -4981.58679 -8735.27226
[115,] -21871.82068 -4981.58679
[116,] -47573.12315 -21871.82068
[117,] -15386.74083 -47573.12315
[118,] 18957.09445 -15386.74083
[119,] -13596.04295 18957.09445
[120,] -22093.18393 -13596.04295
[121,] 42304.72040 -22093.18393
[122,] 35278.18966 42304.72040
[123,] 20029.28219 35278.18966
[124,] -14787.95847 20029.28219
[125,] 17740.29822 -14787.95847
[126,] -13054.86511 17740.29822
[127,] -2506.70738 -13054.86511
[128,] -19789.22981 -2506.70738
[129,] -8176.65762 -19789.22981
[130,] 50405.60292 -8176.65762
[131,] -3502.26040 50405.60292
[132,] -3585.44196 -3502.26040
[133,] 9177.08998 -3585.44196
[134,] -3904.08591 9177.08998
[135,] 45653.40344 -3904.08591
[136,] 24183.22343 45653.40344
[137,] -1332.35119 24183.22343
[138,] -18263.95866 -1332.35119
[139,] -25905.98669 -18263.95866
[140,] 21371.33241 -25905.98669
[141,] -289.77371 21371.33241
[142,] -72.52195 -289.77371
[143,] 15336.10276 -72.52195
[144,] -7918.54083 15336.10276
[145,] 38743.40309 -7918.54083
[146,] 29560.89552 38743.40309
[147,] 20339.97673 29560.89552
[148,] -12766.50808 20339.97673
[149,] -10881.04112 -12766.50808
[150,] -12766.50808 -10881.04112
[151,] -12766.50808 -12766.50808
[152,] -12766.50808 -12766.50808
[153,] -12766.50808 -12766.50808
[154,] -14071.26483 -12766.50808
[155,] -45343.81203 -14071.26483
[156,] -12766.50808 -45343.81203
[157,] -12766.50808 -12766.50808
[158,] -14126.76746 -12766.50808
[159,] -17894.67371 -14126.76746
[160,] -12499.23460 -17894.67371
[161,] 401.40967 -12499.23460
[162,] -12766.50808 401.40967
[163,] 8689.15567 -12766.50808
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -14007.90478 7670.32510
2 5320.06855 -14007.90478
3 7541.17092 5320.06855
4 -14420.68748 7541.17092
5 18110.16037 -14420.68748
6 -7883.35172 18110.16037
7 4961.79668 -7883.35172
8 25790.14533 4961.79668
9 -6294.21027 25790.14533
10 -27283.69392 -6294.21027
11 10402.36097 -27283.69392
12 1973.30446 10402.36097
13 -9035.44496 1973.30446
14 -17558.22627 -9035.44496
15 -20817.82744 -17558.22627
16 22040.57867 -20817.82744
17 13132.60558 22040.57867
18 11086.19912 13132.60558
19 3511.45262 11086.19912
20 7088.36077 3511.45262
21 -22865.62913 7088.36077
22 -6074.05606 -22865.62913
23 7710.69733 -6074.05606
24 -14509.10608 7710.69733
25 -6642.30058 -14509.10608
26 -5187.25997 -6642.30058
27 -18059.72523 -5187.25997
28 -15238.98081 -18059.72523
29 -27432.39264 -15238.98081
30 14622.69178 -27432.39264
31 -6536.58982 14622.69178
32 -19546.23457 -6536.58982
33 13250.18617 -19546.23457
34 -21267.08952 13250.18617
35 -14800.17684 -21267.08952
36 -24932.82445 -14800.17684
37 -13130.54687 -24932.82445
38 -11565.91633 -13130.54687
39 -13224.44876 -11565.91633
40 -16215.14507 -13224.44876
41 -7118.14105 -16215.14507
42 -10803.68118 -7118.14105
43 -2801.80322 -10803.68118
44 6806.81597 -2801.80322
45 9502.42106 6806.81597
46 -7803.15280 9502.42106
47 -6495.33063 -7803.15280
48 23661.14118 -6495.33063
49 -9567.32339 23661.14118
50 -9289.78121 -9567.32339
51 -14749.14769 -9289.78121
52 -3383.28191 -14749.14769
53 4749.98520 -3383.28191
54 -8665.90507 4749.98520
55 432.56109 -8665.90507
56 22158.75167 432.56109
57 -16421.71558 22158.75167
58 -19520.61120 -16421.71558
59 9184.80347 -19520.61120
60 11469.43955 9184.80347
61 6574.88419 11469.43955
62 -11162.24855 6574.88419
63 8838.12383 -11162.24855
64 1589.13664 8838.12383
65 -24162.43111 1589.13664
66 31009.78677 -24162.43111
67 -8162.06801 31009.78677
68 -1648.60995 -8162.06801
69 2587.88749 -1648.60995
70 1671.81348 2587.88749
71 -6420.51554 1671.81348
72 1359.84655 -6420.51554
73 5654.78440 1359.84655
74 -2270.14291 5654.78440
75 4201.79121 -2270.14291
76 -4064.35273 4201.79121
77 150265.40700 -4064.35273
78 -7178.13135 150265.40700
79 -699.00075 -7178.13135
80 -7592.53943 -699.00075
81 -3785.82984 -7592.53943
82 -8611.66947 -3785.82984
83 -7762.44136 -8611.66947
84 8042.83689 -7762.44136
85 -18004.35955 8042.83689
86 17755.45035 -18004.35955
87 1069.41195 17755.45035
88 -18984.96531 1069.41195
89 33041.97919 -18984.96531
90 -23243.75571 33041.97919
91 -5516.64899 -23243.75571
92 -8543.33661 -5516.64899
93 -12852.45873 -8543.33661
94 6796.41024 -12852.45873
95 24084.73386 6796.41024
96 34265.92583 24084.73386
97 22186.24726 34265.92583
98 2067.33999 22186.24726
99 -472.75288 2067.33999
100 32341.57366 -472.75288
101 7088.65019 32341.57366
102 -8092.69465 7088.65019
103 10526.92504 -8092.69465
104 -21363.36862 10526.92504
105 -13165.88748 -21363.36862
106 3977.42235 -13165.88748
107 68.33090 3977.42235
108 117290.82902 68.33090
109 8646.09411 117290.82902
110 16163.81157 8646.09411
111 -13630.83408 16163.81157
112 -16698.98128 -13630.83408
113 -8735.27226 -16698.98128
114 -4981.58679 -8735.27226
115 -21871.82068 -4981.58679
116 -47573.12315 -21871.82068
117 -15386.74083 -47573.12315
118 18957.09445 -15386.74083
119 -13596.04295 18957.09445
120 -22093.18393 -13596.04295
121 42304.72040 -22093.18393
122 35278.18966 42304.72040
123 20029.28219 35278.18966
124 -14787.95847 20029.28219
125 17740.29822 -14787.95847
126 -13054.86511 17740.29822
127 -2506.70738 -13054.86511
128 -19789.22981 -2506.70738
129 -8176.65762 -19789.22981
130 50405.60292 -8176.65762
131 -3502.26040 50405.60292
132 -3585.44196 -3502.26040
133 9177.08998 -3585.44196
134 -3904.08591 9177.08998
135 45653.40344 -3904.08591
136 24183.22343 45653.40344
137 -1332.35119 24183.22343
138 -18263.95866 -1332.35119
139 -25905.98669 -18263.95866
140 21371.33241 -25905.98669
141 -289.77371 21371.33241
142 -72.52195 -289.77371
143 15336.10276 -72.52195
144 -7918.54083 15336.10276
145 38743.40309 -7918.54083
146 29560.89552 38743.40309
147 20339.97673 29560.89552
148 -12766.50808 20339.97673
149 -10881.04112 -12766.50808
150 -12766.50808 -10881.04112
151 -12766.50808 -12766.50808
152 -12766.50808 -12766.50808
153 -12766.50808 -12766.50808
154 -14071.26483 -12766.50808
155 -45343.81203 -14071.26483
156 -12766.50808 -45343.81203
157 -12766.50808 -12766.50808
158 -14126.76746 -12766.50808
159 -17894.67371 -14126.76746
160 -12499.23460 -17894.67371
161 401.40967 -12499.23460
162 -12766.50808 401.40967
163 8689.15567 -12766.50808
> 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/79ykp1321900729.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/8xipw1321900729.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/98h5e1321900729.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/10ux4n1321900729.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/11101o1321900729.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/127uzv1321900729.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/13yunz1321900729.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/14ep6n1321900729.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/15orcl1321900729.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/1692hh1321900729.tab")
+ }
>
> try(system("convert tmp/1zps81321900729.ps tmp/1zps81321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/26dsp1321900729.ps tmp/26dsp1321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/3s4ve1321900729.ps tmp/3s4ve1321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/4m7sa1321900729.ps tmp/4m7sa1321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/5n4vs1321900729.ps tmp/5n4vs1321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/60j171321900729.ps tmp/60j171321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/79ykp1321900729.ps tmp/79ykp1321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/8xipw1321900729.ps tmp/8xipw1321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/98h5e1321900729.ps tmp/98h5e1321900729.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ux4n1321900729.ps tmp/10ux4n1321900729.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.607 0.539 5.221