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 = '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 83 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 46 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.487e+01 1.815e-04 2.284e-04 1.836e-02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-53.11 -22.37 -9.97 7.28 536.36
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.487e+01 8.804e+00 2.825 0.00533 **
Grootte 1.815e-04 1.806e-04 1.005 0.31638
Tijd 2.284e-04 2.137e-04 1.069 0.28673
Hyperlinks 1.836e-02 1.893e-01 0.097 0.92285
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 51.77 on 160 degrees of freedom
Multiple R-squared: 0.07733, Adjusted R-squared: 0.06003
F-statistic: 4.47 on 3 and 160 DF, p-value: 0.004818
> 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.117074e-02 6.234148e-02 9.688293e-01
[2,] 1.905605e-02 3.811211e-02 9.809439e-01
[3,] 5.235784e-03 1.047157e-02 9.947642e-01
[4,] 1.457475e-03 2.914949e-03 9.985425e-01
[5,] 8.673408e-04 1.734682e-03 9.991327e-01
[6,] 7.442423e-04 1.488485e-03 9.992558e-01
[7,] 2.106405e-04 4.212811e-04 9.997894e-01
[8,] 1.342017e-04 2.684035e-04 9.998658e-01
[9,] 5.995957e-05 1.199191e-04 9.999400e-01
[10,] 2.891380e-05 5.782759e-05 9.999711e-01
[11,] 6.803899e-05 1.360780e-04 9.999320e-01
[12,] 3.362230e-05 6.724460e-05 9.999664e-01
[13,] 1.356658e-04 2.713316e-04 9.998643e-01
[14,] 1.113477e-04 2.226955e-04 9.998887e-01
[15,] 5.538759e-05 1.107752e-04 9.999446e-01
[16,] 2.862071e-05 5.724142e-05 9.999714e-01
[17,] 1.130767e-05 2.261535e-05 9.999887e-01
[18,] 5.651943e-06 1.130389e-05 9.999943e-01
[19,] 4.083278e-05 8.166557e-05 9.999592e-01
[20,] 1.757580e-05 3.515160e-05 9.999824e-01
[21,] 7.899142e-06 1.579828e-05 9.999921e-01
[22,] 3.975954e-06 7.951909e-06 9.999960e-01
[23,] 1.730465e-06 3.460929e-06 9.999983e-01
[24,] 3.514169e-06 7.028338e-06 9.999965e-01
[25,] 1.626135e-06 3.252269e-06 9.999984e-01
[26,] 7.320291e-07 1.464058e-06 9.999993e-01
[27,] 4.589386e-07 9.178771e-07 9.999995e-01
[28,] 1.850174e-07 3.700347e-07 9.999998e-01
[29,] 1.457850e-07 2.915701e-07 9.999999e-01
[30,] 5.781373e-08 1.156275e-07 9.999999e-01
[31,] 2.460821e-08 4.921642e-08 1.000000e+00
[32,] 1.130450e-08 2.260900e-08 1.000000e+00
[33,] 5.999201e-09 1.199840e-08 1.000000e+00
[34,] 4.431964e-09 8.863927e-09 1.000000e+00
[35,] 2.750646e-09 5.501292e-09 1.000000e+00
[36,] 1.042505e-09 2.085010e-09 1.000000e+00
[37,] 4.914745e-10 9.829490e-10 1.000000e+00
[38,] 1.821979e-10 3.643958e-10 1.000000e+00
[39,] 1.092033e-10 2.184065e-10 1.000000e+00
[40,] 1.000000e+00 5.462277e-16 2.731139e-16
[41,] 1.000000e+00 1.333004e-15 6.665022e-16
[42,] 1.000000e+00 3.430051e-15 1.715025e-15
[43,] 1.000000e+00 5.608161e-15 2.804081e-15
[44,] 1.000000e+00 1.388535e-14 6.942675e-15
[45,] 1.000000e+00 2.250948e-14 1.125474e-14
[46,] 1.000000e+00 5.428447e-14 2.714223e-14
[47,] 1.000000e+00 1.256722e-13 6.283610e-14
[48,] 1.000000e+00 2.491567e-13 1.245783e-13
[49,] 1.000000e+00 4.585386e-13 2.292693e-13
[50,] 1.000000e+00 9.776799e-13 4.888399e-13
[51,] 1.000000e+00 1.427973e-12 7.139866e-13
[52,] 1.000000e+00 1.901084e-13 9.505422e-14
[53,] 1.000000e+00 3.421204e-13 1.710602e-13
[54,] 1.000000e+00 7.533780e-13 3.766890e-13
[55,] 1.000000e+00 8.413792e-13 4.206896e-13
[56,] 1.000000e+00 1.256845e-12 6.284226e-13
[57,] 1.000000e+00 2.715689e-12 1.357844e-12
[58,] 1.000000e+00 4.361092e-12 2.180546e-12
[59,] 1.000000e+00 8.415733e-12 4.207867e-12
[60,] 1.000000e+00 1.668766e-11 8.343831e-12
[61,] 1.000000e+00 2.290027e-11 1.145014e-11
[62,] 1.000000e+00 4.965004e-11 2.482502e-11
[63,] 1.000000e+00 1.030068e-10 5.150338e-11
[64,] 1.000000e+00 2.086561e-10 1.043280e-10
[65,] 1.000000e+00 3.906788e-10 1.953394e-10
[66,] 1.000000e+00 8.147111e-10 4.073556e-10
[67,] 1.000000e+00 1.464956e-09 7.324780e-10
[68,] 1.000000e+00 2.527005e-09 1.263502e-09
[69,] 1.000000e+00 5.078245e-09 2.539122e-09
[70,] 1.000000e+00 9.959120e-09 4.979560e-09
[71,] 1.000000e+00 9.779683e-09 4.889842e-09
[72,] 1.000000e+00 4.894308e-09 2.447154e-09
[73,] 1.000000e+00 9.287906e-09 4.643953e-09
[74,] 1.000000e+00 1.821691e-08 9.108453e-09
[75,] 1.000000e+00 3.354007e-08 1.677003e-08
[76,] 1.000000e+00 5.485034e-08 2.742517e-08
[77,] 1.000000e+00 9.806338e-08 4.903169e-08
[78,] 9.999999e-01 1.699395e-07 8.496977e-08
[79,] 9.999999e-01 2.923842e-07 1.461921e-07
[80,] 1.000000e+00 1.360782e-08 6.803911e-09
[81,] 1.000000e+00 2.661852e-08 1.330926e-08
[82,] 1.000000e+00 2.877179e-13 1.438590e-13
[83,] 1.000000e+00 7.129800e-13 3.564900e-13
[84,] 1.000000e+00 1.712210e-12 8.561052e-13
[85,] 1.000000e+00 4.150709e-12 2.075355e-12
[86,] 1.000000e+00 9.591213e-12 4.795607e-12
[87,] 1.000000e+00 1.712693e-11 8.563467e-12
[88,] 1.000000e+00 3.450099e-11 1.725050e-11
[89,] 1.000000e+00 5.660163e-11 2.830082e-11
[90,] 1.000000e+00 1.229590e-10 6.147952e-11
[91,] 1.000000e+00 1.992578e-10 9.962890e-11
[92,] 1.000000e+00 1.713534e-10 8.567668e-11
[93,] 1.000000e+00 2.196431e-10 1.098215e-10
[94,] 1.000000e+00 1.325071e-10 6.625354e-11
[95,] 1.000000e+00 2.898081e-10 1.449040e-10
[96,] 1.000000e+00 5.740714e-10 2.870357e-10
[97,] 1.000000e+00 1.290093e-09 6.450467e-10
[98,] 1.000000e+00 2.794562e-09 1.397281e-09
[99,] 1.000000e+00 5.823108e-09 2.911554e-09
[100,] 1.000000e+00 6.518480e-09 3.259240e-09
[101,] 1.000000e+00 1.359341e-08 6.796703e-09
[102,] 1.000000e+00 1.826398e-08 9.131991e-09
[103,] 1.000000e+00 1.535308e-08 7.676541e-09
[104,] 1.000000e+00 3.015922e-08 1.507961e-08
[105,] 1.000000e+00 4.165160e-08 2.082580e-08
[106,] 1.000000e+00 8.524657e-08 4.262328e-08
[107,] 9.999999e-01 1.707540e-07 8.537698e-08
[108,] 9.999998e-01 3.187050e-07 1.593525e-07
[109,] 9.999997e-01 6.510759e-07 3.255379e-07
[110,] 9.999997e-01 5.288684e-07 2.644342e-07
[111,] 9.999997e-01 5.357718e-07 2.678859e-07
[112,] 9.999995e-01 9.813736e-07 4.906868e-07
[113,] 9.999992e-01 1.569135e-06 7.845677e-07
[114,] 9.999984e-01 3.210895e-06 1.605447e-06
[115,] 9.999995e-01 9.169980e-07 4.584990e-07
[116,] 9.999990e-01 1.902898e-06 9.514491e-07
[117,] 9.999988e-01 2.491850e-06 1.245925e-06
[118,] 9.999974e-01 5.164994e-06 2.582497e-06
[119,] 9.999968e-01 6.479624e-06 3.239812e-06
[120,] 9.999943e-01 1.136123e-05 5.680615e-06
[121,] 9.999889e-01 2.211360e-05 1.105680e-05
[122,] 9.999852e-01 2.968628e-05 1.484314e-05
[123,] 9.999849e-01 3.015414e-05 1.507707e-05
[124,] 9.999712e-01 5.762763e-05 2.881382e-05
[125,] 9.999737e-01 5.266241e-05 2.633120e-05
[126,] 9.999579e-01 8.429034e-05 4.214517e-05
[127,] 9.999151e-01 1.697363e-04 8.486814e-05
[128,] 9.999520e-01 9.591823e-05 4.795911e-05
[129,] 9.999359e-01 1.281774e-04 6.408868e-05
[130,] 9.998669e-01 2.662720e-04 1.331360e-04
[131,] 9.998444e-01 3.111008e-04 1.555504e-04
[132,] 9.997046e-01 5.907044e-04 2.953522e-04
[133,] 9.994056e-01 1.188839e-03 5.944195e-04
[134,] 9.999985e-01 2.961778e-06 1.480889e-06
[135,] 9.999963e-01 7.434513e-06 3.717257e-06
[136,] 9.999949e-01 1.014344e-05 5.071721e-06
[137,] 9.999887e-01 2.255635e-05 1.127818e-05
[138,] 9.999725e-01 5.507313e-05 2.753656e-05
[139,] 9.999244e-01 1.512227e-04 7.561135e-05
[140,] 9.999994e-01 1.289952e-06 6.449760e-07
[141,] 9.999975e-01 5.008028e-06 2.504014e-06
[142,] 9.999994e-01 1.134195e-06 5.670974e-07
[143,] 9.999974e-01 5.265610e-06 2.632805e-06
[144,] 9.999885e-01 2.294204e-05 1.147102e-05
[145,] 9.999509e-01 9.813396e-05 4.906698e-05
[146,] 9.998002e-01 3.995300e-04 1.997650e-04
[147,] 9.992305e-01 1.539055e-03 7.695277e-04
[148,] 9.972157e-01 5.568577e-03 2.784288e-03
[149,] 9.939630e-01 1.207405e-02 6.037024e-03
[150,] 9.879331e-01 2.413375e-02 1.206688e-02
[151,] 9.578350e-01 8.433004e-02 4.216502e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1bmv11321900276.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/250vu1321900276.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/3ecrt1321900276.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/4boos1321900276.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/5b4rv1321900276.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.6950513 -12.6655760 -18.4958304 59.8119467 -13.6366644 -19.9890360
7 8 9 10 11 12
-31.8904847 8.3323286 4.4659614 0.7353618 3.5623927 -10.9530982
13 14 15 16 17 18
-6.0872208 19.7602171 -17.7062301 14.4994248 -35.3807616 5.0462166
19 20 21 22 23 24
-32.1085757 -20.2961047 5.8671596 15.0556159 -11.1491401 -14.6177288
25 26 27 28 29 30
72.6008126 0.7543865 2.7344894 -13.3609010 -6.2649621 45.1372984
31 32 33 34 35 36
-38.6441206 4.1776836 -32.5691044 -12.9308858 -32.2355237 1.5549946
37 38 39 40 41 42
-12.3656857 -10.9670445 -21.9010548 -33.7798527 -33.8493860 8.0353435
43 44 45 46 47 48
-4.1712155 4.4228723 8.5742424 536.3642380 12.7342874 -0.6882608
49 50 51 52 53 54
20.7489763 -2.6991642 -34.0297358 -9.5174742 -10.6413232 -15.9003796
55 56 57 58 59 60
24.2645293 -13.0475280 -15.1359520 80.1562036 -27.6605750 -2.6546587
61 62 63 64 65 66
-34.9753206 34.7867770 11.0224450 -26.1158708 -17.6987106 -15.2547310
67 68 69 70 71 72
-23.9077088 5.2726004 7.0252744 -10.9586793 -17.8111532 1.1040227
73 74 75 76 77 78
-18.5528083 20.0485724 -4.0140826 -4.3999597 -44.1747385 -51.6784061
79 80 81 82 83 84
-14.0737867 4.6838520 -13.0349408 24.4970886 -11.5779069 -19.3170461
85 86 87 88 89 90
-17.9761151 108.0860994 -8.2152617 164.5468173 -4.3774387 -7.8474742
91 92 93 94 95 96
-0.5285553 -9.4022768 19.9711444 14.9528785 21.3559590 -16.1666395
97 98 99 100 101 102
-31.4631783 -46.8250077 30.0648839 -44.8657755 -17.6517673 -14.3845649
103 104 105 106 107 108
-6.1624192 4.8046262 9.2611915 -27.2034945 6.6008264 -30.2052553
109 110 111 112 113 114
-53.1083658 14.3950003 -29.8409402 -9.6108329 -17.6195555 -15.4085209
115 116 117 118 119 120
-10.6290529 40.9943653 -30.6122890 -24.6126135 -17.2425001 -9.1544652
121 122 123 124 125 126
68.4876625 -5.3329878 26.6729271 -8.5169028 22.0484379 14.7016436
127 128 129 130 131 132
13.5453009 -23.1207350 36.9064324 11.3590351 -25.5922230 -23.9852718
133 134 135 136 137 138
-12.1110061 54.7122100 34.8074289 -5.1849619 37.2448632 6.2944390
139 140 141 142 143 144
-10.3249130 85.6560468 2.9307298 15.7217545 -22.1163879 2.5865831
145 146 147 148 149 150
-18.1825785 47.2102359 -28.9567962 -34.8848513 -24.8712211 -27.8729449
151 152 153 154 155 156
-24.8712211 -24.8712211 -24.8712211 -24.8712211 -12.5800205 6.0950062
157 158 159 160 161 162
-24.8712211 -24.8712211 -26.2495189 -24.1449794 -24.3909947 21.1500161
163 164
-24.8712211 -19.1378173
> postscript(file="/var/wessaorg/rcomp/tmp/637v61321900276.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.6950513 NA
1 -12.6655760 -0.6950513
2 -18.4958304 -12.6655760
3 59.8119467 -18.4958304
4 -13.6366644 59.8119467
5 -19.9890360 -13.6366644
6 -31.8904847 -19.9890360
7 8.3323286 -31.8904847
8 4.4659614 8.3323286
9 0.7353618 4.4659614
10 3.5623927 0.7353618
11 -10.9530982 3.5623927
12 -6.0872208 -10.9530982
13 19.7602171 -6.0872208
14 -17.7062301 19.7602171
15 14.4994248 -17.7062301
16 -35.3807616 14.4994248
17 5.0462166 -35.3807616
18 -32.1085757 5.0462166
19 -20.2961047 -32.1085757
20 5.8671596 -20.2961047
21 15.0556159 5.8671596
22 -11.1491401 15.0556159
23 -14.6177288 -11.1491401
24 72.6008126 -14.6177288
25 0.7543865 72.6008126
26 2.7344894 0.7543865
27 -13.3609010 2.7344894
28 -6.2649621 -13.3609010
29 45.1372984 -6.2649621
30 -38.6441206 45.1372984
31 4.1776836 -38.6441206
32 -32.5691044 4.1776836
33 -12.9308858 -32.5691044
34 -32.2355237 -12.9308858
35 1.5549946 -32.2355237
36 -12.3656857 1.5549946
37 -10.9670445 -12.3656857
38 -21.9010548 -10.9670445
39 -33.7798527 -21.9010548
40 -33.8493860 -33.7798527
41 8.0353435 -33.8493860
42 -4.1712155 8.0353435
43 4.4228723 -4.1712155
44 8.5742424 4.4228723
45 536.3642380 8.5742424
46 12.7342874 536.3642380
47 -0.6882608 12.7342874
48 20.7489763 -0.6882608
49 -2.6991642 20.7489763
50 -34.0297358 -2.6991642
51 -9.5174742 -34.0297358
52 -10.6413232 -9.5174742
53 -15.9003796 -10.6413232
54 24.2645293 -15.9003796
55 -13.0475280 24.2645293
56 -15.1359520 -13.0475280
57 80.1562036 -15.1359520
58 -27.6605750 80.1562036
59 -2.6546587 -27.6605750
60 -34.9753206 -2.6546587
61 34.7867770 -34.9753206
62 11.0224450 34.7867770
63 -26.1158708 11.0224450
64 -17.6987106 -26.1158708
65 -15.2547310 -17.6987106
66 -23.9077088 -15.2547310
67 5.2726004 -23.9077088
68 7.0252744 5.2726004
69 -10.9586793 7.0252744
70 -17.8111532 -10.9586793
71 1.1040227 -17.8111532
72 -18.5528083 1.1040227
73 20.0485724 -18.5528083
74 -4.0140826 20.0485724
75 -4.3999597 -4.0140826
76 -44.1747385 -4.3999597
77 -51.6784061 -44.1747385
78 -14.0737867 -51.6784061
79 4.6838520 -14.0737867
80 -13.0349408 4.6838520
81 24.4970886 -13.0349408
82 -11.5779069 24.4970886
83 -19.3170461 -11.5779069
84 -17.9761151 -19.3170461
85 108.0860994 -17.9761151
86 -8.2152617 108.0860994
87 164.5468173 -8.2152617
88 -4.3774387 164.5468173
89 -7.8474742 -4.3774387
90 -0.5285553 -7.8474742
91 -9.4022768 -0.5285553
92 19.9711444 -9.4022768
93 14.9528785 19.9711444
94 21.3559590 14.9528785
95 -16.1666395 21.3559590
96 -31.4631783 -16.1666395
97 -46.8250077 -31.4631783
98 30.0648839 -46.8250077
99 -44.8657755 30.0648839
100 -17.6517673 -44.8657755
101 -14.3845649 -17.6517673
102 -6.1624192 -14.3845649
103 4.8046262 -6.1624192
104 9.2611915 4.8046262
105 -27.2034945 9.2611915
106 6.6008264 -27.2034945
107 -30.2052553 6.6008264
108 -53.1083658 -30.2052553
109 14.3950003 -53.1083658
110 -29.8409402 14.3950003
111 -9.6108329 -29.8409402
112 -17.6195555 -9.6108329
113 -15.4085209 -17.6195555
114 -10.6290529 -15.4085209
115 40.9943653 -10.6290529
116 -30.6122890 40.9943653
117 -24.6126135 -30.6122890
118 -17.2425001 -24.6126135
119 -9.1544652 -17.2425001
120 68.4876625 -9.1544652
121 -5.3329878 68.4876625
122 26.6729271 -5.3329878
123 -8.5169028 26.6729271
124 22.0484379 -8.5169028
125 14.7016436 22.0484379
126 13.5453009 14.7016436
127 -23.1207350 13.5453009
128 36.9064324 -23.1207350
129 11.3590351 36.9064324
130 -25.5922230 11.3590351
131 -23.9852718 -25.5922230
132 -12.1110061 -23.9852718
133 54.7122100 -12.1110061
134 34.8074289 54.7122100
135 -5.1849619 34.8074289
136 37.2448632 -5.1849619
137 6.2944390 37.2448632
138 -10.3249130 6.2944390
139 85.6560468 -10.3249130
140 2.9307298 85.6560468
141 15.7217545 2.9307298
142 -22.1163879 15.7217545
143 2.5865831 -22.1163879
144 -18.1825785 2.5865831
145 47.2102359 -18.1825785
146 -28.9567962 47.2102359
147 -34.8848513 -28.9567962
148 -24.8712211 -34.8848513
149 -27.8729449 -24.8712211
150 -24.8712211 -27.8729449
151 -24.8712211 -24.8712211
152 -24.8712211 -24.8712211
153 -24.8712211 -24.8712211
154 -12.5800205 -24.8712211
155 6.0950062 -12.5800205
156 -24.8712211 6.0950062
157 -24.8712211 -24.8712211
158 -26.2495189 -24.8712211
159 -24.1449794 -26.2495189
160 -24.3909947 -24.1449794
161 21.1500161 -24.3909947
162 -24.8712211 21.1500161
163 -19.1378173 -24.8712211
164 NA -19.1378173
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -12.6655760 -0.6950513
[2,] -18.4958304 -12.6655760
[3,] 59.8119467 -18.4958304
[4,] -13.6366644 59.8119467
[5,] -19.9890360 -13.6366644
[6,] -31.8904847 -19.9890360
[7,] 8.3323286 -31.8904847
[8,] 4.4659614 8.3323286
[9,] 0.7353618 4.4659614
[10,] 3.5623927 0.7353618
[11,] -10.9530982 3.5623927
[12,] -6.0872208 -10.9530982
[13,] 19.7602171 -6.0872208
[14,] -17.7062301 19.7602171
[15,] 14.4994248 -17.7062301
[16,] -35.3807616 14.4994248
[17,] 5.0462166 -35.3807616
[18,] -32.1085757 5.0462166
[19,] -20.2961047 -32.1085757
[20,] 5.8671596 -20.2961047
[21,] 15.0556159 5.8671596
[22,] -11.1491401 15.0556159
[23,] -14.6177288 -11.1491401
[24,] 72.6008126 -14.6177288
[25,] 0.7543865 72.6008126
[26,] 2.7344894 0.7543865
[27,] -13.3609010 2.7344894
[28,] -6.2649621 -13.3609010
[29,] 45.1372984 -6.2649621
[30,] -38.6441206 45.1372984
[31,] 4.1776836 -38.6441206
[32,] -32.5691044 4.1776836
[33,] -12.9308858 -32.5691044
[34,] -32.2355237 -12.9308858
[35,] 1.5549946 -32.2355237
[36,] -12.3656857 1.5549946
[37,] -10.9670445 -12.3656857
[38,] -21.9010548 -10.9670445
[39,] -33.7798527 -21.9010548
[40,] -33.8493860 -33.7798527
[41,] 8.0353435 -33.8493860
[42,] -4.1712155 8.0353435
[43,] 4.4228723 -4.1712155
[44,] 8.5742424 4.4228723
[45,] 536.3642380 8.5742424
[46,] 12.7342874 536.3642380
[47,] -0.6882608 12.7342874
[48,] 20.7489763 -0.6882608
[49,] -2.6991642 20.7489763
[50,] -34.0297358 -2.6991642
[51,] -9.5174742 -34.0297358
[52,] -10.6413232 -9.5174742
[53,] -15.9003796 -10.6413232
[54,] 24.2645293 -15.9003796
[55,] -13.0475280 24.2645293
[56,] -15.1359520 -13.0475280
[57,] 80.1562036 -15.1359520
[58,] -27.6605750 80.1562036
[59,] -2.6546587 -27.6605750
[60,] -34.9753206 -2.6546587
[61,] 34.7867770 -34.9753206
[62,] 11.0224450 34.7867770
[63,] -26.1158708 11.0224450
[64,] -17.6987106 -26.1158708
[65,] -15.2547310 -17.6987106
[66,] -23.9077088 -15.2547310
[67,] 5.2726004 -23.9077088
[68,] 7.0252744 5.2726004
[69,] -10.9586793 7.0252744
[70,] -17.8111532 -10.9586793
[71,] 1.1040227 -17.8111532
[72,] -18.5528083 1.1040227
[73,] 20.0485724 -18.5528083
[74,] -4.0140826 20.0485724
[75,] -4.3999597 -4.0140826
[76,] -44.1747385 -4.3999597
[77,] -51.6784061 -44.1747385
[78,] -14.0737867 -51.6784061
[79,] 4.6838520 -14.0737867
[80,] -13.0349408 4.6838520
[81,] 24.4970886 -13.0349408
[82,] -11.5779069 24.4970886
[83,] -19.3170461 -11.5779069
[84,] -17.9761151 -19.3170461
[85,] 108.0860994 -17.9761151
[86,] -8.2152617 108.0860994
[87,] 164.5468173 -8.2152617
[88,] -4.3774387 164.5468173
[89,] -7.8474742 -4.3774387
[90,] -0.5285553 -7.8474742
[91,] -9.4022768 -0.5285553
[92,] 19.9711444 -9.4022768
[93,] 14.9528785 19.9711444
[94,] 21.3559590 14.9528785
[95,] -16.1666395 21.3559590
[96,] -31.4631783 -16.1666395
[97,] -46.8250077 -31.4631783
[98,] 30.0648839 -46.8250077
[99,] -44.8657755 30.0648839
[100,] -17.6517673 -44.8657755
[101,] -14.3845649 -17.6517673
[102,] -6.1624192 -14.3845649
[103,] 4.8046262 -6.1624192
[104,] 9.2611915 4.8046262
[105,] -27.2034945 9.2611915
[106,] 6.6008264 -27.2034945
[107,] -30.2052553 6.6008264
[108,] -53.1083658 -30.2052553
[109,] 14.3950003 -53.1083658
[110,] -29.8409402 14.3950003
[111,] -9.6108329 -29.8409402
[112,] -17.6195555 -9.6108329
[113,] -15.4085209 -17.6195555
[114,] -10.6290529 -15.4085209
[115,] 40.9943653 -10.6290529
[116,] -30.6122890 40.9943653
[117,] -24.6126135 -30.6122890
[118,] -17.2425001 -24.6126135
[119,] -9.1544652 -17.2425001
[120,] 68.4876625 -9.1544652
[121,] -5.3329878 68.4876625
[122,] 26.6729271 -5.3329878
[123,] -8.5169028 26.6729271
[124,] 22.0484379 -8.5169028
[125,] 14.7016436 22.0484379
[126,] 13.5453009 14.7016436
[127,] -23.1207350 13.5453009
[128,] 36.9064324 -23.1207350
[129,] 11.3590351 36.9064324
[130,] -25.5922230 11.3590351
[131,] -23.9852718 -25.5922230
[132,] -12.1110061 -23.9852718
[133,] 54.7122100 -12.1110061
[134,] 34.8074289 54.7122100
[135,] -5.1849619 34.8074289
[136,] 37.2448632 -5.1849619
[137,] 6.2944390 37.2448632
[138,] -10.3249130 6.2944390
[139,] 85.6560468 -10.3249130
[140,] 2.9307298 85.6560468
[141,] 15.7217545 2.9307298
[142,] -22.1163879 15.7217545
[143,] 2.5865831 -22.1163879
[144,] -18.1825785 2.5865831
[145,] 47.2102359 -18.1825785
[146,] -28.9567962 47.2102359
[147,] -34.8848513 -28.9567962
[148,] -24.8712211 -34.8848513
[149,] -27.8729449 -24.8712211
[150,] -24.8712211 -27.8729449
[151,] -24.8712211 -24.8712211
[152,] -24.8712211 -24.8712211
[153,] -24.8712211 -24.8712211
[154,] -12.5800205 -24.8712211
[155,] 6.0950062 -12.5800205
[156,] -24.8712211 6.0950062
[157,] -24.8712211 -24.8712211
[158,] -26.2495189 -24.8712211
[159,] -24.1449794 -26.2495189
[160,] -24.3909947 -24.1449794
[161,] 21.1500161 -24.3909947
[162,] -24.8712211 21.1500161
[163,] -19.1378173 -24.8712211
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -12.6655760 -0.6950513
2 -18.4958304 -12.6655760
3 59.8119467 -18.4958304
4 -13.6366644 59.8119467
5 -19.9890360 -13.6366644
6 -31.8904847 -19.9890360
7 8.3323286 -31.8904847
8 4.4659614 8.3323286
9 0.7353618 4.4659614
10 3.5623927 0.7353618
11 -10.9530982 3.5623927
12 -6.0872208 -10.9530982
13 19.7602171 -6.0872208
14 -17.7062301 19.7602171
15 14.4994248 -17.7062301
16 -35.3807616 14.4994248
17 5.0462166 -35.3807616
18 -32.1085757 5.0462166
19 -20.2961047 -32.1085757
20 5.8671596 -20.2961047
21 15.0556159 5.8671596
22 -11.1491401 15.0556159
23 -14.6177288 -11.1491401
24 72.6008126 -14.6177288
25 0.7543865 72.6008126
26 2.7344894 0.7543865
27 -13.3609010 2.7344894
28 -6.2649621 -13.3609010
29 45.1372984 -6.2649621
30 -38.6441206 45.1372984
31 4.1776836 -38.6441206
32 -32.5691044 4.1776836
33 -12.9308858 -32.5691044
34 -32.2355237 -12.9308858
35 1.5549946 -32.2355237
36 -12.3656857 1.5549946
37 -10.9670445 -12.3656857
38 -21.9010548 -10.9670445
39 -33.7798527 -21.9010548
40 -33.8493860 -33.7798527
41 8.0353435 -33.8493860
42 -4.1712155 8.0353435
43 4.4228723 -4.1712155
44 8.5742424 4.4228723
45 536.3642380 8.5742424
46 12.7342874 536.3642380
47 -0.6882608 12.7342874
48 20.7489763 -0.6882608
49 -2.6991642 20.7489763
50 -34.0297358 -2.6991642
51 -9.5174742 -34.0297358
52 -10.6413232 -9.5174742
53 -15.9003796 -10.6413232
54 24.2645293 -15.9003796
55 -13.0475280 24.2645293
56 -15.1359520 -13.0475280
57 80.1562036 -15.1359520
58 -27.6605750 80.1562036
59 -2.6546587 -27.6605750
60 -34.9753206 -2.6546587
61 34.7867770 -34.9753206
62 11.0224450 34.7867770
63 -26.1158708 11.0224450
64 -17.6987106 -26.1158708
65 -15.2547310 -17.6987106
66 -23.9077088 -15.2547310
67 5.2726004 -23.9077088
68 7.0252744 5.2726004
69 -10.9586793 7.0252744
70 -17.8111532 -10.9586793
71 1.1040227 -17.8111532
72 -18.5528083 1.1040227
73 20.0485724 -18.5528083
74 -4.0140826 20.0485724
75 -4.3999597 -4.0140826
76 -44.1747385 -4.3999597
77 -51.6784061 -44.1747385
78 -14.0737867 -51.6784061
79 4.6838520 -14.0737867
80 -13.0349408 4.6838520
81 24.4970886 -13.0349408
82 -11.5779069 24.4970886
83 -19.3170461 -11.5779069
84 -17.9761151 -19.3170461
85 108.0860994 -17.9761151
86 -8.2152617 108.0860994
87 164.5468173 -8.2152617
88 -4.3774387 164.5468173
89 -7.8474742 -4.3774387
90 -0.5285553 -7.8474742
91 -9.4022768 -0.5285553
92 19.9711444 -9.4022768
93 14.9528785 19.9711444
94 21.3559590 14.9528785
95 -16.1666395 21.3559590
96 -31.4631783 -16.1666395
97 -46.8250077 -31.4631783
98 30.0648839 -46.8250077
99 -44.8657755 30.0648839
100 -17.6517673 -44.8657755
101 -14.3845649 -17.6517673
102 -6.1624192 -14.3845649
103 4.8046262 -6.1624192
104 9.2611915 4.8046262
105 -27.2034945 9.2611915
106 6.6008264 -27.2034945
107 -30.2052553 6.6008264
108 -53.1083658 -30.2052553
109 14.3950003 -53.1083658
110 -29.8409402 14.3950003
111 -9.6108329 -29.8409402
112 -17.6195555 -9.6108329
113 -15.4085209 -17.6195555
114 -10.6290529 -15.4085209
115 40.9943653 -10.6290529
116 -30.6122890 40.9943653
117 -24.6126135 -30.6122890
118 -17.2425001 -24.6126135
119 -9.1544652 -17.2425001
120 68.4876625 -9.1544652
121 -5.3329878 68.4876625
122 26.6729271 -5.3329878
123 -8.5169028 26.6729271
124 22.0484379 -8.5169028
125 14.7016436 22.0484379
126 13.5453009 14.7016436
127 -23.1207350 13.5453009
128 36.9064324 -23.1207350
129 11.3590351 36.9064324
130 -25.5922230 11.3590351
131 -23.9852718 -25.5922230
132 -12.1110061 -23.9852718
133 54.7122100 -12.1110061
134 34.8074289 54.7122100
135 -5.1849619 34.8074289
136 37.2448632 -5.1849619
137 6.2944390 37.2448632
138 -10.3249130 6.2944390
139 85.6560468 -10.3249130
140 2.9307298 85.6560468
141 15.7217545 2.9307298
142 -22.1163879 15.7217545
143 2.5865831 -22.1163879
144 -18.1825785 2.5865831
145 47.2102359 -18.1825785
146 -28.9567962 47.2102359
147 -34.8848513 -28.9567962
148 -24.8712211 -34.8848513
149 -27.8729449 -24.8712211
150 -24.8712211 -27.8729449
151 -24.8712211 -24.8712211
152 -24.8712211 -24.8712211
153 -24.8712211 -24.8712211
154 -12.5800205 -24.8712211
155 6.0950062 -12.5800205
156 -24.8712211 6.0950062
157 -24.8712211 -24.8712211
158 -26.2495189 -24.8712211
159 -24.1449794 -26.2495189
160 -24.3909947 -24.1449794
161 21.1500161 -24.3909947
162 -24.8712211 21.1500161
163 -19.1378173 -24.8712211
> 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/7zqm21321900276.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/8x3581321900276.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/9q1av1321900276.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/1015qf1321900276.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/11hh9t1321900276.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/126xmi1321900276.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/132ed61321900276.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/14m9cl1321900276.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/150znx1321900276.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/163s6t1321900276.tab")
+ }
>
> try(system("convert tmp/1bmv11321900276.ps tmp/1bmv11321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/250vu1321900276.ps tmp/250vu1321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ecrt1321900276.ps tmp/3ecrt1321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/4boos1321900276.ps tmp/4boos1321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/5b4rv1321900276.ps tmp/5b4rv1321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/637v61321900276.ps tmp/637v61321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/7zqm21321900276.ps tmp/7zqm21321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/8x3581321900276.ps tmp/8x3581321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/9q1av1321900276.ps tmp/9q1av1321900276.png",intern=TRUE))
character(0)
> try(system("convert tmp/1015qf1321900276.ps tmp/1015qf1321900276.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.728 0.510 5.855