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(63047
+ ,257
+ ,13
+ ,22
+ ,10345
+ ,66751
+ ,160
+ ,26
+ ,21
+ ,17607
+ ,7176
+ ,70
+ ,0
+ ,0
+ ,1423
+ ,78306
+ ,360
+ ,37
+ ,28
+ ,20050
+ ,144655
+ ,757
+ ,47
+ ,59
+ ,21212
+ ,269638
+ ,974
+ ,84
+ ,58
+ ,93979
+ ,69266
+ ,287
+ ,21
+ ,36
+ ,15524
+ ,83529
+ ,154
+ ,36
+ ,58
+ ,16182
+ ,73226
+ ,311
+ ,35
+ ,29
+ ,19238
+ ,178519
+ ,617
+ ,40
+ ,48
+ ,28909
+ ,67250
+ ,297
+ ,35
+ ,24
+ ,22357
+ ,102982
+ ,393
+ ,46
+ ,44
+ ,25560
+ ,50001
+ ,369
+ ,20
+ ,16
+ ,9954
+ ,91093
+ ,558
+ ,24
+ ,46
+ ,18490
+ ,80112
+ ,226
+ ,19
+ ,35
+ ,17777
+ ,72961
+ ,315
+ ,15
+ ,35
+ ,25268
+ ,77159
+ ,243
+ ,52
+ ,63
+ ,37525
+ ,15629
+ ,88
+ ,0
+ ,15
+ ,6023
+ ,71693
+ ,494
+ ,38
+ ,62
+ ,25042
+ ,19920
+ ,155
+ ,12
+ ,12
+ ,35713
+ ,39403
+ ,234
+ ,10
+ ,33
+ ,7039
+ ,104383
+ ,365
+ ,53
+ ,44
+ ,40841
+ ,56088
+ ,280
+ ,4
+ ,29
+ ,9214
+ ,62006
+ ,331
+ ,24
+ ,26
+ ,17446
+ ,81665
+ ,378
+ ,39
+ ,31
+ ,10295
+ ,69451
+ ,230
+ ,19
+ ,22
+ ,13206
+ ,88794
+ ,396
+ ,23
+ ,46
+ ,26093
+ ,90642
+ ,179
+ ,39
+ ,39
+ ,20744
+ ,207069
+ ,524
+ ,38
+ ,45
+ ,68013
+ ,99340
+ ,504
+ ,20
+ ,23
+ ,12840
+ ,56695
+ ,225
+ ,20
+ ,41
+ ,12672
+ ,108143
+ ,366
+ ,41
+ ,32
+ ,10872
+ ,64204
+ ,372
+ ,29
+ ,12
+ ,21325
+ ,29101
+ ,171
+ ,0
+ ,18
+ ,24542
+ ,113060
+ ,437
+ ,31
+ ,41
+ ,16401
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,65773
+ ,313
+ ,8
+ ,32
+ ,12821
+ ,67047
+ ,366
+ ,35
+ ,24
+ ,14662
+ ,41953
+ ,232
+ ,3
+ ,54
+ ,22190
+ ,113787
+ ,402
+ ,47
+ ,71
+ ,37929
+ ,86584
+ ,349
+ ,42
+ ,32
+ ,18009
+ ,59588
+ ,316
+ ,11
+ ,53
+ ,11076
+ ,40064
+ ,140
+ ,10
+ ,24
+ ,24981
+ ,74471
+ ,445
+ ,26
+ ,35
+ ,30691
+ ,60437
+ ,226
+ ,27
+ ,42
+ ,29164
+ ,55118
+ ,173
+ ,1
+ ,33
+ ,13985
+ ,40295
+ ,103
+ ,15
+ ,30
+ ,7588
+ ,103397
+ ,356
+ ,32
+ ,36
+ ,20023
+ ,78982
+ ,293
+ ,13
+ ,48
+ ,25524
+ ,67317
+ ,460
+ ,25
+ ,34
+ ,14717
+ ,39887
+ ,156
+ ,10
+ ,34
+ ,6832
+ ,59682
+ ,204
+ ,24
+ ,30
+ ,9624
+ ,132740
+ ,455
+ ,26
+ ,43
+ ,24300
+ ,104816
+ ,321
+ ,29
+ ,41
+ ,21790
+ ,101395
+ ,367
+ ,40
+ ,66
+ ,16493
+ ,72824
+ ,309
+ ,22
+ ,20
+ ,9269
+ ,76018
+ ,235
+ ,27
+ ,23
+ ,20105
+ ,33891
+ ,137
+ ,8
+ ,30
+ ,11216
+ ,63694
+ ,198
+ ,27
+ ,49
+ ,15569
+ ,33239
+ ,248
+ ,0
+ ,37
+ ,21799
+ ,35093
+ ,149
+ ,0
+ ,61
+ ,3772
+ ,35252
+ ,306
+ ,17
+ ,25
+ ,6057
+ ,36977
+ ,178
+ ,7
+ ,28
+ ,20828
+ ,42406
+ ,145
+ ,18
+ ,25
+ ,9976
+ ,56353
+ ,144
+ ,7
+ ,29
+ ,14055
+ ,58817
+ ,270
+ ,24
+ ,53
+ ,17455
+ ,81051
+ ,311
+ ,19
+ ,55
+ ,39553
+ ,70872
+ ,501
+ ,39
+ ,33
+ ,14818
+ ,42372
+ ,153
+ ,17
+ ,37
+ ,17065
+ ,19144
+ ,40
+ ,0
+ ,27
+ ,1536
+ ,114177
+ ,500
+ ,39
+ ,26
+ ,11938
+ ,59414
+ ,209
+ ,21
+ ,2
+ ,24589
+ ,51379
+ ,242
+ ,29
+ ,46
+ ,21332
+ ,40756
+ ,265
+ ,27
+ ,15
+ ,13229
+ ,53398
+ ,311
+ ,23
+ ,63
+ ,11331
+ ,17799
+ ,141
+ ,0
+ ,28
+ ,853
+ ,71154
+ ,234
+ ,31
+ ,24
+ ,19821
+ ,58305
+ ,336
+ ,19
+ ,31
+ ,34666
+ ,27454
+ ,124
+ ,12
+ ,25
+ ,15051
+ ,34323
+ ,241
+ ,23
+ ,7
+ ,27969
+ ,44761
+ ,127
+ ,33
+ ,35
+ ,17897
+ ,113862
+ ,327
+ ,21
+ ,42
+ ,6031
+ ,35027
+ ,175
+ ,17
+ ,10
+ ,7153
+ ,62396
+ ,331
+ ,27
+ ,33
+ ,13365
+ ,29613
+ ,176
+ ,14
+ ,28
+ ,11197
+ ,65559
+ ,281
+ ,12
+ ,25
+ ,25291
+ ,120064
+ ,303
+ ,22
+ ,62
+ ,28994
+ ,36149
+ ,159
+ ,15
+ ,35
+ ,10461
+ ,40181
+ ,155
+ ,14
+ ,30
+ ,16415
+ ,53398
+ ,194
+ ,22
+ ,36
+ ,8495
+ ,56435
+ ,300
+ ,25
+ ,17
+ ,18318
+ ,77283
+ ,370
+ ,36
+ ,34
+ ,25143
+ ,71738
+ ,187
+ ,10
+ ,37
+ ,20471
+ ,48503
+ ,212
+ ,16
+ ,20
+ ,14561
+ ,25214
+ ,185
+ ,12
+ ,7
+ ,16902
+ ,119424
+ ,449
+ ,20
+ ,46
+ ,12994
+ ,79201
+ ,234
+ ,38
+ ,43
+ ,29697
+ ,19349
+ ,67
+ ,13
+ ,0
+ ,3895
+ ,78760
+ ,316
+ ,12
+ ,45
+ ,9807
+ ,54133
+ ,336
+ ,11
+ ,26
+ ,10711
+ ,21623
+ ,116
+ ,8
+ ,1
+ ,2325
+ ,25497
+ ,141
+ ,22
+ ,16
+ ,19000
+ ,69535
+ ,236
+ ,14
+ ,29
+ ,22418
+ ,30709
+ ,98
+ ,7
+ ,21
+ ,7872
+ ,37043
+ ,97
+ ,14
+ ,19
+ ,5650
+ ,24716
+ ,152
+ ,2
+ ,10
+ ,3979
+ ,60734
+ ,153
+ ,35
+ ,47
+ ,14956
+ ,27246
+ ,97
+ ,5
+ ,7
+ ,3738
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,38814
+ ,165
+ ,34
+ ,11
+ ,10586
+ ,27646
+ ,153
+ ,12
+ ,28
+ ,18122
+ ,65373
+ ,226
+ ,34
+ ,27
+ ,17899
+ ,43021
+ ,182
+ ,30
+ ,46
+ ,10913
+ ,43116
+ ,172
+ ,21
+ ,9
+ ,18060
+ ,3058
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,96347
+ ,196
+ ,28
+ ,49
+ ,15452
+ ,55195
+ ,282
+ ,18
+ ,27
+ ,33996
+ ,73321
+ ,307
+ ,13
+ ,31
+ ,8877
+ ,45266
+ ,183
+ ,14
+ ,46
+ ,18708
+ ,43410
+ ,292
+ ,7
+ ,3
+ ,2781
+ ,83842
+ ,257
+ ,41
+ ,41
+ ,20854
+ ,39296
+ ,141
+ ,21
+ ,15
+ ,8179
+ ,38490
+ ,192
+ ,28
+ ,21
+ ,7139
+ ,39841
+ ,129
+ ,1
+ ,23
+ ,13798
+ ,19764
+ ,75
+ ,10
+ ,4
+ ,5619
+ ,66463
+ ,315
+ ,31
+ ,41
+ ,13050
+ ,64589
+ ,204
+ ,7
+ ,46
+ ,11297
+ ,63339
+ ,257
+ ,26
+ ,54
+ ,16170
+ ,11796
+ ,79
+ ,1
+ ,1
+ ,0
+ ,7627
+ ,25
+ ,0
+ ,0
+ ,0
+ ,68998
+ ,217
+ ,12
+ ,21
+ ,20539
+ ,6836
+ ,11
+ ,0
+ ,0
+ ,0
+ ,35414
+ ,228
+ ,18
+ ,3
+ ,10056
+ ,5118
+ ,6
+ ,5
+ ,0
+ ,0
+ ,20898
+ ,115
+ ,4
+ ,3
+ ,2418
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,42690
+ ,167
+ ,6
+ ,44
+ ,11806
+ ,14507
+ ,75
+ ,0
+ ,19
+ ,15924
+ ,7131
+ ,27
+ ,0
+ ,0
+ ,0
+ ,4194
+ ,14
+ ,0
+ ,0
+ ,0
+ ,21416
+ ,96
+ ,15
+ ,12
+ ,7084
+ ,39000
+ ,117
+ ,1
+ ,24
+ ,14831
+ ,42419
+ ,228
+ ,12
+ ,26
+ ,6585)
+ ,dim=c(5
+ ,144)
+ ,dimnames=list(c('TijdInRFC'
+ ,'CompendiumViews'
+ ,'Blogs'
+ ,'FeedbackMessages'
+ ,'CompendiumLengte')
+ ,1:144))
> y <- array(NA,dim=c(5,144),dimnames=list(c('TijdInRFC','CompendiumViews','Blogs','FeedbackMessages','CompendiumLengte'),1:144))
> 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
TijdInRFC CompendiumViews Blogs FeedbackMessages CompendiumLengte
1 63047 257 13 22 10345
2 66751 160 26 21 17607
3 7176 70 0 0 1423
4 78306 360 37 28 20050
5 144655 757 47 59 21212
6 269638 974 84 58 93979
7 69266 287 21 36 15524
8 83529 154 36 58 16182
9 73226 311 35 29 19238
10 178519 617 40 48 28909
11 67250 297 35 24 22357
12 102982 393 46 44 25560
13 50001 369 20 16 9954
14 91093 558 24 46 18490
15 80112 226 19 35 17777
16 72961 315 15 35 25268
17 77159 243 52 63 37525
18 15629 88 0 15 6023
19 71693 494 38 62 25042
20 19920 155 12 12 35713
21 39403 234 10 33 7039
22 104383 365 53 44 40841
23 56088 280 4 29 9214
24 62006 331 24 26 17446
25 81665 378 39 31 10295
26 69451 230 19 22 13206
27 88794 396 23 46 26093
28 90642 179 39 39 20744
29 207069 524 38 45 68013
30 99340 504 20 23 12840
31 56695 225 20 41 12672
32 108143 366 41 32 10872
33 64204 372 29 12 21325
34 29101 171 0 18 24542
35 113060 437 31 41 16401
36 0 0 0 0 0
37 65773 313 8 32 12821
38 67047 366 35 24 14662
39 41953 232 3 54 22190
40 113787 402 47 71 37929
41 86584 349 42 32 18009
42 59588 316 11 53 11076
43 40064 140 10 24 24981
44 74471 445 26 35 30691
45 60437 226 27 42 29164
46 55118 173 1 33 13985
47 40295 103 15 30 7588
48 103397 356 32 36 20023
49 78982 293 13 48 25524
50 67317 460 25 34 14717
51 39887 156 10 34 6832
52 59682 204 24 30 9624
53 132740 455 26 43 24300
54 104816 321 29 41 21790
55 101395 367 40 66 16493
56 72824 309 22 20 9269
57 76018 235 27 23 20105
58 33891 137 8 30 11216
59 63694 198 27 49 15569
60 33239 248 0 37 21799
61 35093 149 0 61 3772
62 35252 306 17 25 6057
63 36977 178 7 28 20828
64 42406 145 18 25 9976
65 56353 144 7 29 14055
66 58817 270 24 53 17455
67 81051 311 19 55 39553
68 70872 501 39 33 14818
69 42372 153 17 37 17065
70 19144 40 0 27 1536
71 114177 500 39 26 11938
72 59414 209 21 2 24589
73 51379 242 29 46 21332
74 40756 265 27 15 13229
75 53398 311 23 63 11331
76 17799 141 0 28 853
77 71154 234 31 24 19821
78 58305 336 19 31 34666
79 27454 124 12 25 15051
80 34323 241 23 7 27969
81 44761 127 33 35 17897
82 113862 327 21 42 6031
83 35027 175 17 10 7153
84 62396 331 27 33 13365
85 29613 176 14 28 11197
86 65559 281 12 25 25291
87 120064 303 22 62 28994
88 36149 159 15 35 10461
89 40181 155 14 30 16415
90 53398 194 22 36 8495
91 56435 300 25 17 18318
92 77283 370 36 34 25143
93 71738 187 10 37 20471
94 48503 212 16 20 14561
95 25214 185 12 7 16902
96 119424 449 20 46 12994
97 79201 234 38 43 29697
98 19349 67 13 0 3895
99 78760 316 12 45 9807
100 54133 336 11 26 10711
101 21623 116 8 1 2325
102 25497 141 22 16 19000
103 69535 236 14 29 22418
104 30709 98 7 21 7872
105 37043 97 14 19 5650
106 24716 152 2 10 3979
107 60734 153 35 47 14956
108 27246 97 5 7 3738
109 0 0 0 0 0
110 38814 165 34 11 10586
111 27646 153 12 28 18122
112 65373 226 34 27 17899
113 43021 182 30 46 10913
114 43116 172 21 9 18060
115 3058 1 0 0 0
116 0 0 0 0 0
117 96347 196 28 49 15452
118 55195 282 18 27 33996
119 73321 307 13 31 8877
120 45266 183 14 46 18708
121 43410 292 7 3 2781
122 83842 257 41 41 20854
123 39296 141 21 15 8179
124 38490 192 28 21 7139
125 39841 129 1 23 13798
126 19764 75 10 4 5619
127 66463 315 31 41 13050
128 64589 204 7 46 11297
129 63339 257 26 54 16170
130 11796 79 1 1 0
131 7627 25 0 0 0
132 68998 217 12 21 20539
133 6836 11 0 0 0
134 35414 228 18 3 10056
135 5118 6 5 0 0
136 20898 115 4 3 2418
137 0 0 0 0 0
138 42690 167 6 44 11806
139 14507 75 0 19 15924
140 7131 27 0 0 0
141 4194 14 0 0 0
142 21416 96 15 12 7084
143 39000 117 1 24 14831
144 42419 228 12 26 6585
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CompendiumViews Blogs FeedbackMessages
-3711.5606 135.9199 484.0041 331.4775
CompendiumLengte
0.6562
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-47116 -9801 247 7853 61621
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3711.5606 2861.2824 -1.297 0.196723
CompendiumViews 135.9199 14.1339 9.617 < 2e-16 ***
Blogs 484.0041 142.0674 3.407 0.000860 ***
FeedbackMessages 331.4775 97.5999 3.396 0.000891 ***
CompendiumLengte 0.6562 0.1537 4.270 3.6e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 16060 on 139 degrees of freedom
Multiple R-squared: 0.8318, Adjusted R-squared: 0.8269
F-statistic: 171.8 on 4 and 139 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.16689049 3.337810e-01 8.331095e-01
[2,] 0.08807562 1.761512e-01 9.119244e-01
[3,] 0.76064972 4.787006e-01 2.393503e-01
[4,] 0.67021342 6.595732e-01 3.297866e-01
[5,] 0.55866751 8.826650e-01 4.413325e-01
[6,] 0.51033521 9.793296e-01 4.896648e-01
[7,] 0.72736285 5.452743e-01 2.726371e-01
[8,] 0.66289998 6.742000e-01 3.371000e-01
[9,] 0.66766281 6.646744e-01 3.323372e-01
[10,] 0.87581049 2.483790e-01 1.241895e-01
[11,] 0.83412816 3.317437e-01 1.658718e-01
[12,] 0.97567631 4.864737e-02 2.432369e-02
[13,] 0.99270328 1.459344e-02 7.296721e-03
[14,] 0.98868188 2.263625e-02 1.131812e-02
[15,] 0.98432989 3.134022e-02 1.567011e-02
[16,] 0.97857382 4.285237e-02 2.142618e-02
[17,] 0.97181745 5.636509e-02 2.818255e-02
[18,] 0.95951787 8.096426e-02 4.048213e-02
[19,] 0.96023146 7.953707e-02 3.976854e-02
[20,] 0.94492183 1.101563e-01 5.507817e-02
[21,] 0.96037786 7.924428e-02 3.962214e-02
[22,] 0.99957131 8.573726e-04 4.286863e-04
[23,] 0.99940700 1.185991e-03 5.929957e-04
[24,] 0.99903327 1.933452e-03 9.667260e-04
[25,] 0.99951741 9.651743e-04 4.825871e-04
[26,] 0.99948022 1.039568e-03 5.197842e-04
[27,] 0.99936771 1.264580e-03 6.322902e-04
[28,] 0.99944577 1.108466e-03 5.542328e-04
[29,] 0.99914332 1.713366e-03 8.566832e-04
[30,] 0.99870042 2.599161e-03 1.299581e-03
[31,] 0.99842229 3.155415e-03 1.577707e-03
[32,] 0.99855870 2.882606e-03 1.441303e-03
[33,] 0.99793819 4.123618e-03 2.061809e-03
[34,] 0.99692289 6.154219e-03 3.077110e-03
[35,] 0.99598702 8.025969e-03 4.012985e-03
[36,] 0.99425557 1.148887e-02 5.744434e-03
[37,] 0.99649107 7.017854e-03 3.508927e-03
[38,] 0.99558510 8.829793e-03 4.414896e-03
[39,] 0.99567106 8.657880e-03 4.328940e-03
[40,] 0.99436880 1.126240e-02 5.631199e-03
[41,] 0.99512913 9.741735e-03 4.870868e-03
[42,] 0.99333668 1.332665e-02 6.663325e-03
[43,] 0.99551144 8.977124e-03 4.488562e-03
[44,] 0.99371768 1.256463e-02 6.282316e-03
[45,] 0.99180459 1.639081e-02 8.195407e-03
[46,] 0.99758654 4.826915e-03 2.413458e-03
[47,] 0.99862554 2.748925e-03 1.374463e-03
[48,] 0.99800437 3.991261e-03 1.995630e-03
[49,] 0.99761030 4.779398e-03 2.389699e-03
[50,] 0.99766669 4.666613e-03 2.333306e-03
[51,] 0.99663149 6.737014e-03 3.368507e-03
[52,] 0.99515605 9.687893e-03 4.843946e-03
[53,] 0.99658172 6.836559e-03 3.418280e-03
[54,] 0.99619189 7.616224e-03 3.808112e-03
[55,] 0.99771862 4.562765e-03 2.281382e-03
[56,] 0.99705632 5.887353e-03 2.943676e-03
[57,] 0.99578533 8.429350e-03 4.214675e-03
[58,] 0.99623130 7.537393e-03 3.768696e-03
[59,] 0.99613113 7.737742e-03 3.868871e-03
[60,] 0.99489493 1.021014e-02 5.105072e-03
[61,] 0.99857187 2.856268e-03 1.428134e-03
[62,] 0.99799231 4.015381e-03 2.007690e-03
[63,] 0.99724487 5.510267e-03 2.755133e-03
[64,] 0.99721307 5.573855e-03 2.786928e-03
[65,] 0.99741679 5.166420e-03 2.583210e-03
[66,] 0.99803592 3.928151e-03 1.964076e-03
[67,] 0.99813576 3.728471e-03 1.864235e-03
[68,] 0.99965139 6.972131e-04 3.486066e-04
[69,] 0.99975171 4.965767e-04 2.482883e-04
[70,] 0.99974044 5.191145e-04 2.595572e-04
[71,] 0.99982053 3.589476e-04 1.794738e-04
[72,] 0.99977037 4.592620e-04 2.296310e-04
[73,] 0.99981908 3.618447e-04 1.809224e-04
[74,] 0.99972702 5.459592e-04 2.729796e-04
[75,] 0.99999120 1.760002e-05 8.800009e-06
[76,] 0.99998427 3.145649e-05 1.572824e-05
[77,] 0.99998123 3.754790e-05 1.877395e-05
[78,] 0.99998583 2.833341e-05 1.416671e-05
[79,] 0.99997510 4.980475e-05 2.490238e-05
[80,] 0.99999763 4.738369e-06 2.369184e-06
[81,] 0.99999728 5.431859e-06 2.715930e-06
[82,] 0.99999538 9.245578e-06 4.622789e-06
[83,] 0.99999160 1.680399e-05 8.401997e-06
[84,] 0.99998604 2.792545e-05 1.396272e-05
[85,] 0.99998082 3.836414e-05 1.918207e-05
[86,] 0.99998904 2.191832e-05 1.095916e-05
[87,] 0.99997966 4.068182e-05 2.034091e-05
[88,] 0.99997649 4.702353e-05 2.351176e-05
[89,] 0.99999544 9.127794e-06 4.563897e-06
[90,] 0.99999241 1.518132e-05 7.590661e-06
[91,] 0.99998663 2.674306e-05 1.337153e-05
[92,] 0.99998056 3.888404e-05 1.944202e-05
[93,] 0.99997434 5.132257e-05 2.566128e-05
[94,] 0.99995292 9.415491e-05 4.707746e-05
[95,] 0.99995956 8.088506e-05 4.044253e-05
[96,] 0.99995815 8.370787e-05 4.185394e-05
[97,] 0.99992364 1.527150e-04 7.635748e-05
[98,] 0.99988839 2.232188e-04 1.116094e-04
[99,] 0.99980234 3.953292e-04 1.976646e-04
[100,] 0.99964587 7.082531e-04 3.541265e-04
[101,] 0.99948155 1.036905e-03 5.184526e-04
[102,] 0.99910580 1.788396e-03 8.941978e-04
[103,] 0.99852102 2.957963e-03 1.478981e-03
[104,] 0.99886157 2.276865e-03 1.138432e-03
[105,] 0.99818110 3.637792e-03 1.818896e-03
[106,] 0.99893055 2.138892e-03 1.069446e-03
[107,] 0.99816280 3.674393e-03 1.837197e-03
[108,] 0.99686331 6.273378e-03 3.136689e-03
[109,] 0.99478215 1.043569e-02 5.217846e-03
[110,] 0.99987407 2.518545e-04 1.259272e-04
[111,] 0.99993919 1.216204e-04 6.081018e-05
[112,] 0.99995156 9.688877e-05 4.844438e-05
[113,] 0.99996124 7.752482e-05 3.876241e-05
[114,] 0.99990769 1.846233e-04 9.231166e-05
[115,] 0.99994776 1.044721e-04 5.223607e-05
[116,] 0.99992669 1.466258e-04 7.331291e-05
[117,] 0.99981387 3.722513e-04 1.861257e-04
[118,] 0.99954973 9.005323e-04 4.502662e-04
[119,] 0.99900722 1.985563e-03 9.927814e-04
[120,] 0.99770221 4.595578e-03 2.297789e-03
[121,] 0.99828217 3.435661e-03 1.717830e-03
[122,] 0.99594489 8.110227e-03 4.055113e-03
[123,] 0.99073357 1.853285e-02 9.266427e-03
[124,] 0.98016859 3.966281e-02 1.983141e-02
[125,] 0.99891407 2.171869e-03 1.085935e-03
[126,] 0.99650688 6.986232e-03 3.493116e-03
[127,] 0.98837796 2.324409e-02 1.162204e-02
[128,] 0.96656276 6.687448e-02 3.343724e-02
[129,] 0.90349292 1.930142e-01 9.650708e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1kxwz1322154889.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/2u6zf1322154889.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/3j4bt1322154890.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/40ecp1322154890.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/5cll71322154890.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 = 144
Frequency = 1
1 2 3 4 5 6
11454.3692 17616.8220 439.4180 -7259.6040 -10749.1376 19414.0818
7 8 9 10 11 12
1684.6811 19040.6943 -4510.1767 44127.2892 -8972.5459 -344.2076
13 14 15 16 17 18
-17957.2573 -20035.6420 20642.9007 -1584.4235 -22832.5499 -1544.7456
19 20 21 22 23 24
-47115.7776 -30656.0765 -9088.3710 -8552.6147 4147.0492 -10954.2167
25 26 27 28 29 30
-1908.5358 16746.8419 -4820.5730 24608.2485 61620.8933 8818.4672
31 32 33 34 35 36
-1761.2331 24522.3997 -14653.6037 -12500.3878 18017.7928 3711.5606
37 38 39 40 41 42
4049.3902 -13504.6900 -19781.3615 -8312.7133 106.8544 -9811.3694
43 44 45 46 47 48
-4440.8411 -26626.5391 -12696.4330 14715.9322 7823.3048 18160.9934
49 50 51 52 53 54
3917.6326 -24521.9855 1801.7346 7790.3674 31825.1088 22972.3395
55 56 57 58 59 60
3163.8434 11176.5047 13903.7238 -2194.5761 966.7930 -23326.3828
61 62 63 64 65 66
-4142.7563 -23117.4418 -9841.5665 2864.0779 18268.5620 -14807.8999
67 68 69 70 71 72
-10889.8873 -33050.5568 -6402.6899 7460.9745 14600.5132 7756.3680
73 74 75 76 77 78
-21083.8429 -18272.1379 -24611.9210 -7495.2410 7094.5057 -25871.6581
79 80 81 82 83 84
-9659.7089 -26527.3642 -8106.8277 45084.1669 -1283.9478 -11658.6878
85 86 87 88 89 90
-14002.0550 386.5486 32366.7557 -7476.8122 -4666.6558 2585.5407
91 92 93 94 95 96
-10384.5979 -14488.6050 19495.1019 -528.7606 -15438.8240 28653.0280
97 98 99 100 101 102
-1025.0609 5106.0391 12361.1429 -8795.3686 3838.7142 -18375.3589
103 104 105 106 107 108
10070.2409 5585.8787 10788.7638 873.9977 1316.3513 10580.1531
109 110 111 112 113 114
3711.5606 -6949.9733 -16418.9575 1215.6043 -14933.8793 -1548.7174
115 116 117 118 119 120
6633.6407 3711.5606 33484.4021 -19392.4260 12912.3532 -10195.6813
121 122 123 124 125 126
1225.6392 5503.3519 3339.6813 -9092.6975 8856.8895 3428.5224
127 128 129 130 131 132
-9798.1079 14524.0032 -8975.2313 3954.4059 7940.5628 16968.5156
133 134 135 136 137 138
9052.4416 -8169.2647 5594.0205 4461.6706 3711.5606 -1532.9981
139 140 141 142 143 144
-8722.5667 7172.7230 6002.6818 -3806.9447 8637.6137 -3606.6102
> postscript(file="/var/wessaorg/rcomp/tmp/6w5cj1322154890.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 = 144
Frequency = 1
lag(myerror, k = 1) myerror
0 11454.3692 NA
1 17616.8220 11454.3692
2 439.4180 17616.8220
3 -7259.6040 439.4180
4 -10749.1376 -7259.6040
5 19414.0818 -10749.1376
6 1684.6811 19414.0818
7 19040.6943 1684.6811
8 -4510.1767 19040.6943
9 44127.2892 -4510.1767
10 -8972.5459 44127.2892
11 -344.2076 -8972.5459
12 -17957.2573 -344.2076
13 -20035.6420 -17957.2573
14 20642.9007 -20035.6420
15 -1584.4235 20642.9007
16 -22832.5499 -1584.4235
17 -1544.7456 -22832.5499
18 -47115.7776 -1544.7456
19 -30656.0765 -47115.7776
20 -9088.3710 -30656.0765
21 -8552.6147 -9088.3710
22 4147.0492 -8552.6147
23 -10954.2167 4147.0492
24 -1908.5358 -10954.2167
25 16746.8419 -1908.5358
26 -4820.5730 16746.8419
27 24608.2485 -4820.5730
28 61620.8933 24608.2485
29 8818.4672 61620.8933
30 -1761.2331 8818.4672
31 24522.3997 -1761.2331
32 -14653.6037 24522.3997
33 -12500.3878 -14653.6037
34 18017.7928 -12500.3878
35 3711.5606 18017.7928
36 4049.3902 3711.5606
37 -13504.6900 4049.3902
38 -19781.3615 -13504.6900
39 -8312.7133 -19781.3615
40 106.8544 -8312.7133
41 -9811.3694 106.8544
42 -4440.8411 -9811.3694
43 -26626.5391 -4440.8411
44 -12696.4330 -26626.5391
45 14715.9322 -12696.4330
46 7823.3048 14715.9322
47 18160.9934 7823.3048
48 3917.6326 18160.9934
49 -24521.9855 3917.6326
50 1801.7346 -24521.9855
51 7790.3674 1801.7346
52 31825.1088 7790.3674
53 22972.3395 31825.1088
54 3163.8434 22972.3395
55 11176.5047 3163.8434
56 13903.7238 11176.5047
57 -2194.5761 13903.7238
58 966.7930 -2194.5761
59 -23326.3828 966.7930
60 -4142.7563 -23326.3828
61 -23117.4418 -4142.7563
62 -9841.5665 -23117.4418
63 2864.0779 -9841.5665
64 18268.5620 2864.0779
65 -14807.8999 18268.5620
66 -10889.8873 -14807.8999
67 -33050.5568 -10889.8873
68 -6402.6899 -33050.5568
69 7460.9745 -6402.6899
70 14600.5132 7460.9745
71 7756.3680 14600.5132
72 -21083.8429 7756.3680
73 -18272.1379 -21083.8429
74 -24611.9210 -18272.1379
75 -7495.2410 -24611.9210
76 7094.5057 -7495.2410
77 -25871.6581 7094.5057
78 -9659.7089 -25871.6581
79 -26527.3642 -9659.7089
80 -8106.8277 -26527.3642
81 45084.1669 -8106.8277
82 -1283.9478 45084.1669
83 -11658.6878 -1283.9478
84 -14002.0550 -11658.6878
85 386.5486 -14002.0550
86 32366.7557 386.5486
87 -7476.8122 32366.7557
88 -4666.6558 -7476.8122
89 2585.5407 -4666.6558
90 -10384.5979 2585.5407
91 -14488.6050 -10384.5979
92 19495.1019 -14488.6050
93 -528.7606 19495.1019
94 -15438.8240 -528.7606
95 28653.0280 -15438.8240
96 -1025.0609 28653.0280
97 5106.0391 -1025.0609
98 12361.1429 5106.0391
99 -8795.3686 12361.1429
100 3838.7142 -8795.3686
101 -18375.3589 3838.7142
102 10070.2409 -18375.3589
103 5585.8787 10070.2409
104 10788.7638 5585.8787
105 873.9977 10788.7638
106 1316.3513 873.9977
107 10580.1531 1316.3513
108 3711.5606 10580.1531
109 -6949.9733 3711.5606
110 -16418.9575 -6949.9733
111 1215.6043 -16418.9575
112 -14933.8793 1215.6043
113 -1548.7174 -14933.8793
114 6633.6407 -1548.7174
115 3711.5606 6633.6407
116 33484.4021 3711.5606
117 -19392.4260 33484.4021
118 12912.3532 -19392.4260
119 -10195.6813 12912.3532
120 1225.6392 -10195.6813
121 5503.3519 1225.6392
122 3339.6813 5503.3519
123 -9092.6975 3339.6813
124 8856.8895 -9092.6975
125 3428.5224 8856.8895
126 -9798.1079 3428.5224
127 14524.0032 -9798.1079
128 -8975.2313 14524.0032
129 3954.4059 -8975.2313
130 7940.5628 3954.4059
131 16968.5156 7940.5628
132 9052.4416 16968.5156
133 -8169.2647 9052.4416
134 5594.0205 -8169.2647
135 4461.6706 5594.0205
136 3711.5606 4461.6706
137 -1532.9981 3711.5606
138 -8722.5667 -1532.9981
139 7172.7230 -8722.5667
140 6002.6818 7172.7230
141 -3806.9447 6002.6818
142 8637.6137 -3806.9447
143 -3606.6102 8637.6137
144 NA -3606.6102
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 17616.8220 11454.3692
[2,] 439.4180 17616.8220
[3,] -7259.6040 439.4180
[4,] -10749.1376 -7259.6040
[5,] 19414.0818 -10749.1376
[6,] 1684.6811 19414.0818
[7,] 19040.6943 1684.6811
[8,] -4510.1767 19040.6943
[9,] 44127.2892 -4510.1767
[10,] -8972.5459 44127.2892
[11,] -344.2076 -8972.5459
[12,] -17957.2573 -344.2076
[13,] -20035.6420 -17957.2573
[14,] 20642.9007 -20035.6420
[15,] -1584.4235 20642.9007
[16,] -22832.5499 -1584.4235
[17,] -1544.7456 -22832.5499
[18,] -47115.7776 -1544.7456
[19,] -30656.0765 -47115.7776
[20,] -9088.3710 -30656.0765
[21,] -8552.6147 -9088.3710
[22,] 4147.0492 -8552.6147
[23,] -10954.2167 4147.0492
[24,] -1908.5358 -10954.2167
[25,] 16746.8419 -1908.5358
[26,] -4820.5730 16746.8419
[27,] 24608.2485 -4820.5730
[28,] 61620.8933 24608.2485
[29,] 8818.4672 61620.8933
[30,] -1761.2331 8818.4672
[31,] 24522.3997 -1761.2331
[32,] -14653.6037 24522.3997
[33,] -12500.3878 -14653.6037
[34,] 18017.7928 -12500.3878
[35,] 3711.5606 18017.7928
[36,] 4049.3902 3711.5606
[37,] -13504.6900 4049.3902
[38,] -19781.3615 -13504.6900
[39,] -8312.7133 -19781.3615
[40,] 106.8544 -8312.7133
[41,] -9811.3694 106.8544
[42,] -4440.8411 -9811.3694
[43,] -26626.5391 -4440.8411
[44,] -12696.4330 -26626.5391
[45,] 14715.9322 -12696.4330
[46,] 7823.3048 14715.9322
[47,] 18160.9934 7823.3048
[48,] 3917.6326 18160.9934
[49,] -24521.9855 3917.6326
[50,] 1801.7346 -24521.9855
[51,] 7790.3674 1801.7346
[52,] 31825.1088 7790.3674
[53,] 22972.3395 31825.1088
[54,] 3163.8434 22972.3395
[55,] 11176.5047 3163.8434
[56,] 13903.7238 11176.5047
[57,] -2194.5761 13903.7238
[58,] 966.7930 -2194.5761
[59,] -23326.3828 966.7930
[60,] -4142.7563 -23326.3828
[61,] -23117.4418 -4142.7563
[62,] -9841.5665 -23117.4418
[63,] 2864.0779 -9841.5665
[64,] 18268.5620 2864.0779
[65,] -14807.8999 18268.5620
[66,] -10889.8873 -14807.8999
[67,] -33050.5568 -10889.8873
[68,] -6402.6899 -33050.5568
[69,] 7460.9745 -6402.6899
[70,] 14600.5132 7460.9745
[71,] 7756.3680 14600.5132
[72,] -21083.8429 7756.3680
[73,] -18272.1379 -21083.8429
[74,] -24611.9210 -18272.1379
[75,] -7495.2410 -24611.9210
[76,] 7094.5057 -7495.2410
[77,] -25871.6581 7094.5057
[78,] -9659.7089 -25871.6581
[79,] -26527.3642 -9659.7089
[80,] -8106.8277 -26527.3642
[81,] 45084.1669 -8106.8277
[82,] -1283.9478 45084.1669
[83,] -11658.6878 -1283.9478
[84,] -14002.0550 -11658.6878
[85,] 386.5486 -14002.0550
[86,] 32366.7557 386.5486
[87,] -7476.8122 32366.7557
[88,] -4666.6558 -7476.8122
[89,] 2585.5407 -4666.6558
[90,] -10384.5979 2585.5407
[91,] -14488.6050 -10384.5979
[92,] 19495.1019 -14488.6050
[93,] -528.7606 19495.1019
[94,] -15438.8240 -528.7606
[95,] 28653.0280 -15438.8240
[96,] -1025.0609 28653.0280
[97,] 5106.0391 -1025.0609
[98,] 12361.1429 5106.0391
[99,] -8795.3686 12361.1429
[100,] 3838.7142 -8795.3686
[101,] -18375.3589 3838.7142
[102,] 10070.2409 -18375.3589
[103,] 5585.8787 10070.2409
[104,] 10788.7638 5585.8787
[105,] 873.9977 10788.7638
[106,] 1316.3513 873.9977
[107,] 10580.1531 1316.3513
[108,] 3711.5606 10580.1531
[109,] -6949.9733 3711.5606
[110,] -16418.9575 -6949.9733
[111,] 1215.6043 -16418.9575
[112,] -14933.8793 1215.6043
[113,] -1548.7174 -14933.8793
[114,] 6633.6407 -1548.7174
[115,] 3711.5606 6633.6407
[116,] 33484.4021 3711.5606
[117,] -19392.4260 33484.4021
[118,] 12912.3532 -19392.4260
[119,] -10195.6813 12912.3532
[120,] 1225.6392 -10195.6813
[121,] 5503.3519 1225.6392
[122,] 3339.6813 5503.3519
[123,] -9092.6975 3339.6813
[124,] 8856.8895 -9092.6975
[125,] 3428.5224 8856.8895
[126,] -9798.1079 3428.5224
[127,] 14524.0032 -9798.1079
[128,] -8975.2313 14524.0032
[129,] 3954.4059 -8975.2313
[130,] 7940.5628 3954.4059
[131,] 16968.5156 7940.5628
[132,] 9052.4416 16968.5156
[133,] -8169.2647 9052.4416
[134,] 5594.0205 -8169.2647
[135,] 4461.6706 5594.0205
[136,] 3711.5606 4461.6706
[137,] -1532.9981 3711.5606
[138,] -8722.5667 -1532.9981
[139,] 7172.7230 -8722.5667
[140,] 6002.6818 7172.7230
[141,] -3806.9447 6002.6818
[142,] 8637.6137 -3806.9447
[143,] -3606.6102 8637.6137
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 17616.8220 11454.3692
2 439.4180 17616.8220
3 -7259.6040 439.4180
4 -10749.1376 -7259.6040
5 19414.0818 -10749.1376
6 1684.6811 19414.0818
7 19040.6943 1684.6811
8 -4510.1767 19040.6943
9 44127.2892 -4510.1767
10 -8972.5459 44127.2892
11 -344.2076 -8972.5459
12 -17957.2573 -344.2076
13 -20035.6420 -17957.2573
14 20642.9007 -20035.6420
15 -1584.4235 20642.9007
16 -22832.5499 -1584.4235
17 -1544.7456 -22832.5499
18 -47115.7776 -1544.7456
19 -30656.0765 -47115.7776
20 -9088.3710 -30656.0765
21 -8552.6147 -9088.3710
22 4147.0492 -8552.6147
23 -10954.2167 4147.0492
24 -1908.5358 -10954.2167
25 16746.8419 -1908.5358
26 -4820.5730 16746.8419
27 24608.2485 -4820.5730
28 61620.8933 24608.2485
29 8818.4672 61620.8933
30 -1761.2331 8818.4672
31 24522.3997 -1761.2331
32 -14653.6037 24522.3997
33 -12500.3878 -14653.6037
34 18017.7928 -12500.3878
35 3711.5606 18017.7928
36 4049.3902 3711.5606
37 -13504.6900 4049.3902
38 -19781.3615 -13504.6900
39 -8312.7133 -19781.3615
40 106.8544 -8312.7133
41 -9811.3694 106.8544
42 -4440.8411 -9811.3694
43 -26626.5391 -4440.8411
44 -12696.4330 -26626.5391
45 14715.9322 -12696.4330
46 7823.3048 14715.9322
47 18160.9934 7823.3048
48 3917.6326 18160.9934
49 -24521.9855 3917.6326
50 1801.7346 -24521.9855
51 7790.3674 1801.7346
52 31825.1088 7790.3674
53 22972.3395 31825.1088
54 3163.8434 22972.3395
55 11176.5047 3163.8434
56 13903.7238 11176.5047
57 -2194.5761 13903.7238
58 966.7930 -2194.5761
59 -23326.3828 966.7930
60 -4142.7563 -23326.3828
61 -23117.4418 -4142.7563
62 -9841.5665 -23117.4418
63 2864.0779 -9841.5665
64 18268.5620 2864.0779
65 -14807.8999 18268.5620
66 -10889.8873 -14807.8999
67 -33050.5568 -10889.8873
68 -6402.6899 -33050.5568
69 7460.9745 -6402.6899
70 14600.5132 7460.9745
71 7756.3680 14600.5132
72 -21083.8429 7756.3680
73 -18272.1379 -21083.8429
74 -24611.9210 -18272.1379
75 -7495.2410 -24611.9210
76 7094.5057 -7495.2410
77 -25871.6581 7094.5057
78 -9659.7089 -25871.6581
79 -26527.3642 -9659.7089
80 -8106.8277 -26527.3642
81 45084.1669 -8106.8277
82 -1283.9478 45084.1669
83 -11658.6878 -1283.9478
84 -14002.0550 -11658.6878
85 386.5486 -14002.0550
86 32366.7557 386.5486
87 -7476.8122 32366.7557
88 -4666.6558 -7476.8122
89 2585.5407 -4666.6558
90 -10384.5979 2585.5407
91 -14488.6050 -10384.5979
92 19495.1019 -14488.6050
93 -528.7606 19495.1019
94 -15438.8240 -528.7606
95 28653.0280 -15438.8240
96 -1025.0609 28653.0280
97 5106.0391 -1025.0609
98 12361.1429 5106.0391
99 -8795.3686 12361.1429
100 3838.7142 -8795.3686
101 -18375.3589 3838.7142
102 10070.2409 -18375.3589
103 5585.8787 10070.2409
104 10788.7638 5585.8787
105 873.9977 10788.7638
106 1316.3513 873.9977
107 10580.1531 1316.3513
108 3711.5606 10580.1531
109 -6949.9733 3711.5606
110 -16418.9575 -6949.9733
111 1215.6043 -16418.9575
112 -14933.8793 1215.6043
113 -1548.7174 -14933.8793
114 6633.6407 -1548.7174
115 3711.5606 6633.6407
116 33484.4021 3711.5606
117 -19392.4260 33484.4021
118 12912.3532 -19392.4260
119 -10195.6813 12912.3532
120 1225.6392 -10195.6813
121 5503.3519 1225.6392
122 3339.6813 5503.3519
123 -9092.6975 3339.6813
124 8856.8895 -9092.6975
125 3428.5224 8856.8895
126 -9798.1079 3428.5224
127 14524.0032 -9798.1079
128 -8975.2313 14524.0032
129 3954.4059 -8975.2313
130 7940.5628 3954.4059
131 16968.5156 7940.5628
132 9052.4416 16968.5156
133 -8169.2647 9052.4416
134 5594.0205 -8169.2647
135 4461.6706 5594.0205
136 3711.5606 4461.6706
137 -1532.9981 3711.5606
138 -8722.5667 -1532.9981
139 7172.7230 -8722.5667
140 6002.6818 7172.7230
141 -3806.9447 6002.6818
142 8637.6137 -3806.9447
143 -3606.6102 8637.6137
> 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/7whvj1322154890.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/8yswj1322154890.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/9psik1322154890.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/10zhzi1322154890.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/11mabm1322154890.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/12poc11322154890.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/139x861322154890.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/142lpz1322154890.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/152kj11322154890.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/16dfk21322154890.tab")
+ }
>
> try(system("convert tmp/1kxwz1322154889.ps tmp/1kxwz1322154889.png",intern=TRUE))
character(0)
> try(system("convert tmp/2u6zf1322154889.ps tmp/2u6zf1322154889.png",intern=TRUE))
character(0)
> try(system("convert tmp/3j4bt1322154890.ps tmp/3j4bt1322154890.png",intern=TRUE))
character(0)
> try(system("convert tmp/40ecp1322154890.ps tmp/40ecp1322154890.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cll71322154890.ps tmp/5cll71322154890.png",intern=TRUE))
character(0)
> try(system("convert tmp/6w5cj1322154890.ps tmp/6w5cj1322154890.png",intern=TRUE))
character(0)
> try(system("convert tmp/7whvj1322154890.ps tmp/7whvj1322154890.png",intern=TRUE))
character(0)
> try(system("convert tmp/8yswj1322154890.ps tmp/8yswj1322154890.png",intern=TRUE))
character(0)
> try(system("convert tmp/9psik1322154890.ps tmp/9psik1322154890.png",intern=TRUE))
character(0)
> try(system("convert tmp/10zhzi1322154890.ps tmp/10zhzi1322154890.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.367 0.493 4.893