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(130
+ ,279055
+ ,73
+ ,140824
+ ,186099
+ ,143
+ ,212408
+ ,75
+ ,110459
+ ,113854
+ ,118
+ ,233939
+ ,83
+ ,105079
+ ,99776
+ ,146
+ ,222117
+ ,106
+ ,112098
+ ,106194
+ ,73
+ ,189911
+ ,56
+ ,43929
+ ,100792
+ ,89
+ ,70849
+ ,28
+ ,76173
+ ,47552
+ ,146
+ ,605767
+ ,135
+ ,187326
+ ,250931
+ ,22
+ ,33186
+ ,19
+ ,22807
+ ,6853
+ ,132
+ ,227332
+ ,62
+ ,144408
+ ,115466
+ ,92
+ ,267925
+ ,49
+ ,66485
+ ,110896
+ ,147
+ ,371987
+ ,122
+ ,79089
+ ,169351
+ ,203
+ ,264989
+ ,131
+ ,81625
+ ,94853
+ ,113
+ ,212638
+ ,87
+ ,68788
+ ,72591
+ ,171
+ ,368577
+ ,85
+ ,103297
+ ,101345
+ ,87
+ ,269455
+ ,88
+ ,69446
+ ,113713
+ ,208
+ ,398124
+ ,191
+ ,114948
+ ,165354
+ ,153
+ ,335567
+ ,77
+ ,167949
+ ,164263
+ ,97
+ ,432711
+ ,173
+ ,125081
+ ,135213
+ ,95
+ ,182016
+ ,58
+ ,125818
+ ,111669
+ ,197
+ ,267365
+ ,89
+ ,136588
+ ,134163
+ ,160
+ ,279428
+ ,73
+ ,112431
+ ,140303
+ ,148
+ ,508849
+ ,111
+ ,103037
+ ,150773
+ ,84
+ ,220142
+ ,49
+ ,82317
+ ,111848
+ ,227
+ ,200004
+ ,58
+ ,118906
+ ,102509
+ ,154
+ ,257139
+ ,133
+ ,83515
+ ,96785
+ ,151
+ ,270941
+ ,138
+ ,104581
+ ,116136
+ ,142
+ ,324969
+ ,134
+ ,103129
+ ,158376
+ ,148
+ ,329962
+ ,92
+ ,83243
+ ,153990
+ ,110
+ ,190867
+ ,60
+ ,37110
+ ,64057
+ ,149
+ ,393860
+ ,79
+ ,113344
+ ,230054
+ ,179
+ ,327660
+ ,89
+ ,139165
+ ,184531
+ ,149
+ ,269239
+ ,83
+ ,86652
+ ,114198
+ ,187
+ ,396136
+ ,106
+ ,112302
+ ,198299
+ ,153
+ ,130446
+ ,49
+ ,69652
+ ,33750
+ ,163
+ ,430118
+ ,104
+ ,119442
+ ,189723
+ ,127
+ ,273950
+ ,56
+ ,69867
+ ,100826
+ ,151
+ ,428077
+ ,128
+ ,101629
+ ,188355
+ ,100
+ ,254312
+ ,93
+ ,70168
+ ,104470
+ ,46
+ ,120351
+ ,35
+ ,31081
+ ,58391
+ ,156
+ ,395658
+ ,212
+ ,103925
+ ,164808
+ ,128
+ ,345875
+ ,86
+ ,92622
+ ,134097
+ ,111
+ ,216827
+ ,82
+ ,79011
+ ,80238
+ ,119
+ ,224524
+ ,83
+ ,93487
+ ,133252
+ ,148
+ ,182485
+ ,69
+ ,64520
+ ,54518
+ ,65
+ ,157164
+ ,85
+ ,93473
+ ,121850
+ ,134
+ ,459455
+ ,157
+ ,114360
+ ,79367
+ ,66
+ ,78800
+ ,42
+ ,33032
+ ,56968
+ ,201
+ ,255072
+ ,85
+ ,96125
+ ,106314
+ ,177
+ ,368086
+ ,123
+ ,151911
+ ,191889
+ ,156
+ ,230299
+ ,70
+ ,89256
+ ,104864
+ ,158
+ ,244782
+ ,81
+ ,95676
+ ,160792
+ ,7
+ ,24188
+ ,24
+ ,5950
+ ,15049
+ ,175
+ ,400109
+ ,334
+ ,149695
+ ,191179
+ ,61
+ ,65029
+ ,17
+ ,32551
+ ,25109
+ ,41
+ ,101097
+ ,64
+ ,31701
+ ,45824
+ ,133
+ ,309810
+ ,67
+ ,100087
+ ,129711
+ ,228
+ ,375638
+ ,91
+ ,169707
+ ,210012
+ ,140
+ ,367127
+ ,204
+ ,150491
+ ,194679
+ ,155
+ ,381998
+ ,155
+ ,120192
+ ,197680
+ ,141
+ ,280106
+ ,90
+ ,95893
+ ,81180
+ ,181
+ ,400971
+ ,153
+ ,151715
+ ,197765
+ ,75
+ ,315924
+ ,122
+ ,176225
+ ,214738
+ ,97
+ ,291391
+ ,124
+ ,59900
+ ,96252
+ ,142
+ ,295075
+ ,93
+ ,104767
+ ,124527
+ ,136
+ ,280018
+ ,81
+ ,114799
+ ,153242
+ ,87
+ ,267432
+ ,71
+ ,72128
+ ,145707
+ ,140
+ ,217181
+ ,141
+ ,143592
+ ,113963
+ ,169
+ ,258166
+ ,159
+ ,89626
+ ,134904
+ ,129
+ ,264771
+ ,88
+ ,131072
+ ,114268
+ ,92
+ ,182961
+ ,73
+ ,126817
+ ,94333
+ ,160
+ ,256967
+ ,74
+ ,81351
+ ,102204
+ ,67
+ ,73566
+ ,32
+ ,22618
+ ,23824
+ ,179
+ ,272362
+ ,93
+ ,88977
+ ,111563
+ ,90
+ ,229056
+ ,62
+ ,92059
+ ,91313
+ ,144
+ ,229851
+ ,70
+ ,81897
+ ,89770
+ ,144
+ ,371391
+ ,91
+ ,108146
+ ,100125
+ ,144
+ ,398210
+ ,104
+ ,126372
+ ,165278
+ ,134
+ ,220419
+ ,111
+ ,249771
+ ,181712
+ ,146
+ ,231884
+ ,72
+ ,71154
+ ,80906
+ ,121
+ ,219381
+ ,73
+ ,71571
+ ,75881
+ ,112
+ ,206169
+ ,54
+ ,55918
+ ,83963
+ ,145
+ ,483074
+ ,132
+ ,160141
+ ,175721
+ ,99
+ ,146100
+ ,72
+ ,38692
+ ,68580
+ ,96
+ ,295224
+ ,109
+ ,102812
+ ,136323
+ ,27
+ ,80953
+ ,25
+ ,56622
+ ,55792
+ ,77
+ ,217384
+ ,63
+ ,15986
+ ,25157
+ ,137
+ ,179344
+ ,62
+ ,123534
+ ,100922
+ ,151
+ ,415550
+ ,222
+ ,108535
+ ,118845
+ ,126
+ ,389059
+ ,129
+ ,93879
+ ,170492
+ ,159
+ ,180679
+ ,106
+ ,144551
+ ,81716
+ ,101
+ ,299505
+ ,104
+ ,56750
+ ,115750
+ ,144
+ ,292260
+ ,84
+ ,127654
+ ,105590
+ ,102
+ ,199481
+ ,68
+ ,65594
+ ,92795
+ ,135
+ ,282361
+ ,78
+ ,59938
+ ,82390
+ ,147
+ ,329281
+ ,89
+ ,146975
+ ,135599
+ ,155
+ ,234577
+ ,48
+ ,165904
+ ,127667
+ ,138
+ ,297995
+ ,67
+ ,169265
+ ,163073
+ ,113
+ ,342490
+ ,90
+ ,183500
+ ,211381
+ ,248
+ ,416463
+ ,163
+ ,165986
+ ,189944
+ ,116
+ ,429565
+ ,120
+ ,184923
+ ,226168
+ ,176
+ ,297080
+ ,142
+ ,140358
+ ,117495
+ ,140
+ ,331792
+ ,71
+ ,149959
+ ,195894
+ ,59
+ ,229772
+ ,202
+ ,57224
+ ,80684
+ ,64
+ ,43287
+ ,14
+ ,43750
+ ,19630
+ ,40
+ ,238089
+ ,87
+ ,48029
+ ,88634
+ ,98
+ ,263322
+ ,160
+ ,104978
+ ,139292
+ ,139
+ ,302082
+ ,61
+ ,100046
+ ,128602
+ ,135
+ ,321797
+ ,95
+ ,101047
+ ,135848
+ ,97
+ ,193926
+ ,96
+ ,197426
+ ,178377
+ ,142
+ ,175138
+ ,105
+ ,160902
+ ,106330
+ ,155
+ ,354041
+ ,78
+ ,147172
+ ,178303
+ ,115
+ ,303273
+ ,91
+ ,109432
+ ,116938
+ ,0
+ ,23668
+ ,13
+ ,1168
+ ,5841
+ ,103
+ ,196743
+ ,79
+ ,83248
+ ,106020
+ ,30
+ ,61857
+ ,25
+ ,25162
+ ,24610
+ ,130
+ ,217543
+ ,54
+ ,45724
+ ,74151
+ ,102
+ ,440711
+ ,128
+ ,110529
+ ,232241
+ ,0
+ ,21054
+ ,16
+ ,855
+ ,6622
+ ,77
+ ,252805
+ ,52
+ ,101382
+ ,127097
+ ,9
+ ,31961
+ ,22
+ ,14116
+ ,13155
+ ,150
+ ,360436
+ ,125
+ ,89506
+ ,160501
+ ,163
+ ,251948
+ ,77
+ ,135356
+ ,91502
+ ,148
+ ,187320
+ ,97
+ ,116066
+ ,24469
+ ,94
+ ,180842
+ ,58
+ ,144244
+ ,88229
+ ,21
+ ,38214
+ ,34
+ ,8773
+ ,13983
+ ,151
+ ,280392
+ ,56
+ ,102153
+ ,80716
+ ,187
+ ,358276
+ ,84
+ ,117440
+ ,157384
+ ,171
+ ,211775
+ ,67
+ ,104128
+ ,122975
+ ,170
+ ,447335
+ ,90
+ ,134238
+ ,191469
+ ,145
+ ,348017
+ ,99
+ ,134047
+ ,231257
+ ,198
+ ,441946
+ ,133
+ ,279488
+ ,258287
+ ,152
+ ,215177
+ ,43
+ ,79756
+ ,122531
+ ,112
+ ,130177
+ ,47
+ ,66089
+ ,61394
+ ,173
+ ,318037
+ ,365
+ ,102070
+ ,86480
+ ,177
+ ,466139
+ ,198
+ ,146760
+ ,195791
+ ,153
+ ,162279
+ ,62
+ ,154771
+ ,18284
+ ,161
+ ,416643
+ ,140
+ ,165933
+ ,147581
+ ,115
+ ,178322
+ ,86
+ ,64593
+ ,72558
+ ,147
+ ,292443
+ ,54
+ ,92280
+ ,147341
+ ,124
+ ,283913
+ ,100
+ ,67150
+ ,114651
+ ,57
+ ,244931
+ ,127
+ ,128692
+ ,100187
+ ,144
+ ,387072
+ ,125
+ ,124089
+ ,130332
+ ,126
+ ,246963
+ ,93
+ ,125386
+ ,134218
+ ,78
+ ,173260
+ ,63
+ ,37238
+ ,10901
+ ,153
+ ,346748
+ ,108
+ ,140015
+ ,145758
+ ,196
+ ,178402
+ ,60
+ ,150047
+ ,75767
+ ,130
+ ,268750
+ ,96
+ ,154451
+ ,134969
+ ,159
+ ,314070
+ ,112
+ ,156349
+ ,169216
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,14688
+ ,10
+ ,6023
+ ,7953
+ ,0
+ ,98
+ ,1
+ ,0
+ ,0
+ ,0
+ ,455
+ ,2
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,94
+ ,291847
+ ,95
+ ,84601
+ ,105406
+ ,129
+ ,415421
+ ,168
+ ,68946
+ ,174586
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,203
+ ,4
+ ,0
+ ,0
+ ,0
+ ,7199
+ ,5
+ ,1644
+ ,4245
+ ,13
+ ,46660
+ ,21
+ ,6179
+ ,21509
+ ,4
+ ,17547
+ ,5
+ ,3926
+ ,7670
+ ,89
+ ,121550
+ ,46
+ ,52789
+ ,15673
+ ,0
+ ,969
+ ,2
+ ,0
+ ,0
+ ,71
+ ,242774
+ ,75
+ ,100350
+ ,75882)
+ ,dim=c(5
+ ,164)
+ ,dimnames=list(c('LongPR'
+ ,'Time'
+ ,'Log'
+ ,'CompChar'
+ ,'CompSec')
+ ,1:164))
> y <- array(NA,dim=c(5,164),dimnames=list(c('LongPR','Time','Log','CompChar','CompSec'),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
LongPR Time Log CompChar CompSec
1 130 279055 73 140824 186099
2 143 212408 75 110459 113854
3 118 233939 83 105079 99776
4 146 222117 106 112098 106194
5 73 189911 56 43929 100792
6 89 70849 28 76173 47552
7 146 605767 135 187326 250931
8 22 33186 19 22807 6853
9 132 227332 62 144408 115466
10 92 267925 49 66485 110896
11 147 371987 122 79089 169351
12 203 264989 131 81625 94853
13 113 212638 87 68788 72591
14 171 368577 85 103297 101345
15 87 269455 88 69446 113713
16 208 398124 191 114948 165354
17 153 335567 77 167949 164263
18 97 432711 173 125081 135213
19 95 182016 58 125818 111669
20 197 267365 89 136588 134163
21 160 279428 73 112431 140303
22 148 508849 111 103037 150773
23 84 220142 49 82317 111848
24 227 200004 58 118906 102509
25 154 257139 133 83515 96785
26 151 270941 138 104581 116136
27 142 324969 134 103129 158376
28 148 329962 92 83243 153990
29 110 190867 60 37110 64057
30 149 393860 79 113344 230054
31 179 327660 89 139165 184531
32 149 269239 83 86652 114198
33 187 396136 106 112302 198299
34 153 130446 49 69652 33750
35 163 430118 104 119442 189723
36 127 273950 56 69867 100826
37 151 428077 128 101629 188355
38 100 254312 93 70168 104470
39 46 120351 35 31081 58391
40 156 395658 212 103925 164808
41 128 345875 86 92622 134097
42 111 216827 82 79011 80238
43 119 224524 83 93487 133252
44 148 182485 69 64520 54518
45 65 157164 85 93473 121850
46 134 459455 157 114360 79367
47 66 78800 42 33032 56968
48 201 255072 85 96125 106314
49 177 368086 123 151911 191889
50 156 230299 70 89256 104864
51 158 244782 81 95676 160792
52 7 24188 24 5950 15049
53 175 400109 334 149695 191179
54 61 65029 17 32551 25109
55 41 101097 64 31701 45824
56 133 309810 67 100087 129711
57 228 375638 91 169707 210012
58 140 367127 204 150491 194679
59 155 381998 155 120192 197680
60 141 280106 90 95893 81180
61 181 400971 153 151715 197765
62 75 315924 122 176225 214738
63 97 291391 124 59900 96252
64 142 295075 93 104767 124527
65 136 280018 81 114799 153242
66 87 267432 71 72128 145707
67 140 217181 141 143592 113963
68 169 258166 159 89626 134904
69 129 264771 88 131072 114268
70 92 182961 73 126817 94333
71 160 256967 74 81351 102204
72 67 73566 32 22618 23824
73 179 272362 93 88977 111563
74 90 229056 62 92059 91313
75 144 229851 70 81897 89770
76 144 371391 91 108146 100125
77 144 398210 104 126372 165278
78 134 220419 111 249771 181712
79 146 231884 72 71154 80906
80 121 219381 73 71571 75881
81 112 206169 54 55918 83963
82 145 483074 132 160141 175721
83 99 146100 72 38692 68580
84 96 295224 109 102812 136323
85 27 80953 25 56622 55792
86 77 217384 63 15986 25157
87 137 179344 62 123534 100922
88 151 415550 222 108535 118845
89 126 389059 129 93879 170492
90 159 180679 106 144551 81716
91 101 299505 104 56750 115750
92 144 292260 84 127654 105590
93 102 199481 68 65594 92795
94 135 282361 78 59938 82390
95 147 329281 89 146975 135599
96 155 234577 48 165904 127667
97 138 297995 67 169265 163073
98 113 342490 90 183500 211381
99 248 416463 163 165986 189944
100 116 429565 120 184923 226168
101 176 297080 142 140358 117495
102 140 331792 71 149959 195894
103 59 229772 202 57224 80684
104 64 43287 14 43750 19630
105 40 238089 87 48029 88634
106 98 263322 160 104978 139292
107 139 302082 61 100046 128602
108 135 321797 95 101047 135848
109 97 193926 96 197426 178377
110 142 175138 105 160902 106330
111 155 354041 78 147172 178303
112 115 303273 91 109432 116938
113 0 23668 13 1168 5841
114 103 196743 79 83248 106020
115 30 61857 25 25162 24610
116 130 217543 54 45724 74151
117 102 440711 128 110529 232241
118 0 21054 16 855 6622
119 77 252805 52 101382 127097
120 9 31961 22 14116 13155
121 150 360436 125 89506 160501
122 163 251948 77 135356 91502
123 148 187320 97 116066 24469
124 94 180842 58 144244 88229
125 21 38214 34 8773 13983
126 151 280392 56 102153 80716
127 187 358276 84 117440 157384
128 171 211775 67 104128 122975
129 170 447335 90 134238 191469
130 145 348017 99 134047 231257
131 198 441946 133 279488 258287
132 152 215177 43 79756 122531
133 112 130177 47 66089 61394
134 173 318037 365 102070 86480
135 177 466139 198 146760 195791
136 153 162279 62 154771 18284
137 161 416643 140 165933 147581
138 115 178322 86 64593 72558
139 147 292443 54 92280 147341
140 124 283913 100 67150 114651
141 57 244931 127 128692 100187
142 144 387072 125 124089 130332
143 126 246963 93 125386 134218
144 78 173260 63 37238 10901
145 153 346748 108 140015 145758
146 196 178402 60 150047 75767
147 130 268750 96 154451 134969
148 159 314070 112 156349 169216
149 0 1 0 0 0
150 0 14688 10 6023 7953
151 0 98 1 0 0
152 0 455 2 0 0
153 0 0 0 0 0
154 0 0 0 0 0
155 94 291847 95 84601 105406
156 129 415421 168 68946 174586
157 0 0 0 0 0
158 0 203 4 0 0
159 0 7199 5 1644 4245
160 13 46660 21 6179 21509
161 4 17547 5 3926 7670
162 89 121550 46 52789 15673
163 0 969 2 0 0
164 71 242774 75 100350 75882
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Time Log CompChar CompSec
25.6282458 0.0002420 0.0550932 0.0004941 -0.0001813
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-81.944 -24.367 -0.955 19.393 109.608
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.563e+01 6.123e+00 4.186 4.70e-05 ***
Time 2.420e-04 4.862e-05 4.977 1.66e-06 ***
Log 5.509e-02 6.997e-02 0.787 0.4322
CompChar 4.941e-04 8.403e-05 5.880 2.34e-08 ***
CompSec -1.813e-04 1.014e-04 -1.788 0.0756 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 33.83 on 159 degrees of freedom
Multiple R-squared: 0.6364, Adjusted R-squared: 0.6273
F-statistic: 69.58 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.14151461 2.830292e-01 8.584854e-01
[2,] 0.05671898 1.134380e-01 9.432810e-01
[3,] 0.10700804 2.140161e-01 8.929920e-01
[4,] 0.07302549 1.460510e-01 9.269745e-01
[5,] 0.13640420 2.728084e-01 8.635958e-01
[6,] 0.08574773 1.714955e-01 9.142523e-01
[7,] 0.21276675 4.255335e-01 7.872333e-01
[8,] 0.21006865 4.201373e-01 7.899313e-01
[9,] 0.16927087 3.385417e-01 8.307291e-01
[10,] 0.12071882 2.414376e-01 8.792812e-01
[11,] 0.71456320 5.708736e-01 2.854368e-01
[12,] 0.68336591 6.332682e-01 3.166341e-01
[13,] 0.77874116 4.425177e-01 2.212588e-01
[14,] 0.78143456 4.371309e-01 2.185654e-01
[15,] 0.75268201 4.946360e-01 2.473180e-01
[16,] 0.70545576 5.890885e-01 2.945442e-01
[17,] 0.96078984 7.842033e-02 3.921016e-02
[18,] 0.94876494 1.024701e-01 5.123506e-02
[19,] 0.93313186 1.337363e-01 6.686814e-02
[20,] 0.91173933 1.765213e-01 8.826067e-02
[21,] 0.90277121 1.944576e-01 9.722879e-02
[22,] 0.88629547 2.274091e-01 1.137045e-01
[23,] 0.86219868 2.756026e-01 1.378013e-01
[24,] 0.84914533 3.017093e-01 1.508547e-01
[25,] 0.83357451 3.328510e-01 1.664255e-01
[26,] 0.84023320 3.195336e-01 1.597668e-01
[27,] 0.88573831 2.285234e-01 1.142617e-01
[28,] 0.85925999 2.814800e-01 1.407400e-01
[29,] 0.83431967 3.313607e-01 1.656803e-01
[30,] 0.79746945 4.050611e-01 2.025306e-01
[31,] 0.77503805 4.499239e-01 2.249620e-01
[32,] 0.77184940 4.563012e-01 2.281506e-01
[33,] 0.74959200 5.008160e-01 2.504080e-01
[34,] 0.70589617 5.882077e-01 2.941038e-01
[35,] 0.66275945 6.744811e-01 3.372406e-01
[36,] 0.62157765 7.568447e-01 3.784224e-01
[37,] 0.65375664 6.924867e-01 3.462434e-01
[38,] 0.72336737 5.532653e-01 2.766326e-01
[39,] 0.76203660 4.759268e-01 2.379634e-01
[40,] 0.73432167 5.313567e-01 2.656783e-01
[41,] 0.86850569 2.629886e-01 1.314943e-01
[42,] 0.84366488 3.126702e-01 1.563351e-01
[43,] 0.85440470 2.911906e-01 1.455953e-01
[44,] 0.87382588 2.523482e-01 1.261741e-01
[45,] 0.89189738 2.162052e-01 1.081026e-01
[46,] 0.88883164 2.223367e-01 1.111684e-01
[47,] 0.86906373 2.618725e-01 1.309363e-01
[48,] 0.86604789 2.679042e-01 1.339521e-01
[49,] 0.83844946 3.231011e-01 1.615505e-01
[50,] 0.88305451 2.338910e-01 1.169455e-01
[51,] 0.88459979 2.308004e-01 1.154002e-01
[52,] 0.86224079 2.755184e-01 1.377592e-01
[53,] 0.83561791 3.287642e-01 1.643821e-01
[54,] 0.80907120 3.818576e-01 1.909288e-01
[55,] 0.94624641 1.075072e-01 5.375359e-02
[56,] 0.93690010 1.261998e-01 6.309990e-02
[57,] 0.92260923 1.547815e-01 7.739077e-02
[58,] 0.90695424 1.860915e-01 9.304576e-02
[59,] 0.89294304 2.141139e-01 1.070570e-01
[60,] 0.87361490 2.527702e-01 1.263851e-01
[61,] 0.90891941 1.821612e-01 9.108059e-02
[62,] 0.89295517 2.140897e-01 1.070448e-01
[63,] 0.89353608 2.129278e-01 1.064639e-01
[64,] 0.91027066 1.794587e-01 8.972934e-02
[65,] 0.89580852 2.083830e-01 1.041915e-01
[66,] 0.93368534 1.326293e-01 6.631466e-02
[67,] 0.92840218 1.431956e-01 7.159782e-02
[68,] 0.92960774 1.407845e-01 7.039226e-02
[69,] 0.91643474 1.671305e-01 8.356526e-02
[70,] 0.90155201 1.968960e-01 9.844799e-02
[71,] 0.90848887 1.830223e-01 9.151113e-02
[72,] 0.91599706 1.680059e-01 8.400294e-02
[73,] 0.90255884 1.948823e-01 9.744116e-02
[74,] 0.89263748 2.147250e-01 1.073625e-01
[75,] 0.91958340 1.608332e-01 8.041660e-02
[76,] 0.92043528 1.591294e-01 7.956472e-02
[77,] 0.92012026 1.597595e-01 7.987974e-02
[78,] 0.93021453 1.395709e-01 6.978547e-02
[79,] 0.91671783 1.665643e-01 8.328217e-02
[80,] 0.90970250 1.805950e-01 9.029750e-02
[81,] 0.89753918 2.049216e-01 1.024608e-01
[82,] 0.88020668 2.395866e-01 1.197933e-01
[83,] 0.87697412 2.460518e-01 1.230259e-01
[84,] 0.85523310 2.895338e-01 1.447669e-01
[85,] 0.82734202 3.453160e-01 1.726580e-01
[86,] 0.80395204 3.920959e-01 1.960480e-01
[87,] 0.78321416 4.335717e-01 2.167858e-01
[88,] 0.75167947 4.966411e-01 2.483205e-01
[89,] 0.72079187 5.584163e-01 2.792081e-01
[90,] 0.68778521 6.244296e-01 3.122148e-01
[91,] 0.72863519 5.427296e-01 2.713648e-01
[92,] 0.85081632 2.983674e-01 1.491837e-01
[93,] 0.92291551 1.541690e-01 7.708449e-02
[94,] 0.91641018 1.671796e-01 8.358982e-02
[95,] 0.89668941 2.066212e-01 1.033106e-01
[96,] 0.91235415 1.752917e-01 8.764585e-02
[97,] 0.90021196 1.995761e-01 9.978804e-02
[98,] 0.93414264 1.317147e-01 6.585736e-02
[99,] 0.92470013 1.505997e-01 7.529987e-02
[100,] 0.90821465 1.835707e-01 9.178535e-02
[101,] 0.88628151 2.274370e-01 1.137185e-01
[102,] 0.89691875 2.061625e-01 1.030812e-01
[103,] 0.87601912 2.479618e-01 1.239809e-01
[104,] 0.84841376 3.031725e-01 1.515862e-01
[105,] 0.83052744 3.389451e-01 1.694726e-01
[106,] 0.82605862 3.478828e-01 1.739414e-01
[107,] 0.79561481 4.087704e-01 2.043852e-01
[108,] 0.77013661 4.597268e-01 2.298634e-01
[109,] 0.80075011 3.984998e-01 1.992499e-01
[110,] 0.84190121 3.161976e-01 1.580988e-01
[111,] 0.83054473 3.389105e-01 1.694553e-01
[112,] 0.84373767 3.125247e-01 1.562623e-01
[113,] 0.82946209 3.410758e-01 1.705379e-01
[114,] 0.80091447 3.981711e-01 1.990855e-01
[115,] 0.78192722 4.361456e-01 2.180728e-01
[116,] 0.76856858 4.628628e-01 2.314314e-01
[117,] 0.76261545 4.747691e-01 2.373845e-01
[118,] 0.72483505 5.503299e-01 2.751649e-01
[119,] 0.70261339 5.947732e-01 2.973866e-01
[120,] 0.73592074 5.281585e-01 2.640793e-01
[121,] 0.85584436 2.883113e-01 1.441556e-01
[122,] 0.82016839 3.596632e-01 1.798316e-01
[123,] 0.77994373 4.401125e-01 2.200563e-01
[124,] 0.83362163 3.327567e-01 1.663784e-01
[125,] 0.91478158 1.704368e-01 8.521842e-02
[126,] 0.93232041 1.353592e-01 6.767959e-02
[127,] 0.95536069 8.927862e-02 4.463931e-02
[128,] 0.94212226 1.157555e-01 5.787774e-02
[129,] 0.93085563 1.382887e-01 6.914437e-02
[130,] 0.92357667 1.528467e-01 7.642333e-02
[131,] 0.96521314 6.957372e-02 3.478686e-02
[132,] 0.94969570 1.006086e-01 5.030430e-02
[133,] 0.95178925 9.642150e-02 4.821075e-02
[134,] 0.99974227 5.154564e-04 2.577282e-04
[135,] 0.99945542 1.089168e-03 5.445841e-04
[136,] 0.99894583 2.108350e-03 1.054175e-03
[137,] 0.99780820 4.383606e-03 2.191803e-03
[138,] 0.99869271 2.614582e-03 1.307291e-03
[139,] 0.99997836 4.328601e-05 2.164301e-05
[140,] 0.99998345 3.309424e-05 1.654712e-05
[141,] 1.00000000 9.015127e-14 4.507564e-14
[142,] 1.00000000 2.009075e-12 1.004537e-12
[143,] 1.00000000 4.017724e-13 2.008862e-13
[144,] 1.00000000 1.383612e-11 6.918060e-12
[145,] 1.00000000 3.667539e-10 1.833770e-10
[146,] 0.99999999 1.158146e-08 5.790730e-09
[147,] 0.99999983 3.417343e-07 1.708672e-07
[148,] 0.99999632 7.352037e-06 3.676019e-06
[149,] 0.99994563 1.087326e-04 5.436629e-05
> postscript(file="/var/wessaorg/rcomp/tmp/1bmum1324651191.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/2o9uv1324651191.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/3wl7b1324651191.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/47sqd1324651191.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/5fjr21324651191.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
-3.0228057 27.9005338 -2.6452203 24.6442732 -5.1041143 15.6678168
7 8 9 10 11 12
-80.7278364 -22.7327348 -2.4769011 -13.9115396 16.2536900 82.8918779
13 14 15 16 17 18
10.2917857 18.8257972 -22.3827156 48.6842319 -11.2812656 -80.1661892
19 20 21 22 23 24
-19.7927465 58.6010741 32.6124144 -30.4634133 -17.9975324 109.6083496
25 26 27 28 29 30
35.0979230 21.5821539 8.1033430 24.2393095 28.1528374 9.4101620
31 32 33 34 35 36
33.8682093 31.5314954 40.1290511 64.8073022 2.9324321 15.7478208
37 38 39 40 41 42
-1.3425153 -8.0260479 -15.4526479 1.4715268 -7.5222749 3.8888067
43 44 45 46 47 48
12.4305722 52.4127196 -27.4382370 -53.5854511 12.9954662 80.7397866
49 50 51 52 53 54
15.2478619 45.6925625 50.5499255 -26.0155168 -5.1605069 7.1666930
55 56 57 58 59 60
-19.9756038 2.7688996 60.6761549 -24.7751138 4.8403489 9.9633202
61 62 63 64 65 66
10.7988070 -81.9439871 -18.1240632 10.6501800 9.2048799 -16.4807535
67 68 69 70 71 72
3.7580497 52.3090296 -9.5978532 -27.4847109 46.4418197 14.9491504
73 74 75 76 77 78
58.5982227 -23.4078203 34.7003018 -11.8028678 -16.2018378 -41.5518652
79 80 81 82 83 84
39.7990454 16.6526623 21.0963832 -52.0741612 27.3642064 -33.1626259
85 86 87 88 89 90
-37.4580169 -8.0455986 21.8134709 -19.5050088 -16.3644039 27.1994889
91 92 93 94 95 96
-9.8941946 -0.9147110 8.7641070 22.0634240 -11.2550650 11.1321029
97 98 99 100 101 102
-17.5035262 -52.8134874 65.0293096 -70.5613282 22.6049052 -8.4131305
103 104 105 106 107 108
-47.0094001 9.0669229 -55.7017917 -26.7836688 10.7888940 0.9637038
109 110 111 112 113 114
-46.0549647 7.9794143 -0.9957098 -21.9045973 -31.5904055 3.4957618
115 116 117 118 119 120
-19.9459751 39.6015504 -49.8404003 -30.8268113 -39.7227270 -30.1646963
121 122 123 124 125 126
15.1322107 21.8669509 18.7828573 -33.8628972 -17.5490055 18.5900853
127 128 129 130 131 132
40.5464579 61.2763786 -0.4570653 5.3915591 -33.1747071 54.7369736
133 134 135 136 137 138
30.7553118 15.5419152 -9.3613587 11.5257677 -28.4019316 22.7184609
139 140 141 142 143 144
28.7421003 11.7617070 -80.3221359 -19.8714619 -2.1369389 -9.4525481
145 146 147 148 149 150
-5.2481283 63.4906282 -17.7997130 4.6225609 -25.6284878 -31.2677897
151 152 153 154 155 156
-25.7070560 -25.8485468 -25.6282458 -25.6282458 -30.1817055 -8.8312413
157 158 159 160 161 162
-25.6282458 -25.8977467 -27.6885631 -24.2305486 -26.6994171 8.1798793
163 164
-25.9729401 -53.3383601
> postscript(file="/var/wessaorg/rcomp/tmp/65v021324651191.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 -3.0228057 NA
1 27.9005338 -3.0228057
2 -2.6452203 27.9005338
3 24.6442732 -2.6452203
4 -5.1041143 24.6442732
5 15.6678168 -5.1041143
6 -80.7278364 15.6678168
7 -22.7327348 -80.7278364
8 -2.4769011 -22.7327348
9 -13.9115396 -2.4769011
10 16.2536900 -13.9115396
11 82.8918779 16.2536900
12 10.2917857 82.8918779
13 18.8257972 10.2917857
14 -22.3827156 18.8257972
15 48.6842319 -22.3827156
16 -11.2812656 48.6842319
17 -80.1661892 -11.2812656
18 -19.7927465 -80.1661892
19 58.6010741 -19.7927465
20 32.6124144 58.6010741
21 -30.4634133 32.6124144
22 -17.9975324 -30.4634133
23 109.6083496 -17.9975324
24 35.0979230 109.6083496
25 21.5821539 35.0979230
26 8.1033430 21.5821539
27 24.2393095 8.1033430
28 28.1528374 24.2393095
29 9.4101620 28.1528374
30 33.8682093 9.4101620
31 31.5314954 33.8682093
32 40.1290511 31.5314954
33 64.8073022 40.1290511
34 2.9324321 64.8073022
35 15.7478208 2.9324321
36 -1.3425153 15.7478208
37 -8.0260479 -1.3425153
38 -15.4526479 -8.0260479
39 1.4715268 -15.4526479
40 -7.5222749 1.4715268
41 3.8888067 -7.5222749
42 12.4305722 3.8888067
43 52.4127196 12.4305722
44 -27.4382370 52.4127196
45 -53.5854511 -27.4382370
46 12.9954662 -53.5854511
47 80.7397866 12.9954662
48 15.2478619 80.7397866
49 45.6925625 15.2478619
50 50.5499255 45.6925625
51 -26.0155168 50.5499255
52 -5.1605069 -26.0155168
53 7.1666930 -5.1605069
54 -19.9756038 7.1666930
55 2.7688996 -19.9756038
56 60.6761549 2.7688996
57 -24.7751138 60.6761549
58 4.8403489 -24.7751138
59 9.9633202 4.8403489
60 10.7988070 9.9633202
61 -81.9439871 10.7988070
62 -18.1240632 -81.9439871
63 10.6501800 -18.1240632
64 9.2048799 10.6501800
65 -16.4807535 9.2048799
66 3.7580497 -16.4807535
67 52.3090296 3.7580497
68 -9.5978532 52.3090296
69 -27.4847109 -9.5978532
70 46.4418197 -27.4847109
71 14.9491504 46.4418197
72 58.5982227 14.9491504
73 -23.4078203 58.5982227
74 34.7003018 -23.4078203
75 -11.8028678 34.7003018
76 -16.2018378 -11.8028678
77 -41.5518652 -16.2018378
78 39.7990454 -41.5518652
79 16.6526623 39.7990454
80 21.0963832 16.6526623
81 -52.0741612 21.0963832
82 27.3642064 -52.0741612
83 -33.1626259 27.3642064
84 -37.4580169 -33.1626259
85 -8.0455986 -37.4580169
86 21.8134709 -8.0455986
87 -19.5050088 21.8134709
88 -16.3644039 -19.5050088
89 27.1994889 -16.3644039
90 -9.8941946 27.1994889
91 -0.9147110 -9.8941946
92 8.7641070 -0.9147110
93 22.0634240 8.7641070
94 -11.2550650 22.0634240
95 11.1321029 -11.2550650
96 -17.5035262 11.1321029
97 -52.8134874 -17.5035262
98 65.0293096 -52.8134874
99 -70.5613282 65.0293096
100 22.6049052 -70.5613282
101 -8.4131305 22.6049052
102 -47.0094001 -8.4131305
103 9.0669229 -47.0094001
104 -55.7017917 9.0669229
105 -26.7836688 -55.7017917
106 10.7888940 -26.7836688
107 0.9637038 10.7888940
108 -46.0549647 0.9637038
109 7.9794143 -46.0549647
110 -0.9957098 7.9794143
111 -21.9045973 -0.9957098
112 -31.5904055 -21.9045973
113 3.4957618 -31.5904055
114 -19.9459751 3.4957618
115 39.6015504 -19.9459751
116 -49.8404003 39.6015504
117 -30.8268113 -49.8404003
118 -39.7227270 -30.8268113
119 -30.1646963 -39.7227270
120 15.1322107 -30.1646963
121 21.8669509 15.1322107
122 18.7828573 21.8669509
123 -33.8628972 18.7828573
124 -17.5490055 -33.8628972
125 18.5900853 -17.5490055
126 40.5464579 18.5900853
127 61.2763786 40.5464579
128 -0.4570653 61.2763786
129 5.3915591 -0.4570653
130 -33.1747071 5.3915591
131 54.7369736 -33.1747071
132 30.7553118 54.7369736
133 15.5419152 30.7553118
134 -9.3613587 15.5419152
135 11.5257677 -9.3613587
136 -28.4019316 11.5257677
137 22.7184609 -28.4019316
138 28.7421003 22.7184609
139 11.7617070 28.7421003
140 -80.3221359 11.7617070
141 -19.8714619 -80.3221359
142 -2.1369389 -19.8714619
143 -9.4525481 -2.1369389
144 -5.2481283 -9.4525481
145 63.4906282 -5.2481283
146 -17.7997130 63.4906282
147 4.6225609 -17.7997130
148 -25.6284878 4.6225609
149 -31.2677897 -25.6284878
150 -25.7070560 -31.2677897
151 -25.8485468 -25.7070560
152 -25.6282458 -25.8485468
153 -25.6282458 -25.6282458
154 -30.1817055 -25.6282458
155 -8.8312413 -30.1817055
156 -25.6282458 -8.8312413
157 -25.8977467 -25.6282458
158 -27.6885631 -25.8977467
159 -24.2305486 -27.6885631
160 -26.6994171 -24.2305486
161 8.1798793 -26.6994171
162 -25.9729401 8.1798793
163 -53.3383601 -25.9729401
164 NA -53.3383601
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 27.9005338 -3.0228057
[2,] -2.6452203 27.9005338
[3,] 24.6442732 -2.6452203
[4,] -5.1041143 24.6442732
[5,] 15.6678168 -5.1041143
[6,] -80.7278364 15.6678168
[7,] -22.7327348 -80.7278364
[8,] -2.4769011 -22.7327348
[9,] -13.9115396 -2.4769011
[10,] 16.2536900 -13.9115396
[11,] 82.8918779 16.2536900
[12,] 10.2917857 82.8918779
[13,] 18.8257972 10.2917857
[14,] -22.3827156 18.8257972
[15,] 48.6842319 -22.3827156
[16,] -11.2812656 48.6842319
[17,] -80.1661892 -11.2812656
[18,] -19.7927465 -80.1661892
[19,] 58.6010741 -19.7927465
[20,] 32.6124144 58.6010741
[21,] -30.4634133 32.6124144
[22,] -17.9975324 -30.4634133
[23,] 109.6083496 -17.9975324
[24,] 35.0979230 109.6083496
[25,] 21.5821539 35.0979230
[26,] 8.1033430 21.5821539
[27,] 24.2393095 8.1033430
[28,] 28.1528374 24.2393095
[29,] 9.4101620 28.1528374
[30,] 33.8682093 9.4101620
[31,] 31.5314954 33.8682093
[32,] 40.1290511 31.5314954
[33,] 64.8073022 40.1290511
[34,] 2.9324321 64.8073022
[35,] 15.7478208 2.9324321
[36,] -1.3425153 15.7478208
[37,] -8.0260479 -1.3425153
[38,] -15.4526479 -8.0260479
[39,] 1.4715268 -15.4526479
[40,] -7.5222749 1.4715268
[41,] 3.8888067 -7.5222749
[42,] 12.4305722 3.8888067
[43,] 52.4127196 12.4305722
[44,] -27.4382370 52.4127196
[45,] -53.5854511 -27.4382370
[46,] 12.9954662 -53.5854511
[47,] 80.7397866 12.9954662
[48,] 15.2478619 80.7397866
[49,] 45.6925625 15.2478619
[50,] 50.5499255 45.6925625
[51,] -26.0155168 50.5499255
[52,] -5.1605069 -26.0155168
[53,] 7.1666930 -5.1605069
[54,] -19.9756038 7.1666930
[55,] 2.7688996 -19.9756038
[56,] 60.6761549 2.7688996
[57,] -24.7751138 60.6761549
[58,] 4.8403489 -24.7751138
[59,] 9.9633202 4.8403489
[60,] 10.7988070 9.9633202
[61,] -81.9439871 10.7988070
[62,] -18.1240632 -81.9439871
[63,] 10.6501800 -18.1240632
[64,] 9.2048799 10.6501800
[65,] -16.4807535 9.2048799
[66,] 3.7580497 -16.4807535
[67,] 52.3090296 3.7580497
[68,] -9.5978532 52.3090296
[69,] -27.4847109 -9.5978532
[70,] 46.4418197 -27.4847109
[71,] 14.9491504 46.4418197
[72,] 58.5982227 14.9491504
[73,] -23.4078203 58.5982227
[74,] 34.7003018 -23.4078203
[75,] -11.8028678 34.7003018
[76,] -16.2018378 -11.8028678
[77,] -41.5518652 -16.2018378
[78,] 39.7990454 -41.5518652
[79,] 16.6526623 39.7990454
[80,] 21.0963832 16.6526623
[81,] -52.0741612 21.0963832
[82,] 27.3642064 -52.0741612
[83,] -33.1626259 27.3642064
[84,] -37.4580169 -33.1626259
[85,] -8.0455986 -37.4580169
[86,] 21.8134709 -8.0455986
[87,] -19.5050088 21.8134709
[88,] -16.3644039 -19.5050088
[89,] 27.1994889 -16.3644039
[90,] -9.8941946 27.1994889
[91,] -0.9147110 -9.8941946
[92,] 8.7641070 -0.9147110
[93,] 22.0634240 8.7641070
[94,] -11.2550650 22.0634240
[95,] 11.1321029 -11.2550650
[96,] -17.5035262 11.1321029
[97,] -52.8134874 -17.5035262
[98,] 65.0293096 -52.8134874
[99,] -70.5613282 65.0293096
[100,] 22.6049052 -70.5613282
[101,] -8.4131305 22.6049052
[102,] -47.0094001 -8.4131305
[103,] 9.0669229 -47.0094001
[104,] -55.7017917 9.0669229
[105,] -26.7836688 -55.7017917
[106,] 10.7888940 -26.7836688
[107,] 0.9637038 10.7888940
[108,] -46.0549647 0.9637038
[109,] 7.9794143 -46.0549647
[110,] -0.9957098 7.9794143
[111,] -21.9045973 -0.9957098
[112,] -31.5904055 -21.9045973
[113,] 3.4957618 -31.5904055
[114,] -19.9459751 3.4957618
[115,] 39.6015504 -19.9459751
[116,] -49.8404003 39.6015504
[117,] -30.8268113 -49.8404003
[118,] -39.7227270 -30.8268113
[119,] -30.1646963 -39.7227270
[120,] 15.1322107 -30.1646963
[121,] 21.8669509 15.1322107
[122,] 18.7828573 21.8669509
[123,] -33.8628972 18.7828573
[124,] -17.5490055 -33.8628972
[125,] 18.5900853 -17.5490055
[126,] 40.5464579 18.5900853
[127,] 61.2763786 40.5464579
[128,] -0.4570653 61.2763786
[129,] 5.3915591 -0.4570653
[130,] -33.1747071 5.3915591
[131,] 54.7369736 -33.1747071
[132,] 30.7553118 54.7369736
[133,] 15.5419152 30.7553118
[134,] -9.3613587 15.5419152
[135,] 11.5257677 -9.3613587
[136,] -28.4019316 11.5257677
[137,] 22.7184609 -28.4019316
[138,] 28.7421003 22.7184609
[139,] 11.7617070 28.7421003
[140,] -80.3221359 11.7617070
[141,] -19.8714619 -80.3221359
[142,] -2.1369389 -19.8714619
[143,] -9.4525481 -2.1369389
[144,] -5.2481283 -9.4525481
[145,] 63.4906282 -5.2481283
[146,] -17.7997130 63.4906282
[147,] 4.6225609 -17.7997130
[148,] -25.6284878 4.6225609
[149,] -31.2677897 -25.6284878
[150,] -25.7070560 -31.2677897
[151,] -25.8485468 -25.7070560
[152,] -25.6282458 -25.8485468
[153,] -25.6282458 -25.6282458
[154,] -30.1817055 -25.6282458
[155,] -8.8312413 -30.1817055
[156,] -25.6282458 -8.8312413
[157,] -25.8977467 -25.6282458
[158,] -27.6885631 -25.8977467
[159,] -24.2305486 -27.6885631
[160,] -26.6994171 -24.2305486
[161,] 8.1798793 -26.6994171
[162,] -25.9729401 8.1798793
[163,] -53.3383601 -25.9729401
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 27.9005338 -3.0228057
2 -2.6452203 27.9005338
3 24.6442732 -2.6452203
4 -5.1041143 24.6442732
5 15.6678168 -5.1041143
6 -80.7278364 15.6678168
7 -22.7327348 -80.7278364
8 -2.4769011 -22.7327348
9 -13.9115396 -2.4769011
10 16.2536900 -13.9115396
11 82.8918779 16.2536900
12 10.2917857 82.8918779
13 18.8257972 10.2917857
14 -22.3827156 18.8257972
15 48.6842319 -22.3827156
16 -11.2812656 48.6842319
17 -80.1661892 -11.2812656
18 -19.7927465 -80.1661892
19 58.6010741 -19.7927465
20 32.6124144 58.6010741
21 -30.4634133 32.6124144
22 -17.9975324 -30.4634133
23 109.6083496 -17.9975324
24 35.0979230 109.6083496
25 21.5821539 35.0979230
26 8.1033430 21.5821539
27 24.2393095 8.1033430
28 28.1528374 24.2393095
29 9.4101620 28.1528374
30 33.8682093 9.4101620
31 31.5314954 33.8682093
32 40.1290511 31.5314954
33 64.8073022 40.1290511
34 2.9324321 64.8073022
35 15.7478208 2.9324321
36 -1.3425153 15.7478208
37 -8.0260479 -1.3425153
38 -15.4526479 -8.0260479
39 1.4715268 -15.4526479
40 -7.5222749 1.4715268
41 3.8888067 -7.5222749
42 12.4305722 3.8888067
43 52.4127196 12.4305722
44 -27.4382370 52.4127196
45 -53.5854511 -27.4382370
46 12.9954662 -53.5854511
47 80.7397866 12.9954662
48 15.2478619 80.7397866
49 45.6925625 15.2478619
50 50.5499255 45.6925625
51 -26.0155168 50.5499255
52 -5.1605069 -26.0155168
53 7.1666930 -5.1605069
54 -19.9756038 7.1666930
55 2.7688996 -19.9756038
56 60.6761549 2.7688996
57 -24.7751138 60.6761549
58 4.8403489 -24.7751138
59 9.9633202 4.8403489
60 10.7988070 9.9633202
61 -81.9439871 10.7988070
62 -18.1240632 -81.9439871
63 10.6501800 -18.1240632
64 9.2048799 10.6501800
65 -16.4807535 9.2048799
66 3.7580497 -16.4807535
67 52.3090296 3.7580497
68 -9.5978532 52.3090296
69 -27.4847109 -9.5978532
70 46.4418197 -27.4847109
71 14.9491504 46.4418197
72 58.5982227 14.9491504
73 -23.4078203 58.5982227
74 34.7003018 -23.4078203
75 -11.8028678 34.7003018
76 -16.2018378 -11.8028678
77 -41.5518652 -16.2018378
78 39.7990454 -41.5518652
79 16.6526623 39.7990454
80 21.0963832 16.6526623
81 -52.0741612 21.0963832
82 27.3642064 -52.0741612
83 -33.1626259 27.3642064
84 -37.4580169 -33.1626259
85 -8.0455986 -37.4580169
86 21.8134709 -8.0455986
87 -19.5050088 21.8134709
88 -16.3644039 -19.5050088
89 27.1994889 -16.3644039
90 -9.8941946 27.1994889
91 -0.9147110 -9.8941946
92 8.7641070 -0.9147110
93 22.0634240 8.7641070
94 -11.2550650 22.0634240
95 11.1321029 -11.2550650
96 -17.5035262 11.1321029
97 -52.8134874 -17.5035262
98 65.0293096 -52.8134874
99 -70.5613282 65.0293096
100 22.6049052 -70.5613282
101 -8.4131305 22.6049052
102 -47.0094001 -8.4131305
103 9.0669229 -47.0094001
104 -55.7017917 9.0669229
105 -26.7836688 -55.7017917
106 10.7888940 -26.7836688
107 0.9637038 10.7888940
108 -46.0549647 0.9637038
109 7.9794143 -46.0549647
110 -0.9957098 7.9794143
111 -21.9045973 -0.9957098
112 -31.5904055 -21.9045973
113 3.4957618 -31.5904055
114 -19.9459751 3.4957618
115 39.6015504 -19.9459751
116 -49.8404003 39.6015504
117 -30.8268113 -49.8404003
118 -39.7227270 -30.8268113
119 -30.1646963 -39.7227270
120 15.1322107 -30.1646963
121 21.8669509 15.1322107
122 18.7828573 21.8669509
123 -33.8628972 18.7828573
124 -17.5490055 -33.8628972
125 18.5900853 -17.5490055
126 40.5464579 18.5900853
127 61.2763786 40.5464579
128 -0.4570653 61.2763786
129 5.3915591 -0.4570653
130 -33.1747071 5.3915591
131 54.7369736 -33.1747071
132 30.7553118 54.7369736
133 15.5419152 30.7553118
134 -9.3613587 15.5419152
135 11.5257677 -9.3613587
136 -28.4019316 11.5257677
137 22.7184609 -28.4019316
138 28.7421003 22.7184609
139 11.7617070 28.7421003
140 -80.3221359 11.7617070
141 -19.8714619 -80.3221359
142 -2.1369389 -19.8714619
143 -9.4525481 -2.1369389
144 -5.2481283 -9.4525481
145 63.4906282 -5.2481283
146 -17.7997130 63.4906282
147 4.6225609 -17.7997130
148 -25.6284878 4.6225609
149 -31.2677897 -25.6284878
150 -25.7070560 -31.2677897
151 -25.8485468 -25.7070560
152 -25.6282458 -25.8485468
153 -25.6282458 -25.6282458
154 -30.1817055 -25.6282458
155 -8.8312413 -30.1817055
156 -25.6282458 -8.8312413
157 -25.8977467 -25.6282458
158 -27.6885631 -25.8977467
159 -24.2305486 -27.6885631
160 -26.6994171 -24.2305486
161 8.1798793 -26.6994171
162 -25.9729401 8.1798793
163 -53.3383601 -25.9729401
> 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/7lsp31324651191.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/8tcv51324651191.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/9yprm1324651191.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/10zliv1324651191.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/117q7f1324651191.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/12iysx1324651191.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/13hk0m1324651191.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/14f0p01324651191.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/15sf3m1324651191.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/16rzrp1324651191.tab")
+ }
>
> try(system("convert tmp/1bmum1324651191.ps tmp/1bmum1324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/2o9uv1324651191.ps tmp/2o9uv1324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wl7b1324651191.ps tmp/3wl7b1324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/47sqd1324651191.ps tmp/47sqd1324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/5fjr21324651191.ps tmp/5fjr21324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/65v021324651191.ps tmp/65v021324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/7lsp31324651191.ps tmp/7lsp31324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/8tcv51324651191.ps tmp/8tcv51324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/9yprm1324651191.ps tmp/9yprm1324651191.png",intern=TRUE))
character(0)
> try(system("convert tmp/10zliv1324651191.ps tmp/10zliv1324651191.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.826 0.655 5.494