R version 2.12.0 (2010-10-15)
Copyright (C) 2010 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(129404
+ ,20
+ ,18158
+ ,5636
+ ,22622
+ ,30
+ ,28
+ ,130358
+ ,38
+ ,30461
+ ,9079
+ ,73570
+ ,42
+ ,39
+ ,7215
+ ,0
+ ,1423
+ ,603
+ ,1929
+ ,0
+ ,0
+ ,112861
+ ,49
+ ,25629
+ ,8874
+ ,36294
+ ,54
+ ,54
+ ,219904
+ ,76
+ ,48758
+ ,17988
+ ,62378
+ ,86
+ ,80
+ ,396382
+ ,104
+ ,129230
+ ,21325
+ ,167760
+ ,157
+ ,144
+ ,117604
+ ,37
+ ,27376
+ ,8325
+ ,52443
+ ,36
+ ,36
+ ,126737
+ ,53
+ ,26706
+ ,7117
+ ,57283
+ ,48
+ ,48
+ ,99729
+ ,42
+ ,26505
+ ,7996
+ ,36614
+ ,45
+ ,42
+ ,256310
+ ,62
+ ,49801
+ ,14218
+ ,93268
+ ,77
+ ,71
+ ,113066
+ ,50
+ ,46580
+ ,6321
+ ,35439
+ ,49
+ ,49
+ ,157228
+ ,65
+ ,48352
+ ,19690
+ ,72405
+ ,77
+ ,74
+ ,69952
+ ,28
+ ,13899
+ ,5659
+ ,24044
+ ,28
+ ,27
+ ,152673
+ ,48
+ ,39342
+ ,11370
+ ,55909
+ ,84
+ ,83
+ ,130642
+ ,42
+ ,27465
+ ,4778
+ ,44689
+ ,31
+ ,31
+ ,125769
+ ,47
+ ,55211
+ ,5954
+ ,49319
+ ,28
+ ,28
+ ,123467
+ ,71
+ ,74098
+ ,22924
+ ,62075
+ ,99
+ ,98
+ ,56232
+ ,0
+ ,13497
+ ,70
+ ,2341
+ ,2
+ ,2
+ ,108330
+ ,50
+ ,38338
+ ,14369
+ ,40551
+ ,41
+ ,43
+ ,22762
+ ,12
+ ,52505
+ ,3706
+ ,11621
+ ,25
+ ,24
+ ,48554
+ ,16
+ ,10663
+ ,3147
+ ,18741
+ ,16
+ ,16
+ ,182081
+ ,77
+ ,74484
+ ,16801
+ ,84202
+ ,96
+ ,95
+ ,140857
+ ,29
+ ,28895
+ ,2162
+ ,15334
+ ,23
+ ,22
+ ,93773
+ ,38
+ ,32827
+ ,4721
+ ,28024
+ ,33
+ ,33
+ ,133398
+ ,50
+ ,36188
+ ,5290
+ ,53306
+ ,46
+ ,45
+ ,113933
+ ,33
+ ,28173
+ ,6446
+ ,37918
+ ,59
+ ,59
+ ,153851
+ ,49
+ ,54926
+ ,14711
+ ,54819
+ ,72
+ ,66
+ ,140711
+ ,59
+ ,38900
+ ,13311
+ ,89058
+ ,72
+ ,70
+ ,303804
+ ,55
+ ,88530
+ ,13577
+ ,103354
+ ,62
+ ,56
+ ,161651
+ ,40
+ ,35482
+ ,14634
+ ,70239
+ ,55
+ ,55
+ ,123344
+ ,40
+ ,26730
+ ,6931
+ ,33045
+ ,27
+ ,27
+ ,157640
+ ,51
+ ,29806
+ ,9992
+ ,63852
+ ,41
+ ,37
+ ,91279
+ ,41
+ ,41799
+ ,6185
+ ,30905
+ ,51
+ ,48
+ ,189374
+ ,73
+ ,54289
+ ,3445
+ ,24242
+ ,26
+ ,26
+ ,178768
+ ,51
+ ,36805
+ ,12327
+ ,78907
+ ,65
+ ,64
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,175403
+ ,46
+ ,33146
+ ,9898
+ ,36005
+ ,28
+ ,21
+ ,92342
+ ,44
+ ,23333
+ ,8022
+ ,31972
+ ,44
+ ,44
+ ,100023
+ ,31
+ ,47686
+ ,10765
+ ,35853
+ ,36
+ ,36
+ ,178277
+ ,71
+ ,77783
+ ,22717
+ ,115301
+ ,100
+ ,89
+ ,145062
+ ,61
+ ,36042
+ ,10090
+ ,47689
+ ,104
+ ,101
+ ,110980
+ ,28
+ ,34541
+ ,12385
+ ,34223
+ ,35
+ ,31
+ ,86039
+ ,21
+ ,75620
+ ,8513
+ ,43431
+ ,69
+ ,65
+ ,125481
+ ,42
+ ,60610
+ ,5508
+ ,52220
+ ,73
+ ,71
+ ,95535
+ ,44
+ ,55041
+ ,9628
+ ,33863
+ ,106
+ ,102
+ ,126456
+ ,40
+ ,32087
+ ,11872
+ ,46879
+ ,53
+ ,53
+ ,61554
+ ,15
+ ,16356
+ ,4186
+ ,23228
+ ,43
+ ,41
+ ,164752
+ ,46
+ ,40161
+ ,10877
+ ,42827
+ ,49
+ ,46
+ ,159121
+ ,43
+ ,55459
+ ,17066
+ ,65765
+ ,38
+ ,37
+ ,129362
+ ,47
+ ,36679
+ ,9175
+ ,38167
+ ,51
+ ,51
+ ,48188
+ ,12
+ ,22346
+ ,2102
+ ,14812
+ ,14
+ ,14
+ ,95461
+ ,46
+ ,27377
+ ,10807
+ ,32615
+ ,40
+ ,40
+ ,229864
+ ,56
+ ,50273
+ ,13662
+ ,82188
+ ,79
+ ,77
+ ,191094
+ ,47
+ ,32104
+ ,9224
+ ,51763
+ ,52
+ ,51
+ ,150640
+ ,48
+ ,27016
+ ,9001
+ ,59325
+ ,44
+ ,43
+ ,111388
+ ,35
+ ,19715
+ ,7204
+ ,48976
+ ,34
+ ,33
+ ,165098
+ ,44
+ ,33629
+ ,6572
+ ,43384
+ ,47
+ ,47
+ ,63205
+ ,25
+ ,27084
+ ,7509
+ ,26692
+ ,32
+ ,31
+ ,109102
+ ,47
+ ,32352
+ ,12920
+ ,53279
+ ,31
+ ,31
+ ,137303
+ ,28
+ ,51845
+ ,5438
+ ,20652
+ ,40
+ ,40
+ ,125304
+ ,48
+ ,26591
+ ,11489
+ ,38338
+ ,42
+ ,42
+ ,85332
+ ,32
+ ,29677
+ ,6661
+ ,36735
+ ,34
+ ,35
+ ,95808
+ ,28
+ ,54237
+ ,7941
+ ,42764
+ ,40
+ ,40
+ ,83419
+ ,31
+ ,20284
+ ,6173
+ ,44331
+ ,35
+ ,30
+ ,101723
+ ,13
+ ,22741
+ ,5562
+ ,41354
+ ,11
+ ,11
+ ,94982
+ ,38
+ ,34178
+ ,9492
+ ,47879
+ ,43
+ ,41
+ ,129700
+ ,39
+ ,69551
+ ,17456
+ ,103793
+ ,53
+ ,53
+ ,113325
+ ,68
+ ,29653
+ ,9422
+ ,52235
+ ,82
+ ,82
+ ,81518
+ ,32
+ ,38071
+ ,10913
+ ,49825
+ ,41
+ ,41
+ ,31970
+ ,5
+ ,4157
+ ,1283
+ ,4105
+ ,6
+ ,6
+ ,192268
+ ,53
+ ,28321
+ ,6198
+ ,58687
+ ,82
+ ,81
+ ,91086
+ ,33
+ ,40195
+ ,4501
+ ,40745
+ ,47
+ ,47
+ ,80820
+ ,54
+ ,48158
+ ,9560
+ ,33187
+ ,108
+ ,100
+ ,83261
+ ,36
+ ,13310
+ ,3394
+ ,14063
+ ,46
+ ,46
+ ,116290
+ ,52
+ ,78474
+ ,9871
+ ,37407
+ ,38
+ ,38
+ ,56544
+ ,0
+ ,6386
+ ,2419
+ ,7190
+ ,0
+ ,0
+ ,116173
+ ,52
+ ,31588
+ ,10630
+ ,49562
+ ,45
+ ,45
+ ,111488
+ ,45
+ ,61254
+ ,8536
+ ,76324
+ ,57
+ ,56
+ ,60138
+ ,16
+ ,21152
+ ,4911
+ ,21928
+ ,20
+ ,18
+ ,73422
+ ,33
+ ,41272
+ ,9775
+ ,27860
+ ,56
+ ,54
+ ,67751
+ ,48
+ ,34165
+ ,11227
+ ,28078
+ ,38
+ ,37
+ ,213351
+ ,33
+ ,37054
+ ,6916
+ ,49577
+ ,42
+ ,40
+ ,51185
+ ,24
+ ,12368
+ ,3424
+ ,28145
+ ,37
+ ,37
+ ,97181
+ ,37
+ ,23168
+ ,8637
+ ,36241
+ ,36
+ ,36
+ ,45100
+ ,17
+ ,16380
+ ,3189
+ ,10824
+ ,34
+ ,34
+ ,115801
+ ,32
+ ,41242
+ ,8178
+ ,46892
+ ,53
+ ,49
+ ,186310
+ ,55
+ ,48450
+ ,16739
+ ,61264
+ ,85
+ ,82
+ ,71960
+ ,39
+ ,20790
+ ,6094
+ ,22933
+ ,36
+ ,36
+ ,80105
+ ,31
+ ,34585
+ ,7237
+ ,20787
+ ,33
+ ,33
+ ,103613
+ ,26
+ ,35672
+ ,7355
+ ,43978
+ ,57
+ ,55
+ ,98707
+ ,37
+ ,52168
+ ,9734
+ ,51305
+ ,50
+ ,50
+ ,136234
+ ,66
+ ,53933
+ ,11225
+ ,55593
+ ,71
+ ,71
+ ,136781
+ ,35
+ ,34474
+ ,6213
+ ,51648
+ ,32
+ ,31
+ ,105863
+ ,24
+ ,43753
+ ,4875
+ ,30552
+ ,45
+ ,42
+ ,38775
+ ,18
+ ,36456
+ ,8159
+ ,23470
+ ,33
+ ,31
+ ,179997
+ ,37
+ ,51183
+ ,11893
+ ,77530
+ ,53
+ ,51
+ ,169406
+ ,86
+ ,52742
+ ,10754
+ ,57299
+ ,64
+ ,64
+ ,19349
+ ,13
+ ,3895
+ ,786
+ ,9604
+ ,14
+ ,14
+ ,153069
+ ,21
+ ,37076
+ ,9706
+ ,34684
+ ,38
+ ,37
+ ,109510
+ ,32
+ ,24079
+ ,7796
+ ,41094
+ ,39
+ ,37
+ ,43803
+ ,8
+ ,2325
+ ,593
+ ,3439
+ ,8
+ ,8
+ ,47062
+ ,38
+ ,29354
+ ,5600
+ ,25171
+ ,38
+ ,38
+ ,110845
+ ,45
+ ,30341
+ ,7245
+ ,23437
+ ,24
+ ,23
+ ,92517
+ ,24
+ ,18992
+ ,7360
+ ,34086
+ ,22
+ ,22
+ ,58660
+ ,23
+ ,15292
+ ,4574
+ ,24649
+ ,18
+ ,18
+ ,27676
+ ,2
+ ,5842
+ ,522
+ ,2342
+ ,3
+ ,1
+ ,98550
+ ,52
+ ,28918
+ ,10905
+ ,45571
+ ,49
+ ,48
+ ,43646
+ ,5
+ ,3738
+ ,999
+ ,3255
+ ,5
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,67312
+ ,43
+ ,95352
+ ,9016
+ ,30002
+ ,47
+ ,46
+ ,57359
+ ,18
+ ,37478
+ ,5134
+ ,19360
+ ,33
+ ,33
+ ,104330
+ ,44
+ ,26839
+ ,6608
+ ,43320
+ ,44
+ ,41
+ ,70369
+ ,45
+ ,26783
+ ,8577
+ ,35513
+ ,56
+ ,57
+ ,65494
+ ,29
+ ,33392
+ ,1543
+ ,23536
+ ,49
+ ,49
+ ,3616
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,143931
+ ,32
+ ,25446
+ ,9803
+ ,54438
+ ,45
+ ,45
+ ,117946
+ ,65
+ ,59847
+ ,12140
+ ,56812
+ ,78
+ ,78
+ ,131175
+ ,26
+ ,28162
+ ,6678
+ ,33838
+ ,51
+ ,46
+ ,84336
+ ,24
+ ,33298
+ ,6420
+ ,32366
+ ,25
+ ,25
+ ,43410
+ ,7
+ ,2781
+ ,4
+ ,13
+ ,1
+ ,1
+ ,136250
+ ,62
+ ,37121
+ ,7979
+ ,55082
+ ,62
+ ,59
+ ,79015
+ ,30
+ ,22698
+ ,5141
+ ,31334
+ ,29
+ ,29
+ ,92937
+ ,49
+ ,27615
+ ,1311
+ ,16612
+ ,26
+ ,26
+ ,57586
+ ,3
+ ,32689
+ ,443
+ ,5084
+ ,4
+ ,4
+ ,19764
+ ,10
+ ,5752
+ ,2416
+ ,9927
+ ,10
+ ,10
+ ,105757
+ ,42
+ ,23164
+ ,8396
+ ,47413
+ ,43
+ ,43
+ ,97213
+ ,18
+ ,20304
+ ,5462
+ ,27389
+ ,36
+ ,36
+ ,113402
+ ,40
+ ,34409
+ ,7271
+ ,30425
+ ,43
+ ,41
+ ,11796
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,7627
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,121085
+ ,29
+ ,92538
+ ,4423
+ ,33510
+ ,33
+ ,32
+ ,6836
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,139563
+ ,46
+ ,46037
+ ,5331
+ ,40389
+ ,53
+ ,53
+ ,5118
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,40248
+ ,8
+ ,5444
+ ,775
+ ,6012
+ ,6
+ ,6
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,95079
+ ,21
+ ,23924
+ ,6676
+ ,22205
+ ,19
+ ,18
+ ,80763
+ ,21
+ ,52230
+ ,1489
+ ,17231
+ ,26
+ ,26
+ ,7131
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4194
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,60378
+ ,15
+ ,8019
+ ,3080
+ ,11017
+ ,16
+ ,16
+ ,109173
+ ,47
+ ,34542
+ ,11409
+ ,46741
+ ,84
+ ,84
+ ,83484
+ ,17
+ ,21157
+ ,6769
+ ,39869
+ ,28
+ ,22)
+ ,dim=c(7
+ ,144)
+ ,dimnames=list(c('timeRFC'
+ ,'blogcomp'
+ ,'characters'
+ ,'revisions'
+ ,'seconds'
+ ,'inclhyper'
+ ,'inclblogs')
+ ,1:144))
> y <- array(NA,dim=c(7,144),dimnames=list(c('timeRFC','blogcomp','characters','revisions','seconds','inclhyper','inclblogs'),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'
> 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
timeRFC blogcomp characters revisions seconds inclhyper inclblogs
1 129404 20 18158 5636 22622 30 28
2 130358 38 30461 9079 73570 42 39
3 7215 0 1423 603 1929 0 0
4 112861 49 25629 8874 36294 54 54
5 219904 76 48758 17988 62378 86 80
6 396382 104 129230 21325 167760 157 144
7 117604 37 27376 8325 52443 36 36
8 126737 53 26706 7117 57283 48 48
9 99729 42 26505 7996 36614 45 42
10 256310 62 49801 14218 93268 77 71
11 113066 50 46580 6321 35439 49 49
12 157228 65 48352 19690 72405 77 74
13 69952 28 13899 5659 24044 28 27
14 152673 48 39342 11370 55909 84 83
15 130642 42 27465 4778 44689 31 31
16 125769 47 55211 5954 49319 28 28
17 123467 71 74098 22924 62075 99 98
18 56232 0 13497 70 2341 2 2
19 108330 50 38338 14369 40551 41 43
20 22762 12 52505 3706 11621 25 24
21 48554 16 10663 3147 18741 16 16
22 182081 77 74484 16801 84202 96 95
23 140857 29 28895 2162 15334 23 22
24 93773 38 32827 4721 28024 33 33
25 133398 50 36188 5290 53306 46 45
26 113933 33 28173 6446 37918 59 59
27 153851 49 54926 14711 54819 72 66
28 140711 59 38900 13311 89058 72 70
29 303804 55 88530 13577 103354 62 56
30 161651 40 35482 14634 70239 55 55
31 123344 40 26730 6931 33045 27 27
32 157640 51 29806 9992 63852 41 37
33 91279 41 41799 6185 30905 51 48
34 189374 73 54289 3445 24242 26 26
35 178768 51 36805 12327 78907 65 64
36 0 0 0 0 0 0 0
37 175403 46 33146 9898 36005 28 21
38 92342 44 23333 8022 31972 44 44
39 100023 31 47686 10765 35853 36 36
40 178277 71 77783 22717 115301 100 89
41 145062 61 36042 10090 47689 104 101
42 110980 28 34541 12385 34223 35 31
43 86039 21 75620 8513 43431 69 65
44 125481 42 60610 5508 52220 73 71
45 95535 44 55041 9628 33863 106 102
46 126456 40 32087 11872 46879 53 53
47 61554 15 16356 4186 23228 43 41
48 164752 46 40161 10877 42827 49 46
49 159121 43 55459 17066 65765 38 37
50 129362 47 36679 9175 38167 51 51
51 48188 12 22346 2102 14812 14 14
52 95461 46 27377 10807 32615 40 40
53 229864 56 50273 13662 82188 79 77
54 191094 47 32104 9224 51763 52 51
55 150640 48 27016 9001 59325 44 43
56 111388 35 19715 7204 48976 34 33
57 165098 44 33629 6572 43384 47 47
58 63205 25 27084 7509 26692 32 31
59 109102 47 32352 12920 53279 31 31
60 137303 28 51845 5438 20652 40 40
61 125304 48 26591 11489 38338 42 42
62 85332 32 29677 6661 36735 34 35
63 95808 28 54237 7941 42764 40 40
64 83419 31 20284 6173 44331 35 30
65 101723 13 22741 5562 41354 11 11
66 94982 38 34178 9492 47879 43 41
67 129700 39 69551 17456 103793 53 53
68 113325 68 29653 9422 52235 82 82
69 81518 32 38071 10913 49825 41 41
70 31970 5 4157 1283 4105 6 6
71 192268 53 28321 6198 58687 82 81
72 91086 33 40195 4501 40745 47 47
73 80820 54 48158 9560 33187 108 100
74 83261 36 13310 3394 14063 46 46
75 116290 52 78474 9871 37407 38 38
76 56544 0 6386 2419 7190 0 0
77 116173 52 31588 10630 49562 45 45
78 111488 45 61254 8536 76324 57 56
79 60138 16 21152 4911 21928 20 18
80 73422 33 41272 9775 27860 56 54
81 67751 48 34165 11227 28078 38 37
82 213351 33 37054 6916 49577 42 40
83 51185 24 12368 3424 28145 37 37
84 97181 37 23168 8637 36241 36 36
85 45100 17 16380 3189 10824 34 34
86 115801 32 41242 8178 46892 53 49
87 186310 55 48450 16739 61264 85 82
88 71960 39 20790 6094 22933 36 36
89 80105 31 34585 7237 20787 33 33
90 103613 26 35672 7355 43978 57 55
91 98707 37 52168 9734 51305 50 50
92 136234 66 53933 11225 55593 71 71
93 136781 35 34474 6213 51648 32 31
94 105863 24 43753 4875 30552 45 42
95 38775 18 36456 8159 23470 33 31
96 179997 37 51183 11893 77530 53 51
97 169406 86 52742 10754 57299 64 64
98 19349 13 3895 786 9604 14 14
99 153069 21 37076 9706 34684 38 37
100 109510 32 24079 7796 41094 39 37
101 43803 8 2325 593 3439 8 8
102 47062 38 29354 5600 25171 38 38
103 110845 45 30341 7245 23437 24 23
104 92517 24 18992 7360 34086 22 22
105 58660 23 15292 4574 24649 18 18
106 27676 2 5842 522 2342 3 1
107 98550 52 28918 10905 45571 49 48
108 43646 5 3738 999 3255 5 5
109 0 0 0 0 0 0 0
110 67312 43 95352 9016 30002 47 46
111 57359 18 37478 5134 19360 33 33
112 104330 44 26839 6608 43320 44 41
113 70369 45 26783 8577 35513 56 57
114 65494 29 33392 1543 23536 49 49
115 3616 0 0 0 0 0 0
116 0 0 0 0 0 0 0
117 143931 32 25446 9803 54438 45 45
118 117946 65 59847 12140 56812 78 78
119 131175 26 28162 6678 33838 51 46
120 84336 24 33298 6420 32366 25 25
121 43410 7 2781 4 13 1 1
122 136250 62 37121 7979 55082 62 59
123 79015 30 22698 5141 31334 29 29
124 92937 49 27615 1311 16612 26 26
125 57586 3 32689 443 5084 4 4
126 19764 10 5752 2416 9927 10 10
127 105757 42 23164 8396 47413 43 43
128 97213 18 20304 5462 27389 36 36
129 113402 40 34409 7271 30425 43 41
130 11796 1 0 0 0 0 0
131 7627 0 0 0 0 0 0
132 121085 29 92538 4423 33510 33 32
133 6836 0 0 0 0 0 0
134 139563 46 46037 5331 40389 53 53
135 5118 5 0 0 0 0 0
136 40248 8 5444 775 6012 6 6
137 0 0 0 0 0 0 0
138 95079 21 23924 6676 22205 19 18
139 80763 21 52230 1489 17231 26 26
140 7131 0 0 0 0 0 0
141 4194 0 0 0 0 0 0
142 60378 15 8019 3080 11017 16 16
143 109173 47 34542 11409 46741 84 84
144 83484 17 21157 6769 39869 28 22
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) blogcomp characters revisions seconds inclhyper
20273.9296 1278.0742 0.2443 -1.8252 1.4153 3673.4083
inclblogs
-4004.0651
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-84444 -16928 -5378 14639 90185
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20273.9296 4815.6237 4.210 4.60e-05 ***
blogcomp 1278.0742 242.6633 5.267 5.25e-07 ***
characters 0.2443 0.1701 1.436 0.15332
revisions -1.8252 0.9814 -1.860 0.06504 .
seconds 1.4153 0.1961 7.218 3.29e-11 ***
inclhyper 3673.4083 1331.4487 2.759 0.00659 **
inclblogs -4004.0651 1378.4618 -2.905 0.00429 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 28290 on 137 degrees of freedom
Multiple R-squared: 0.7895, Adjusted R-squared: 0.7803
F-statistic: 85.64 on 6 and 137 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.6616173 0.6767653017 0.3383826509
[2,] 0.6640857 0.6718286626 0.3359143313
[3,] 0.7100413 0.5799174224 0.2899587112
[4,] 0.6251117 0.7497766804 0.3748883402
[5,] 0.5279043 0.9441914309 0.4720957154
[6,] 0.5079405 0.9841189137 0.4920594568
[7,] 0.4300019 0.8600037745 0.5699981128
[8,] 0.3773513 0.7547026512 0.6226486744
[9,] 0.3480249 0.6960497476 0.6519751262
[10,] 0.3640529 0.7281057511 0.6359471244
[11,] 0.3792704 0.7585407397 0.6207296302
[12,] 0.3190994 0.6381988456 0.6809005772
[13,] 0.2513699 0.5027397259 0.7486301371
[14,] 0.4429014 0.8858027061 0.5570986470
[15,] 0.3745770 0.7491540609 0.6254229695
[16,] 0.3298862 0.6597724841 0.6701137579
[17,] 0.2832687 0.5665373438 0.7167313281
[18,] 0.2406270 0.4812540499 0.7593729750
[19,] 0.3045737 0.6091474203 0.6954262899
[20,] 0.6955264 0.6089472550 0.3044736275
[21,] 0.7321549 0.5356902136 0.2678451068
[22,] 0.7020497 0.5959006766 0.2979503383
[23,] 0.6684466 0.6631067674 0.3315533837
[24,] 0.6686177 0.6627646144 0.3313823072
[25,] 0.7176101 0.5647797021 0.2823898511
[26,] 0.6890266 0.6219467130 0.3109733565
[27,] 0.6747530 0.6504939593 0.3252469797
[28,] 0.6852187 0.6295625839 0.3147812920
[29,] 0.6342117 0.7315765917 0.3657882959
[30,] 0.5807917 0.8384166760 0.4192083380
[31,] 0.9092972 0.1814055612 0.0907027806
[32,] 0.8859283 0.2281434946 0.1140717473
[33,] 0.8659200 0.2681599716 0.1340799858
[34,] 0.8515972 0.2968055690 0.1484027845
[35,] 0.8245891 0.3508218222 0.1754109111
[36,] 0.7914322 0.4171356707 0.2085678353
[37,] 0.7730303 0.4539394760 0.2269697380
[38,] 0.7313221 0.5373558194 0.2686779097
[39,] 0.7610095 0.4779810255 0.2389905127
[40,] 0.7356272 0.5287456589 0.2643728294
[41,] 0.7077631 0.5844738070 0.2922369035
[42,] 0.6652195 0.6695609135 0.3347804567
[43,] 0.6219415 0.7561169272 0.3780584636
[44,] 0.7394215 0.5211569076 0.2605784538
[45,] 0.8548238 0.2903524813 0.1451762406
[46,] 0.8280276 0.3439447198 0.1719723599
[47,] 0.7973175 0.4053649482 0.2026824741
[48,] 0.8485910 0.3028180812 0.1514090406
[49,] 0.8257696 0.3484607622 0.1742303811
[50,] 0.8108588 0.3782824586 0.1891412293
[51,] 0.9023199 0.1953601644 0.0976800822
[52,] 0.8913329 0.2173342367 0.1086671183
[53,] 0.8697032 0.2605936376 0.1302968188
[54,] 0.8441044 0.3117911386 0.1558955693
[55,] 0.8689129 0.2621741670 0.1310870835
[56,] 0.8496972 0.3006055152 0.1503027576
[57,] 0.8442810 0.3114379021 0.1557189511
[58,] 0.9250575 0.1498849055 0.0749424528
[59,] 0.9300238 0.1399523398 0.0699761699
[60,] 0.9342464 0.1315071616 0.0657535808
[61,] 0.9170081 0.1659838858 0.0829919429
[62,] 0.9538681 0.0922637672 0.0461318836
[63,] 0.9452242 0.1095516087 0.0547758044
[64,] 0.9627055 0.0745889010 0.0372944505
[65,] 0.9602854 0.0794291799 0.0397145899
[66,] 0.9531820 0.0936360270 0.0468180135
[67,] 0.9527733 0.0944534548 0.0472267274
[68,] 0.9426607 0.1146786078 0.0573393039
[69,] 0.9872506 0.0254988505 0.0127494252
[70,] 0.9833541 0.0332918635 0.0166459317
[71,] 0.9781015 0.0437970373 0.0218985187
[72,] 0.9787881 0.0424237342 0.0212118671
[73,] 0.9994910 0.0010180856 0.0005090428
[74,] 0.9994219 0.0011562355 0.0005781177
[75,] 0.9990907 0.0018186803 0.0009093401
[76,] 0.9986060 0.0027880766 0.0013940383
[77,] 0.9980151 0.0039698153 0.0019849077
[78,] 0.9988084 0.0023832035 0.0011916017
[79,] 0.9982644 0.0034712752 0.0017356376
[80,] 0.9975965 0.0048069375 0.0024034687
[81,] 0.9964258 0.0071483778 0.0035741889
[82,] 0.9966266 0.0067467333 0.0033733666
[83,] 0.9953432 0.0093135578 0.0046567789
[84,] 0.9931372 0.0137256115 0.0068628058
[85,] 0.9908283 0.0183434549 0.0091717274
[86,] 0.9930603 0.0138794599 0.0069397300
[87,] 0.9906777 0.0186445273 0.0093222637
[88,] 0.9888402 0.0223196516 0.0111598258
[89,] 0.9872119 0.0255761390 0.0127880695
[90,] 0.9988461 0.0023078685 0.0011539343
[91,] 0.9981547 0.0036905219 0.0018452609
[92,] 0.9976509 0.0046981345 0.0023490672
[93,] 0.9983152 0.0033696289 0.0016848144
[94,] 0.9989564 0.0020872117 0.0010436058
[95,] 0.9984492 0.0031015744 0.0015507872
[96,] 0.9976560 0.0046880594 0.0023440297
[97,] 0.9962403 0.0075193321 0.0037596661
[98,] 0.9947664 0.0104672080 0.0052336040
[99,] 0.9939507 0.0120985636 0.0060492818
[100,] 0.9922561 0.0154877530 0.0077438765
[101,] 0.9975091 0.0049818697 0.0024909348
[102,] 0.9962518 0.0074963905 0.0037481952
[103,] 0.9949269 0.0101462709 0.0050731354
[104,] 0.9948633 0.0102733667 0.0051366834
[105,] 0.9926141 0.0147717277 0.0073858638
[106,] 0.9894370 0.0211260699 0.0105630350
[107,] 0.9865902 0.0268195426 0.0134097713
[108,] 0.9929688 0.0140624071 0.0070312036
[109,] 0.9986092 0.0027815872 0.0013907936
[110,] 0.9993689 0.0012622207 0.0006311103
[111,] 0.9988281 0.0023437553 0.0011718776
[112,] 0.9988980 0.0022040498 0.0011020249
[113,] 0.9980431 0.0039137395 0.0019568698
[114,] 0.9964908 0.0070184786 0.0035092393
[115,] 0.9929178 0.0141644755 0.0070822377
[116,] 0.9913108 0.0173784306 0.0086892153
[117,] 0.9892575 0.0214850806 0.0107425403
[118,] 0.9993007 0.0013985792 0.0006992896
[119,] 0.9998365 0.0003269297 0.0001634649
[120,] 0.9994838 0.0010323028 0.0005161514
[121,] 0.9982636 0.0034727600 0.0017363800
[122,] 0.9943942 0.0112115303 0.0056057651
[123,] 0.9918503 0.0162993077 0.0081496539
[124,] 0.9727761 0.0544477431 0.0272238715
[125,] 0.9603349 0.0793301336 0.0396650668
> postscript(file="/var/www/rcomp/tmp/1tamv1323979394.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/www/rcomp/tmp/2dz6j1323979394.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/www/rcomp/tmp/3ak921323979394.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/www/rcomp/tmp/4wuz51323979394.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/www/rcomp/tmp/5bixy1323979394.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
59314.2878 -31601.9385 -15036.0683 6385.9111 39545.6877 12970.3004
7 8 9 10 11 12
-3770.8032 -20010.4645 -15057.1105 40013.7259 -4907.9113 -11020.9056
13 14 15 16 17 18
-7949.8002 26836.1952 5702.1056 -17737.2866 -22933.7854 30136.9392
19 20 21 22 23 24
5186.5762 -31095.1350 -10263.7932 -15567.1209 62305.3385 -3220.8196
25 26 27 28 29 30
-14202.7802 22208.8228 6581.9494 -50422.2459 66589.0767 27072.7177
31 32 33 34 35 36
20226.8565 -9689.1229 -19206.4318 43114.1528 12631.4471 -20273.9296
37 38 39 40 41 42
36578.4628 -5926.5202 9289.1610 -84443.5208 11318.9688 16208.2689
43 44 45 46 47 48
-18677.8964 -11002.2103 -5739.5119 20066.2869 -910.8861 39305.5335
49 50 51 52 53 54
16974.5185 19650.3764 -5379.2216 -3500.9274 52465.3576 59673.2734
55 56 57 58 59 60
5429.1357 -7363.8286 46508.2178 -13131.7810 -20718.6185 62501.3616
61 62 63 64 65 66
17784.1699 -7677.0977 -6304.9312 -41352.7786 14539.1323 -26436.3967
67 68 69 70 71 72
-54922.4746 -30719.4386 -25996.6519 2806.0801 48699.8095 -15093.8789
73 74 75 76 77 78
-46076.2313 15226.5311 -11973.9100 28949.2248 -14141.1987 -58861.2520
79 80 81 82 83 84
-9218.3941 -10190.5458 -32902.6795 90184.7925 -24134.1517 334.5671
85 86 87 88 89 90
841.1887 -5377.4846 43844.9769 -12668.1866 6463.2038 3416.3949
91 92 93 94 95 96
-19912.2389 -16284.2134 8172.1044 12752.1399 -28831.4382 21426.1319
97 98 99 100 101 102
-13971.5821 -26020.2371 74086.4773 3411.6863 11596.8746 -41787.8966
103 104 105 106 107 108
9630.8885 9395.6168 -15330.8434 -5959.1878 -27642.9526 14938.4303
109 110 111 112 113 114
-20273.9296 -45680.3623 -2193.3049 -25449.0477 -26047.0324 -14293.2767
115 116 117 118 119 120
-16657.9296 -20273.9296 32268.0492 -32479.3617 31932.4036 -569.3427
121 122 123 124 125 126
13829.7873 -27238.7695 -10520.7260 -9229.4866 20428.5379 -21029.2841
127 128 129 130 131 132
-11416.0537 32082.8823 10020.1782 -9756.0038 -12646.9296 8695.6573
133 134 135 136 137 138
-13437.9296 19343.8484 -21546.3005 3309.2497 -20273.9296 25158.0017
139 140 141 142 143 144
7818.6258 -13142.9296 -16079.9296 14293.7725 2837.6728 -22523.6637
> postscript(file="/var/www/rcomp/tmp/6oajv1323979394.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 59314.2878 NA
1 -31601.9385 59314.2878
2 -15036.0683 -31601.9385
3 6385.9111 -15036.0683
4 39545.6877 6385.9111
5 12970.3004 39545.6877
6 -3770.8032 12970.3004
7 -20010.4645 -3770.8032
8 -15057.1105 -20010.4645
9 40013.7259 -15057.1105
10 -4907.9113 40013.7259
11 -11020.9056 -4907.9113
12 -7949.8002 -11020.9056
13 26836.1952 -7949.8002
14 5702.1056 26836.1952
15 -17737.2866 5702.1056
16 -22933.7854 -17737.2866
17 30136.9392 -22933.7854
18 5186.5762 30136.9392
19 -31095.1350 5186.5762
20 -10263.7932 -31095.1350
21 -15567.1209 -10263.7932
22 62305.3385 -15567.1209
23 -3220.8196 62305.3385
24 -14202.7802 -3220.8196
25 22208.8228 -14202.7802
26 6581.9494 22208.8228
27 -50422.2459 6581.9494
28 66589.0767 -50422.2459
29 27072.7177 66589.0767
30 20226.8565 27072.7177
31 -9689.1229 20226.8565
32 -19206.4318 -9689.1229
33 43114.1528 -19206.4318
34 12631.4471 43114.1528
35 -20273.9296 12631.4471
36 36578.4628 -20273.9296
37 -5926.5202 36578.4628
38 9289.1610 -5926.5202
39 -84443.5208 9289.1610
40 11318.9688 -84443.5208
41 16208.2689 11318.9688
42 -18677.8964 16208.2689
43 -11002.2103 -18677.8964
44 -5739.5119 -11002.2103
45 20066.2869 -5739.5119
46 -910.8861 20066.2869
47 39305.5335 -910.8861
48 16974.5185 39305.5335
49 19650.3764 16974.5185
50 -5379.2216 19650.3764
51 -3500.9274 -5379.2216
52 52465.3576 -3500.9274
53 59673.2734 52465.3576
54 5429.1357 59673.2734
55 -7363.8286 5429.1357
56 46508.2178 -7363.8286
57 -13131.7810 46508.2178
58 -20718.6185 -13131.7810
59 62501.3616 -20718.6185
60 17784.1699 62501.3616
61 -7677.0977 17784.1699
62 -6304.9312 -7677.0977
63 -41352.7786 -6304.9312
64 14539.1323 -41352.7786
65 -26436.3967 14539.1323
66 -54922.4746 -26436.3967
67 -30719.4386 -54922.4746
68 -25996.6519 -30719.4386
69 2806.0801 -25996.6519
70 48699.8095 2806.0801
71 -15093.8789 48699.8095
72 -46076.2313 -15093.8789
73 15226.5311 -46076.2313
74 -11973.9100 15226.5311
75 28949.2248 -11973.9100
76 -14141.1987 28949.2248
77 -58861.2520 -14141.1987
78 -9218.3941 -58861.2520
79 -10190.5458 -9218.3941
80 -32902.6795 -10190.5458
81 90184.7925 -32902.6795
82 -24134.1517 90184.7925
83 334.5671 -24134.1517
84 841.1887 334.5671
85 -5377.4846 841.1887
86 43844.9769 -5377.4846
87 -12668.1866 43844.9769
88 6463.2038 -12668.1866
89 3416.3949 6463.2038
90 -19912.2389 3416.3949
91 -16284.2134 -19912.2389
92 8172.1044 -16284.2134
93 12752.1399 8172.1044
94 -28831.4382 12752.1399
95 21426.1319 -28831.4382
96 -13971.5821 21426.1319
97 -26020.2371 -13971.5821
98 74086.4773 -26020.2371
99 3411.6863 74086.4773
100 11596.8746 3411.6863
101 -41787.8966 11596.8746
102 9630.8885 -41787.8966
103 9395.6168 9630.8885
104 -15330.8434 9395.6168
105 -5959.1878 -15330.8434
106 -27642.9526 -5959.1878
107 14938.4303 -27642.9526
108 -20273.9296 14938.4303
109 -45680.3623 -20273.9296
110 -2193.3049 -45680.3623
111 -25449.0477 -2193.3049
112 -26047.0324 -25449.0477
113 -14293.2767 -26047.0324
114 -16657.9296 -14293.2767
115 -20273.9296 -16657.9296
116 32268.0492 -20273.9296
117 -32479.3617 32268.0492
118 31932.4036 -32479.3617
119 -569.3427 31932.4036
120 13829.7873 -569.3427
121 -27238.7695 13829.7873
122 -10520.7260 -27238.7695
123 -9229.4866 -10520.7260
124 20428.5379 -9229.4866
125 -21029.2841 20428.5379
126 -11416.0537 -21029.2841
127 32082.8823 -11416.0537
128 10020.1782 32082.8823
129 -9756.0038 10020.1782
130 -12646.9296 -9756.0038
131 8695.6573 -12646.9296
132 -13437.9296 8695.6573
133 19343.8484 -13437.9296
134 -21546.3005 19343.8484
135 3309.2497 -21546.3005
136 -20273.9296 3309.2497
137 25158.0017 -20273.9296
138 7818.6258 25158.0017
139 -13142.9296 7818.6258
140 -16079.9296 -13142.9296
141 14293.7725 -16079.9296
142 2837.6728 14293.7725
143 -22523.6637 2837.6728
144 NA -22523.6637
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -31601.9385 59314.2878
[2,] -15036.0683 -31601.9385
[3,] 6385.9111 -15036.0683
[4,] 39545.6877 6385.9111
[5,] 12970.3004 39545.6877
[6,] -3770.8032 12970.3004
[7,] -20010.4645 -3770.8032
[8,] -15057.1105 -20010.4645
[9,] 40013.7259 -15057.1105
[10,] -4907.9113 40013.7259
[11,] -11020.9056 -4907.9113
[12,] -7949.8002 -11020.9056
[13,] 26836.1952 -7949.8002
[14,] 5702.1056 26836.1952
[15,] -17737.2866 5702.1056
[16,] -22933.7854 -17737.2866
[17,] 30136.9392 -22933.7854
[18,] 5186.5762 30136.9392
[19,] -31095.1350 5186.5762
[20,] -10263.7932 -31095.1350
[21,] -15567.1209 -10263.7932
[22,] 62305.3385 -15567.1209
[23,] -3220.8196 62305.3385
[24,] -14202.7802 -3220.8196
[25,] 22208.8228 -14202.7802
[26,] 6581.9494 22208.8228
[27,] -50422.2459 6581.9494
[28,] 66589.0767 -50422.2459
[29,] 27072.7177 66589.0767
[30,] 20226.8565 27072.7177
[31,] -9689.1229 20226.8565
[32,] -19206.4318 -9689.1229
[33,] 43114.1528 -19206.4318
[34,] 12631.4471 43114.1528
[35,] -20273.9296 12631.4471
[36,] 36578.4628 -20273.9296
[37,] -5926.5202 36578.4628
[38,] 9289.1610 -5926.5202
[39,] -84443.5208 9289.1610
[40,] 11318.9688 -84443.5208
[41,] 16208.2689 11318.9688
[42,] -18677.8964 16208.2689
[43,] -11002.2103 -18677.8964
[44,] -5739.5119 -11002.2103
[45,] 20066.2869 -5739.5119
[46,] -910.8861 20066.2869
[47,] 39305.5335 -910.8861
[48,] 16974.5185 39305.5335
[49,] 19650.3764 16974.5185
[50,] -5379.2216 19650.3764
[51,] -3500.9274 -5379.2216
[52,] 52465.3576 -3500.9274
[53,] 59673.2734 52465.3576
[54,] 5429.1357 59673.2734
[55,] -7363.8286 5429.1357
[56,] 46508.2178 -7363.8286
[57,] -13131.7810 46508.2178
[58,] -20718.6185 -13131.7810
[59,] 62501.3616 -20718.6185
[60,] 17784.1699 62501.3616
[61,] -7677.0977 17784.1699
[62,] -6304.9312 -7677.0977
[63,] -41352.7786 -6304.9312
[64,] 14539.1323 -41352.7786
[65,] -26436.3967 14539.1323
[66,] -54922.4746 -26436.3967
[67,] -30719.4386 -54922.4746
[68,] -25996.6519 -30719.4386
[69,] 2806.0801 -25996.6519
[70,] 48699.8095 2806.0801
[71,] -15093.8789 48699.8095
[72,] -46076.2313 -15093.8789
[73,] 15226.5311 -46076.2313
[74,] -11973.9100 15226.5311
[75,] 28949.2248 -11973.9100
[76,] -14141.1987 28949.2248
[77,] -58861.2520 -14141.1987
[78,] -9218.3941 -58861.2520
[79,] -10190.5458 -9218.3941
[80,] -32902.6795 -10190.5458
[81,] 90184.7925 -32902.6795
[82,] -24134.1517 90184.7925
[83,] 334.5671 -24134.1517
[84,] 841.1887 334.5671
[85,] -5377.4846 841.1887
[86,] 43844.9769 -5377.4846
[87,] -12668.1866 43844.9769
[88,] 6463.2038 -12668.1866
[89,] 3416.3949 6463.2038
[90,] -19912.2389 3416.3949
[91,] -16284.2134 -19912.2389
[92,] 8172.1044 -16284.2134
[93,] 12752.1399 8172.1044
[94,] -28831.4382 12752.1399
[95,] 21426.1319 -28831.4382
[96,] -13971.5821 21426.1319
[97,] -26020.2371 -13971.5821
[98,] 74086.4773 -26020.2371
[99,] 3411.6863 74086.4773
[100,] 11596.8746 3411.6863
[101,] -41787.8966 11596.8746
[102,] 9630.8885 -41787.8966
[103,] 9395.6168 9630.8885
[104,] -15330.8434 9395.6168
[105,] -5959.1878 -15330.8434
[106,] -27642.9526 -5959.1878
[107,] 14938.4303 -27642.9526
[108,] -20273.9296 14938.4303
[109,] -45680.3623 -20273.9296
[110,] -2193.3049 -45680.3623
[111,] -25449.0477 -2193.3049
[112,] -26047.0324 -25449.0477
[113,] -14293.2767 -26047.0324
[114,] -16657.9296 -14293.2767
[115,] -20273.9296 -16657.9296
[116,] 32268.0492 -20273.9296
[117,] -32479.3617 32268.0492
[118,] 31932.4036 -32479.3617
[119,] -569.3427 31932.4036
[120,] 13829.7873 -569.3427
[121,] -27238.7695 13829.7873
[122,] -10520.7260 -27238.7695
[123,] -9229.4866 -10520.7260
[124,] 20428.5379 -9229.4866
[125,] -21029.2841 20428.5379
[126,] -11416.0537 -21029.2841
[127,] 32082.8823 -11416.0537
[128,] 10020.1782 32082.8823
[129,] -9756.0038 10020.1782
[130,] -12646.9296 -9756.0038
[131,] 8695.6573 -12646.9296
[132,] -13437.9296 8695.6573
[133,] 19343.8484 -13437.9296
[134,] -21546.3005 19343.8484
[135,] 3309.2497 -21546.3005
[136,] -20273.9296 3309.2497
[137,] 25158.0017 -20273.9296
[138,] 7818.6258 25158.0017
[139,] -13142.9296 7818.6258
[140,] -16079.9296 -13142.9296
[141,] 14293.7725 -16079.9296
[142,] 2837.6728 14293.7725
[143,] -22523.6637 2837.6728
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -31601.9385 59314.2878
2 -15036.0683 -31601.9385
3 6385.9111 -15036.0683
4 39545.6877 6385.9111
5 12970.3004 39545.6877
6 -3770.8032 12970.3004
7 -20010.4645 -3770.8032
8 -15057.1105 -20010.4645
9 40013.7259 -15057.1105
10 -4907.9113 40013.7259
11 -11020.9056 -4907.9113
12 -7949.8002 -11020.9056
13 26836.1952 -7949.8002
14 5702.1056 26836.1952
15 -17737.2866 5702.1056
16 -22933.7854 -17737.2866
17 30136.9392 -22933.7854
18 5186.5762 30136.9392
19 -31095.1350 5186.5762
20 -10263.7932 -31095.1350
21 -15567.1209 -10263.7932
22 62305.3385 -15567.1209
23 -3220.8196 62305.3385
24 -14202.7802 -3220.8196
25 22208.8228 -14202.7802
26 6581.9494 22208.8228
27 -50422.2459 6581.9494
28 66589.0767 -50422.2459
29 27072.7177 66589.0767
30 20226.8565 27072.7177
31 -9689.1229 20226.8565
32 -19206.4318 -9689.1229
33 43114.1528 -19206.4318
34 12631.4471 43114.1528
35 -20273.9296 12631.4471
36 36578.4628 -20273.9296
37 -5926.5202 36578.4628
38 9289.1610 -5926.5202
39 -84443.5208 9289.1610
40 11318.9688 -84443.5208
41 16208.2689 11318.9688
42 -18677.8964 16208.2689
43 -11002.2103 -18677.8964
44 -5739.5119 -11002.2103
45 20066.2869 -5739.5119
46 -910.8861 20066.2869
47 39305.5335 -910.8861
48 16974.5185 39305.5335
49 19650.3764 16974.5185
50 -5379.2216 19650.3764
51 -3500.9274 -5379.2216
52 52465.3576 -3500.9274
53 59673.2734 52465.3576
54 5429.1357 59673.2734
55 -7363.8286 5429.1357
56 46508.2178 -7363.8286
57 -13131.7810 46508.2178
58 -20718.6185 -13131.7810
59 62501.3616 -20718.6185
60 17784.1699 62501.3616
61 -7677.0977 17784.1699
62 -6304.9312 -7677.0977
63 -41352.7786 -6304.9312
64 14539.1323 -41352.7786
65 -26436.3967 14539.1323
66 -54922.4746 -26436.3967
67 -30719.4386 -54922.4746
68 -25996.6519 -30719.4386
69 2806.0801 -25996.6519
70 48699.8095 2806.0801
71 -15093.8789 48699.8095
72 -46076.2313 -15093.8789
73 15226.5311 -46076.2313
74 -11973.9100 15226.5311
75 28949.2248 -11973.9100
76 -14141.1987 28949.2248
77 -58861.2520 -14141.1987
78 -9218.3941 -58861.2520
79 -10190.5458 -9218.3941
80 -32902.6795 -10190.5458
81 90184.7925 -32902.6795
82 -24134.1517 90184.7925
83 334.5671 -24134.1517
84 841.1887 334.5671
85 -5377.4846 841.1887
86 43844.9769 -5377.4846
87 -12668.1866 43844.9769
88 6463.2038 -12668.1866
89 3416.3949 6463.2038
90 -19912.2389 3416.3949
91 -16284.2134 -19912.2389
92 8172.1044 -16284.2134
93 12752.1399 8172.1044
94 -28831.4382 12752.1399
95 21426.1319 -28831.4382
96 -13971.5821 21426.1319
97 -26020.2371 -13971.5821
98 74086.4773 -26020.2371
99 3411.6863 74086.4773
100 11596.8746 3411.6863
101 -41787.8966 11596.8746
102 9630.8885 -41787.8966
103 9395.6168 9630.8885
104 -15330.8434 9395.6168
105 -5959.1878 -15330.8434
106 -27642.9526 -5959.1878
107 14938.4303 -27642.9526
108 -20273.9296 14938.4303
109 -45680.3623 -20273.9296
110 -2193.3049 -45680.3623
111 -25449.0477 -2193.3049
112 -26047.0324 -25449.0477
113 -14293.2767 -26047.0324
114 -16657.9296 -14293.2767
115 -20273.9296 -16657.9296
116 32268.0492 -20273.9296
117 -32479.3617 32268.0492
118 31932.4036 -32479.3617
119 -569.3427 31932.4036
120 13829.7873 -569.3427
121 -27238.7695 13829.7873
122 -10520.7260 -27238.7695
123 -9229.4866 -10520.7260
124 20428.5379 -9229.4866
125 -21029.2841 20428.5379
126 -11416.0537 -21029.2841
127 32082.8823 -11416.0537
128 10020.1782 32082.8823
129 -9756.0038 10020.1782
130 -12646.9296 -9756.0038
131 8695.6573 -12646.9296
132 -13437.9296 8695.6573
133 19343.8484 -13437.9296
134 -21546.3005 19343.8484
135 3309.2497 -21546.3005
136 -20273.9296 3309.2497
137 25158.0017 -20273.9296
138 7818.6258 25158.0017
139 -13142.9296 7818.6258
140 -16079.9296 -13142.9296
141 14293.7725 -16079.9296
142 2837.6728 14293.7725
143 -22523.6637 2837.6728
> 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/www/rcomp/tmp/7njt91323979394.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/www/rcomp/tmp/8v1up1323979394.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/www/rcomp/tmp/9cgkq1323979394.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/www/rcomp/tmp/10frap1323979394.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/www/rcomp/tmp/11cjs81323979394.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/www/rcomp/tmp/12drdp1323979394.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/www/rcomp/tmp/13abny1323979394.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/www/rcomp/tmp/14l7t81323979394.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/www/rcomp/tmp/15rmim1323979394.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/www/rcomp/tmp/16ocb01323979394.tab")
+ }
>
> try(system("convert tmp/1tamv1323979394.ps tmp/1tamv1323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/2dz6j1323979394.ps tmp/2dz6j1323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ak921323979394.ps tmp/3ak921323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/4wuz51323979394.ps tmp/4wuz51323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/5bixy1323979394.ps tmp/5bixy1323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/6oajv1323979394.ps tmp/6oajv1323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/7njt91323979394.ps tmp/7njt91323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/8v1up1323979394.ps tmp/8v1up1323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/9cgkq1323979394.ps tmp/9cgkq1323979394.png",intern=TRUE))
character(0)
> try(system("convert tmp/10frap1323979394.ps tmp/10frap1323979394.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.260 0.230 4.466