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(293403
+ ,111
+ ,74
+ ,91256
+ ,123
+ ,277108
+ ,70
+ ,69
+ ,86997
+ ,64
+ ,264020
+ ,76
+ ,76
+ ,55709
+ ,101
+ ,260646
+ ,109
+ ,60
+ ,75741
+ ,104
+ ,246100
+ ,81
+ ,89
+ ,92046
+ ,135
+ ,244051
+ ,67
+ ,111
+ ,84607
+ ,130
+ ,241329
+ ,54
+ ,57
+ ,73586
+ ,93
+ ,234730
+ ,106
+ ,116
+ ,162365
+ ,159
+ ,234509
+ ,125
+ ,122
+ ,70817
+ ,125
+ ,233482
+ ,68
+ ,90
+ ,59635
+ ,81
+ ,233406
+ ,96
+ ,85
+ ,109104
+ ,117
+ ,228548
+ ,106
+ ,65
+ ,120087
+ ,205
+ ,223914
+ ,104
+ ,89
+ ,72631
+ ,115
+ ,223696
+ ,88
+ ,82
+ ,104911
+ ,115
+ ,223004
+ ,87
+ ,84
+ ,85224
+ ,147
+ ,213765
+ ,84
+ ,56
+ ,58233
+ ,150
+ ,210554
+ ,81
+ ,73
+ ,117986
+ ,126
+ ,202204
+ ,44
+ ,79
+ ,67271
+ ,61
+ ,199512
+ ,75
+ ,59
+ ,55071
+ ,82
+ ,195304
+ ,93
+ ,47
+ ,114425
+ ,152
+ ,191467
+ ,76
+ ,75
+ ,79194
+ ,109
+ ,191381
+ ,87
+ ,71
+ ,101653
+ ,210
+ ,191276
+ ,112
+ ,90
+ ,81493
+ ,151
+ ,190410
+ ,84
+ ,107
+ ,64664
+ ,96
+ ,188967
+ ,86
+ ,75
+ ,63717
+ ,98
+ ,188780
+ ,98
+ ,85
+ ,72369
+ ,98
+ ,185139
+ ,121
+ ,83
+ ,86281
+ ,128
+ ,185039
+ ,94
+ ,73
+ ,63958
+ ,100
+ ,184217
+ ,69
+ ,45
+ ,73795
+ ,74
+ ,181853
+ ,87
+ ,93
+ ,96750
+ ,92
+ ,181379
+ ,92
+ ,123
+ ,83038
+ ,101
+ ,181344
+ ,75
+ ,114
+ ,65196
+ ,109
+ ,179562
+ ,76
+ ,89
+ ,62932
+ ,116
+ ,178863
+ ,86
+ ,78
+ ,57637
+ ,88
+ ,178140
+ ,56
+ ,91
+ ,70111
+ ,83
+ ,176789
+ ,115
+ ,66
+ ,123328
+ ,149
+ ,176460
+ ,97
+ ,55
+ ,38885
+ ,122
+ ,175877
+ ,95
+ ,81
+ ,54628
+ ,96
+ ,175568
+ ,106
+ ,80
+ ,74482
+ ,105
+ ,174107
+ ,49
+ ,71
+ ,76168
+ ,95
+ ,173587
+ ,70
+ ,70
+ ,71170
+ ,97
+ ,173260
+ ,41
+ ,78
+ ,37238
+ ,16
+ ,172684
+ ,87
+ ,112
+ ,101773
+ ,103
+ ,167845
+ ,105
+ ,77
+ ,103646
+ ,145
+ ,167131
+ ,71
+ ,69
+ ,37048
+ ,56
+ ,167105
+ ,56
+ ,32
+ ,85903
+ ,75
+ ,166790
+ ,49
+ ,59
+ ,43460
+ ,46
+ ,164767
+ ,51
+ ,87
+ ,90257
+ ,81
+ ,162810
+ ,49
+ ,76
+ ,70027
+ ,83
+ ,162336
+ ,111
+ ,84
+ ,111436
+ ,153
+ ,161678
+ ,75
+ ,59
+ ,65911
+ ,87
+ ,158980
+ ,84
+ ,75
+ ,105965
+ ,123
+ ,157250
+ ,84
+ ,106
+ ,61704
+ ,104
+ ,156833
+ ,79
+ ,73
+ ,48204
+ ,85
+ ,155383
+ ,83
+ ,75
+ ,60029
+ ,99
+ ,154991
+ ,63
+ ,87
+ ,52295
+ ,99
+ ,154730
+ ,78
+ ,82
+ ,82204
+ ,98
+ ,151503
+ ,93
+ ,83
+ ,56316
+ ,99
+ ,146455
+ ,65
+ ,68
+ ,95556
+ ,127
+ ,143937
+ ,98
+ ,66
+ ,78792
+ ,140
+ ,142339
+ ,75
+ ,67
+ ,125410
+ ,144
+ ,142146
+ ,108
+ ,88
+ ,76013
+ ,152
+ ,142141
+ ,73
+ ,87
+ ,91939
+ ,61
+ ,142069
+ ,66
+ ,88
+ ,57231
+ ,83
+ ,141933
+ ,90
+ ,75
+ ,51370
+ ,100
+ ,139350
+ ,70
+ ,79
+ ,99518
+ ,89
+ ,139144
+ ,57
+ ,76
+ ,56530
+ ,75
+ ,137793
+ ,70
+ ,78
+ ,56699
+ ,77
+ ,136911
+ ,95
+ ,86
+ ,74349
+ ,117
+ ,136548
+ ,89
+ ,62
+ ,83042
+ ,158
+ ,135171
+ ,80
+ ,61
+ ,71181
+ ,82
+ ,134043
+ ,54
+ ,69
+ ,55901
+ ,57
+ ,131876
+ ,27
+ ,83
+ ,38417
+ ,36
+ ,131122
+ ,56
+ ,50
+ ,65724
+ ,89
+ ,130539
+ ,60
+ ,47
+ ,48821
+ ,66
+ ,130533
+ ,64
+ ,76
+ ,85168
+ ,78
+ ,130232
+ ,102
+ ,83
+ ,55027
+ ,107
+ ,129100
+ ,38
+ ,60
+ ,73713
+ ,87
+ ,128655
+ ,75
+ ,70
+ ,79774
+ ,111
+ ,128066
+ ,42
+ ,48
+ ,42564
+ ,80
+ ,127619
+ ,49
+ ,50
+ ,36311
+ ,52
+ ,127324
+ ,79
+ ,87
+ ,56733
+ ,104
+ ,126683
+ ,71
+ ,123
+ ,63262
+ ,72
+ ,126681
+ ,39
+ ,90
+ ,94137
+ ,67
+ ,125971
+ ,61
+ ,45
+ ,38439
+ ,71
+ ,125366
+ ,69
+ ,22
+ ,34497
+ ,68
+ ,122433
+ ,51
+ ,91
+ ,58425
+ ,66
+ ,121135
+ ,50
+ ,51
+ ,42051
+ ,69
+ ,119291
+ ,83
+ ,38
+ ,64102
+ ,123
+ ,118958
+ ,52
+ ,68
+ ,54506
+ ,61
+ ,118807
+ ,56
+ ,81
+ ,55827
+ ,70
+ ,118372
+ ,72
+ ,35
+ ,66477
+ ,142
+ ,116900
+ ,42
+ ,36
+ ,28340
+ ,58
+ ,116775
+ ,30
+ ,83
+ ,73087
+ ,124
+ ,115199
+ ,84
+ ,54
+ ,51360
+ ,87
+ ,114928
+ ,44
+ ,72
+ ,53009
+ ,96
+ ,114397
+ ,70
+ ,65
+ ,55064
+ ,87
+ ,113337
+ ,58
+ ,37
+ ,63016
+ ,68
+ ,111664
+ ,55
+ ,59
+ ,38650
+ ,98
+ ,108715
+ ,64
+ ,35
+ ,40671
+ ,80
+ ,107342
+ ,77
+ ,53
+ ,82043
+ ,116
+ ,107335
+ ,48
+ ,61
+ ,49319
+ ,65
+ ,106539
+ ,36
+ ,68
+ ,77411
+ ,63
+ ,105615
+ ,57
+ ,70
+ ,202316
+ ,51
+ ,105410
+ ,62
+ ,72
+ ,89041
+ ,88
+ ,105324
+ ,42
+ ,71
+ ,26982
+ ,46
+ ,103012
+ ,30
+ ,37
+ ,29467
+ ,28
+ ,102531
+ ,46
+ ,63
+ ,40001
+ ,64
+ ,101324
+ ,81
+ ,104
+ ,70780
+ ,103
+ ,100885
+ ,39
+ ,29
+ ,49288
+ ,49
+ ,100672
+ ,38
+ ,69
+ ,50466
+ ,55
+ ,99946
+ ,106
+ ,80
+ ,99501
+ ,125
+ ,99768
+ ,24
+ ,62
+ ,15430
+ ,27
+ ,99246
+ ,27
+ ,63
+ ,37361
+ ,52
+ ,98599
+ ,48
+ ,55
+ ,36252
+ ,46
+ ,98030
+ ,30
+ ,41
+ ,31701
+ ,35
+ ,94763
+ ,94
+ ,75
+ ,56979
+ ,100
+ ,93340
+ ,41
+ ,63
+ ,43448
+ ,60
+ ,93125
+ ,30
+ ,29
+ ,50838
+ ,37
+ ,91185
+ ,57
+ ,66
+ ,21067
+ ,67
+ ,90961
+ ,42
+ ,78
+ ,63785
+ ,49
+ ,90938
+ ,40
+ ,51
+ ,37137
+ ,43
+ ,89318
+ ,75
+ ,78
+ ,44970
+ ,82
+ ,88817
+ ,70
+ ,60
+ ,46765
+ ,56
+ ,84944
+ ,54
+ ,72
+ ,54565
+ ,90
+ ,84572
+ ,43
+ ,82
+ ,72571
+ ,84
+ ,84256
+ ,97
+ ,58
+ ,59155
+ ,76
+ ,80953
+ ,49
+ ,27
+ ,56622
+ ,59
+ ,78800
+ ,20
+ ,66
+ ,33032
+ ,21
+ ,78776
+ ,30
+ ,18
+ ,26998
+ ,34
+ ,75812
+ ,28
+ ,57
+ ,35606
+ ,30
+ ,75426
+ ,3
+ ,19
+ ,47261
+ ,36
+ ,74398
+ ,41
+ ,30
+ ,31258
+ ,51
+ ,74112
+ ,28
+ ,54
+ ,174949
+ ,52
+ ,73567
+ ,37
+ ,31
+ ,23238
+ ,18
+ ,69471
+ ,22
+ ,63
+ ,22618
+ ,26
+ ,68948
+ ,31
+ ,47
+ ,35838
+ ,45
+ ,67746
+ ,18
+ ,35
+ ,62832
+ ,58
+ ,67507
+ ,101
+ ,112
+ ,78956
+ ,49
+ ,65029
+ ,21
+ ,61
+ ,32551
+ ,21
+ ,64320
+ ,16
+ ,56
+ ,62147
+ ,24
+ ,61857
+ ,23
+ ,30
+ ,25162
+ ,31
+ ,61499
+ ,28
+ ,75
+ ,36990
+ ,15
+ ,50999
+ ,2
+ ,66
+ ,63989
+ ,8
+ ,46660
+ ,12
+ ,13
+ ,6179
+ ,13
+ ,43287
+ ,13
+ ,64
+ ,43750
+ ,49
+ ,38214
+ ,16
+ ,21
+ ,8773
+ ,16
+ ,35523
+ ,0
+ ,53
+ ,52491
+ ,33
+ ,32750
+ ,1
+ ,22
+ ,22807
+ ,5
+ ,31414
+ ,18
+ ,9
+ ,14116
+ ,39
+ ,24188
+ ,8
+ ,7
+ ,5950
+ ,7
+ ,22938
+ ,12
+ ,0
+ ,1168
+ ,11
+ ,21054
+ ,4
+ ,0
+ ,855
+ ,4
+ ,17547
+ ,0
+ ,4
+ ,3926
+ ,3
+ ,14688
+ ,4
+ ,0
+ ,6023
+ ,5
+ ,7199
+ ,7
+ ,0
+ ,1644
+ ,6
+ ,969
+ ,0
+ ,0
+ ,0
+ ,0
+ ,455
+ ,0
+ ,0
+ ,0
+ ,0
+ ,203
+ ,0
+ ,0
+ ,0
+ ,0
+ ,98
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0)
+ ,dim=c(5
+ ,164)
+ ,dimnames=list(c('Total_time_RFC'
+ ,'Total_Blogged_Comp'
+ ,'Total_long_PR(+120characters)'
+ ,'Total_characters_comp'
+ ,'Total_hyperl_comp')
+ ,1:164))
> y <- array(NA,dim=c(5,164),dimnames=list(c('Total_time_RFC','Total_Blogged_Comp','Total_long_PR(+120characters)','Total_characters_comp','Total_hyperl_comp'),1:164))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> library(lattice)
> library(lmtest)
Loading required package: zoo
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Total_time_RFC Total_Blogged_Comp Total_long_PR(+120characters)
1 293403 111 74
2 277108 70 69
3 264020 76 76
4 260646 109 60
5 246100 81 89
6 244051 67 111
7 241329 54 57
8 234730 106 116
9 234509 125 122
10 233482 68 90
11 233406 96 85
12 228548 106 65
13 223914 104 89
14 223696 88 82
15 223004 87 84
16 213765 84 56
17 210554 81 73
18 202204 44 79
19 199512 75 59
20 195304 93 47
21 191467 76 75
22 191381 87 71
23 191276 112 90
24 190410 84 107
25 188967 86 75
26 188780 98 85
27 185139 121 83
28 185039 94 73
29 184217 69 45
30 181853 87 93
31 181379 92 123
32 181344 75 114
33 179562 76 89
34 178863 86 78
35 178140 56 91
36 176789 115 66
37 176460 97 55
38 175877 95 81
39 175568 106 80
40 174107 49 71
41 173587 70 70
42 173260 41 78
43 172684 87 112
44 167845 105 77
45 167131 71 69
46 167105 56 32
47 166790 49 59
48 164767 51 87
49 162810 49 76
50 162336 111 84
51 161678 75 59
52 158980 84 75
53 157250 84 106
54 156833 79 73
55 155383 83 75
56 154991 63 87
57 154730 78 82
58 151503 93 83
59 146455 65 68
60 143937 98 66
61 142339 75 67
62 142146 108 88
63 142141 73 87
64 142069 66 88
65 141933 90 75
66 139350 70 79
67 139144 57 76
68 137793 70 78
69 136911 95 86
70 136548 89 62
71 135171 80 61
72 134043 54 69
73 131876 27 83
74 131122 56 50
75 130539 60 47
76 130533 64 76
77 130232 102 83
78 129100 38 60
79 128655 75 70
80 128066 42 48
81 127619 49 50
82 127324 79 87
83 126683 71 123
84 126681 39 90
85 125971 61 45
86 125366 69 22
87 122433 51 91
88 121135 50 51
89 119291 83 38
90 118958 52 68
91 118807 56 81
92 118372 72 35
93 116900 42 36
94 116775 30 83
95 115199 84 54
96 114928 44 72
97 114397 70 65
98 113337 58 37
99 111664 55 59
100 108715 64 35
101 107342 77 53
102 107335 48 61
103 106539 36 68
104 105615 57 70
105 105410 62 72
106 105324 42 71
107 103012 30 37
108 102531 46 63
109 101324 81 104
110 100885 39 29
111 100672 38 69
112 99946 106 80
113 99768 24 62
114 99246 27 63
115 98599 48 55
116 98030 30 41
117 94763 94 75
118 93340 41 63
119 93125 30 29
120 91185 57 66
121 90961 42 78
122 90938 40 51
123 89318 75 78
124 88817 70 60
125 84944 54 72
126 84572 43 82
127 84256 97 58
128 80953 49 27
129 78800 20 66
130 78776 30 18
131 75812 28 57
132 75426 3 19
133 74398 41 30
134 74112 28 54
135 73567 37 31
136 69471 22 63
137 68948 31 47
138 67746 18 35
139 67507 101 112
140 65029 21 61
141 64320 16 56
142 61857 23 30
143 61499 28 75
144 50999 2 66
145 46660 12 13
146 43287 13 64
147 38214 16 21
148 35523 0 53
149 32750 1 22
150 31414 18 9
151 24188 8 7
152 22938 12 0
153 21054 4 0
154 17547 0 4
155 14688 4 0
156 7199 7 0
157 969 0 0
158 455 0 0
159 203 0 0
160 98 0 0
161 0 0 0
162 0 0 0
163 0 0 0
164 0 0 0
Total_characters_comp Total_hyperl_comp
1 91256 123
2 86997 64
3 55709 101
4 75741 104
5 92046 135
6 84607 130
7 73586 93
8 162365 159
9 70817 125
10 59635 81
11 109104 117
12 120087 205
13 72631 115
14 104911 115
15 85224 147
16 58233 150
17 117986 126
18 67271 61
19 55071 82
20 114425 152
21 79194 109
22 101653 210
23 81493 151
24 64664 96
25 63717 98
26 72369 98
27 86281 128
28 63958 100
29 73795 74
30 96750 92
31 83038 101
32 65196 109
33 62932 116
34 57637 88
35 70111 83
36 123328 149
37 38885 122
38 54628 96
39 74482 105
40 76168 95
41 71170 97
42 37238 16
43 101773 103
44 103646 145
45 37048 56
46 85903 75
47 43460 46
48 90257 81
49 70027 83
50 111436 153
51 65911 87
52 105965 123
53 61704 104
54 48204 85
55 60029 99
56 52295 99
57 82204 98
58 56316 99
59 95556 127
60 78792 140
61 125410 144
62 76013 152
63 91939 61
64 57231 83
65 51370 100
66 99518 89
67 56530 75
68 56699 77
69 74349 117
70 83042 158
71 71181 82
72 55901 57
73 38417 36
74 65724 89
75 48821 66
76 85168 78
77 55027 107
78 73713 87
79 79774 111
80 42564 80
81 36311 52
82 56733 104
83 63262 72
84 94137 67
85 38439 71
86 34497 68
87 58425 66
88 42051 69
89 64102 123
90 54506 61
91 55827 70
92 66477 142
93 28340 58
94 73087 124
95 51360 87
96 53009 96
97 55064 87
98 63016 68
99 38650 98
100 40671 80
101 82043 116
102 49319 65
103 77411 63
104 202316 51
105 89041 88
106 26982 46
107 29467 28
108 40001 64
109 70780 103
110 49288 49
111 50466 55
112 99501 125
113 15430 27
114 37361 52
115 36252 46
116 31701 35
117 56979 100
118 43448 60
119 50838 37
120 21067 67
121 63785 49
122 37137 43
123 44970 82
124 46765 56
125 54565 90
126 72571 84
127 59155 76
128 56622 59
129 33032 21
130 26998 34
131 35606 30
132 47261 36
133 31258 51
134 174949 52
135 23238 18
136 22618 26
137 35838 45
138 62832 58
139 78956 49
140 32551 21
141 62147 24
142 25162 31
143 36990 15
144 63989 8
145 6179 13
146 43750 49
147 8773 16
148 52491 33
149 22807 5
150 14116 39
151 5950 7
152 1168 11
153 855 4
154 3926 3
155 6023 5
156 1644 6
157 0 0
158 0 0
159 0 0
160 0 0
161 0 0
162 0 0
163 0 0
164 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Total_Blogged_Comp
1.759e+04 6.829e+02
`Total_long_PR(+120characters)` Total_characters_comp
5.170e+02 1.549e-01
Total_hyperl_comp
3.692e+02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-107284 -17658 -6061 16672 138934
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.759e+04 7.142e+03 2.463 0.014837 *
Total_Blogged_Comp 6.829e+02 1.906e+02 3.583 0.000450 ***
`Total_long_PR(+120characters)` 5.170e+02 1.470e+02 3.518 0.000567 ***
Total_characters_comp 1.549e-01 1.304e-01 1.188 0.236461
Total_hyperl_comp 3.692e+02 1.408e+02 2.623 0.009575 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 37180 on 159 degrees of freedom
Multiple R-squared: 0.6682, Adjusted R-squared: 0.6598
F-statistic: 80.04 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.1946896 3.893791e-01 8.053104e-01
[2,] 0.2404162 4.808323e-01 7.595838e-01
[3,] 0.1834667 3.669333e-01 8.165333e-01
[4,] 0.1704616 3.409233e-01 8.295384e-01
[5,] 0.1277275 2.554551e-01 8.722725e-01
[6,] 0.1412392 2.824784e-01 8.587608e-01
[7,] 0.1502214 3.004429e-01 8.497786e-01
[8,] 0.1141916 2.283833e-01 8.858084e-01
[9,] 0.1088434 2.176867e-01 8.911566e-01
[10,] 0.1469410 2.938820e-01 8.530590e-01
[11,] 0.2465017 4.930035e-01 7.534983e-01
[12,] 0.4012924 8.025848e-01 5.987076e-01
[13,] 0.4587466 9.174931e-01 5.412534e-01
[14,] 0.5407381 9.185239e-01 4.592619e-01
[15,] 0.4773678 9.547356e-01 5.226322e-01
[16,] 0.5502709 8.994582e-01 4.497291e-01
[17,] 0.6229696 7.540609e-01 3.770304e-01
[18,] 0.6915884 6.168232e-01 3.084116e-01
[19,] 0.7542173 4.915654e-01 2.457827e-01
[20,] 0.7944509 4.110982e-01 2.055491e-01
[21,] 0.8167407 3.665185e-01 1.832593e-01
[22,] 0.8766318 2.467364e-01 1.233682e-01
[23,] 0.9081668 1.836665e-01 9.183324e-02
[24,] 0.9162486 1.675028e-01 8.375142e-02
[25,] 0.9098713 1.802573e-01 9.012866e-02
[26,] 0.9067722 1.864556e-01 9.322779e-02
[27,] 0.9138900 1.722200e-01 8.611001e-02
[28,] 0.9212218 1.575565e-01 7.877824e-02
[29,] 0.9424338 1.151324e-01 5.756622e-02
[30,] 0.9410725 1.178550e-01 5.892749e-02
[31,] 0.9401240 1.197521e-01 5.987603e-02
[32,] 0.9403068 1.193864e-01 5.969322e-02
[33,] 0.9545916 9.081679e-02 4.540840e-02
[34,] 0.9610883 7.782335e-02 3.891167e-02
[35,] 0.9793157 4.136851e-02 2.068426e-02
[36,] 0.9811158 3.776845e-02 1.888422e-02
[37,] 0.9844646 3.107074e-02 1.553537e-02
[38,] 0.9889863 2.202747e-02 1.101373e-02
[39,] 0.9954365 9.126943e-03 4.563472e-03
[40,] 0.9982112 3.577628e-03 1.788814e-03
[41,] 0.9987563 2.487485e-03 1.243742e-03
[42,] 0.9991589 1.682209e-03 8.411047e-04
[43,] 0.9994635 1.072904e-03 5.364522e-04
[44,] 0.9996594 6.812105e-04 3.406052e-04
[45,] 0.9997299 5.402588e-04 2.701294e-04
[46,] 0.9997423 5.153031e-04 2.576515e-04
[47,] 0.9997973 4.054202e-04 2.027101e-04
[48,] 0.9998242 3.516681e-04 1.758340e-04
[49,] 0.9998274 3.451464e-04 1.725732e-04
[50,] 0.9998555 2.890104e-04 1.445052e-04
[51,] 0.9998638 2.723269e-04 1.361634e-04
[52,] 0.9998913 2.173932e-04 1.086966e-04
[53,] 0.9999166 1.667651e-04 8.338255e-05
[54,] 0.9999428 1.143397e-04 5.716984e-05
[55,] 0.9999647 7.057388e-05 3.528694e-05
[56,] 0.9999774 4.515020e-05 2.257510e-05
[57,] 0.9999781 4.385671e-05 2.192835e-05
[58,] 0.9999780 4.405119e-05 2.202560e-05
[59,] 0.9999818 3.638423e-05 1.819212e-05
[60,] 0.9999839 3.211831e-05 1.605915e-05
[61,] 0.9999851 2.980547e-05 1.490273e-05
[62,] 0.9999870 2.603324e-05 1.301662e-05
[63,] 0.9999891 2.189940e-05 1.094970e-05
[64,] 0.9999906 1.888521e-05 9.442605e-06
[65,] 0.9999933 1.337501e-05 6.687503e-06
[66,] 0.9999965 6.972227e-06 3.486113e-06
[67,] 0.9999966 6.803759e-06 3.401880e-06
[68,] 0.9999977 4.648574e-06 2.324287e-06
[69,] 0.9999978 4.352024e-06 2.176012e-06
[70,] 0.9999979 4.169296e-06 2.084648e-06
[71,] 0.9999978 4.358858e-06 2.179429e-06
[72,] 0.9999976 4.857475e-06 2.428738e-06
[73,] 0.9999978 4.401499e-06 2.200749e-06
[74,] 0.9999988 2.317330e-06 1.158665e-06
[75,] 0.9999986 2.738444e-06 1.369222e-06
[76,] 0.9999985 3.045485e-06 1.522742e-06
[77,] 0.9999984 3.163713e-06 1.581856e-06
[78,] 0.9999987 2.563586e-06 1.281793e-06
[79,] 0.9999994 1.238924e-06 6.194620e-07
[80,] 0.9999992 1.527192e-06 7.635959e-07
[81,] 0.9999994 1.289365e-06 6.446825e-07
[82,] 0.9999992 1.612838e-06 8.064191e-07
[83,] 0.9999992 1.559720e-06 7.798599e-07
[84,] 0.9999990 1.913343e-06 9.566716e-07
[85,] 0.9999986 2.744574e-06 1.372287e-06
[86,] 0.9999993 1.414766e-06 7.073831e-07
[87,] 0.9999989 2.196482e-06 1.098241e-06
[88,] 0.9999987 2.521238e-06 1.260619e-06
[89,] 0.9999979 4.120020e-06 2.060010e-06
[90,] 0.9999973 5.417141e-06 2.708571e-06
[91,] 0.9999979 4.158147e-06 2.079074e-06
[92,] 0.9999967 6.647577e-06 3.323789e-06
[93,] 0.9999966 6.718842e-06 3.359421e-06
[94,] 0.9999961 7.849512e-06 3.924756e-06
[95,] 0.9999952 9.529175e-06 4.764588e-06
[96,] 0.9999940 1.207835e-05 6.039175e-06
[97,] 0.9999957 8.554121e-06 4.277061e-06
[98,] 0.9999943 1.147614e-05 5.738068e-06
[99,] 0.9999934 1.312986e-05 6.564932e-06
[100,] 0.9999978 4.470365e-06 2.235183e-06
[101,] 0.9999970 5.974374e-06 2.987187e-06
[102,] 0.9999982 3.538525e-06 1.769263e-06
[103,] 0.9999991 1.746628e-06 8.733139e-07
[104,] 0.9999988 2.499155e-06 1.249578e-06
[105,] 0.9999995 9.374069e-07 4.687034e-07
[106,] 0.9999997 5.023084e-07 2.511542e-07
[107,] 0.9999997 5.851132e-07 2.925566e-07
[108,] 0.9999997 5.241277e-07 2.620639e-07
[109,] 0.9999999 1.634782e-07 8.173910e-08
[110,] 0.9999999 1.287251e-07 6.436256e-08
[111,] 0.9999999 2.150752e-07 1.075376e-07
[112,] 1.0000000 7.253892e-08 3.626946e-08
[113,] 0.9999999 1.367463e-07 6.837317e-08
[114,] 0.9999999 2.358237e-07 1.179118e-07
[115,] 0.9999999 1.997765e-07 9.988823e-08
[116,] 0.9999999 2.910435e-07 1.455218e-07
[117,] 0.9999998 4.911876e-07 2.455938e-07
[118,] 0.9999997 6.213892e-07 3.106946e-07
[119,] 0.9999997 5.374156e-07 2.687078e-07
[120,] 0.9999997 5.838877e-07 2.919438e-07
[121,] 0.9999994 1.228242e-06 6.141210e-07
[122,] 0.9999993 1.319610e-06 6.598048e-07
[123,] 0.9999996 7.530547e-07 3.765274e-07
[124,] 0.9999995 1.080869e-06 5.404344e-07
[125,] 0.9999997 5.507880e-07 2.753940e-07
[126,] 0.9999996 8.891633e-07 4.445817e-07
[127,] 0.9999990 1.950642e-06 9.753210e-07
[128,] 0.9999999 2.959072e-07 1.479536e-07
[129,] 0.9999997 5.093707e-07 2.546853e-07
[130,] 0.9999995 9.386901e-07 4.693450e-07
[131,] 0.9999990 1.998930e-06 9.994648e-07
[132,] 1.0000000 1.750548e-10 8.752738e-11
[133,] 1.0000000 4.766135e-10 2.383067e-10
[134,] 1.0000000 1.357411e-09 6.787057e-10
[135,] 1.0000000 5.360121e-09 2.680061e-09
[136,] 1.0000000 4.779734e-09 2.389867e-09
[137,] 1.0000000 3.942373e-09 1.971187e-09
[138,] 1.0000000 7.604021e-10 3.802011e-10
[139,] 1.0000000 4.930813e-09 2.465407e-09
[140,] 1.0000000 3.283460e-08 1.641730e-08
[141,] 1.0000000 8.397773e-08 4.198886e-08
[142,] 0.9999998 3.790339e-07 1.895170e-07
[143,] 1.0000000 7.373048e-08 3.686524e-08
[144,] 1.0000000 3.130564e-08 1.565282e-08
[145,] 1.0000000 6.846098e-14 3.423049e-14
[146,] 1.0000000 7.905584e-12 3.952792e-12
[147,] 1.0000000 8.473589e-10 4.236795e-10
[148,] 1.0000000 8.328559e-08 4.164280e-08
[149,] 0.9999963 7.379367e-06 3.689684e-06
> postscript(file="/var/wessaorg/rcomp/tmp/1ybgh1321540528.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/277j71321540528.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/3b9ab1321540528.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/4sgrm1321540528.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/56b9r1321540528.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
102201.4473 138933.9178 109315.8783 87466.6580 63078.1290 62214.5396
7 8 9 10 11 12
111656.0888 921.8316 11358.8752 83779.2128 46211.5177 10672.6041
13 14 15 16 17 18
35576.9335 44903.8013 35095.9739 45455.2981 35108.3347 80779.2905
19 20 21 22 23 24
61393.4508 16057.4808 30687.9866 -15611.2597 -17705.6962 14674.4987
25 26 27 28 29 30
27817.7634 12925.4999 -18619.9673 18684.6819 57486.8359 7812.8168
31 32 33 34 35 36
-12784.2061 3253.6759 11479.8921 20796.7452 33753.8733 -27576.1420
37 38 39 40 41 42
13124.5207 7626.0213 -6076.6383 39472.3414 25163.9818 75667.9582
43 44 45 46 47 48
-16018.4876 -30852.0143 38965.6195 53728.7062 61517.4258 23480.8734
49 50 51 52 53 54
30972.1989 -48237.9200 20034.1142 -16578.5176 -20463.6053 8701.0745
55 56 57 58 59 60
-3515.3630 4745.1435 -7438.8285 -17785.2564 -12373.4667 -38596.3295
61 62 63 64 65 66
-33703.0370 -62590.3081 -7045.6971 -5599.9614 -20773.5464 -15163.9049
67 68 69 70 71 72
6887.4498 -5140.0282 -44733.4105 -45075.2361 -9891.8298 14197.3137
73 74 75 76 77 78
33693.0207 6397.0014 15743.6415 -12048.0970 -47956.4567 10998.3140
79 80 81 82 83 84
-29684.3946 20846.5442 25891.6340 -36382.0539 -39368.3531 -3393.3134
85 86 87 88 89 90
11289.0323 18829.8726 -10451.6753 11041.9874 -29970.5295 -265.5792
91 92 93 94 95 96
-13396.6641 -29209.3364 26210.5588 -21317.8890 -27751.9511 -13590.5540
97 98 99 100 101 102
-25253.8852 2139.9454 -16159.6564 -6514.4100 -45771.8707 -6211.2328
103 104 105 106 107 108
-6044.7316 -37263.4010 -38029.3525 1180.6330 30902.1527 -8870.6642
109 110 111 112 113 114
-74343.6951 15940.9127 -6666.6562 -92958.6463 21374.5790 5659.1835
115 116 117 118 119 120
-2806.0401 20921.6460 -71544.1379 -13704.2622 18517.5061 -27454.1274
121 122 123 124 125 126
-23610.3644 -1965.2262 -57058.6118 -35517.8526 -48429.5165 -47033.5895
127 128 129 130 131 132
-66787.1299 -14614.4801 558.6497 14656.2859 -6961.3435 25350.4972
133 134 135 136 137 138
-10374.1657 -36819.5478 4435.7558 -8817.9235 -16278.1908 -11379.8925
139 140 141 142 143 144
-107284.3939 -11235.7812 -11637.7888 -2294.1860 -25256.5381 -14945.9673
145 146 147 148 149 150
8396.2884 -41138.1458 -8426.7976 -29784.1442 -2276.9016 -19708.1774
151 152 153 154 155 156
-5991.3727 -7090.0885 -877.8323 -3827.6916 -8413.6515 -17642.2206
157 158 159 160 161 162
-16621.8913 -17135.8913 -17387.8913 -17492.8913 -17590.8913 -17590.8913
163 164
-17590.8913 -17590.8913
> postscript(file="/var/wessaorg/rcomp/tmp/6vksf1321540528.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 102201.4473 NA
1 138933.9178 102201.4473
2 109315.8783 138933.9178
3 87466.6580 109315.8783
4 63078.1290 87466.6580
5 62214.5396 63078.1290
6 111656.0888 62214.5396
7 921.8316 111656.0888
8 11358.8752 921.8316
9 83779.2128 11358.8752
10 46211.5177 83779.2128
11 10672.6041 46211.5177
12 35576.9335 10672.6041
13 44903.8013 35576.9335
14 35095.9739 44903.8013
15 45455.2981 35095.9739
16 35108.3347 45455.2981
17 80779.2905 35108.3347
18 61393.4508 80779.2905
19 16057.4808 61393.4508
20 30687.9866 16057.4808
21 -15611.2597 30687.9866
22 -17705.6962 -15611.2597
23 14674.4987 -17705.6962
24 27817.7634 14674.4987
25 12925.4999 27817.7634
26 -18619.9673 12925.4999
27 18684.6819 -18619.9673
28 57486.8359 18684.6819
29 7812.8168 57486.8359
30 -12784.2061 7812.8168
31 3253.6759 -12784.2061
32 11479.8921 3253.6759
33 20796.7452 11479.8921
34 33753.8733 20796.7452
35 -27576.1420 33753.8733
36 13124.5207 -27576.1420
37 7626.0213 13124.5207
38 -6076.6383 7626.0213
39 39472.3414 -6076.6383
40 25163.9818 39472.3414
41 75667.9582 25163.9818
42 -16018.4876 75667.9582
43 -30852.0143 -16018.4876
44 38965.6195 -30852.0143
45 53728.7062 38965.6195
46 61517.4258 53728.7062
47 23480.8734 61517.4258
48 30972.1989 23480.8734
49 -48237.9200 30972.1989
50 20034.1142 -48237.9200
51 -16578.5176 20034.1142
52 -20463.6053 -16578.5176
53 8701.0745 -20463.6053
54 -3515.3630 8701.0745
55 4745.1435 -3515.3630
56 -7438.8285 4745.1435
57 -17785.2564 -7438.8285
58 -12373.4667 -17785.2564
59 -38596.3295 -12373.4667
60 -33703.0370 -38596.3295
61 -62590.3081 -33703.0370
62 -7045.6971 -62590.3081
63 -5599.9614 -7045.6971
64 -20773.5464 -5599.9614
65 -15163.9049 -20773.5464
66 6887.4498 -15163.9049
67 -5140.0282 6887.4498
68 -44733.4105 -5140.0282
69 -45075.2361 -44733.4105
70 -9891.8298 -45075.2361
71 14197.3137 -9891.8298
72 33693.0207 14197.3137
73 6397.0014 33693.0207
74 15743.6415 6397.0014
75 -12048.0970 15743.6415
76 -47956.4567 -12048.0970
77 10998.3140 -47956.4567
78 -29684.3946 10998.3140
79 20846.5442 -29684.3946
80 25891.6340 20846.5442
81 -36382.0539 25891.6340
82 -39368.3531 -36382.0539
83 -3393.3134 -39368.3531
84 11289.0323 -3393.3134
85 18829.8726 11289.0323
86 -10451.6753 18829.8726
87 11041.9874 -10451.6753
88 -29970.5295 11041.9874
89 -265.5792 -29970.5295
90 -13396.6641 -265.5792
91 -29209.3364 -13396.6641
92 26210.5588 -29209.3364
93 -21317.8890 26210.5588
94 -27751.9511 -21317.8890
95 -13590.5540 -27751.9511
96 -25253.8852 -13590.5540
97 2139.9454 -25253.8852
98 -16159.6564 2139.9454
99 -6514.4100 -16159.6564
100 -45771.8707 -6514.4100
101 -6211.2328 -45771.8707
102 -6044.7316 -6211.2328
103 -37263.4010 -6044.7316
104 -38029.3525 -37263.4010
105 1180.6330 -38029.3525
106 30902.1527 1180.6330
107 -8870.6642 30902.1527
108 -74343.6951 -8870.6642
109 15940.9127 -74343.6951
110 -6666.6562 15940.9127
111 -92958.6463 -6666.6562
112 21374.5790 -92958.6463
113 5659.1835 21374.5790
114 -2806.0401 5659.1835
115 20921.6460 -2806.0401
116 -71544.1379 20921.6460
117 -13704.2622 -71544.1379
118 18517.5061 -13704.2622
119 -27454.1274 18517.5061
120 -23610.3644 -27454.1274
121 -1965.2262 -23610.3644
122 -57058.6118 -1965.2262
123 -35517.8526 -57058.6118
124 -48429.5165 -35517.8526
125 -47033.5895 -48429.5165
126 -66787.1299 -47033.5895
127 -14614.4801 -66787.1299
128 558.6497 -14614.4801
129 14656.2859 558.6497
130 -6961.3435 14656.2859
131 25350.4972 -6961.3435
132 -10374.1657 25350.4972
133 -36819.5478 -10374.1657
134 4435.7558 -36819.5478
135 -8817.9235 4435.7558
136 -16278.1908 -8817.9235
137 -11379.8925 -16278.1908
138 -107284.3939 -11379.8925
139 -11235.7812 -107284.3939
140 -11637.7888 -11235.7812
141 -2294.1860 -11637.7888
142 -25256.5381 -2294.1860
143 -14945.9673 -25256.5381
144 8396.2884 -14945.9673
145 -41138.1458 8396.2884
146 -8426.7976 -41138.1458
147 -29784.1442 -8426.7976
148 -2276.9016 -29784.1442
149 -19708.1774 -2276.9016
150 -5991.3727 -19708.1774
151 -7090.0885 -5991.3727
152 -877.8323 -7090.0885
153 -3827.6916 -877.8323
154 -8413.6515 -3827.6916
155 -17642.2206 -8413.6515
156 -16621.8913 -17642.2206
157 -17135.8913 -16621.8913
158 -17387.8913 -17135.8913
159 -17492.8913 -17387.8913
160 -17590.8913 -17492.8913
161 -17590.8913 -17590.8913
162 -17590.8913 -17590.8913
163 -17590.8913 -17590.8913
164 NA -17590.8913
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 138933.9178 102201.4473
[2,] 109315.8783 138933.9178
[3,] 87466.6580 109315.8783
[4,] 63078.1290 87466.6580
[5,] 62214.5396 63078.1290
[6,] 111656.0888 62214.5396
[7,] 921.8316 111656.0888
[8,] 11358.8752 921.8316
[9,] 83779.2128 11358.8752
[10,] 46211.5177 83779.2128
[11,] 10672.6041 46211.5177
[12,] 35576.9335 10672.6041
[13,] 44903.8013 35576.9335
[14,] 35095.9739 44903.8013
[15,] 45455.2981 35095.9739
[16,] 35108.3347 45455.2981
[17,] 80779.2905 35108.3347
[18,] 61393.4508 80779.2905
[19,] 16057.4808 61393.4508
[20,] 30687.9866 16057.4808
[21,] -15611.2597 30687.9866
[22,] -17705.6962 -15611.2597
[23,] 14674.4987 -17705.6962
[24,] 27817.7634 14674.4987
[25,] 12925.4999 27817.7634
[26,] -18619.9673 12925.4999
[27,] 18684.6819 -18619.9673
[28,] 57486.8359 18684.6819
[29,] 7812.8168 57486.8359
[30,] -12784.2061 7812.8168
[31,] 3253.6759 -12784.2061
[32,] 11479.8921 3253.6759
[33,] 20796.7452 11479.8921
[34,] 33753.8733 20796.7452
[35,] -27576.1420 33753.8733
[36,] 13124.5207 -27576.1420
[37,] 7626.0213 13124.5207
[38,] -6076.6383 7626.0213
[39,] 39472.3414 -6076.6383
[40,] 25163.9818 39472.3414
[41,] 75667.9582 25163.9818
[42,] -16018.4876 75667.9582
[43,] -30852.0143 -16018.4876
[44,] 38965.6195 -30852.0143
[45,] 53728.7062 38965.6195
[46,] 61517.4258 53728.7062
[47,] 23480.8734 61517.4258
[48,] 30972.1989 23480.8734
[49,] -48237.9200 30972.1989
[50,] 20034.1142 -48237.9200
[51,] -16578.5176 20034.1142
[52,] -20463.6053 -16578.5176
[53,] 8701.0745 -20463.6053
[54,] -3515.3630 8701.0745
[55,] 4745.1435 -3515.3630
[56,] -7438.8285 4745.1435
[57,] -17785.2564 -7438.8285
[58,] -12373.4667 -17785.2564
[59,] -38596.3295 -12373.4667
[60,] -33703.0370 -38596.3295
[61,] -62590.3081 -33703.0370
[62,] -7045.6971 -62590.3081
[63,] -5599.9614 -7045.6971
[64,] -20773.5464 -5599.9614
[65,] -15163.9049 -20773.5464
[66,] 6887.4498 -15163.9049
[67,] -5140.0282 6887.4498
[68,] -44733.4105 -5140.0282
[69,] -45075.2361 -44733.4105
[70,] -9891.8298 -45075.2361
[71,] 14197.3137 -9891.8298
[72,] 33693.0207 14197.3137
[73,] 6397.0014 33693.0207
[74,] 15743.6415 6397.0014
[75,] -12048.0970 15743.6415
[76,] -47956.4567 -12048.0970
[77,] 10998.3140 -47956.4567
[78,] -29684.3946 10998.3140
[79,] 20846.5442 -29684.3946
[80,] 25891.6340 20846.5442
[81,] -36382.0539 25891.6340
[82,] -39368.3531 -36382.0539
[83,] -3393.3134 -39368.3531
[84,] 11289.0323 -3393.3134
[85,] 18829.8726 11289.0323
[86,] -10451.6753 18829.8726
[87,] 11041.9874 -10451.6753
[88,] -29970.5295 11041.9874
[89,] -265.5792 -29970.5295
[90,] -13396.6641 -265.5792
[91,] -29209.3364 -13396.6641
[92,] 26210.5588 -29209.3364
[93,] -21317.8890 26210.5588
[94,] -27751.9511 -21317.8890
[95,] -13590.5540 -27751.9511
[96,] -25253.8852 -13590.5540
[97,] 2139.9454 -25253.8852
[98,] -16159.6564 2139.9454
[99,] -6514.4100 -16159.6564
[100,] -45771.8707 -6514.4100
[101,] -6211.2328 -45771.8707
[102,] -6044.7316 -6211.2328
[103,] -37263.4010 -6044.7316
[104,] -38029.3525 -37263.4010
[105,] 1180.6330 -38029.3525
[106,] 30902.1527 1180.6330
[107,] -8870.6642 30902.1527
[108,] -74343.6951 -8870.6642
[109,] 15940.9127 -74343.6951
[110,] -6666.6562 15940.9127
[111,] -92958.6463 -6666.6562
[112,] 21374.5790 -92958.6463
[113,] 5659.1835 21374.5790
[114,] -2806.0401 5659.1835
[115,] 20921.6460 -2806.0401
[116,] -71544.1379 20921.6460
[117,] -13704.2622 -71544.1379
[118,] 18517.5061 -13704.2622
[119,] -27454.1274 18517.5061
[120,] -23610.3644 -27454.1274
[121,] -1965.2262 -23610.3644
[122,] -57058.6118 -1965.2262
[123,] -35517.8526 -57058.6118
[124,] -48429.5165 -35517.8526
[125,] -47033.5895 -48429.5165
[126,] -66787.1299 -47033.5895
[127,] -14614.4801 -66787.1299
[128,] 558.6497 -14614.4801
[129,] 14656.2859 558.6497
[130,] -6961.3435 14656.2859
[131,] 25350.4972 -6961.3435
[132,] -10374.1657 25350.4972
[133,] -36819.5478 -10374.1657
[134,] 4435.7558 -36819.5478
[135,] -8817.9235 4435.7558
[136,] -16278.1908 -8817.9235
[137,] -11379.8925 -16278.1908
[138,] -107284.3939 -11379.8925
[139,] -11235.7812 -107284.3939
[140,] -11637.7888 -11235.7812
[141,] -2294.1860 -11637.7888
[142,] -25256.5381 -2294.1860
[143,] -14945.9673 -25256.5381
[144,] 8396.2884 -14945.9673
[145,] -41138.1458 8396.2884
[146,] -8426.7976 -41138.1458
[147,] -29784.1442 -8426.7976
[148,] -2276.9016 -29784.1442
[149,] -19708.1774 -2276.9016
[150,] -5991.3727 -19708.1774
[151,] -7090.0885 -5991.3727
[152,] -877.8323 -7090.0885
[153,] -3827.6916 -877.8323
[154,] -8413.6515 -3827.6916
[155,] -17642.2206 -8413.6515
[156,] -16621.8913 -17642.2206
[157,] -17135.8913 -16621.8913
[158,] -17387.8913 -17135.8913
[159,] -17492.8913 -17387.8913
[160,] -17590.8913 -17492.8913
[161,] -17590.8913 -17590.8913
[162,] -17590.8913 -17590.8913
[163,] -17590.8913 -17590.8913
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 138933.9178 102201.4473
2 109315.8783 138933.9178
3 87466.6580 109315.8783
4 63078.1290 87466.6580
5 62214.5396 63078.1290
6 111656.0888 62214.5396
7 921.8316 111656.0888
8 11358.8752 921.8316
9 83779.2128 11358.8752
10 46211.5177 83779.2128
11 10672.6041 46211.5177
12 35576.9335 10672.6041
13 44903.8013 35576.9335
14 35095.9739 44903.8013
15 45455.2981 35095.9739
16 35108.3347 45455.2981
17 80779.2905 35108.3347
18 61393.4508 80779.2905
19 16057.4808 61393.4508
20 30687.9866 16057.4808
21 -15611.2597 30687.9866
22 -17705.6962 -15611.2597
23 14674.4987 -17705.6962
24 27817.7634 14674.4987
25 12925.4999 27817.7634
26 -18619.9673 12925.4999
27 18684.6819 -18619.9673
28 57486.8359 18684.6819
29 7812.8168 57486.8359
30 -12784.2061 7812.8168
31 3253.6759 -12784.2061
32 11479.8921 3253.6759
33 20796.7452 11479.8921
34 33753.8733 20796.7452
35 -27576.1420 33753.8733
36 13124.5207 -27576.1420
37 7626.0213 13124.5207
38 -6076.6383 7626.0213
39 39472.3414 -6076.6383
40 25163.9818 39472.3414
41 75667.9582 25163.9818
42 -16018.4876 75667.9582
43 -30852.0143 -16018.4876
44 38965.6195 -30852.0143
45 53728.7062 38965.6195
46 61517.4258 53728.7062
47 23480.8734 61517.4258
48 30972.1989 23480.8734
49 -48237.9200 30972.1989
50 20034.1142 -48237.9200
51 -16578.5176 20034.1142
52 -20463.6053 -16578.5176
53 8701.0745 -20463.6053
54 -3515.3630 8701.0745
55 4745.1435 -3515.3630
56 -7438.8285 4745.1435
57 -17785.2564 -7438.8285
58 -12373.4667 -17785.2564
59 -38596.3295 -12373.4667
60 -33703.0370 -38596.3295
61 -62590.3081 -33703.0370
62 -7045.6971 -62590.3081
63 -5599.9614 -7045.6971
64 -20773.5464 -5599.9614
65 -15163.9049 -20773.5464
66 6887.4498 -15163.9049
67 -5140.0282 6887.4498
68 -44733.4105 -5140.0282
69 -45075.2361 -44733.4105
70 -9891.8298 -45075.2361
71 14197.3137 -9891.8298
72 33693.0207 14197.3137
73 6397.0014 33693.0207
74 15743.6415 6397.0014
75 -12048.0970 15743.6415
76 -47956.4567 -12048.0970
77 10998.3140 -47956.4567
78 -29684.3946 10998.3140
79 20846.5442 -29684.3946
80 25891.6340 20846.5442
81 -36382.0539 25891.6340
82 -39368.3531 -36382.0539
83 -3393.3134 -39368.3531
84 11289.0323 -3393.3134
85 18829.8726 11289.0323
86 -10451.6753 18829.8726
87 11041.9874 -10451.6753
88 -29970.5295 11041.9874
89 -265.5792 -29970.5295
90 -13396.6641 -265.5792
91 -29209.3364 -13396.6641
92 26210.5588 -29209.3364
93 -21317.8890 26210.5588
94 -27751.9511 -21317.8890
95 -13590.5540 -27751.9511
96 -25253.8852 -13590.5540
97 2139.9454 -25253.8852
98 -16159.6564 2139.9454
99 -6514.4100 -16159.6564
100 -45771.8707 -6514.4100
101 -6211.2328 -45771.8707
102 -6044.7316 -6211.2328
103 -37263.4010 -6044.7316
104 -38029.3525 -37263.4010
105 1180.6330 -38029.3525
106 30902.1527 1180.6330
107 -8870.6642 30902.1527
108 -74343.6951 -8870.6642
109 15940.9127 -74343.6951
110 -6666.6562 15940.9127
111 -92958.6463 -6666.6562
112 21374.5790 -92958.6463
113 5659.1835 21374.5790
114 -2806.0401 5659.1835
115 20921.6460 -2806.0401
116 -71544.1379 20921.6460
117 -13704.2622 -71544.1379
118 18517.5061 -13704.2622
119 -27454.1274 18517.5061
120 -23610.3644 -27454.1274
121 -1965.2262 -23610.3644
122 -57058.6118 -1965.2262
123 -35517.8526 -57058.6118
124 -48429.5165 -35517.8526
125 -47033.5895 -48429.5165
126 -66787.1299 -47033.5895
127 -14614.4801 -66787.1299
128 558.6497 -14614.4801
129 14656.2859 558.6497
130 -6961.3435 14656.2859
131 25350.4972 -6961.3435
132 -10374.1657 25350.4972
133 -36819.5478 -10374.1657
134 4435.7558 -36819.5478
135 -8817.9235 4435.7558
136 -16278.1908 -8817.9235
137 -11379.8925 -16278.1908
138 -107284.3939 -11379.8925
139 -11235.7812 -107284.3939
140 -11637.7888 -11235.7812
141 -2294.1860 -11637.7888
142 -25256.5381 -2294.1860
143 -14945.9673 -25256.5381
144 8396.2884 -14945.9673
145 -41138.1458 8396.2884
146 -8426.7976 -41138.1458
147 -29784.1442 -8426.7976
148 -2276.9016 -29784.1442
149 -19708.1774 -2276.9016
150 -5991.3727 -19708.1774
151 -7090.0885 -5991.3727
152 -877.8323 -7090.0885
153 -3827.6916 -877.8323
154 -8413.6515 -3827.6916
155 -17642.2206 -8413.6515
156 -16621.8913 -17642.2206
157 -17135.8913 -16621.8913
158 -17387.8913 -17135.8913
159 -17492.8913 -17387.8913
160 -17590.8913 -17492.8913
161 -17590.8913 -17590.8913
162 -17590.8913 -17590.8913
163 -17590.8913 -17590.8913
> 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/7dryo1321540528.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/80bpy1321540528.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/9m6gu1321540528.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/10dz1o1321540528.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/119bz11321540528.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/12srnz1321540528.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/133xqy1321540528.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/14ijev1321540528.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/15ackb1321540528.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/16n99a1321540528.tab")
+ }
>
> try(system("convert tmp/1ybgh1321540528.ps tmp/1ybgh1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/277j71321540528.ps tmp/277j71321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/3b9ab1321540528.ps tmp/3b9ab1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/4sgrm1321540528.ps tmp/4sgrm1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/56b9r1321540528.ps tmp/56b9r1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/6vksf1321540528.ps tmp/6vksf1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/7dryo1321540528.ps tmp/7dryo1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/80bpy1321540528.ps tmp/80bpy1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/9m6gu1321540528.ps tmp/9m6gu1321540528.png",intern=TRUE))
character(0)
> try(system("convert tmp/10dz1o1321540528.ps tmp/10dz1o1321540528.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.155 0.550 5.775