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(252101
+ ,62
+ ,34
+ ,104
+ ,124252
+ ,134577
+ ,59
+ ,30
+ ,111
+ ,98956
+ ,198520
+ ,62
+ ,38
+ ,93
+ ,98073
+ ,189326
+ ,94
+ ,34
+ ,119
+ ,106816
+ ,137449
+ ,43
+ ,25
+ ,57
+ ,41449
+ ,65295
+ ,27
+ ,31
+ ,80
+ ,76173
+ ,439387
+ ,103
+ ,29
+ ,107
+ ,177551
+ ,33186
+ ,19
+ ,18
+ ,22
+ ,22807
+ ,178368
+ ,51
+ ,30
+ ,103
+ ,126938
+ ,186657
+ ,38
+ ,29
+ ,72
+ ,61680
+ ,261949
+ ,96
+ ,38
+ ,123
+ ,72117
+ ,191051
+ ,95
+ ,49
+ ,164
+ ,79738
+ ,138866
+ ,57
+ ,33
+ ,100
+ ,57793
+ ,296878
+ ,66
+ ,46
+ ,143
+ ,91677
+ ,192648
+ ,72
+ ,38
+ ,79
+ ,64631
+ ,333462
+ ,162
+ ,52
+ ,183
+ ,106385
+ ,243571
+ ,58
+ ,32
+ ,123
+ ,161961
+ ,263451
+ ,130
+ ,35
+ ,81
+ ,112669
+ ,155679
+ ,48
+ ,25
+ ,74
+ ,114029
+ ,227053
+ ,70
+ ,42
+ ,158
+ ,124550
+ ,240028
+ ,63
+ ,40
+ ,133
+ ,105416
+ ,388549
+ ,90
+ ,35
+ ,128
+ ,72875
+ ,156540
+ ,34
+ ,25
+ ,84
+ ,81964
+ ,148421
+ ,43
+ ,46
+ ,184
+ ,104880
+ ,177732
+ ,97
+ ,36
+ ,127
+ ,76302
+ ,191441
+ ,105
+ ,35
+ ,128
+ ,96740
+ ,249893
+ ,122
+ ,38
+ ,118
+ ,93071
+ ,236812
+ ,76
+ ,35
+ ,125
+ ,78912
+ ,142329
+ ,45
+ ,28
+ ,89
+ ,35224
+ ,259667
+ ,53
+ ,37
+ ,122
+ ,90694
+ ,231625
+ ,65
+ ,40
+ ,151
+ ,125369
+ ,176062
+ ,67
+ ,42
+ ,122
+ ,80849
+ ,286683
+ ,79
+ ,44
+ ,162
+ ,104434
+ ,87485
+ ,33
+ ,33
+ ,121
+ ,65702
+ ,322865
+ ,83
+ ,35
+ ,132
+ ,108179
+ ,247082
+ ,51
+ ,37
+ ,110
+ ,63583
+ ,346011
+ ,106
+ ,39
+ ,135
+ ,95066
+ ,191653
+ ,74
+ ,32
+ ,80
+ ,62486
+ ,114673
+ ,31
+ ,17
+ ,46
+ ,31081
+ ,284224
+ ,161
+ ,34
+ ,127
+ ,94584
+ ,284195
+ ,72
+ ,33
+ ,103
+ ,87408
+ ,155363
+ ,59
+ ,35
+ ,95
+ ,68966
+ ,177306
+ ,67
+ ,32
+ ,100
+ ,88766
+ ,144571
+ ,49
+ ,35
+ ,102
+ ,57139
+ ,140319
+ ,73
+ ,45
+ ,45
+ ,90586
+ ,405267
+ ,135
+ ,38
+ ,122
+ ,109249
+ ,78800
+ ,42
+ ,26
+ ,66
+ ,33032
+ ,201970
+ ,69
+ ,45
+ ,159
+ ,96056
+ ,302674
+ ,99
+ ,44
+ ,153
+ ,146648
+ ,164733
+ ,50
+ ,40
+ ,131
+ ,80613
+ ,194221
+ ,68
+ ,33
+ ,113
+ ,87026
+ ,24188
+ ,24
+ ,4
+ ,7
+ ,5950
+ ,342263
+ ,279
+ ,41
+ ,147
+ ,131106
+ ,65029
+ ,17
+ ,18
+ ,61
+ ,32551
+ ,101097
+ ,64
+ ,14
+ ,41
+ ,31701
+ ,246088
+ ,46
+ ,33
+ ,108
+ ,91072
+ ,273108
+ ,75
+ ,49
+ ,184
+ ,159803
+ ,282220
+ ,160
+ ,32
+ ,115
+ ,143950
+ ,273495
+ ,119
+ ,37
+ ,132
+ ,112368
+ ,214872
+ ,74
+ ,32
+ ,113
+ ,82124
+ ,335121
+ ,124
+ ,41
+ ,141
+ ,144068
+ ,267171
+ ,107
+ ,25
+ ,65
+ ,162627
+ ,187938
+ ,88
+ ,40
+ ,87
+ ,55062
+ ,229512
+ ,78
+ ,35
+ ,121
+ ,95329
+ ,209798
+ ,61
+ ,33
+ ,112
+ ,105612
+ ,201345
+ ,60
+ ,28
+ ,81
+ ,62853
+ ,163833
+ ,114
+ ,31
+ ,116
+ ,125976
+ ,204250
+ ,129
+ ,40
+ ,132
+ ,79146
+ ,197813
+ ,67
+ ,32
+ ,104
+ ,108461
+ ,132955
+ ,60
+ ,25
+ ,80
+ ,99971
+ ,216092
+ ,59
+ ,42
+ ,145
+ ,77826
+ ,73566
+ ,32
+ ,23
+ ,67
+ ,22618
+ ,213198
+ ,67
+ ,42
+ ,159
+ ,84892
+ ,181713
+ ,49
+ ,38
+ ,90
+ ,92059
+ ,148698
+ ,49
+ ,34
+ ,120
+ ,77993
+ ,300103
+ ,70
+ ,38
+ ,126
+ ,104155
+ ,251437
+ ,78
+ ,32
+ ,118
+ ,109840
+ ,197295
+ ,101
+ ,37
+ ,112
+ ,238712
+ ,158163
+ ,55
+ ,34
+ ,123
+ ,67486
+ ,155529
+ ,57
+ ,33
+ ,98
+ ,68007
+ ,132672
+ ,41
+ ,25
+ ,78
+ ,48194
+ ,377205
+ ,100
+ ,40
+ ,119
+ ,134796
+ ,145905
+ ,66
+ ,26
+ ,99
+ ,38692
+ ,223701
+ ,87
+ ,40
+ ,81
+ ,93587
+ ,80953
+ ,25
+ ,8
+ ,27
+ ,56622
+ ,130805
+ ,47
+ ,27
+ ,77
+ ,15986
+ ,135082
+ ,48
+ ,32
+ ,118
+ ,113402
+ ,300805
+ ,156
+ ,33
+ ,122
+ ,97967
+ ,271806
+ ,95
+ ,50
+ ,103
+ ,74844
+ ,150949
+ ,96
+ ,37
+ ,129
+ ,136051
+ ,225805
+ ,79
+ ,33
+ ,69
+ ,50548
+ ,197389
+ ,68
+ ,34
+ ,121
+ ,112215
+ ,156583
+ ,56
+ ,28
+ ,81
+ ,59591
+ ,222599
+ ,66
+ ,32
+ ,119
+ ,59938
+ ,261601
+ ,70
+ ,32
+ ,116
+ ,137639
+ ,178489
+ ,35
+ ,32
+ ,123
+ ,143372
+ ,200657
+ ,43
+ ,31
+ ,111
+ ,138599
+ ,259084
+ ,68
+ ,35
+ ,100
+ ,174110
+ ,313075
+ ,130
+ ,58
+ ,221
+ ,135062
+ ,346933
+ ,100
+ ,27
+ ,95
+ ,175681
+ ,246440
+ ,104
+ ,45
+ ,153
+ ,130307
+ ,252444
+ ,58
+ ,37
+ ,118
+ ,139141
+ ,159965
+ ,159
+ ,32
+ ,50
+ ,44244
+ ,43287
+ ,14
+ ,19
+ ,64
+ ,43750
+ ,172239
+ ,68
+ ,22
+ ,34
+ ,48029
+ ,183738
+ ,120
+ ,35
+ ,76
+ ,95216
+ ,227681
+ ,43
+ ,36
+ ,112
+ ,92288
+ ,260464
+ ,81
+ ,36
+ ,115
+ ,94588
+ ,106288
+ ,54
+ ,23
+ ,69
+ ,197426
+ ,109632
+ ,77
+ ,36
+ ,108
+ ,151244
+ ,268905
+ ,58
+ ,36
+ ,130
+ ,139206
+ ,266805
+ ,78
+ ,42
+ ,110
+ ,106271
+ ,23623
+ ,11
+ ,1
+ ,0
+ ,1168
+ ,152474
+ ,65
+ ,32
+ ,83
+ ,71764
+ ,61857
+ ,25
+ ,11
+ ,30
+ ,25162
+ ,144889
+ ,43
+ ,40
+ ,106
+ ,45635
+ ,346600
+ ,99
+ ,34
+ ,91
+ ,101817
+ ,21054
+ ,16
+ ,0
+ ,0
+ ,855
+ ,224051
+ ,45
+ ,27
+ ,69
+ ,100174
+ ,31414
+ ,19
+ ,8
+ ,9
+ ,14116
+ ,261043
+ ,105
+ ,35
+ ,123
+ ,85008
+ ,197819
+ ,57
+ ,41
+ ,143
+ ,124254
+ ,154984
+ ,73
+ ,40
+ ,125
+ ,105793
+ ,112933
+ ,45
+ ,28
+ ,81
+ ,117129
+ ,38214
+ ,34
+ ,8
+ ,21
+ ,8773
+ ,158671
+ ,33
+ ,35
+ ,124
+ ,94747
+ ,302148
+ ,70
+ ,47
+ ,168
+ ,107549
+ ,177918
+ ,55
+ ,46
+ ,149
+ ,97392
+ ,350552
+ ,70
+ ,42
+ ,147
+ ,126893
+ ,275578
+ ,91
+ ,48
+ ,145
+ ,118850
+ ,368746
+ ,106
+ ,49
+ ,172
+ ,234853
+ ,172464
+ ,31
+ ,35
+ ,126
+ ,74783
+ ,94381
+ ,35
+ ,32
+ ,89
+ ,66089
+ ,243875
+ ,279
+ ,36
+ ,137
+ ,95684
+ ,382487
+ ,153
+ ,42
+ ,149
+ ,139537
+ ,114525
+ ,40
+ ,35
+ ,121
+ ,144253
+ ,335681
+ ,119
+ ,37
+ ,133
+ ,153824
+ ,147989
+ ,72
+ ,34
+ ,93
+ ,63995
+ ,216638
+ ,45
+ ,36
+ ,119
+ ,84891
+ ,192862
+ ,72
+ ,36
+ ,102
+ ,61263
+ ,184818
+ ,107
+ ,32
+ ,45
+ ,106221
+ ,336707
+ ,105
+ ,33
+ ,104
+ ,113587
+ ,215836
+ ,76
+ ,35
+ ,111
+ ,113864
+ ,173260
+ ,63
+ ,21
+ ,78
+ ,37238
+ ,271773
+ ,89
+ ,40
+ ,120
+ ,119906
+ ,130908
+ ,52
+ ,49
+ ,176
+ ,135096
+ ,204009
+ ,75
+ ,33
+ ,109
+ ,151611
+ ,245514
+ ,92
+ ,39
+ ,132
+ ,144645
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,14688
+ ,10
+ ,0
+ ,0
+ ,6023
+ ,98
+ ,1
+ ,0
+ ,0
+ ,0
+ ,455
+ ,2
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,195765
+ ,75
+ ,33
+ ,78
+ ,77457
+ ,326038
+ ,121
+ ,42
+ ,104
+ ,62464
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,203
+ ,4
+ ,0
+ ,0
+ ,0
+ ,7199
+ ,5
+ ,0
+ ,0
+ ,1644
+ ,46660
+ ,20
+ ,5
+ ,13
+ ,6179
+ ,17547
+ ,5
+ ,1
+ ,4
+ ,3926
+ ,107465
+ ,38
+ ,38
+ ,65
+ ,42087
+ ,969
+ ,2
+ ,0
+ ,0
+ ,0
+ ,173102
+ ,58
+ ,28
+ ,55
+ ,87656)
+ ,dim=c(5
+ ,164)
+ ,dimnames=list(c('TimeRFC'
+ ,'Logins'
+ ,'reviews'
+ ,'Feedbackmessages'
+ ,'Characters')
+ ,1:164))
> y <- array(NA,dim=c(5,164),dimnames=list(c('TimeRFC','Logins','reviews','Feedbackmessages','Characters'),1:164))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> 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
Logins TimeRFC reviews Feedbackmessages Characters
1 62 252101 34 104 124252
2 59 134577 30 111 98956
3 62 198520 38 93 98073
4 94 189326 34 119 106816
5 43 137449 25 57 41449
6 27 65295 31 80 76173
7 103 439387 29 107 177551
8 19 33186 18 22 22807
9 51 178368 30 103 126938
10 38 186657 29 72 61680
11 96 261949 38 123 72117
12 95 191051 49 164 79738
13 57 138866 33 100 57793
14 66 296878 46 143 91677
15 72 192648 38 79 64631
16 162 333462 52 183 106385
17 58 243571 32 123 161961
18 130 263451 35 81 112669
19 48 155679 25 74 114029
20 70 227053 42 158 124550
21 63 240028 40 133 105416
22 90 388549 35 128 72875
23 34 156540 25 84 81964
24 43 148421 46 184 104880
25 97 177732 36 127 76302
26 105 191441 35 128 96740
27 122 249893 38 118 93071
28 76 236812 35 125 78912
29 45 142329 28 89 35224
30 53 259667 37 122 90694
31 65 231625 40 151 125369
32 67 176062 42 122 80849
33 79 286683 44 162 104434
34 33 87485 33 121 65702
35 83 322865 35 132 108179
36 51 247082 37 110 63583
37 106 346011 39 135 95066
38 74 191653 32 80 62486
39 31 114673 17 46 31081
40 161 284224 34 127 94584
41 72 284195 33 103 87408
42 59 155363 35 95 68966
43 67 177306 32 100 88766
44 49 144571 35 102 57139
45 73 140319 45 45 90586
46 135 405267 38 122 109249
47 42 78800 26 66 33032
48 69 201970 45 159 96056
49 99 302674 44 153 146648
50 50 164733 40 131 80613
51 68 194221 33 113 87026
52 24 24188 4 7 5950
53 279 342263 41 147 131106
54 17 65029 18 61 32551
55 64 101097 14 41 31701
56 46 246088 33 108 91072
57 75 273108 49 184 159803
58 160 282220 32 115 143950
59 119 273495 37 132 112368
60 74 214872 32 113 82124
61 124 335121 41 141 144068
62 107 267171 25 65 162627
63 88 187938 40 87 55062
64 78 229512 35 121 95329
65 61 209798 33 112 105612
66 60 201345 28 81 62853
67 114 163833 31 116 125976
68 129 204250 40 132 79146
69 67 197813 32 104 108461
70 60 132955 25 80 99971
71 59 216092 42 145 77826
72 32 73566 23 67 22618
73 67 213198 42 159 84892
74 49 181713 38 90 92059
75 49 148698 34 120 77993
76 70 300103 38 126 104155
77 78 251437 32 118 109840
78 101 197295 37 112 238712
79 55 158163 34 123 67486
80 57 155529 33 98 68007
81 41 132672 25 78 48194
82 100 377205 40 119 134796
83 66 145905 26 99 38692
84 87 223701 40 81 93587
85 25 80953 8 27 56622
86 47 130805 27 77 15986
87 48 135082 32 118 113402
88 156 300805 33 122 97967
89 95 271806 50 103 74844
90 96 150949 37 129 136051
91 79 225805 33 69 50548
92 68 197389 34 121 112215
93 56 156583 28 81 59591
94 66 222599 32 119 59938
95 70 261601 32 116 137639
96 35 178489 32 123 143372
97 43 200657 31 111 138599
98 68 259084 35 100 174110
99 130 313075 58 221 135062
100 100 346933 27 95 175681
101 104 246440 45 153 130307
102 58 252444 37 118 139141
103 159 159965 32 50 44244
104 14 43287 19 64 43750
105 68 172239 22 34 48029
106 120 183738 35 76 95216
107 43 227681 36 112 92288
108 81 260464 36 115 94588
109 54 106288 23 69 197426
110 77 109632 36 108 151244
111 58 268905 36 130 139206
112 78 266805 42 110 106271
113 11 23623 1 0 1168
114 65 152474 32 83 71764
115 25 61857 11 30 25162
116 43 144889 40 106 45635
117 99 346600 34 91 101817
118 16 21054 0 0 855
119 45 224051 27 69 100174
120 19 31414 8 9 14116
121 105 261043 35 123 85008
122 57 197819 41 143 124254
123 73 154984 40 125 105793
124 45 112933 28 81 117129
125 34 38214 8 21 8773
126 33 158671 35 124 94747
127 70 302148 47 168 107549
128 55 177918 46 149 97392
129 70 350552 42 147 126893
130 91 275578 48 145 118850
131 106 368746 49 172 234853
132 31 172464 35 126 74783
133 35 94381 32 89 66089
134 279 243875 36 137 95684
135 153 382487 42 149 139537
136 40 114525 35 121 144253
137 119 335681 37 133 153824
138 72 147989 34 93 63995
139 45 216638 36 119 84891
140 72 192862 36 102 61263
141 107 184818 32 45 106221
142 105 336707 33 104 113587
143 76 215836 35 111 113864
144 63 173260 21 78 37238
145 89 271773 40 120 119906
146 52 130908 49 176 135096
147 75 204009 33 109 151611
148 92 245514 39 132 144645
149 0 1 0 0 0
150 10 14688 0 0 6023
151 1 98 0 0 0
152 2 455 0 0 0
153 0 0 0 0 0
154 0 0 0 0 0
155 75 195765 33 78 77457
156 121 326038 42 104 62464
157 0 0 0 0 0
158 4 203 0 0 0
159 5 7199 0 0 1644
160 20 46660 5 13 6179
161 5 17547 1 4 3926
162 38 107465 38 65 42087
163 2 969 0 0 0
164 58 173102 28 55 87656
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) TimeRFC reviews Feedbackmessages
3.469e+00 2.732e-04 6.685e-01 -9.290e-02
Characters
2.047e-05
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-46.261 -14.785 -3.479 5.186 195.605
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.469e+00 6.457e+00 0.537 0.592
TimeRFC 2.732e-04 3.985e-05 6.855 1.49e-10 ***
reviews 6.685e-01 4.638e-01 1.441 0.151
Feedbackmessages -9.290e-02 1.289e-01 -0.720 0.472
Characters 2.047e-05 7.565e-05 0.271 0.787
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 30.36 on 159 degrees of freedom
Multiple R-squared: 0.5094, Adjusted R-squared: 0.4971
F-statistic: 41.28 on 4 and 159 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,] 0.103758709 2.075174e-01 8.962413e-01
[2,] 0.038707878 7.741576e-02 9.612921e-01
[3,] 0.043998516 8.799703e-02 9.560015e-01
[4,] 0.017388491 3.477698e-02 9.826115e-01
[5,] 0.006704348 1.340870e-02 9.932957e-01
[6,] 0.002572221 5.144443e-03 9.974278e-01
[7,] 0.007734899 1.546980e-02 9.922651e-01
[8,] 0.010044825 2.008965e-02 9.899552e-01
[9,] 0.032919417 6.583883e-02 9.670806e-01
[10,] 0.022630436 4.526087e-02 9.773696e-01
[11,] 0.149650501 2.993010e-01 8.503495e-01
[12,] 0.105681383 2.113628e-01 8.943186e-01
[13,] 0.084299911 1.685998e-01 9.157001e-01
[14,] 0.075549414 1.510988e-01 9.244506e-01
[15,] 0.059913110 1.198262e-01 9.400869e-01
[16,] 0.041842274 8.368455e-02 9.581577e-01
[17,] 0.039769337 7.953867e-02 9.602307e-01
[18,] 0.054087638 1.081753e-01 9.459124e-01
[19,] 0.080752723 1.615054e-01 9.192473e-01
[20,] 0.100902715 2.018054e-01 8.990973e-01
[21,] 0.073755148 1.475103e-01 9.262449e-01
[22,] 0.053232393 1.064648e-01 9.467676e-01
[23,] 0.061152263 1.223045e-01 9.388477e-01
[24,] 0.048539431 9.707886e-02 9.514606e-01
[25,] 0.035738168 7.147634e-02 9.642618e-01
[26,] 0.029038574 5.807715e-02 9.709614e-01
[27,] 0.020494847 4.098969e-02 9.795052e-01
[28,] 0.014751946 2.950389e-02 9.852481e-01
[29,] 0.016678627 3.335725e-02 9.833214e-01
[30,] 0.011667069 2.333414e-02 9.883329e-01
[31,] 0.008135982 1.627196e-02 9.918640e-01
[32,] 0.005506144 1.101229e-02 9.944939e-01
[33,] 0.058776813 1.175536e-01 9.412232e-01
[34,] 0.048515122 9.703024e-02 9.514849e-01
[35,] 0.035893939 7.178788e-02 9.641061e-01
[36,] 0.026538574 5.307715e-02 9.734614e-01
[37,] 0.019720309 3.944062e-02 9.802797e-01
[38,] 0.014010615 2.802123e-02 9.859894e-01
[39,] 0.010926737 2.185347e-02 9.890733e-01
[40,] 0.007821286 1.564257e-02 9.921787e-01
[41,] 0.005625623 1.125125e-02 9.943744e-01
[42,] 0.003820046 7.640091e-03 9.961800e-01
[43,] 0.002905240 5.810481e-03 9.970948e-01
[44,] 0.001929050 3.858100e-03 9.980709e-01
[45,] 0.001605762 3.211524e-03 9.983942e-01
[46,] 0.822941128 3.541177e-01 1.770589e-01
[47,] 0.791621543 4.167569e-01 2.083785e-01
[48,] 0.792411176 4.151776e-01 2.075888e-01
[49,] 0.807880687 3.842386e-01 1.921193e-01
[50,] 0.791957837 4.160843e-01 2.080422e-01
[51,] 0.891303444 2.173931e-01 1.086966e-01
[52,] 0.883921269 2.321575e-01 1.160787e-01
[53,] 0.859125371 2.817493e-01 1.408746e-01
[54,] 0.834859608 3.302808e-01 1.651404e-01
[55,] 0.812076085 3.758478e-01 1.879239e-01
[56,] 0.786103628 4.277927e-01 2.138964e-01
[57,] 0.750621813 4.987564e-01 2.493782e-01
[58,] 0.719799288 5.604014e-01 2.802007e-01
[59,] 0.683395656 6.332087e-01 3.166043e-01
[60,] 0.755115828 4.897683e-01 2.448842e-01
[61,] 0.822473021 3.550540e-01 1.775270e-01
[62,] 0.791873652 4.162527e-01 2.081263e-01
[63,] 0.759870323 4.802594e-01 2.401297e-01
[64,] 0.737551445 5.248971e-01 2.624486e-01
[65,] 0.699046554 6.019069e-01 3.009534e-01
[66,] 0.661942294 6.761154e-01 3.380577e-01
[67,] 0.644922926 7.101541e-01 3.550771e-01
[68,] 0.604430150 7.911397e-01 3.955699e-01
[69,] 0.604687234 7.906255e-01 3.953128e-01
[70,] 0.562491653 8.750167e-01 4.375083e-01
[71,] 0.541467511 9.170650e-01 4.585325e-01
[72,] 0.496706053 9.934121e-01 5.032939e-01
[73,] 0.451745624 9.034912e-01 5.482544e-01
[74,] 0.410328400 8.206568e-01 5.896716e-01
[75,] 0.395021819 7.900436e-01 6.049782e-01
[76,] 0.361324340 7.226487e-01 6.386757e-01
[77,] 0.320024226 6.400485e-01 6.799758e-01
[78,] 0.280783911 5.615678e-01 7.192161e-01
[79,] 0.244992447 4.899849e-01 7.550076e-01
[80,] 0.212358879 4.247178e-01 7.876411e-01
[81,] 0.309639083 6.192782e-01 6.903609e-01
[82,] 0.276983324 5.539666e-01 7.230167e-01
[83,] 0.289858051 5.797161e-01 7.101419e-01
[84,] 0.254576440 5.091529e-01 7.454236e-01
[85,] 0.220188258 4.403765e-01 7.798117e-01
[86,] 0.187955365 3.759107e-01 8.120446e-01
[87,] 0.160627136 3.212543e-01 8.393729e-01
[88,] 0.143385327 2.867707e-01 8.566147e-01
[89,] 0.141810325 2.836206e-01 8.581897e-01
[90,] 0.136766508 2.735330e-01 8.632335e-01
[91,] 0.126575047 2.531501e-01 8.734250e-01
[92,] 0.115317986 2.306360e-01 8.846820e-01
[93,] 0.096197254 1.923945e-01 9.038027e-01
[94,] 0.082490983 1.649820e-01 9.175090e-01
[95,] 0.081961879 1.639238e-01 9.180381e-01
[96,] 0.319334588 6.386692e-01 6.806654e-01
[97,] 0.280442212 5.608844e-01 7.195578e-01
[98,] 0.242921183 4.858424e-01 7.570788e-01
[99,] 0.303748275 6.074966e-01 6.962517e-01
[100,] 0.321725243 6.434505e-01 6.782748e-01
[101,] 0.282706783 5.654136e-01 7.172932e-01
[102,] 0.246868410 4.937368e-01 7.531316e-01
[103,] 0.246971415 4.939428e-01 7.530286e-01
[104,] 0.254063097 5.081262e-01 7.459369e-01
[105,] 0.226998318 4.539966e-01 7.730017e-01
[106,] 0.191950256 3.839005e-01 8.080497e-01
[107,] 0.161776777 3.235536e-01 8.382232e-01
[108,] 0.133191347 2.663827e-01 8.668087e-01
[109,] 0.114386544 2.287731e-01 8.856135e-01
[110,] 0.098874493 1.977490e-01 9.011255e-01
[111,] 0.079508567 1.590171e-01 9.204914e-01
[112,] 0.081964558 1.639291e-01 9.180354e-01
[113,] 0.064416055 1.288321e-01 9.355839e-01
[114,] 0.052162955 1.043259e-01 9.478370e-01
[115,] 0.042526466 8.505293e-02 9.574735e-01
[116,] 0.033678556 6.735711e-02 9.663214e-01
[117,] 0.025116502 5.023300e-02 9.748835e-01
[118,] 0.019911865 3.982373e-02 9.800881e-01
[119,] 0.017793479 3.558696e-02 9.822065e-01
[120,] 0.021064055 4.212811e-02 9.789359e-01
[121,] 0.016699722 3.339944e-02 9.833003e-01
[122,] 0.034851058 6.970212e-02 9.651489e-01
[123,] 0.027657397 5.531479e-02 9.723426e-01
[124,] 0.025077224 5.015445e-02 9.749228e-01
[125,] 0.034680459 6.936092e-02 9.653195e-01
[126,] 0.025669143 5.133829e-02 9.743309e-01
[127,] 0.999999980 4.049435e-08 2.024717e-08
[128,] 0.999999994 1.106357e-08 5.531787e-09
[129,] 0.999999985 2.976443e-08 1.488222e-08
[130,] 0.999999959 8.112626e-08 4.056313e-08
[131,] 0.999999967 6.638590e-08 3.319295e-08
[132,] 0.999999998 4.780140e-09 2.390070e-09
[133,] 0.999999991 1.714046e-08 8.570232e-09
[134,] 1.000000000 3.447550e-13 1.723775e-13
[135,] 1.000000000 2.333575e-14 1.166787e-14
[136,] 1.000000000 1.897301e-13 9.486505e-14
[137,] 1.000000000 1.439529e-12 7.197647e-13
[138,] 1.000000000 8.229507e-15 4.114754e-15
[139,] 1.000000000 9.313654e-14 4.656827e-14
[140,] 1.000000000 1.444307e-12 7.221533e-13
[141,] 1.000000000 8.583983e-12 4.291992e-12
[142,] 1.000000000 1.030772e-10 5.153859e-11
[143,] 1.000000000 1.465128e-10 7.325641e-11
[144,] 0.999999999 2.741648e-09 1.370824e-09
[145,] 0.999999976 4.706640e-08 2.353320e-08
[146,] 0.999999677 6.455126e-07 3.227563e-07
[147,] 0.999995947 8.105855e-06 4.052928e-06
[148,] 0.999977659 4.468269e-05 2.234135e-05
[149,] 0.999641245 7.175091e-04 3.587546e-04
> postscript(file="/var/wessaorg/rcomp/tmp/1kilh1323436071.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/2sigk1323436071.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/30qmr1323436071.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/4ayqk1323436071.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/5cht91323436071.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
-25.955724755 6.995246628 -14.476551000 24.945603998 -10.286516182
6 7 8 9 10
-9.158003680 -33.594675614 -3.991229212 -14.284999304 -30.425230629
11 12 13 14 15
5.512158527 20.182227703 1.638793877 -37.920948491 -3.488270104
16 17 18 19 20
47.488000598 -25.295134915 36.375278043 -10.173626540 -11.449484893
21 22 23 24 25
-22.588309678 -32.622199824 -22.823488439 -16.822027985 31.144142722
26 27 28 29 30
35.741655854 33.912577376 -5.568024294 -8.524956142 -36.669089936
31 32 33 34 35
-17.028759949 -2.967908201 -19.294684657 -6.534284876 -22.027592834
36 37 38 39 40
-35.790531953 -7.478072321 2.931125103 -11.525830013 67.011867078
41 42 43 44 45
-23.394443005 -2.898518692 1.170933349 -9.057610917 3.439586738
46 47 48 49 50
4.502879303 5.077062899 -6.925684445 -5.363854444 -14.694844356
51 52 53 54 55
-1.875603543 11.777109298 165.586057412 -11.267523649 26.711485402
56 57 58 59 60
-38.593638659 -22.017742294 65.770968913 26.038247193 -0.748913738
61 62 63 64 65
11.714609105 16.534449378 13.400722841 -2.281231185 -13.604795949
66 67 68 69 70
-10.957637149 53.245072641 53.631544569 -4.463401645 8.880023279
71 72 73 74 75
-19.706039337 -1.181495192 -9.759414195 -23.040257342 -8.271401445
76 77 78 79 80
-31.289122728 -6.841788840 24.412755713 -4.363578613 -3.308629323
81 82 83 84 85
-9.168565235 -24.968796642 13.692951982 1.283807568 -4.584912150
86 87 88 89 90
-3.428982644 -5.125057673 57.616438615 -8.116188631 35.755856106
91 92 93 94 95
-2.845605271 -3.182029246 -2.661322789 -9.848476663 -18.373574014
96 97 98 99 100
-30.133393121 -28.538599889 -23.924230803 19.990393483 -11.074681877
101 102 103 104 105
14.666028691 -31.058998122 94.175122608 -8.946341967 4.942409257
106 107 108 109 110
48.046641547 -38.223279904 -8.948390561 8.485869052 26.450743661
111 112 113 114 115
-33.774431279 -18.395223341 0.384438063 4.724094257 -0.450321572
116 117 118 119 120
-17.879688393 -15.522478135 6.761185070 -33.371509365 2.147686595
121 122 123 124 125
16.501176643 -17.181363781 9.895866249 -2.913415442 16.514006559
126 127 128 129 130
-27.635969008 -34.031655806 -15.979174967 -46.260816779 -8.808875566
131 132 133 134 135
-19.798333261 -32.809921778 -8.730603781 195.605283176 27.941112581
136 137 138 139 140
-9.866828847 8.292533813 12.700566569 -32.404479237 -0.004194531
141 142 143 144 145
33.651786006 -5.184373287 -1.853187190 4.640383442 -6.765748698
146 147 148 149 150
-6.404352611 0.756519750 4.685373983 -3.469368977 2.394665625
151 152 153 154 155
-2.495870594 -1.593407475 -3.469095764 -3.469095764 1.646958628
156 157 158 159 160
8.760924111 -3.469095764 0.475442088 -0.469606105 1.521728621
161 162 163 164
-3.640382094 -15.054313960 -1.733838726 -8.164403753
> postscript(file="/var/wessaorg/rcomp/tmp/6ngns1323436071.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 -25.955724755 NA
1 6.995246628 -25.955724755
2 -14.476551000 6.995246628
3 24.945603998 -14.476551000
4 -10.286516182 24.945603998
5 -9.158003680 -10.286516182
6 -33.594675614 -9.158003680
7 -3.991229212 -33.594675614
8 -14.284999304 -3.991229212
9 -30.425230629 -14.284999304
10 5.512158527 -30.425230629
11 20.182227703 5.512158527
12 1.638793877 20.182227703
13 -37.920948491 1.638793877
14 -3.488270104 -37.920948491
15 47.488000598 -3.488270104
16 -25.295134915 47.488000598
17 36.375278043 -25.295134915
18 -10.173626540 36.375278043
19 -11.449484893 -10.173626540
20 -22.588309678 -11.449484893
21 -32.622199824 -22.588309678
22 -22.823488439 -32.622199824
23 -16.822027985 -22.823488439
24 31.144142722 -16.822027985
25 35.741655854 31.144142722
26 33.912577376 35.741655854
27 -5.568024294 33.912577376
28 -8.524956142 -5.568024294
29 -36.669089936 -8.524956142
30 -17.028759949 -36.669089936
31 -2.967908201 -17.028759949
32 -19.294684657 -2.967908201
33 -6.534284876 -19.294684657
34 -22.027592834 -6.534284876
35 -35.790531953 -22.027592834
36 -7.478072321 -35.790531953
37 2.931125103 -7.478072321
38 -11.525830013 2.931125103
39 67.011867078 -11.525830013
40 -23.394443005 67.011867078
41 -2.898518692 -23.394443005
42 1.170933349 -2.898518692
43 -9.057610917 1.170933349
44 3.439586738 -9.057610917
45 4.502879303 3.439586738
46 5.077062899 4.502879303
47 -6.925684445 5.077062899
48 -5.363854444 -6.925684445
49 -14.694844356 -5.363854444
50 -1.875603543 -14.694844356
51 11.777109298 -1.875603543
52 165.586057412 11.777109298
53 -11.267523649 165.586057412
54 26.711485402 -11.267523649
55 -38.593638659 26.711485402
56 -22.017742294 -38.593638659
57 65.770968913 -22.017742294
58 26.038247193 65.770968913
59 -0.748913738 26.038247193
60 11.714609105 -0.748913738
61 16.534449378 11.714609105
62 13.400722841 16.534449378
63 -2.281231185 13.400722841
64 -13.604795949 -2.281231185
65 -10.957637149 -13.604795949
66 53.245072641 -10.957637149
67 53.631544569 53.245072641
68 -4.463401645 53.631544569
69 8.880023279 -4.463401645
70 -19.706039337 8.880023279
71 -1.181495192 -19.706039337
72 -9.759414195 -1.181495192
73 -23.040257342 -9.759414195
74 -8.271401445 -23.040257342
75 -31.289122728 -8.271401445
76 -6.841788840 -31.289122728
77 24.412755713 -6.841788840
78 -4.363578613 24.412755713
79 -3.308629323 -4.363578613
80 -9.168565235 -3.308629323
81 -24.968796642 -9.168565235
82 13.692951982 -24.968796642
83 1.283807568 13.692951982
84 -4.584912150 1.283807568
85 -3.428982644 -4.584912150
86 -5.125057673 -3.428982644
87 57.616438615 -5.125057673
88 -8.116188631 57.616438615
89 35.755856106 -8.116188631
90 -2.845605271 35.755856106
91 -3.182029246 -2.845605271
92 -2.661322789 -3.182029246
93 -9.848476663 -2.661322789
94 -18.373574014 -9.848476663
95 -30.133393121 -18.373574014
96 -28.538599889 -30.133393121
97 -23.924230803 -28.538599889
98 19.990393483 -23.924230803
99 -11.074681877 19.990393483
100 14.666028691 -11.074681877
101 -31.058998122 14.666028691
102 94.175122608 -31.058998122
103 -8.946341967 94.175122608
104 4.942409257 -8.946341967
105 48.046641547 4.942409257
106 -38.223279904 48.046641547
107 -8.948390561 -38.223279904
108 8.485869052 -8.948390561
109 26.450743661 8.485869052
110 -33.774431279 26.450743661
111 -18.395223341 -33.774431279
112 0.384438063 -18.395223341
113 4.724094257 0.384438063
114 -0.450321572 4.724094257
115 -17.879688393 -0.450321572
116 -15.522478135 -17.879688393
117 6.761185070 -15.522478135
118 -33.371509365 6.761185070
119 2.147686595 -33.371509365
120 16.501176643 2.147686595
121 -17.181363781 16.501176643
122 9.895866249 -17.181363781
123 -2.913415442 9.895866249
124 16.514006559 -2.913415442
125 -27.635969008 16.514006559
126 -34.031655806 -27.635969008
127 -15.979174967 -34.031655806
128 -46.260816779 -15.979174967
129 -8.808875566 -46.260816779
130 -19.798333261 -8.808875566
131 -32.809921778 -19.798333261
132 -8.730603781 -32.809921778
133 195.605283176 -8.730603781
134 27.941112581 195.605283176
135 -9.866828847 27.941112581
136 8.292533813 -9.866828847
137 12.700566569 8.292533813
138 -32.404479237 12.700566569
139 -0.004194531 -32.404479237
140 33.651786006 -0.004194531
141 -5.184373287 33.651786006
142 -1.853187190 -5.184373287
143 4.640383442 -1.853187190
144 -6.765748698 4.640383442
145 -6.404352611 -6.765748698
146 0.756519750 -6.404352611
147 4.685373983 0.756519750
148 -3.469368977 4.685373983
149 2.394665625 -3.469368977
150 -2.495870594 2.394665625
151 -1.593407475 -2.495870594
152 -3.469095764 -1.593407475
153 -3.469095764 -3.469095764
154 1.646958628 -3.469095764
155 8.760924111 1.646958628
156 -3.469095764 8.760924111
157 0.475442088 -3.469095764
158 -0.469606105 0.475442088
159 1.521728621 -0.469606105
160 -3.640382094 1.521728621
161 -15.054313960 -3.640382094
162 -1.733838726 -15.054313960
163 -8.164403753 -1.733838726
164 NA -8.164403753
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 6.995246628 -25.955724755
[2,] -14.476551000 6.995246628
[3,] 24.945603998 -14.476551000
[4,] -10.286516182 24.945603998
[5,] -9.158003680 -10.286516182
[6,] -33.594675614 -9.158003680
[7,] -3.991229212 -33.594675614
[8,] -14.284999304 -3.991229212
[9,] -30.425230629 -14.284999304
[10,] 5.512158527 -30.425230629
[11,] 20.182227703 5.512158527
[12,] 1.638793877 20.182227703
[13,] -37.920948491 1.638793877
[14,] -3.488270104 -37.920948491
[15,] 47.488000598 -3.488270104
[16,] -25.295134915 47.488000598
[17,] 36.375278043 -25.295134915
[18,] -10.173626540 36.375278043
[19,] -11.449484893 -10.173626540
[20,] -22.588309678 -11.449484893
[21,] -32.622199824 -22.588309678
[22,] -22.823488439 -32.622199824
[23,] -16.822027985 -22.823488439
[24,] 31.144142722 -16.822027985
[25,] 35.741655854 31.144142722
[26,] 33.912577376 35.741655854
[27,] -5.568024294 33.912577376
[28,] -8.524956142 -5.568024294
[29,] -36.669089936 -8.524956142
[30,] -17.028759949 -36.669089936
[31,] -2.967908201 -17.028759949
[32,] -19.294684657 -2.967908201
[33,] -6.534284876 -19.294684657
[34,] -22.027592834 -6.534284876
[35,] -35.790531953 -22.027592834
[36,] -7.478072321 -35.790531953
[37,] 2.931125103 -7.478072321
[38,] -11.525830013 2.931125103
[39,] 67.011867078 -11.525830013
[40,] -23.394443005 67.011867078
[41,] -2.898518692 -23.394443005
[42,] 1.170933349 -2.898518692
[43,] -9.057610917 1.170933349
[44,] 3.439586738 -9.057610917
[45,] 4.502879303 3.439586738
[46,] 5.077062899 4.502879303
[47,] -6.925684445 5.077062899
[48,] -5.363854444 -6.925684445
[49,] -14.694844356 -5.363854444
[50,] -1.875603543 -14.694844356
[51,] 11.777109298 -1.875603543
[52,] 165.586057412 11.777109298
[53,] -11.267523649 165.586057412
[54,] 26.711485402 -11.267523649
[55,] -38.593638659 26.711485402
[56,] -22.017742294 -38.593638659
[57,] 65.770968913 -22.017742294
[58,] 26.038247193 65.770968913
[59,] -0.748913738 26.038247193
[60,] 11.714609105 -0.748913738
[61,] 16.534449378 11.714609105
[62,] 13.400722841 16.534449378
[63,] -2.281231185 13.400722841
[64,] -13.604795949 -2.281231185
[65,] -10.957637149 -13.604795949
[66,] 53.245072641 -10.957637149
[67,] 53.631544569 53.245072641
[68,] -4.463401645 53.631544569
[69,] 8.880023279 -4.463401645
[70,] -19.706039337 8.880023279
[71,] -1.181495192 -19.706039337
[72,] -9.759414195 -1.181495192
[73,] -23.040257342 -9.759414195
[74,] -8.271401445 -23.040257342
[75,] -31.289122728 -8.271401445
[76,] -6.841788840 -31.289122728
[77,] 24.412755713 -6.841788840
[78,] -4.363578613 24.412755713
[79,] -3.308629323 -4.363578613
[80,] -9.168565235 -3.308629323
[81,] -24.968796642 -9.168565235
[82,] 13.692951982 -24.968796642
[83,] 1.283807568 13.692951982
[84,] -4.584912150 1.283807568
[85,] -3.428982644 -4.584912150
[86,] -5.125057673 -3.428982644
[87,] 57.616438615 -5.125057673
[88,] -8.116188631 57.616438615
[89,] 35.755856106 -8.116188631
[90,] -2.845605271 35.755856106
[91,] -3.182029246 -2.845605271
[92,] -2.661322789 -3.182029246
[93,] -9.848476663 -2.661322789
[94,] -18.373574014 -9.848476663
[95,] -30.133393121 -18.373574014
[96,] -28.538599889 -30.133393121
[97,] -23.924230803 -28.538599889
[98,] 19.990393483 -23.924230803
[99,] -11.074681877 19.990393483
[100,] 14.666028691 -11.074681877
[101,] -31.058998122 14.666028691
[102,] 94.175122608 -31.058998122
[103,] -8.946341967 94.175122608
[104,] 4.942409257 -8.946341967
[105,] 48.046641547 4.942409257
[106,] -38.223279904 48.046641547
[107,] -8.948390561 -38.223279904
[108,] 8.485869052 -8.948390561
[109,] 26.450743661 8.485869052
[110,] -33.774431279 26.450743661
[111,] -18.395223341 -33.774431279
[112,] 0.384438063 -18.395223341
[113,] 4.724094257 0.384438063
[114,] -0.450321572 4.724094257
[115,] -17.879688393 -0.450321572
[116,] -15.522478135 -17.879688393
[117,] 6.761185070 -15.522478135
[118,] -33.371509365 6.761185070
[119,] 2.147686595 -33.371509365
[120,] 16.501176643 2.147686595
[121,] -17.181363781 16.501176643
[122,] 9.895866249 -17.181363781
[123,] -2.913415442 9.895866249
[124,] 16.514006559 -2.913415442
[125,] -27.635969008 16.514006559
[126,] -34.031655806 -27.635969008
[127,] -15.979174967 -34.031655806
[128,] -46.260816779 -15.979174967
[129,] -8.808875566 -46.260816779
[130,] -19.798333261 -8.808875566
[131,] -32.809921778 -19.798333261
[132,] -8.730603781 -32.809921778
[133,] 195.605283176 -8.730603781
[134,] 27.941112581 195.605283176
[135,] -9.866828847 27.941112581
[136,] 8.292533813 -9.866828847
[137,] 12.700566569 8.292533813
[138,] -32.404479237 12.700566569
[139,] -0.004194531 -32.404479237
[140,] 33.651786006 -0.004194531
[141,] -5.184373287 33.651786006
[142,] -1.853187190 -5.184373287
[143,] 4.640383442 -1.853187190
[144,] -6.765748698 4.640383442
[145,] -6.404352611 -6.765748698
[146,] 0.756519750 -6.404352611
[147,] 4.685373983 0.756519750
[148,] -3.469368977 4.685373983
[149,] 2.394665625 -3.469368977
[150,] -2.495870594 2.394665625
[151,] -1.593407475 -2.495870594
[152,] -3.469095764 -1.593407475
[153,] -3.469095764 -3.469095764
[154,] 1.646958628 -3.469095764
[155,] 8.760924111 1.646958628
[156,] -3.469095764 8.760924111
[157,] 0.475442088 -3.469095764
[158,] -0.469606105 0.475442088
[159,] 1.521728621 -0.469606105
[160,] -3.640382094 1.521728621
[161,] -15.054313960 -3.640382094
[162,] -1.733838726 -15.054313960
[163,] -8.164403753 -1.733838726
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 6.995246628 -25.955724755
2 -14.476551000 6.995246628
3 24.945603998 -14.476551000
4 -10.286516182 24.945603998
5 -9.158003680 -10.286516182
6 -33.594675614 -9.158003680
7 -3.991229212 -33.594675614
8 -14.284999304 -3.991229212
9 -30.425230629 -14.284999304
10 5.512158527 -30.425230629
11 20.182227703 5.512158527
12 1.638793877 20.182227703
13 -37.920948491 1.638793877
14 -3.488270104 -37.920948491
15 47.488000598 -3.488270104
16 -25.295134915 47.488000598
17 36.375278043 -25.295134915
18 -10.173626540 36.375278043
19 -11.449484893 -10.173626540
20 -22.588309678 -11.449484893
21 -32.622199824 -22.588309678
22 -22.823488439 -32.622199824
23 -16.822027985 -22.823488439
24 31.144142722 -16.822027985
25 35.741655854 31.144142722
26 33.912577376 35.741655854
27 -5.568024294 33.912577376
28 -8.524956142 -5.568024294
29 -36.669089936 -8.524956142
30 -17.028759949 -36.669089936
31 -2.967908201 -17.028759949
32 -19.294684657 -2.967908201
33 -6.534284876 -19.294684657
34 -22.027592834 -6.534284876
35 -35.790531953 -22.027592834
36 -7.478072321 -35.790531953
37 2.931125103 -7.478072321
38 -11.525830013 2.931125103
39 67.011867078 -11.525830013
40 -23.394443005 67.011867078
41 -2.898518692 -23.394443005
42 1.170933349 -2.898518692
43 -9.057610917 1.170933349
44 3.439586738 -9.057610917
45 4.502879303 3.439586738
46 5.077062899 4.502879303
47 -6.925684445 5.077062899
48 -5.363854444 -6.925684445
49 -14.694844356 -5.363854444
50 -1.875603543 -14.694844356
51 11.777109298 -1.875603543
52 165.586057412 11.777109298
53 -11.267523649 165.586057412
54 26.711485402 -11.267523649
55 -38.593638659 26.711485402
56 -22.017742294 -38.593638659
57 65.770968913 -22.017742294
58 26.038247193 65.770968913
59 -0.748913738 26.038247193
60 11.714609105 -0.748913738
61 16.534449378 11.714609105
62 13.400722841 16.534449378
63 -2.281231185 13.400722841
64 -13.604795949 -2.281231185
65 -10.957637149 -13.604795949
66 53.245072641 -10.957637149
67 53.631544569 53.245072641
68 -4.463401645 53.631544569
69 8.880023279 -4.463401645
70 -19.706039337 8.880023279
71 -1.181495192 -19.706039337
72 -9.759414195 -1.181495192
73 -23.040257342 -9.759414195
74 -8.271401445 -23.040257342
75 -31.289122728 -8.271401445
76 -6.841788840 -31.289122728
77 24.412755713 -6.841788840
78 -4.363578613 24.412755713
79 -3.308629323 -4.363578613
80 -9.168565235 -3.308629323
81 -24.968796642 -9.168565235
82 13.692951982 -24.968796642
83 1.283807568 13.692951982
84 -4.584912150 1.283807568
85 -3.428982644 -4.584912150
86 -5.125057673 -3.428982644
87 57.616438615 -5.125057673
88 -8.116188631 57.616438615
89 35.755856106 -8.116188631
90 -2.845605271 35.755856106
91 -3.182029246 -2.845605271
92 -2.661322789 -3.182029246
93 -9.848476663 -2.661322789
94 -18.373574014 -9.848476663
95 -30.133393121 -18.373574014
96 -28.538599889 -30.133393121
97 -23.924230803 -28.538599889
98 19.990393483 -23.924230803
99 -11.074681877 19.990393483
100 14.666028691 -11.074681877
101 -31.058998122 14.666028691
102 94.175122608 -31.058998122
103 -8.946341967 94.175122608
104 4.942409257 -8.946341967
105 48.046641547 4.942409257
106 -38.223279904 48.046641547
107 -8.948390561 -38.223279904
108 8.485869052 -8.948390561
109 26.450743661 8.485869052
110 -33.774431279 26.450743661
111 -18.395223341 -33.774431279
112 0.384438063 -18.395223341
113 4.724094257 0.384438063
114 -0.450321572 4.724094257
115 -17.879688393 -0.450321572
116 -15.522478135 -17.879688393
117 6.761185070 -15.522478135
118 -33.371509365 6.761185070
119 2.147686595 -33.371509365
120 16.501176643 2.147686595
121 -17.181363781 16.501176643
122 9.895866249 -17.181363781
123 -2.913415442 9.895866249
124 16.514006559 -2.913415442
125 -27.635969008 16.514006559
126 -34.031655806 -27.635969008
127 -15.979174967 -34.031655806
128 -46.260816779 -15.979174967
129 -8.808875566 -46.260816779
130 -19.798333261 -8.808875566
131 -32.809921778 -19.798333261
132 -8.730603781 -32.809921778
133 195.605283176 -8.730603781
134 27.941112581 195.605283176
135 -9.866828847 27.941112581
136 8.292533813 -9.866828847
137 12.700566569 8.292533813
138 -32.404479237 12.700566569
139 -0.004194531 -32.404479237
140 33.651786006 -0.004194531
141 -5.184373287 33.651786006
142 -1.853187190 -5.184373287
143 4.640383442 -1.853187190
144 -6.765748698 4.640383442
145 -6.404352611 -6.765748698
146 0.756519750 -6.404352611
147 4.685373983 0.756519750
148 -3.469368977 4.685373983
149 2.394665625 -3.469368977
150 -2.495870594 2.394665625
151 -1.593407475 -2.495870594
152 -3.469095764 -1.593407475
153 -3.469095764 -3.469095764
154 1.646958628 -3.469095764
155 8.760924111 1.646958628
156 -3.469095764 8.760924111
157 0.475442088 -3.469095764
158 -0.469606105 0.475442088
159 1.521728621 -0.469606105
160 -3.640382094 1.521728621
161 -15.054313960 -3.640382094
162 -1.733838726 -15.054313960
163 -8.164403753 -1.733838726
> 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/79p3n1323436071.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/8ugze1323436071.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/9ykwr1323436071.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/103cb41323436071.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/113yvd1323436071.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/12xmya1323436071.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/133rjq1323436072.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/1487ih1323436072.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/15wl4r1323436072.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/1613501323436072.tab")
+ }
>
> try(system("convert tmp/1kilh1323436071.ps tmp/1kilh1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/2sigk1323436071.ps tmp/2sigk1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/30qmr1323436071.ps tmp/30qmr1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ayqk1323436071.ps tmp/4ayqk1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cht91323436071.ps tmp/5cht91323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ngns1323436071.ps tmp/6ngns1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/79p3n1323436071.ps tmp/79p3n1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ugze1323436071.ps tmp/8ugze1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ykwr1323436071.ps tmp/9ykwr1323436071.png",intern=TRUE))
character(0)
> try(system("convert tmp/103cb41323436071.ps tmp/103cb41323436071.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.214 0.543 5.786