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('TimeinRFC'
+ ,'#logins'
+ ,'#FBmess'
+ ,'#revCom'
+ ,'#char')
+ ,1:164))
> y <- array(NA,dim=c(5,164),dimnames=list(c('TimeinRFC','#logins','#FBmess','#revCom','#char'),1:164))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> 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
TimeinRFC #logins #FBmess #revCom #char
1 252101 62 34 104 124252
2 134577 59 30 111 98956
3 198520 62 38 93 98073
4 189326 94 34 119 106816
5 137449 43 25 57 41449
6 65295 27 31 80 76173
7 439387 103 29 107 177551
8 33186 19 18 22 22807
9 178368 51 30 103 126938
10 186657 38 29 72 61680
11 261949 96 38 123 72117
12 191051 95 49 164 79738
13 138866 57 33 100 57793
14 296878 66 46 143 91677
15 192648 72 38 79 64631
16 333462 162 52 183 106385
17 243571 58 32 123 161961
18 263451 130 35 81 112669
19 155679 48 25 74 114029
20 227053 70 42 158 124550
21 240028 63 40 133 105416
22 388549 90 35 128 72875
23 156540 34 25 84 81964
24 148421 43 46 184 104880
25 177732 97 36 127 76302
26 191441 105 35 128 96740
27 249893 122 38 118 93071
28 236812 76 35 125 78912
29 142329 45 28 89 35224
30 259667 53 37 122 90694
31 231625 65 40 151 125369
32 176062 67 42 122 80849
33 286683 79 44 162 104434
34 87485 33 33 121 65702
35 322865 83 35 132 108179
36 247082 51 37 110 63583
37 346011 106 39 135 95066
38 191653 74 32 80 62486
39 114673 31 17 46 31081
40 284224 161 34 127 94584
41 284195 72 33 103 87408
42 155363 59 35 95 68966
43 177306 67 32 100 88766
44 144571 49 35 102 57139
45 140319 73 45 45 90586
46 405267 135 38 122 109249
47 78800 42 26 66 33032
48 201970 69 45 159 96056
49 302674 99 44 153 146648
50 164733 50 40 131 80613
51 194221 68 33 113 87026
52 24188 24 4 7 5950
53 342263 279 41 147 131106
54 65029 17 18 61 32551
55 101097 64 14 41 31701
56 246088 46 33 108 91072
57 273108 75 49 184 159803
58 282220 160 32 115 143950
59 273495 119 37 132 112368
60 214872 74 32 113 82124
61 335121 124 41 141 144068
62 267171 107 25 65 162627
63 187938 88 40 87 55062
64 229512 78 35 121 95329
65 209798 61 33 112 105612
66 201345 60 28 81 62853
67 163833 114 31 116 125976
68 204250 129 40 132 79146
69 197813 67 32 104 108461
70 132955 60 25 80 99971
71 216092 59 42 145 77826
72 73566 32 23 67 22618
73 213198 67 42 159 84892
74 181713 49 38 90 92059
75 148698 49 34 120 77993
76 300103 70 38 126 104155
77 251437 78 32 118 109840
78 197295 101 37 112 238712
79 158163 55 34 123 67486
80 155529 57 33 98 68007
81 132672 41 25 78 48194
82 377205 100 40 119 134796
83 145905 66 26 99 38692
84 223701 87 40 81 93587
85 80953 25 8 27 56622
86 130805 47 27 77 15986
87 135082 48 32 118 113402
88 300805 156 33 122 97967
89 271806 95 50 103 74844
90 150949 96 37 129 136051
91 225805 79 33 69 50548
92 197389 68 34 121 112215
93 156583 56 28 81 59591
94 222599 66 32 119 59938
95 261601 70 32 116 137639
96 178489 35 32 123 143372
97 200657 43 31 111 138599
98 259084 68 35 100 174110
99 313075 130 58 221 135062
100 346933 100 27 95 175681
101 246440 104 45 153 130307
102 252444 58 37 118 139141
103 159965 159 32 50 44244
104 43287 14 19 64 43750
105 172239 68 22 34 48029
106 183738 120 35 76 95216
107 227681 43 36 112 92288
108 260464 81 36 115 94588
109 106288 54 23 69 197426
110 109632 77 36 108 151244
111 268905 58 36 130 139206
112 266805 78 42 110 106271
113 23623 11 1 0 1168
114 152474 65 32 83 71764
115 61857 25 11 30 25162
116 144889 43 40 106 45635
117 346600 99 34 91 101817
118 21054 16 0 0 855
119 224051 45 27 69 100174
120 31414 19 8 9 14116
121 261043 105 35 123 85008
122 197819 57 41 143 124254
123 154984 73 40 125 105793
124 112933 45 28 81 117129
125 38214 34 8 21 8773
126 158671 33 35 124 94747
127 302148 70 47 168 107549
128 177918 55 46 149 97392
129 350552 70 42 147 126893
130 275578 91 48 145 118850
131 368746 106 49 172 234853
132 172464 31 35 126 74783
133 94381 35 32 89 66089
134 243875 279 36 137 95684
135 382487 153 42 149 139537
136 114525 40 35 121 144253
137 335681 119 37 133 153824
138 147989 72 34 93 63995
139 216638 45 36 119 84891
140 192862 72 36 102 61263
141 184818 107 32 45 106221
142 336707 105 33 104 113587
143 215836 76 35 111 113864
144 173260 63 21 78 37238
145 271773 89 40 120 119906
146 130908 52 49 176 135096
147 204009 75 33 109 151611
148 245514 92 39 132 144645
149 1 0 0 0 0
150 14688 10 0 0 6023
151 98 1 0 0 0
152 455 2 0 0 0
153 0 0 0 0 0
154 0 0 0 0 0
155 195765 75 33 78 77457
156 326038 121 42 104 62464
157 0 0 0 0 0
158 203 4 0 0 0
159 7199 5 0 0 1644
160 46660 20 5 13 6179
161 17547 5 1 4 3926
162 107465 38 38 65 42087
163 969 2 0 0 0
164 173102 58 28 55 87656
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `#logins` `#FBmess` `#revCom` `#char`
3889.8946 835.0122 1598.5327 356.7955 0.5061
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-147837 -29614 -3051 28461 175098
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.890e+03 1.129e+04 0.344 0.7310
`#logins` 8.350e+02 1.218e+02 6.855 1.49e-10 ***
`#FBmess` 1.599e+03 8.061e+02 1.983 0.0491 *
`#revCom` 3.568e+02 2.240e+02 1.593 0.1132
`#char` 5.061e-01 1.260e-01 4.015 9.14e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 53070 on 159 degrees of freedom
Multiple R-squared: 0.7087, Adjusted R-squared: 0.7013
F-statistic: 96.69 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.4357502 8.715004e-01 5.642498e-01
[2,] 0.2937942 5.875883e-01 7.062058e-01
[3,] 0.5852119 8.295762e-01 4.147881e-01
[4,] 0.6229535 7.540929e-01 3.770465e-01
[5,] 0.5193803 9.612395e-01 4.806197e-01
[6,] 0.4281577 8.563153e-01 5.718423e-01
[7,] 0.7567539 4.864921e-01 2.432461e-01
[8,] 0.7336230 5.327540e-01 2.663770e-01
[9,] 0.6957606 6.084788e-01 3.042394e-01
[10,] 0.6261987 7.476026e-01 3.738013e-01
[11,] 0.6959091 6.081817e-01 3.040909e-01
[12,] 0.6530057 6.939887e-01 3.469943e-01
[13,] 0.5829347 8.341307e-01 4.170653e-01
[14,] 0.5248075 9.503849e-01 4.751925e-01
[15,] 0.9463325 1.073350e-01 5.366752e-02
[16,] 0.9253823 1.492355e-01 7.461773e-02
[17,] 0.9227680 1.544639e-01 7.723195e-02
[18,] 0.9272738 1.454523e-01 7.272617e-02
[19,] 0.9362624 1.274753e-01 6.373763e-02
[20,] 0.9189500 1.621000e-01 8.105001e-02
[21,] 0.9038481 1.923038e-01 9.615190e-02
[22,] 0.8807497 2.385006e-01 1.192503e-01
[23,] 0.8985666 2.028667e-01 1.014334e-01
[24,] 0.8700567 2.598866e-01 1.299433e-01
[25,] 0.8435119 3.129763e-01 1.564881e-01
[26,] 0.8296893 3.406215e-01 1.703107e-01
[27,] 0.8321600 3.356799e-01 1.678400e-01
[28,] 0.8704563 2.590874e-01 1.295437e-01
[29,] 0.9041911 1.916178e-01 9.580888e-02
[30,] 0.9291251 1.417498e-01 7.087491e-02
[31,] 0.9093358 1.813284e-01 9.066420e-02
[32,] 0.8889697 2.220606e-01 1.110303e-01
[33,] 0.8821679 2.356641e-01 1.178321e-01
[34,] 0.9067696 1.864608e-01 9.323038e-02
[35,] 0.8873103 2.253793e-01 1.126897e-01
[36,] 0.8659907 2.680185e-01 1.340093e-01
[37,] 0.8384583 3.230833e-01 1.615417e-01
[38,] 0.8365187 3.269626e-01 1.634813e-01
[39,] 0.9125410 1.749181e-01 8.745904e-02
[40,] 0.9026142 1.947717e-01 9.738584e-02
[41,] 0.8862984 2.274032e-01 1.137016e-01
[42,] 0.8628585 2.742831e-01 1.371415e-01
[43,] 0.8396038 3.207924e-01 1.603962e-01
[44,] 0.8092866 3.814267e-01 1.907134e-01
[45,] 0.7835964 4.328073e-01 2.164036e-01
[46,] 0.9036431 1.927138e-01 9.635688e-02
[47,] 0.8848916 2.302168e-01 1.151084e-01
[48,] 0.8610992 2.778016e-01 1.389008e-01
[49,] 0.8690570 2.618860e-01 1.309430e-01
[50,] 0.8518162 2.963677e-01 1.481838e-01
[51,] 0.8412036 3.175929e-01 1.587964e-01
[52,] 0.8117472 3.765057e-01 1.882528e-01
[53,] 0.7807817 4.384366e-01 2.192183e-01
[54,] 0.7596292 4.807415e-01 2.403708e-01
[55,] 0.7344630 5.310739e-01 2.655370e-01
[56,] 0.6973270 6.053459e-01 3.026730e-01
[57,] 0.6574152 6.851697e-01 3.425848e-01
[58,] 0.6149674 7.700653e-01 3.850326e-01
[59,] 0.5964828 8.070345e-01 4.035172e-01
[60,] 0.6986798 6.026404e-01 3.013202e-01
[61,] 0.6988688 6.022625e-01 3.011312e-01
[62,] 0.6601374 6.797252e-01 3.398626e-01
[63,] 0.6506690 6.986620e-01 3.493310e-01
[64,] 0.6078751 7.842497e-01 3.921249e-01
[65,] 0.5747985 8.504030e-01 4.252015e-01
[66,] 0.5316277 9.367445e-01 4.683723e-01
[67,] 0.4861218 9.722437e-01 5.138782e-01
[68,] 0.4582797 9.165594e-01 5.417203e-01
[69,] 0.5083462 9.833077e-01 4.916538e-01
[70,] 0.4791174 9.582349e-01 5.208826e-01
[71,] 0.6606658 6.786683e-01 3.393342e-01
[72,] 0.6265194 7.469612e-01 3.734806e-01
[73,] 0.5874604 8.250792e-01 4.125396e-01
[74,] 0.5424265 9.151469e-01 4.575735e-01
[75,] 0.6987109 6.025783e-01 3.012891e-01
[76,] 0.6587728 6.824545e-01 3.412272e-01
[77,] 0.6166512 7.666976e-01 3.833488e-01
[78,] 0.5730733 8.538534e-01 4.269267e-01
[79,] 0.5292852 9.414295e-01 4.707148e-01
[80,] 0.5401354 9.197292e-01 4.598646e-01
[81,] 0.5048278 9.903444e-01 4.951722e-01
[82,] 0.4760484 9.520968e-01 5.239516e-01
[83,] 0.6059991 7.880019e-01 3.940009e-01
[84,] 0.6047131 7.905739e-01 3.952869e-01
[85,] 0.5641466 8.717069e-01 4.358534e-01
[86,] 0.5183878 9.632243e-01 4.816122e-01
[87,] 0.4984276 9.968552e-01 5.015724e-01
[88,] 0.4753794 9.507588e-01 5.246206e-01
[89,] 0.4366470 8.732940e-01 5.633530e-01
[90,] 0.3913555 7.827111e-01 6.086445e-01
[91,] 0.3531293 7.062587e-01 6.468707e-01
[92,] 0.3302375 6.604750e-01 6.697625e-01
[93,] 0.4413674 8.827348e-01 5.586326e-01
[94,] 0.4145683 8.291366e-01 5.854317e-01
[95,] 0.3858815 7.717630e-01 6.141185e-01
[96,] 0.4140131 8.280262e-01 5.859869e-01
[97,] 0.4062004 8.124009e-01 5.937996e-01
[98,] 0.3857185 7.714369e-01 6.142815e-01
[99,] 0.3786587 7.573174e-01 6.213413e-01
[100,] 0.3621135 7.242270e-01 6.378865e-01
[101,] 0.3456984 6.913969e-01 6.543016e-01
[102,] 0.4412524 8.825049e-01 5.587476e-01
[103,] 0.6842644 6.314712e-01 3.157356e-01
[104,] 0.6680546 6.638908e-01 3.319454e-01
[105,] 0.6424061 7.151877e-01 3.575939e-01
[106,] 0.5958566 8.082868e-01 4.041434e-01
[107,] 0.5558739 8.882521e-01 4.441261e-01
[108,] 0.5057536 9.884927e-01 4.942464e-01
[109,] 0.4607627 9.215255e-01 5.392373e-01
[110,] 0.6658853 6.682294e-01 3.341147e-01
[111,] 0.6178610 7.642780e-01 3.821390e-01
[112,] 0.6419686 7.160628e-01 3.580314e-01
[113,] 0.5933512 8.132976e-01 4.066488e-01
[114,] 0.5613220 8.773560e-01 4.386780e-01
[115,] 0.5235971 9.528059e-01 4.764029e-01
[116,] 0.5585672 8.828656e-01 4.414328e-01
[117,] 0.5775116 8.449768e-01 4.224884e-01
[118,] 0.5278447 9.443105e-01 4.721553e-01
[119,] 0.4812676 9.625351e-01 5.187324e-01
[120,] 0.4835213 9.670426e-01 5.164787e-01
[121,] 0.4661642 9.323284e-01 5.338358e-01
[122,] 0.6464606 7.070789e-01 3.535394e-01
[123,] 0.5947298 8.105404e-01 4.052702e-01
[124,] 0.5510530 8.978939e-01 4.489470e-01
[125,] 0.4986640 9.973279e-01 5.013360e-01
[126,] 0.4952204 9.904408e-01 5.047796e-01
[127,] 0.9997601 4.797051e-04 2.398526e-04
[128,] 0.9997351 5.298138e-04 2.649069e-04
[129,] 0.9996050 7.900688e-04 3.950344e-04
[130,] 0.9992781 1.443876e-03 7.219380e-04
[131,] 0.9995922 8.156856e-04 4.078428e-04
[132,] 0.9999467 1.066015e-04 5.330077e-05
[133,] 0.9998858 2.283773e-04 1.141886e-04
[134,] 1.0000000 1.198881e-08 5.994403e-09
[135,] 1.0000000 1.092925e-10 5.464626e-11
[136,] 1.0000000 5.199867e-10 2.599933e-10
[137,] 1.0000000 1.863460e-09 9.317300e-10
[138,] 1.0000000 4.304348e-12 2.152174e-12
[139,] 1.0000000 3.226054e-11 1.613027e-11
[140,] 1.0000000 3.091589e-10 1.545794e-10
[141,] 1.0000000 2.945914e-09 1.472957e-09
[142,] 1.0000000 2.243562e-08 1.121781e-08
[143,] 1.0000000 3.784980e-08 1.892490e-08
[144,] 0.9999998 3.833827e-07 1.916913e-07
[145,] 0.9999982 3.535668e-06 1.767834e-06
[146,] 0.9999864 2.718179e-05 1.359090e-05
[147,] 0.9999044 1.912997e-04 9.564985e-05
[148,] 0.9999962 7.559725e-06 3.779862e-06
[149,] 0.9999202 1.595503e-04 7.977515e-05
> postscript(file="/var/wessaorg/rcomp/tmp/15oyc1323624273.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/2y2ub1323624273.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/3fa5x1323624273.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/4jpvg1323624273.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/5z2xo1323624273.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
42099.5977 -56220.5033 -701.5960 -43923.3681 16375.5922 -77789.5146
7 8 9 10 11 12
175097.7628 -34734.8325 -17056.7264 47773.6851 36769.4516 -69362.9973
13 14 15 16 17 18
-30299.7407 66925.3336 6996.4084 -7958.5661 14243.0802 9138.6878
19 20 21 22 23 24
-12367.7150 -21834.5354 18786.2159 171007.5215 12843.5903 -83637.0374
25 26 27 28 29 30
-48630.7049 -50703.7326 -5817.7024 28975.7539 6522.9852 62946.4872
31 32 33 34 35 36
-7807.3365 -35358.7940 35836.8112 -73135.8973 91874.0776 70033.9289
37 38 39 40 41 42
94986.7672 14651.3686 25579.9925 -1634.9348 86445.5449 -22540.5059
43 44 45 46 47 48
-14286.7586 -21494.3104 -58362.1056 129086.2750 -41988.2458 -36814.1092
49 50 51 52 53 54
16974.2307 -32387.2417 -3563.0312 -11645.1796 -78936.7858 -20068.2689
55 56 57 58 59 60
-9285.6155 66410.5342 -18262.5436 -20309.4337 7126.5222 16157.3296
61 62 63 64 65 66
38928.8078 28474.2888 -12282.3466 13124.2712 8809.4787 41885.1355
67 68 69 70 71 72
-89947.4991 -58450.5502 -5174.5760 -40137.8831 4674.9466 -29162.7984
73 74 75 76 77 78
-13470.3888 -2539.3672 -32745.3017 79348.9564 33571.2416 -110850.0210
79 80 81 82 83 84
-24043.1707 -18092.4530 2362.2680 115193.6907 -9562.3140 6958.9440
85 86 87 88 89 90
5109.6791 8945.3873 -59536.1208 20791.5006 34034.8476 -107129.7728
91 92 93 94 95 96
52996.3449 -17596.0755 2114.0817 39651.9840 37059.8618 -22225.7508
97 98 99 100 101 102
1557.8447 18668.0506 -39288.0252 93573.8171 -36763.1861 28456.5917
103 104 105 106 107 108
-68076.5285 -47641.9631 39962.0457 -51607.2533 43670.3734 42488.4950
109 110 111 112 113 114
-103994.9496 -131179.4777 42201.6819 37614.5491 8358.3143 -22778.5022
115 116 117 118 119 120
-3930.4059 -19763.9107 121695.8377 3371.1953 64108.2463 -11484.6512
121 122 123 124 125 126
26619.8076 -33113.1065 -71944.3414 -61470.7543 -18787.2885 -20917.0176
127 128 129 130 131 132
50304.0490 -47882.6659 104403.4233 7087.1234 17788.8357 3936.1920
133 134 135 136 137 138
-55089.7938 -147837.1007 59919.6965 -94892.6926 47974.8537 -35941.7184
139 140 141 142 143 144
32203.4008 3905.7215 -29385.4651 97796.1614 -4694.3091 36518.9603
145 146 147 148 149 150
26125.8550 -125898.6922 -30879.3895 -17841.5976 -3888.8946 -600.2554
151 152 153 154 155 156
-4626.9068 -5104.9190 -3889.8946 -3889.8946 9466.5948 85253.5124
157 158 159 160 161 162
-3889.8946 -7026.9433 -1697.9835 10311.6666 4469.3821 -33391.5272
163 164
-4590.9190 12036.0496
> postscript(file="/var/wessaorg/rcomp/tmp/6kbfc1323624273.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 42099.5977 NA
1 -56220.5033 42099.5977
2 -701.5960 -56220.5033
3 -43923.3681 -701.5960
4 16375.5922 -43923.3681
5 -77789.5146 16375.5922
6 175097.7628 -77789.5146
7 -34734.8325 175097.7628
8 -17056.7264 -34734.8325
9 47773.6851 -17056.7264
10 36769.4516 47773.6851
11 -69362.9973 36769.4516
12 -30299.7407 -69362.9973
13 66925.3336 -30299.7407
14 6996.4084 66925.3336
15 -7958.5661 6996.4084
16 14243.0802 -7958.5661
17 9138.6878 14243.0802
18 -12367.7150 9138.6878
19 -21834.5354 -12367.7150
20 18786.2159 -21834.5354
21 171007.5215 18786.2159
22 12843.5903 171007.5215
23 -83637.0374 12843.5903
24 -48630.7049 -83637.0374
25 -50703.7326 -48630.7049
26 -5817.7024 -50703.7326
27 28975.7539 -5817.7024
28 6522.9852 28975.7539
29 62946.4872 6522.9852
30 -7807.3365 62946.4872
31 -35358.7940 -7807.3365
32 35836.8112 -35358.7940
33 -73135.8973 35836.8112
34 91874.0776 -73135.8973
35 70033.9289 91874.0776
36 94986.7672 70033.9289
37 14651.3686 94986.7672
38 25579.9925 14651.3686
39 -1634.9348 25579.9925
40 86445.5449 -1634.9348
41 -22540.5059 86445.5449
42 -14286.7586 -22540.5059
43 -21494.3104 -14286.7586
44 -58362.1056 -21494.3104
45 129086.2750 -58362.1056
46 -41988.2458 129086.2750
47 -36814.1092 -41988.2458
48 16974.2307 -36814.1092
49 -32387.2417 16974.2307
50 -3563.0312 -32387.2417
51 -11645.1796 -3563.0312
52 -78936.7858 -11645.1796
53 -20068.2689 -78936.7858
54 -9285.6155 -20068.2689
55 66410.5342 -9285.6155
56 -18262.5436 66410.5342
57 -20309.4337 -18262.5436
58 7126.5222 -20309.4337
59 16157.3296 7126.5222
60 38928.8078 16157.3296
61 28474.2888 38928.8078
62 -12282.3466 28474.2888
63 13124.2712 -12282.3466
64 8809.4787 13124.2712
65 41885.1355 8809.4787
66 -89947.4991 41885.1355
67 -58450.5502 -89947.4991
68 -5174.5760 -58450.5502
69 -40137.8831 -5174.5760
70 4674.9466 -40137.8831
71 -29162.7984 4674.9466
72 -13470.3888 -29162.7984
73 -2539.3672 -13470.3888
74 -32745.3017 -2539.3672
75 79348.9564 -32745.3017
76 33571.2416 79348.9564
77 -110850.0210 33571.2416
78 -24043.1707 -110850.0210
79 -18092.4530 -24043.1707
80 2362.2680 -18092.4530
81 115193.6907 2362.2680
82 -9562.3140 115193.6907
83 6958.9440 -9562.3140
84 5109.6791 6958.9440
85 8945.3873 5109.6791
86 -59536.1208 8945.3873
87 20791.5006 -59536.1208
88 34034.8476 20791.5006
89 -107129.7728 34034.8476
90 52996.3449 -107129.7728
91 -17596.0755 52996.3449
92 2114.0817 -17596.0755
93 39651.9840 2114.0817
94 37059.8618 39651.9840
95 -22225.7508 37059.8618
96 1557.8447 -22225.7508
97 18668.0506 1557.8447
98 -39288.0252 18668.0506
99 93573.8171 -39288.0252
100 -36763.1861 93573.8171
101 28456.5917 -36763.1861
102 -68076.5285 28456.5917
103 -47641.9631 -68076.5285
104 39962.0457 -47641.9631
105 -51607.2533 39962.0457
106 43670.3734 -51607.2533
107 42488.4950 43670.3734
108 -103994.9496 42488.4950
109 -131179.4777 -103994.9496
110 42201.6819 -131179.4777
111 37614.5491 42201.6819
112 8358.3143 37614.5491
113 -22778.5022 8358.3143
114 -3930.4059 -22778.5022
115 -19763.9107 -3930.4059
116 121695.8377 -19763.9107
117 3371.1953 121695.8377
118 64108.2463 3371.1953
119 -11484.6512 64108.2463
120 26619.8076 -11484.6512
121 -33113.1065 26619.8076
122 -71944.3414 -33113.1065
123 -61470.7543 -71944.3414
124 -18787.2885 -61470.7543
125 -20917.0176 -18787.2885
126 50304.0490 -20917.0176
127 -47882.6659 50304.0490
128 104403.4233 -47882.6659
129 7087.1234 104403.4233
130 17788.8357 7087.1234
131 3936.1920 17788.8357
132 -55089.7938 3936.1920
133 -147837.1007 -55089.7938
134 59919.6965 -147837.1007
135 -94892.6926 59919.6965
136 47974.8537 -94892.6926
137 -35941.7184 47974.8537
138 32203.4008 -35941.7184
139 3905.7215 32203.4008
140 -29385.4651 3905.7215
141 97796.1614 -29385.4651
142 -4694.3091 97796.1614
143 36518.9603 -4694.3091
144 26125.8550 36518.9603
145 -125898.6922 26125.8550
146 -30879.3895 -125898.6922
147 -17841.5976 -30879.3895
148 -3888.8946 -17841.5976
149 -600.2554 -3888.8946
150 -4626.9068 -600.2554
151 -5104.9190 -4626.9068
152 -3889.8946 -5104.9190
153 -3889.8946 -3889.8946
154 9466.5948 -3889.8946
155 85253.5124 9466.5948
156 -3889.8946 85253.5124
157 -7026.9433 -3889.8946
158 -1697.9835 -7026.9433
159 10311.6666 -1697.9835
160 4469.3821 10311.6666
161 -33391.5272 4469.3821
162 -4590.9190 -33391.5272
163 12036.0496 -4590.9190
164 NA 12036.0496
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -56220.5033 42099.5977
[2,] -701.5960 -56220.5033
[3,] -43923.3681 -701.5960
[4,] 16375.5922 -43923.3681
[5,] -77789.5146 16375.5922
[6,] 175097.7628 -77789.5146
[7,] -34734.8325 175097.7628
[8,] -17056.7264 -34734.8325
[9,] 47773.6851 -17056.7264
[10,] 36769.4516 47773.6851
[11,] -69362.9973 36769.4516
[12,] -30299.7407 -69362.9973
[13,] 66925.3336 -30299.7407
[14,] 6996.4084 66925.3336
[15,] -7958.5661 6996.4084
[16,] 14243.0802 -7958.5661
[17,] 9138.6878 14243.0802
[18,] -12367.7150 9138.6878
[19,] -21834.5354 -12367.7150
[20,] 18786.2159 -21834.5354
[21,] 171007.5215 18786.2159
[22,] 12843.5903 171007.5215
[23,] -83637.0374 12843.5903
[24,] -48630.7049 -83637.0374
[25,] -50703.7326 -48630.7049
[26,] -5817.7024 -50703.7326
[27,] 28975.7539 -5817.7024
[28,] 6522.9852 28975.7539
[29,] 62946.4872 6522.9852
[30,] -7807.3365 62946.4872
[31,] -35358.7940 -7807.3365
[32,] 35836.8112 -35358.7940
[33,] -73135.8973 35836.8112
[34,] 91874.0776 -73135.8973
[35,] 70033.9289 91874.0776
[36,] 94986.7672 70033.9289
[37,] 14651.3686 94986.7672
[38,] 25579.9925 14651.3686
[39,] -1634.9348 25579.9925
[40,] 86445.5449 -1634.9348
[41,] -22540.5059 86445.5449
[42,] -14286.7586 -22540.5059
[43,] -21494.3104 -14286.7586
[44,] -58362.1056 -21494.3104
[45,] 129086.2750 -58362.1056
[46,] -41988.2458 129086.2750
[47,] -36814.1092 -41988.2458
[48,] 16974.2307 -36814.1092
[49,] -32387.2417 16974.2307
[50,] -3563.0312 -32387.2417
[51,] -11645.1796 -3563.0312
[52,] -78936.7858 -11645.1796
[53,] -20068.2689 -78936.7858
[54,] -9285.6155 -20068.2689
[55,] 66410.5342 -9285.6155
[56,] -18262.5436 66410.5342
[57,] -20309.4337 -18262.5436
[58,] 7126.5222 -20309.4337
[59,] 16157.3296 7126.5222
[60,] 38928.8078 16157.3296
[61,] 28474.2888 38928.8078
[62,] -12282.3466 28474.2888
[63,] 13124.2712 -12282.3466
[64,] 8809.4787 13124.2712
[65,] 41885.1355 8809.4787
[66,] -89947.4991 41885.1355
[67,] -58450.5502 -89947.4991
[68,] -5174.5760 -58450.5502
[69,] -40137.8831 -5174.5760
[70,] 4674.9466 -40137.8831
[71,] -29162.7984 4674.9466
[72,] -13470.3888 -29162.7984
[73,] -2539.3672 -13470.3888
[74,] -32745.3017 -2539.3672
[75,] 79348.9564 -32745.3017
[76,] 33571.2416 79348.9564
[77,] -110850.0210 33571.2416
[78,] -24043.1707 -110850.0210
[79,] -18092.4530 -24043.1707
[80,] 2362.2680 -18092.4530
[81,] 115193.6907 2362.2680
[82,] -9562.3140 115193.6907
[83,] 6958.9440 -9562.3140
[84,] 5109.6791 6958.9440
[85,] 8945.3873 5109.6791
[86,] -59536.1208 8945.3873
[87,] 20791.5006 -59536.1208
[88,] 34034.8476 20791.5006
[89,] -107129.7728 34034.8476
[90,] 52996.3449 -107129.7728
[91,] -17596.0755 52996.3449
[92,] 2114.0817 -17596.0755
[93,] 39651.9840 2114.0817
[94,] 37059.8618 39651.9840
[95,] -22225.7508 37059.8618
[96,] 1557.8447 -22225.7508
[97,] 18668.0506 1557.8447
[98,] -39288.0252 18668.0506
[99,] 93573.8171 -39288.0252
[100,] -36763.1861 93573.8171
[101,] 28456.5917 -36763.1861
[102,] -68076.5285 28456.5917
[103,] -47641.9631 -68076.5285
[104,] 39962.0457 -47641.9631
[105,] -51607.2533 39962.0457
[106,] 43670.3734 -51607.2533
[107,] 42488.4950 43670.3734
[108,] -103994.9496 42488.4950
[109,] -131179.4777 -103994.9496
[110,] 42201.6819 -131179.4777
[111,] 37614.5491 42201.6819
[112,] 8358.3143 37614.5491
[113,] -22778.5022 8358.3143
[114,] -3930.4059 -22778.5022
[115,] -19763.9107 -3930.4059
[116,] 121695.8377 -19763.9107
[117,] 3371.1953 121695.8377
[118,] 64108.2463 3371.1953
[119,] -11484.6512 64108.2463
[120,] 26619.8076 -11484.6512
[121,] -33113.1065 26619.8076
[122,] -71944.3414 -33113.1065
[123,] -61470.7543 -71944.3414
[124,] -18787.2885 -61470.7543
[125,] -20917.0176 -18787.2885
[126,] 50304.0490 -20917.0176
[127,] -47882.6659 50304.0490
[128,] 104403.4233 -47882.6659
[129,] 7087.1234 104403.4233
[130,] 17788.8357 7087.1234
[131,] 3936.1920 17788.8357
[132,] -55089.7938 3936.1920
[133,] -147837.1007 -55089.7938
[134,] 59919.6965 -147837.1007
[135,] -94892.6926 59919.6965
[136,] 47974.8537 -94892.6926
[137,] -35941.7184 47974.8537
[138,] 32203.4008 -35941.7184
[139,] 3905.7215 32203.4008
[140,] -29385.4651 3905.7215
[141,] 97796.1614 -29385.4651
[142,] -4694.3091 97796.1614
[143,] 36518.9603 -4694.3091
[144,] 26125.8550 36518.9603
[145,] -125898.6922 26125.8550
[146,] -30879.3895 -125898.6922
[147,] -17841.5976 -30879.3895
[148,] -3888.8946 -17841.5976
[149,] -600.2554 -3888.8946
[150,] -4626.9068 -600.2554
[151,] -5104.9190 -4626.9068
[152,] -3889.8946 -5104.9190
[153,] -3889.8946 -3889.8946
[154,] 9466.5948 -3889.8946
[155,] 85253.5124 9466.5948
[156,] -3889.8946 85253.5124
[157,] -7026.9433 -3889.8946
[158,] -1697.9835 -7026.9433
[159,] 10311.6666 -1697.9835
[160,] 4469.3821 10311.6666
[161,] -33391.5272 4469.3821
[162,] -4590.9190 -33391.5272
[163,] 12036.0496 -4590.9190
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -56220.5033 42099.5977
2 -701.5960 -56220.5033
3 -43923.3681 -701.5960
4 16375.5922 -43923.3681
5 -77789.5146 16375.5922
6 175097.7628 -77789.5146
7 -34734.8325 175097.7628
8 -17056.7264 -34734.8325
9 47773.6851 -17056.7264
10 36769.4516 47773.6851
11 -69362.9973 36769.4516
12 -30299.7407 -69362.9973
13 66925.3336 -30299.7407
14 6996.4084 66925.3336
15 -7958.5661 6996.4084
16 14243.0802 -7958.5661
17 9138.6878 14243.0802
18 -12367.7150 9138.6878
19 -21834.5354 -12367.7150
20 18786.2159 -21834.5354
21 171007.5215 18786.2159
22 12843.5903 171007.5215
23 -83637.0374 12843.5903
24 -48630.7049 -83637.0374
25 -50703.7326 -48630.7049
26 -5817.7024 -50703.7326
27 28975.7539 -5817.7024
28 6522.9852 28975.7539
29 62946.4872 6522.9852
30 -7807.3365 62946.4872
31 -35358.7940 -7807.3365
32 35836.8112 -35358.7940
33 -73135.8973 35836.8112
34 91874.0776 -73135.8973
35 70033.9289 91874.0776
36 94986.7672 70033.9289
37 14651.3686 94986.7672
38 25579.9925 14651.3686
39 -1634.9348 25579.9925
40 86445.5449 -1634.9348
41 -22540.5059 86445.5449
42 -14286.7586 -22540.5059
43 -21494.3104 -14286.7586
44 -58362.1056 -21494.3104
45 129086.2750 -58362.1056
46 -41988.2458 129086.2750
47 -36814.1092 -41988.2458
48 16974.2307 -36814.1092
49 -32387.2417 16974.2307
50 -3563.0312 -32387.2417
51 -11645.1796 -3563.0312
52 -78936.7858 -11645.1796
53 -20068.2689 -78936.7858
54 -9285.6155 -20068.2689
55 66410.5342 -9285.6155
56 -18262.5436 66410.5342
57 -20309.4337 -18262.5436
58 7126.5222 -20309.4337
59 16157.3296 7126.5222
60 38928.8078 16157.3296
61 28474.2888 38928.8078
62 -12282.3466 28474.2888
63 13124.2712 -12282.3466
64 8809.4787 13124.2712
65 41885.1355 8809.4787
66 -89947.4991 41885.1355
67 -58450.5502 -89947.4991
68 -5174.5760 -58450.5502
69 -40137.8831 -5174.5760
70 4674.9466 -40137.8831
71 -29162.7984 4674.9466
72 -13470.3888 -29162.7984
73 -2539.3672 -13470.3888
74 -32745.3017 -2539.3672
75 79348.9564 -32745.3017
76 33571.2416 79348.9564
77 -110850.0210 33571.2416
78 -24043.1707 -110850.0210
79 -18092.4530 -24043.1707
80 2362.2680 -18092.4530
81 115193.6907 2362.2680
82 -9562.3140 115193.6907
83 6958.9440 -9562.3140
84 5109.6791 6958.9440
85 8945.3873 5109.6791
86 -59536.1208 8945.3873
87 20791.5006 -59536.1208
88 34034.8476 20791.5006
89 -107129.7728 34034.8476
90 52996.3449 -107129.7728
91 -17596.0755 52996.3449
92 2114.0817 -17596.0755
93 39651.9840 2114.0817
94 37059.8618 39651.9840
95 -22225.7508 37059.8618
96 1557.8447 -22225.7508
97 18668.0506 1557.8447
98 -39288.0252 18668.0506
99 93573.8171 -39288.0252
100 -36763.1861 93573.8171
101 28456.5917 -36763.1861
102 -68076.5285 28456.5917
103 -47641.9631 -68076.5285
104 39962.0457 -47641.9631
105 -51607.2533 39962.0457
106 43670.3734 -51607.2533
107 42488.4950 43670.3734
108 -103994.9496 42488.4950
109 -131179.4777 -103994.9496
110 42201.6819 -131179.4777
111 37614.5491 42201.6819
112 8358.3143 37614.5491
113 -22778.5022 8358.3143
114 -3930.4059 -22778.5022
115 -19763.9107 -3930.4059
116 121695.8377 -19763.9107
117 3371.1953 121695.8377
118 64108.2463 3371.1953
119 -11484.6512 64108.2463
120 26619.8076 -11484.6512
121 -33113.1065 26619.8076
122 -71944.3414 -33113.1065
123 -61470.7543 -71944.3414
124 -18787.2885 -61470.7543
125 -20917.0176 -18787.2885
126 50304.0490 -20917.0176
127 -47882.6659 50304.0490
128 104403.4233 -47882.6659
129 7087.1234 104403.4233
130 17788.8357 7087.1234
131 3936.1920 17788.8357
132 -55089.7938 3936.1920
133 -147837.1007 -55089.7938
134 59919.6965 -147837.1007
135 -94892.6926 59919.6965
136 47974.8537 -94892.6926
137 -35941.7184 47974.8537
138 32203.4008 -35941.7184
139 3905.7215 32203.4008
140 -29385.4651 3905.7215
141 97796.1614 -29385.4651
142 -4694.3091 97796.1614
143 36518.9603 -4694.3091
144 26125.8550 36518.9603
145 -125898.6922 26125.8550
146 -30879.3895 -125898.6922
147 -17841.5976 -30879.3895
148 -3888.8946 -17841.5976
149 -600.2554 -3888.8946
150 -4626.9068 -600.2554
151 -5104.9190 -4626.9068
152 -3889.8946 -5104.9190
153 -3889.8946 -3889.8946
154 9466.5948 -3889.8946
155 85253.5124 9466.5948
156 -3889.8946 85253.5124
157 -7026.9433 -3889.8946
158 -1697.9835 -7026.9433
159 10311.6666 -1697.9835
160 4469.3821 10311.6666
161 -33391.5272 4469.3821
162 -4590.9190 -33391.5272
163 12036.0496 -4590.9190
> 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/7kz6y1323624273.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/85pta1323624273.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/9esnc1323624273.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/10uho91323624273.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/11ru7b1323624273.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/12j3ri1323624273.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/136p7q1323624273.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/141m3l1323624273.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/15m9kr1323624273.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/16zd2d1323624273.tab")
+ }
>
> try(system("convert tmp/15oyc1323624273.ps tmp/15oyc1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/2y2ub1323624273.ps tmp/2y2ub1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/3fa5x1323624273.ps tmp/3fa5x1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/4jpvg1323624273.ps tmp/4jpvg1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/5z2xo1323624273.ps tmp/5z2xo1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/6kbfc1323624273.ps tmp/6kbfc1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/7kz6y1323624273.ps tmp/7kz6y1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/85pta1323624273.ps tmp/85pta1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/9esnc1323624273.ps tmp/9esnc1323624273.png",intern=TRUE))
character(0)
> try(system("convert tmp/10uho91323624273.ps tmp/10uho91323624273.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.761 0.549 5.351