R version 2.12.1 (2010-12-16)
Copyright (C) 2010 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
+ ,82
+ ,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
+ ,41
+ ,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 = '3'
> library(lattice)
> library(lmtest)
Loading required package: zoo
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Review Grootte Tijd Hyperlinks
1 70 95556 114468 127
2 44 54565 88594 90
3 36 63016 74151 68
4 119 79774 77921 111
5 30 31258 53212 51
6 23 52491 34956 33
7 46 91256 149703 123
8 39 22807 6853 5
9 58 77411 58907 63
10 51 48821 67067 66
11 65 52295 110563 99
12 40 63262 58126 72
13 42 50466 57113 55
14 76 62932 77993 116
15 31 38439 68091 71
16 82 70817 124676 125
17 36 105965 109522 123
18 62 73795 75865 74
19 28 82043 79746 116
20 38 74349 77844 117
21 70 82204 98681 98
22 76 55709 105531 101
23 33 37137 51428 43
24 40 70780 65703 103
25 126 55027 72562 107
26 56 56699 81728 77
27 63 65911 95580 87
28 46 56316 98278 99
29 35 26982 46629 46
30 108 54628 115189 96
31 34 96750 124865 92
32 54 53009 59392 96
33 35 64664 127818 96
34 23 36990 17821 15
35 46 85224 154076 147
36 49 37048 64881 56
37 56 59635 136506 81
38 38 42051 66524 69
39 19 26998 45988 34
40 29 63717 107445 98
41 26 55071 102772 82
42 52 40001 46657 64
43 54 54506 97563 61
44 45 35838 36663 45
45 56 50838 55369 37
46 596 86997 77921 64
47 57 33032 56968 21
48 55 61704 77519 104
49 99 117986 129805 126
50 51 56733 72761 104
51 21 55064 81278 87
52 20 5950 15049 7
53 58 84607 113935 130
54 21 32551 25109 21
55 66 31701 45824 35
56 47 71170 89644 97
57 55 101773 109011 103
58 158 101653 134245 210
59 46 81493 136692 151
60 45 55901 50741 57
61 46 109104 149510 117
62 117 114425 147888 152
63 56 36311 54987 52
64 30 70027 74467 83
65 45 73713 100033 87
66 38 40671 85505 80
67 33 89041 62426 88
68 61 57231 82932 83
69 63 68608 72002 120
70 41 59155 65469 76
71 33 55827 63572 70
72 36 22618 23824 26
73 35 58425 73831 66
74 73 65724 63551 89
75 46 56979 56756 100
76 54 72369 81399 98
77 24 79194 117881 109
78 27 202316 70711 51
79 32 44970 50495 82
80 52 49319 53845 65
81 31 36252 51390 46
82 89 75741 104953 104
83 36 38417 65983 36
84 37 64102 76839 123
85 31 56622 55792 59
86 142 15430 25155 27
87 44 72571 55291 84
88 222 67271 84279 61
89 52 43460 99692 46
90 51 99501 59633 125
91 45 28340 63249 58
92 51 76013 82928 152
93 64 37361 50000 52
94 66 48204 69455 85
95 81 76168 84068 95
96 43 85168 76195 78
97 45 125410 114634 144
98 35 123328 139357 149
99 97 83038 110044 101
100 41 120087 155118 205
101 44 91939 83061 61
102 61 103646 127122 145
103 35 29467 45653 28
104 43 43750 19630 49
105 57 34497 67229 68
106 32 66477 86060 142
107 66 71181 88003 82
108 32 74482 95815 105
109 24 174949 85499 52
110 55 46765 27220 56
111 38 90257 109882 81
112 43 51370 72579 100
113 9 1168 5841 11
114 36 51360 68369 87
115 25 25162 24610 31
116 78 21067 30995 67
117 42 58233 150662 150
118 2 855 6622 4
119 41 85903 93694 75
120 22 14116 13155 39
121 131 57637 111908 88
122 51 94137 57550 67
123 67 62147 16356 24
124 38 62832 40174 58
125 52 8773 13983 16
126 64 63785 52316 49
127 75 65196 99585 109
128 37 73087 86271 124
129 107 72631 131012 115
130 84 86281 130274 128
131 68 162365 159051 159
132 30 56530 76506 75
133 31 35606 49145 30
134 109 70111 66398 83
135 108 92046 127546 135
136 33 63989 6802 8
137 106 104911 99509 115
138 50 43448 43106 60
139 52 60029 108303 99
140 134 38650 64167 98
141 39 47261 8579 36
142 78 73586 97811 93
143 40 83042 84365 158
144 37 37238 10901 16
145 41 63958 91346 100
146 95 78956 33660 49
147 37 99518 93634 89
148 38 111436 109348 153
149 0 0 0 0
150 0 6023 7953 5
151 0 0 0 0
152 0 0 0 0
153 0 0 0 0
154 0 0 0 0
155 36 42564 63538 80
156 65 38885 108281 122
157 0 0 0 0
158 0 0 0 0
159 0 1644 4245 6
160 7 6179 21509 13
161 3 3926 7670 3
162 53 23238 10641 18
163 0 0 0 0
164 25 49288 41243 49
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Grootte Tijd Hyperlinks
2.488e+01 1.806e-04 2.267e-04 2.005e-02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-52.90 -22.41 -9.94 7.26 536.46
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.488e+01 8.806e+00 2.825 0.00532 **
Grootte 1.806e-04 1.806e-04 1.000 0.31881
Tijd 2.267e-04 2.138e-04 1.061 0.29043
Hyperlinks 2.005e-02 1.894e-01 0.106 0.91580
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 51.78 on 160 degrees of freedom
Multiple R-squared: 0.07705, Adjusted R-squared: 0.05974
F-statistic: 4.452 on 3 and 160 DF, p-value: 0.004931
> 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.115166e-02 6.230332e-02 9.688483e-01
[2,] 1.904084e-02 3.808168e-02 9.809592e-01
[3,] 5.230523e-03 1.046105e-02 9.947695e-01
[4,] 1.455707e-03 2.911415e-03 9.985443e-01
[5,] 8.661282e-04 1.732256e-03 9.991339e-01
[6,] 7.430692e-04 1.486138e-03 9.992569e-01
[7,] 2.102629e-04 4.205259e-04 9.997897e-01
[8,] 1.339356e-04 2.678711e-04 9.998661e-01
[9,] 5.982811e-05 1.196562e-04 9.999402e-01
[10,] 2.740005e-05 5.480010e-05 9.999726e-01
[11,] 6.506069e-05 1.301214e-04 9.999349e-01
[12,] 3.212477e-05 6.424953e-05 9.999679e-01
[13,] 1.308355e-04 2.616710e-04 9.998692e-01
[14,] 1.072807e-04 2.145613e-04 9.998927e-01
[15,] 5.338477e-05 1.067695e-04 9.999466e-01
[16,] 2.771045e-05 5.542090e-05 9.999723e-01
[17,] 1.092534e-05 2.185067e-05 9.999891e-01
[18,] 5.454873e-06 1.090975e-05 9.999945e-01
[19,] 3.999335e-05 7.998671e-05 9.999600e-01
[20,] 1.720257e-05 3.440514e-05 9.999828e-01
[21,] 7.733138e-06 1.546628e-05 9.999923e-01
[22,] 3.878852e-06 7.757704e-06 9.999961e-01
[23,] 1.686075e-06 3.372150e-06 9.999983e-01
[24,] 3.462343e-06 6.924686e-06 9.999965e-01
[25,] 1.599810e-06 3.199619e-06 9.999984e-01
[26,] 7.193607e-07 1.438721e-06 9.999993e-01
[27,] 4.491296e-07 8.982591e-07 9.999996e-01
[28,] 1.809346e-07 3.618692e-07 9.999998e-01
[29,] 1.417373e-07 2.834747e-07 9.999999e-01
[30,] 5.615120e-08 1.123024e-07 9.999999e-01
[31,] 2.389887e-08 4.779774e-08 1.000000e+00
[32,] 1.096331e-08 2.192663e-08 1.000000e+00
[33,] 5.816310e-09 1.163262e-08 1.000000e+00
[34,] 4.286137e-09 8.572275e-09 1.000000e+00
[35,] 2.654551e-09 5.309101e-09 1.000000e+00
[36,] 1.004955e-09 2.009910e-09 1.000000e+00
[37,] 4.735335e-10 9.470670e-10 1.000000e+00
[38,] 1.753380e-10 3.506760e-10 1.000000e+00
[39,] 1.049298e-10 2.098597e-10 1.000000e+00
[40,] 1.000000e+00 5.747470e-16 2.873735e-16
[41,] 1.000000e+00 1.400094e-15 7.000471e-16
[42,] 1.000000e+00 3.599904e-15 1.799952e-15
[43,] 1.000000e+00 5.873210e-15 2.936605e-15
[44,] 1.000000e+00 1.452971e-14 7.264857e-15
[45,] 1.000000e+00 2.358029e-14 1.179015e-14
[46,] 1.000000e+00 5.683921e-14 2.841960e-14
[47,] 1.000000e+00 1.315633e-13 6.578167e-14
[48,] 1.000000e+00 2.606945e-13 1.303473e-13
[49,] 1.000000e+00 4.791534e-13 2.395767e-13
[50,] 1.000000e+00 1.021533e-12 5.107665e-13
[51,] 1.000000e+00 1.492252e-12 7.461258e-13
[52,] 1.000000e+00 1.997965e-13 9.989823e-14
[53,] 1.000000e+00 3.598997e-13 1.799498e-13
[54,] 1.000000e+00 7.918236e-13 3.959118e-13
[55,] 1.000000e+00 8.888317e-13 4.444159e-13
[56,] 1.000000e+00 1.323884e-12 6.619419e-13
[57,] 1.000000e+00 2.857187e-12 1.428594e-12
[58,] 1.000000e+00 4.590201e-12 2.295100e-12
[59,] 1.000000e+00 8.865176e-12 4.432588e-12
[60,] 1.000000e+00 1.758404e-11 8.792022e-12
[61,] 1.000000e+00 2.411604e-11 1.205802e-11
[62,] 1.000000e+00 5.222667e-11 2.611333e-11
[63,] 1.000000e+00 1.083082e-10 5.415412e-11
[64,] 1.000000e+00 2.192600e-10 1.096300e-10
[65,] 1.000000e+00 4.104482e-10 2.052241e-10
[66,] 1.000000e+00 8.551343e-10 4.275672e-10
[67,] 1.000000e+00 1.538238e-09 7.691192e-10
[68,] 1.000000e+00 2.651859e-09 1.325929e-09
[69,] 1.000000e+00 5.324470e-09 2.662235e-09
[70,] 1.000000e+00 1.043272e-08 5.216359e-09
[71,] 1.000000e+00 1.029106e-08 5.145528e-09
[72,] 1.000000e+00 5.166087e-09 2.583043e-09
[73,] 1.000000e+00 9.792090e-09 4.896045e-09
[74,] 1.000000e+00 1.918327e-08 9.591637e-09
[75,] 1.000000e+00 3.530638e-08 1.765319e-08
[76,] 1.000000e+00 5.762098e-08 2.881049e-08
[77,] 9.999999e-01 1.030744e-07 5.153720e-08
[78,] 9.999999e-01 1.783913e-07 8.919565e-08
[79,] 9.999998e-01 3.068513e-07 1.534256e-07
[80,] 1.000000e+00 1.441486e-08 7.207430e-09
[81,] 1.000000e+00 2.816268e-08 1.408134e-08
[82,] 1.000000e+00 3.075050e-13 1.537525e-13
[83,] 1.000000e+00 7.616005e-13 3.808002e-13
[84,] 1.000000e+00 1.826793e-12 9.133963e-13
[85,] 1.000000e+00 4.422620e-12 2.211310e-12
[86,] 1.000000e+00 1.019226e-11 5.096130e-12
[87,] 1.000000e+00 1.816422e-11 9.082109e-12
[88,] 1.000000e+00 3.655058e-11 1.827529e-11
[89,] 1.000000e+00 5.982735e-11 2.991368e-11
[90,] 1.000000e+00 1.299621e-10 6.498103e-11
[91,] 1.000000e+00 2.108789e-10 1.054394e-10
[92,] 1.000000e+00 1.830276e-10 9.151379e-11
[93,] 1.000000e+00 2.330679e-10 1.165340e-10
[94,] 1.000000e+00 1.409462e-10 7.047311e-11
[95,] 1.000000e+00 3.085951e-10 1.542975e-10
[96,] 1.000000e+00 6.120860e-10 3.060430e-10
[97,] 1.000000e+00 1.372878e-09 6.864391e-10
[98,] 1.000000e+00 2.971758e-09 1.485879e-09
[99,] 1.000000e+00 6.177851e-09 3.088926e-09
[100,] 1.000000e+00 6.878151e-09 3.439076e-09
[101,] 1.000000e+00 1.429584e-08 7.147921e-09
[102,] 1.000000e+00 1.928395e-08 9.641973e-09
[103,] 1.000000e+00 1.671305e-08 8.356525e-09
[104,] 1.000000e+00 3.281443e-08 1.640722e-08
[105,] 1.000000e+00 4.607235e-08 2.303617e-08
[106,] 1.000000e+00 9.396151e-08 4.698076e-08
[107,] 9.999999e-01 1.876746e-07 9.383732e-08
[108,] 9.999998e-01 3.495167e-07 1.747584e-07
[109,] 9.999996e-01 7.122012e-07 3.561006e-07
[110,] 9.999997e-01 5.887819e-07 2.943909e-07
[111,] 9.999997e-01 6.009850e-07 3.004925e-07
[112,] 9.999995e-01 1.098262e-06 5.491312e-07
[113,] 9.999992e-01 1.560799e-06 7.803993e-07
[114,] 9.999984e-01 3.194206e-06 1.597103e-06
[115,] 9.999995e-01 9.117690e-07 4.558845e-07
[116,] 9.999991e-01 1.892469e-06 9.462344e-07
[117,] 9.999988e-01 2.478392e-06 1.239196e-06
[118,] 9.999974e-01 5.138187e-06 2.569094e-06
[119,] 9.999968e-01 6.446856e-06 3.223428e-06
[120,] 9.999943e-01 1.130524e-05 5.652621e-06
[121,] 9.999890e-01 2.200792e-05 1.100396e-05
[122,] 9.999852e-01 2.954853e-05 1.477426e-05
[123,] 9.999850e-01 3.001100e-05 1.500550e-05
[124,] 9.999713e-01 5.736130e-05 2.868065e-05
[125,] 9.999738e-01 5.243008e-05 2.621504e-05
[126,] 9.999580e-01 8.393866e-05 4.196933e-05
[127,] 9.999155e-01 1.690712e-04 8.453561e-05
[128,] 9.999522e-01 9.553978e-05 4.776989e-05
[129,] 9.999362e-01 1.276758e-04 6.383790e-05
[130,] 9.998674e-01 2.652909e-04 1.326455e-04
[131,] 9.998450e-01 3.099641e-04 1.549821e-04
[132,] 9.997057e-01 5.886608e-04 2.943304e-04
[133,] 9.994075e-01 1.185002e-03 5.925009e-04
[134,] 9.999985e-01 2.951400e-06 1.475700e-06
[135,] 9.999963e-01 7.409855e-06 3.704928e-06
[136,] 9.999949e-01 1.011098e-05 5.055492e-06
[137,] 9.999888e-01 2.248742e-05 1.124371e-05
[138,] 9.999725e-01 5.491565e-05 2.745782e-05
[139,] 9.999246e-01 1.508245e-04 7.541224e-05
[140,] 9.999994e-01 1.286438e-06 6.432190e-07
[141,] 9.999975e-01 4.995804e-06 2.497902e-06
[142,] 9.999994e-01 1.131602e-06 5.658010e-07
[143,] 9.999974e-01 5.254598e-06 2.627299e-06
[144,] 9.999886e-01 2.289873e-05 1.144937e-05
[145,] 9.999510e-01 9.796772e-05 4.898386e-05
[146,] 9.998005e-01 3.989307e-04 1.994654e-04
[147,] 9.992315e-01 1.537045e-03 7.685227e-04
[148,] 9.972188e-01 5.562382e-03 2.781191e-03
[149,] 9.939686e-01 1.206281e-02 6.031403e-03
[150,] 9.879422e-01 2.411559e-02 1.205780e-02
[151,] 9.578586e-01 8.428277e-02 4.214139e-02
> postscript(file="/var/www/rcomp/tmp/1vceq1321899929.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/www/rcomp/tmp/2j5n41321899929.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/www/rcomp/tmp/3x12c1321899929.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/www/rcomp/tmp/489kc1321899929.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/www/rcomp/tmp/5ztgt1321899929.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
-0.6378440 -12.6260641 -18.4365015 59.8198076 -13.6122659 -19.9469113
7 8 9 10 11 12
-31.7699910 8.3476469 4.5202418 0.7735207 3.6223211 -10.9277298
13 14 15 16 17 18
-6.0460880 19.7450210 -17.6838454 13.5558258 -35.3161564 5.1077840
19 20 21 22 23 24
-32.1040461 -20.3032517 5.9346184 15.1065448 -11.1091450 -14.6251436
25 26 27 28 29 30
72.5845965 0.8059609 2.8009505 -13.3184768 -6.2471311 45.2122492
31 32 33 34 35 36
-38.5089944 4.1557321 -32.4637582 -12.9012657 -32.1533387 1.5959894
37 38 39 40 41 42
-12.2245524 -10.9408041 -21.8640503 -33.7135757 -33.7716641 8.0342317
43 44 45 46 47 48
-4.0674533 4.4330872 8.6431010 536.4577585 12.8173075 -0.6850861
49 50 51 52 53 54
20.8537482 -2.7084825 -33.9972429 -9.5062592 -10.5996747 -15.8723007
55 56 57 58 59 60
24.3036812 -13.0035030 -15.0421292 80.1124834 -27.6181568 -2.6230498
61 62 63 64 65 66
-34.8294085 34.8754886 11.0526154 -26.0751859 -17.6178009 -15.2157846
67 68 69 70 71 72
-23.8794291 5.3165725 6.9980413 -10.9310914 -17.7795960 1.1127691
73 74 75 76 77 78
-18.4946690 20.0566826 -4.0438227 -4.3706830 -44.0956256 -51.4743537
79 80 81 82 83 84
-14.0943666 4.7015079 -13.0008494 24.5594960 -11.5000672 -19.3450093
85 86 87 88 89 90
-17.9386075 108.0891446 -8.2068542 164.6390185 -4.2543797 -7.8772773
91 92 93 94 95 96
-0.5013506 -9.4583489 19.9936994 14.9625111 21.3981920 -16.1013061
97 98 99 100 101 102
-31.4082559 -46.7380392 30.1474540 -44.8492023 -17.5400614 -14.3290075
103 104 105 106 107 108
-6.1136988 4.7858648 9.2837152 -27.2456721 6.6673734 -30.1612756
109 110 111 112 113 114
-52.9046460 14.3800501 -29.7185685 -9.6184041 -17.6350355 -15.4013608
115 116 117 118 119 120
-10.6251752 40.9448161 -30.5646326 -24.6152146 -22.1415132 -9.1933621
121 122 123 124 125 126
68.5731363 -5.2731435 26.7068648 -8.4989993 22.0451069 14.7563522
127 128 129 130 131 132
13.5808530 -23.1263817 36.9921442 11.4334857 -25.4542679 -23.9394056
133 134 135 136 137 138
-12.0543132 54.7391599 34.8704403 -5.1387531 37.3049151 6.2970192
139 140 141 142 143 144
-10.2620835 85.6263239 2.9180742 15.7886223 -22.1739774 2.6028901
145 146 147 148 149 150
-18.1470169 47.2462959 -28.8676289 -34.8663972 -24.8791505 -27.8704333
151 152 153 154 155 156
-24.8791505 -24.8791505 -24.8791505 -24.8791505 -12.5770095 6.1004681
157 158 159 160 161 162
-24.8791505 -24.8791505 -26.2588733 -24.1326373 -24.3874266 21.1502494
163 164
-24.8791505 -19.1147456
> postscript(file="/var/www/rcomp/tmp/6qpls1321899929.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 -0.6378440 NA
1 -12.6260641 -0.6378440
2 -18.4365015 -12.6260641
3 59.8198076 -18.4365015
4 -13.6122659 59.8198076
5 -19.9469113 -13.6122659
6 -31.7699910 -19.9469113
7 8.3476469 -31.7699910
8 4.5202418 8.3476469
9 0.7735207 4.5202418
10 3.6223211 0.7735207
11 -10.9277298 3.6223211
12 -6.0460880 -10.9277298
13 19.7450210 -6.0460880
14 -17.6838454 19.7450210
15 13.5558258 -17.6838454
16 -35.3161564 13.5558258
17 5.1077840 -35.3161564
18 -32.1040461 5.1077840
19 -20.3032517 -32.1040461
20 5.9346184 -20.3032517
21 15.1065448 5.9346184
22 -11.1091450 15.1065448
23 -14.6251436 -11.1091450
24 72.5845965 -14.6251436
25 0.8059609 72.5845965
26 2.8009505 0.8059609
27 -13.3184768 2.8009505
28 -6.2471311 -13.3184768
29 45.2122492 -6.2471311
30 -38.5089944 45.2122492
31 4.1557321 -38.5089944
32 -32.4637582 4.1557321
33 -12.9012657 -32.4637582
34 -32.1533387 -12.9012657
35 1.5959894 -32.1533387
36 -12.2245524 1.5959894
37 -10.9408041 -12.2245524
38 -21.8640503 -10.9408041
39 -33.7135757 -21.8640503
40 -33.7716641 -33.7135757
41 8.0342317 -33.7716641
42 -4.0674533 8.0342317
43 4.4330872 -4.0674533
44 8.6431010 4.4330872
45 536.4577585 8.6431010
46 12.8173075 536.4577585
47 -0.6850861 12.8173075
48 20.8537482 -0.6850861
49 -2.7084825 20.8537482
50 -33.9972429 -2.7084825
51 -9.5062592 -33.9972429
52 -10.5996747 -9.5062592
53 -15.8723007 -10.5996747
54 24.3036812 -15.8723007
55 -13.0035030 24.3036812
56 -15.0421292 -13.0035030
57 80.1124834 -15.0421292
58 -27.6181568 80.1124834
59 -2.6230498 -27.6181568
60 -34.8294085 -2.6230498
61 34.8754886 -34.8294085
62 11.0526154 34.8754886
63 -26.0751859 11.0526154
64 -17.6178009 -26.0751859
65 -15.2157846 -17.6178009
66 -23.8794291 -15.2157846
67 5.3165725 -23.8794291
68 6.9980413 5.3165725
69 -10.9310914 6.9980413
70 -17.7795960 -10.9310914
71 1.1127691 -17.7795960
72 -18.4946690 1.1127691
73 20.0566826 -18.4946690
74 -4.0438227 20.0566826
75 -4.3706830 -4.0438227
76 -44.0956256 -4.3706830
77 -51.4743537 -44.0956256
78 -14.0943666 -51.4743537
79 4.7015079 -14.0943666
80 -13.0008494 4.7015079
81 24.5594960 -13.0008494
82 -11.5000672 24.5594960
83 -19.3450093 -11.5000672
84 -17.9386075 -19.3450093
85 108.0891446 -17.9386075
86 -8.2068542 108.0891446
87 164.6390185 -8.2068542
88 -4.2543797 164.6390185
89 -7.8772773 -4.2543797
90 -0.5013506 -7.8772773
91 -9.4583489 -0.5013506
92 19.9936994 -9.4583489
93 14.9625111 19.9936994
94 21.3981920 14.9625111
95 -16.1013061 21.3981920
96 -31.4082559 -16.1013061
97 -46.7380392 -31.4082559
98 30.1474540 -46.7380392
99 -44.8492023 30.1474540
100 -17.5400614 -44.8492023
101 -14.3290075 -17.5400614
102 -6.1136988 -14.3290075
103 4.7858648 -6.1136988
104 9.2837152 4.7858648
105 -27.2456721 9.2837152
106 6.6673734 -27.2456721
107 -30.1612756 6.6673734
108 -52.9046460 -30.1612756
109 14.3800501 -52.9046460
110 -29.7185685 14.3800501
111 -9.6184041 -29.7185685
112 -17.6350355 -9.6184041
113 -15.4013608 -17.6350355
114 -10.6251752 -15.4013608
115 40.9448161 -10.6251752
116 -30.5646326 40.9448161
117 -24.6152146 -30.5646326
118 -22.1415132 -24.6152146
119 -9.1933621 -22.1415132
120 68.5731363 -9.1933621
121 -5.2731435 68.5731363
122 26.7068648 -5.2731435
123 -8.4989993 26.7068648
124 22.0451069 -8.4989993
125 14.7563522 22.0451069
126 13.5808530 14.7563522
127 -23.1263817 13.5808530
128 36.9921442 -23.1263817
129 11.4334857 36.9921442
130 -25.4542679 11.4334857
131 -23.9394056 -25.4542679
132 -12.0543132 -23.9394056
133 54.7391599 -12.0543132
134 34.8704403 54.7391599
135 -5.1387531 34.8704403
136 37.3049151 -5.1387531
137 6.2970192 37.3049151
138 -10.2620835 6.2970192
139 85.6263239 -10.2620835
140 2.9180742 85.6263239
141 15.7886223 2.9180742
142 -22.1739774 15.7886223
143 2.6028901 -22.1739774
144 -18.1470169 2.6028901
145 47.2462959 -18.1470169
146 -28.8676289 47.2462959
147 -34.8663972 -28.8676289
148 -24.8791505 -34.8663972
149 -27.8704333 -24.8791505
150 -24.8791505 -27.8704333
151 -24.8791505 -24.8791505
152 -24.8791505 -24.8791505
153 -24.8791505 -24.8791505
154 -12.5770095 -24.8791505
155 6.1004681 -12.5770095
156 -24.8791505 6.1004681
157 -24.8791505 -24.8791505
158 -26.2588733 -24.8791505
159 -24.1326373 -26.2588733
160 -24.3874266 -24.1326373
161 21.1502494 -24.3874266
162 -24.8791505 21.1502494
163 -19.1147456 -24.8791505
164 NA -19.1147456
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -12.6260641 -0.6378440
[2,] -18.4365015 -12.6260641
[3,] 59.8198076 -18.4365015
[4,] -13.6122659 59.8198076
[5,] -19.9469113 -13.6122659
[6,] -31.7699910 -19.9469113
[7,] 8.3476469 -31.7699910
[8,] 4.5202418 8.3476469
[9,] 0.7735207 4.5202418
[10,] 3.6223211 0.7735207
[11,] -10.9277298 3.6223211
[12,] -6.0460880 -10.9277298
[13,] 19.7450210 -6.0460880
[14,] -17.6838454 19.7450210
[15,] 13.5558258 -17.6838454
[16,] -35.3161564 13.5558258
[17,] 5.1077840 -35.3161564
[18,] -32.1040461 5.1077840
[19,] -20.3032517 -32.1040461
[20,] 5.9346184 -20.3032517
[21,] 15.1065448 5.9346184
[22,] -11.1091450 15.1065448
[23,] -14.6251436 -11.1091450
[24,] 72.5845965 -14.6251436
[25,] 0.8059609 72.5845965
[26,] 2.8009505 0.8059609
[27,] -13.3184768 2.8009505
[28,] -6.2471311 -13.3184768
[29,] 45.2122492 -6.2471311
[30,] -38.5089944 45.2122492
[31,] 4.1557321 -38.5089944
[32,] -32.4637582 4.1557321
[33,] -12.9012657 -32.4637582
[34,] -32.1533387 -12.9012657
[35,] 1.5959894 -32.1533387
[36,] -12.2245524 1.5959894
[37,] -10.9408041 -12.2245524
[38,] -21.8640503 -10.9408041
[39,] -33.7135757 -21.8640503
[40,] -33.7716641 -33.7135757
[41,] 8.0342317 -33.7716641
[42,] -4.0674533 8.0342317
[43,] 4.4330872 -4.0674533
[44,] 8.6431010 4.4330872
[45,] 536.4577585 8.6431010
[46,] 12.8173075 536.4577585
[47,] -0.6850861 12.8173075
[48,] 20.8537482 -0.6850861
[49,] -2.7084825 20.8537482
[50,] -33.9972429 -2.7084825
[51,] -9.5062592 -33.9972429
[52,] -10.5996747 -9.5062592
[53,] -15.8723007 -10.5996747
[54,] 24.3036812 -15.8723007
[55,] -13.0035030 24.3036812
[56,] -15.0421292 -13.0035030
[57,] 80.1124834 -15.0421292
[58,] -27.6181568 80.1124834
[59,] -2.6230498 -27.6181568
[60,] -34.8294085 -2.6230498
[61,] 34.8754886 -34.8294085
[62,] 11.0526154 34.8754886
[63,] -26.0751859 11.0526154
[64,] -17.6178009 -26.0751859
[65,] -15.2157846 -17.6178009
[66,] -23.8794291 -15.2157846
[67,] 5.3165725 -23.8794291
[68,] 6.9980413 5.3165725
[69,] -10.9310914 6.9980413
[70,] -17.7795960 -10.9310914
[71,] 1.1127691 -17.7795960
[72,] -18.4946690 1.1127691
[73,] 20.0566826 -18.4946690
[74,] -4.0438227 20.0566826
[75,] -4.3706830 -4.0438227
[76,] -44.0956256 -4.3706830
[77,] -51.4743537 -44.0956256
[78,] -14.0943666 -51.4743537
[79,] 4.7015079 -14.0943666
[80,] -13.0008494 4.7015079
[81,] 24.5594960 -13.0008494
[82,] -11.5000672 24.5594960
[83,] -19.3450093 -11.5000672
[84,] -17.9386075 -19.3450093
[85,] 108.0891446 -17.9386075
[86,] -8.2068542 108.0891446
[87,] 164.6390185 -8.2068542
[88,] -4.2543797 164.6390185
[89,] -7.8772773 -4.2543797
[90,] -0.5013506 -7.8772773
[91,] -9.4583489 -0.5013506
[92,] 19.9936994 -9.4583489
[93,] 14.9625111 19.9936994
[94,] 21.3981920 14.9625111
[95,] -16.1013061 21.3981920
[96,] -31.4082559 -16.1013061
[97,] -46.7380392 -31.4082559
[98,] 30.1474540 -46.7380392
[99,] -44.8492023 30.1474540
[100,] -17.5400614 -44.8492023
[101,] -14.3290075 -17.5400614
[102,] -6.1136988 -14.3290075
[103,] 4.7858648 -6.1136988
[104,] 9.2837152 4.7858648
[105,] -27.2456721 9.2837152
[106,] 6.6673734 -27.2456721
[107,] -30.1612756 6.6673734
[108,] -52.9046460 -30.1612756
[109,] 14.3800501 -52.9046460
[110,] -29.7185685 14.3800501
[111,] -9.6184041 -29.7185685
[112,] -17.6350355 -9.6184041
[113,] -15.4013608 -17.6350355
[114,] -10.6251752 -15.4013608
[115,] 40.9448161 -10.6251752
[116,] -30.5646326 40.9448161
[117,] -24.6152146 -30.5646326
[118,] -22.1415132 -24.6152146
[119,] -9.1933621 -22.1415132
[120,] 68.5731363 -9.1933621
[121,] -5.2731435 68.5731363
[122,] 26.7068648 -5.2731435
[123,] -8.4989993 26.7068648
[124,] 22.0451069 -8.4989993
[125,] 14.7563522 22.0451069
[126,] 13.5808530 14.7563522
[127,] -23.1263817 13.5808530
[128,] 36.9921442 -23.1263817
[129,] 11.4334857 36.9921442
[130,] -25.4542679 11.4334857
[131,] -23.9394056 -25.4542679
[132,] -12.0543132 -23.9394056
[133,] 54.7391599 -12.0543132
[134,] 34.8704403 54.7391599
[135,] -5.1387531 34.8704403
[136,] 37.3049151 -5.1387531
[137,] 6.2970192 37.3049151
[138,] -10.2620835 6.2970192
[139,] 85.6263239 -10.2620835
[140,] 2.9180742 85.6263239
[141,] 15.7886223 2.9180742
[142,] -22.1739774 15.7886223
[143,] 2.6028901 -22.1739774
[144,] -18.1470169 2.6028901
[145,] 47.2462959 -18.1470169
[146,] -28.8676289 47.2462959
[147,] -34.8663972 -28.8676289
[148,] -24.8791505 -34.8663972
[149,] -27.8704333 -24.8791505
[150,] -24.8791505 -27.8704333
[151,] -24.8791505 -24.8791505
[152,] -24.8791505 -24.8791505
[153,] -24.8791505 -24.8791505
[154,] -12.5770095 -24.8791505
[155,] 6.1004681 -12.5770095
[156,] -24.8791505 6.1004681
[157,] -24.8791505 -24.8791505
[158,] -26.2588733 -24.8791505
[159,] -24.1326373 -26.2588733
[160,] -24.3874266 -24.1326373
[161,] 21.1502494 -24.3874266
[162,] -24.8791505 21.1502494
[163,] -19.1147456 -24.8791505
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -12.6260641 -0.6378440
2 -18.4365015 -12.6260641
3 59.8198076 -18.4365015
4 -13.6122659 59.8198076
5 -19.9469113 -13.6122659
6 -31.7699910 -19.9469113
7 8.3476469 -31.7699910
8 4.5202418 8.3476469
9 0.7735207 4.5202418
10 3.6223211 0.7735207
11 -10.9277298 3.6223211
12 -6.0460880 -10.9277298
13 19.7450210 -6.0460880
14 -17.6838454 19.7450210
15 13.5558258 -17.6838454
16 -35.3161564 13.5558258
17 5.1077840 -35.3161564
18 -32.1040461 5.1077840
19 -20.3032517 -32.1040461
20 5.9346184 -20.3032517
21 15.1065448 5.9346184
22 -11.1091450 15.1065448
23 -14.6251436 -11.1091450
24 72.5845965 -14.6251436
25 0.8059609 72.5845965
26 2.8009505 0.8059609
27 -13.3184768 2.8009505
28 -6.2471311 -13.3184768
29 45.2122492 -6.2471311
30 -38.5089944 45.2122492
31 4.1557321 -38.5089944
32 -32.4637582 4.1557321
33 -12.9012657 -32.4637582
34 -32.1533387 -12.9012657
35 1.5959894 -32.1533387
36 -12.2245524 1.5959894
37 -10.9408041 -12.2245524
38 -21.8640503 -10.9408041
39 -33.7135757 -21.8640503
40 -33.7716641 -33.7135757
41 8.0342317 -33.7716641
42 -4.0674533 8.0342317
43 4.4330872 -4.0674533
44 8.6431010 4.4330872
45 536.4577585 8.6431010
46 12.8173075 536.4577585
47 -0.6850861 12.8173075
48 20.8537482 -0.6850861
49 -2.7084825 20.8537482
50 -33.9972429 -2.7084825
51 -9.5062592 -33.9972429
52 -10.5996747 -9.5062592
53 -15.8723007 -10.5996747
54 24.3036812 -15.8723007
55 -13.0035030 24.3036812
56 -15.0421292 -13.0035030
57 80.1124834 -15.0421292
58 -27.6181568 80.1124834
59 -2.6230498 -27.6181568
60 -34.8294085 -2.6230498
61 34.8754886 -34.8294085
62 11.0526154 34.8754886
63 -26.0751859 11.0526154
64 -17.6178009 -26.0751859
65 -15.2157846 -17.6178009
66 -23.8794291 -15.2157846
67 5.3165725 -23.8794291
68 6.9980413 5.3165725
69 -10.9310914 6.9980413
70 -17.7795960 -10.9310914
71 1.1127691 -17.7795960
72 -18.4946690 1.1127691
73 20.0566826 -18.4946690
74 -4.0438227 20.0566826
75 -4.3706830 -4.0438227
76 -44.0956256 -4.3706830
77 -51.4743537 -44.0956256
78 -14.0943666 -51.4743537
79 4.7015079 -14.0943666
80 -13.0008494 4.7015079
81 24.5594960 -13.0008494
82 -11.5000672 24.5594960
83 -19.3450093 -11.5000672
84 -17.9386075 -19.3450093
85 108.0891446 -17.9386075
86 -8.2068542 108.0891446
87 164.6390185 -8.2068542
88 -4.2543797 164.6390185
89 -7.8772773 -4.2543797
90 -0.5013506 -7.8772773
91 -9.4583489 -0.5013506
92 19.9936994 -9.4583489
93 14.9625111 19.9936994
94 21.3981920 14.9625111
95 -16.1013061 21.3981920
96 -31.4082559 -16.1013061
97 -46.7380392 -31.4082559
98 30.1474540 -46.7380392
99 -44.8492023 30.1474540
100 -17.5400614 -44.8492023
101 -14.3290075 -17.5400614
102 -6.1136988 -14.3290075
103 4.7858648 -6.1136988
104 9.2837152 4.7858648
105 -27.2456721 9.2837152
106 6.6673734 -27.2456721
107 -30.1612756 6.6673734
108 -52.9046460 -30.1612756
109 14.3800501 -52.9046460
110 -29.7185685 14.3800501
111 -9.6184041 -29.7185685
112 -17.6350355 -9.6184041
113 -15.4013608 -17.6350355
114 -10.6251752 -15.4013608
115 40.9448161 -10.6251752
116 -30.5646326 40.9448161
117 -24.6152146 -30.5646326
118 -22.1415132 -24.6152146
119 -9.1933621 -22.1415132
120 68.5731363 -9.1933621
121 -5.2731435 68.5731363
122 26.7068648 -5.2731435
123 -8.4989993 26.7068648
124 22.0451069 -8.4989993
125 14.7563522 22.0451069
126 13.5808530 14.7563522
127 -23.1263817 13.5808530
128 36.9921442 -23.1263817
129 11.4334857 36.9921442
130 -25.4542679 11.4334857
131 -23.9394056 -25.4542679
132 -12.0543132 -23.9394056
133 54.7391599 -12.0543132
134 34.8704403 54.7391599
135 -5.1387531 34.8704403
136 37.3049151 -5.1387531
137 6.2970192 37.3049151
138 -10.2620835 6.2970192
139 85.6263239 -10.2620835
140 2.9180742 85.6263239
141 15.7886223 2.9180742
142 -22.1739774 15.7886223
143 2.6028901 -22.1739774
144 -18.1470169 2.6028901
145 47.2462959 -18.1470169
146 -28.8676289 47.2462959
147 -34.8663972 -28.8676289
148 -24.8791505 -34.8663972
149 -27.8704333 -24.8791505
150 -24.8791505 -27.8704333
151 -24.8791505 -24.8791505
152 -24.8791505 -24.8791505
153 -24.8791505 -24.8791505
154 -12.5770095 -24.8791505
155 6.1004681 -12.5770095
156 -24.8791505 6.1004681
157 -24.8791505 -24.8791505
158 -26.2588733 -24.8791505
159 -24.1326373 -26.2588733
160 -24.3874266 -24.1326373
161 21.1502494 -24.3874266
162 -24.8791505 21.1502494
163 -19.1147456 -24.8791505
> 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/www/rcomp/tmp/7xbtq1321899929.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/www/rcomp/tmp/86sg11321899929.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/www/rcomp/tmp/95vrp1321899929.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/www/rcomp/tmp/100etx1321899929.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/www/rcomp/tmp/11gwao1321899929.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/www/rcomp/tmp/125u151321899929.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/www/rcomp/tmp/13nize1321899929.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/www/rcomp/tmp/147k641321899929.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/www/rcomp/tmp/15vzv21321899929.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/www/rcomp/tmp/16sb3x1321899929.tab")
+ }
>
> try(system("convert tmp/1vceq1321899929.ps tmp/1vceq1321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/2j5n41321899929.ps tmp/2j5n41321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/3x12c1321899929.ps tmp/3x12c1321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/489kc1321899929.ps tmp/489kc1321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ztgt1321899929.ps tmp/5ztgt1321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/6qpls1321899929.ps tmp/6qpls1321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xbtq1321899929.ps tmp/7xbtq1321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/86sg11321899929.ps tmp/86sg11321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/95vrp1321899929.ps tmp/95vrp1321899929.png",intern=TRUE))
character(0)
> try(system("convert tmp/100etx1321899929.ps tmp/100etx1321899929.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.148 0.600 6.734