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(18
+ ,264528
+ ,749
+ ,70
+ ,30
+ ,106
+ ,59635
+ ,15
+ ,257677
+ ,592
+ ,67
+ ,31
+ ,111
+ ,84607
+ ,13
+ ,256402
+ ,801
+ ,111
+ ,35
+ ,124
+ ,162365
+ ,12
+ ,255100
+ ,823
+ ,93
+ ,22
+ ,56
+ ,58233
+ ,11
+ ,254825
+ ,1174
+ ,91
+ ,27
+ ,98
+ ,104911
+ ,10
+ ,254150
+ ,1155
+ ,126
+ ,35
+ ,122
+ ,70817
+ ,19
+ ,249232
+ ,1151
+ ,68
+ ,21
+ ,57
+ ,73586
+ ,18
+ ,247024
+ ,916
+ ,106
+ ,22
+ ,77
+ ,120087
+ ,13
+ ,245107
+ ,824
+ ,96
+ ,31
+ ,101
+ ,109104
+ ,15
+ ,244272
+ ,1024
+ ,104
+ ,31
+ ,109
+ ,72631
+ ,12
+ ,243625
+ ,835
+ ,89
+ ,27
+ ,100
+ ,85224
+ ,11
+ ,226191
+ ,939
+ ,44
+ ,24
+ ,88
+ ,67271
+ ,13
+ ,224205
+ ,1084
+ ,78
+ ,25
+ ,75
+ ,55071
+ ,14
+ ,223590
+ ,1033
+ ,81
+ ,34
+ ,113
+ ,117986
+ ,12
+ ,212060
+ ,689
+ ,116
+ ,26
+ ,90
+ ,81493
+ ,17
+ ,209795
+ ,772
+ ,87
+ ,24
+ ,91
+ ,63717
+ ,18
+ ,206879
+ ,824
+ ,94
+ ,21
+ ,57
+ ,114425
+ ,13
+ ,204030
+ ,521
+ ,88
+ ,30
+ ,107
+ ,64664
+ ,15
+ ,201748
+ ,569
+ ,121
+ ,33
+ ,104
+ ,86281
+ ,12
+ ,201744
+ ,713
+ ,95
+ ,40
+ ,150
+ ,83038
+ ,11
+ ,199232
+ ,571
+ ,122
+ ,24
+ ,69
+ ,123328
+ ,10
+ ,198797
+ ,627
+ ,76
+ ,20
+ ,75
+ ,79194
+ ,14
+ ,198432
+ ,767
+ ,74
+ ,22
+ ,45
+ ,73795
+ ,17
+ ,197266
+ ,753
+ ,87
+ ,24
+ ,87
+ ,101653
+ ,13
+ ,197197
+ ,566
+ ,94
+ ,30
+ ,91
+ ,63958
+ ,12
+ ,194652
+ ,613
+ ,78
+ ,33
+ ,118
+ ,65196
+ ,16
+ ,193518
+ ,622
+ ,56
+ ,24
+ ,91
+ ,70111
+ ,15
+ ,193024
+ ,690
+ ,76
+ ,36
+ ,108
+ ,62932
+ ,12
+ ,190926
+ ,603
+ ,98
+ ,25
+ ,85
+ ,72369
+ ,10
+ ,189461
+ ,768
+ ,86
+ ,24
+ ,82
+ ,57637
+ ,19
+ ,189401
+ ,595
+ ,87
+ ,30
+ ,113
+ ,96750
+ ,16
+ ,188150
+ ,573
+ ,95
+ ,30
+ ,100
+ ,54628
+ ,17
+ ,187714
+ ,655
+ ,108
+ ,24
+ ,80
+ ,74482
+ ,13
+ ,187483
+ ,580
+ ,49
+ ,24
+ ,85
+ ,76168
+ ,12
+ ,185366
+ ,537
+ ,114
+ ,29
+ ,100
+ ,111436
+ ,11
+ ,185288
+ ,582
+ ,97
+ ,27
+ ,55
+ ,38885
+ ,16
+ ,182581
+ ,603
+ ,108
+ ,26
+ ,81
+ ,103646
+ ,13
+ ,181110
+ ,486
+ ,85
+ ,24
+ ,91
+ ,105965
+ ,14
+ ,180042
+ ,478
+ ,87
+ ,36
+ ,136
+ ,101773
+ ,16
+ ,176625
+ ,397
+ ,51
+ ,23
+ ,87
+ ,90257
+ ,18
+ ,174150
+ ,596
+ ,56
+ ,19
+ ,40
+ ,85903
+ ,10
+ ,173587
+ ,654
+ ,70
+ ,20
+ ,70
+ ,71170
+ ,11
+ ,173535
+ ,592
+ ,51
+ ,26
+ ,92
+ ,70027
+ ,12
+ ,173260
+ ,716
+ ,41
+ ,21
+ ,78
+ ,37238
+ ,15
+ ,172071
+ ,549
+ ,49
+ ,30
+ ,59
+ ,43460
+ ,16
+ ,170588
+ ,333
+ ,65
+ ,26
+ ,84
+ ,95556
+ ,12
+ ,169613
+ ,735
+ ,79
+ ,24
+ ,88
+ ,48204
+ ,10
+ ,168059
+ ,391
+ ,84
+ ,26
+ ,85
+ ,60029
+ ,18
+ ,167255
+ ,669
+ ,71
+ ,25
+ ,69
+ ,37048
+ ,14
+ ,166822
+ ,465
+ ,79
+ ,27
+ ,82
+ ,82204
+ ,16
+ ,164604
+ ,528
+ ,64
+ ,30
+ ,102
+ ,52295
+ ,17
+ ,162716
+ ,391
+ ,93
+ ,27
+ ,98
+ ,56316
+ ,13
+ ,161756
+ ,695
+ ,75
+ ,21
+ ,59
+ ,65911
+ ,12
+ ,159940
+ ,485
+ ,100
+ ,30
+ ,112
+ ,74349
+ ,14
+ ,158835
+ ,477
+ ,84
+ ,30
+ ,106
+ ,61704
+ ,11
+ ,158054
+ ,432
+ ,73
+ ,31
+ ,103
+ ,91939
+ ,16
+ ,152510
+ ,873
+ ,99
+ ,25
+ ,85
+ ,79774
+ ,14
+ ,152366
+ ,446
+ ,93
+ ,24
+ ,74
+ ,83042
+ ,13
+ ,152193
+ ,450
+ ,110
+ ,25
+ ,91
+ ,76013
+ ,15
+ ,150999
+ ,567
+ ,98
+ ,24
+ ,80
+ ,68608
+ ,10
+ ,149006
+ ,616
+ ,82
+ ,22
+ ,61
+ ,71181
+ ,11
+ ,146342
+ ,850
+ ,103
+ ,28
+ ,99
+ ,55027
+ ,14
+ ,145908
+ ,527
+ ,61
+ ,24
+ ,65
+ ,65724
+ ,16
+ ,145696
+ ,710
+ ,51
+ ,31
+ ,61
+ ,36311
+ ,13
+ ,145285
+ ,636
+ ,66
+ ,28
+ ,88
+ ,57231
+ ,15
+ ,145142
+ ,704
+ ,70
+ ,24
+ ,86
+ ,56699
+ ,17
+ ,142339
+ ,397
+ ,75
+ ,20
+ ,67
+ ,125410
+ ,11
+ ,142064
+ ,390
+ ,38
+ ,24
+ ,80
+ ,73713
+ ,13
+ ,141933
+ ,427
+ ,90
+ ,27
+ ,75
+ ,51370
+ ,14
+ ,141582
+ ,470
+ ,54
+ ,22
+ ,76
+ ,55901
+ ,10
+ ,141574
+ ,393
+ ,62
+ ,29
+ ,59
+ ,38439
+ ,17
+ ,139409
+ ,678
+ ,70
+ ,24
+ ,79
+ ,99518
+ ,14
+ ,139144
+ ,344
+ ,57
+ ,21
+ ,76
+ ,56530
+ ,12
+ ,138191
+ ,451
+ ,57
+ ,21
+ ,72
+ ,54506
+ ,15
+ ,137885
+ ,450
+ ,42
+ ,20
+ ,48
+ ,42564
+ ,13
+ ,137544
+ ,388
+ ,40
+ ,31
+ ,110
+ ,94137
+ ,10
+ ,135261
+ ,311
+ ,31
+ ,33
+ ,102
+ ,73087
+ ,11
+ ,135251
+ ,339
+ ,85
+ ,25
+ ,38
+ ,64102
+ ,13
+ ,133561
+ ,454
+ ,42
+ ,24
+ ,40
+ ,28340
+ ,15
+ ,132798
+ ,570
+ ,27
+ ,22
+ ,83
+ ,38417
+ ,11
+ ,131108
+ ,646
+ ,79
+ ,30
+ ,101
+ ,56733
+ ,14
+ ,130539
+ ,420
+ ,60
+ ,20
+ ,47
+ ,48821
+ ,9
+ ,130533
+ ,387
+ ,64
+ ,20
+ ,76
+ ,85168
+ ,7
+ ,129762
+ ,511
+ ,55
+ ,26
+ ,74
+ ,38650
+ ,15
+ ,129484
+ ,394
+ ,44
+ ,33
+ ,92
+ ,53009
+ ,5
+ ,128734
+ ,342
+ ,72
+ ,18
+ ,65
+ ,55064
+ ,13
+ ,128274
+ ,358
+ ,71
+ ,37
+ ,123
+ ,63262
+ ,3
+ ,127930
+ ,441
+ ,75
+ ,21
+ ,35
+ ,66477
+ ,6
+ ,127493
+ ,507
+ ,69
+ ,15
+ ,22
+ ,34497
+ ,9
+ ,126630
+ ,449
+ ,51
+ ,25
+ ,91
+ ,58425
+ ,15
+ ,125927
+ ,474
+ ,87
+ ,24
+ ,61
+ ,51360
+ ,3
+ ,122024
+ ,368
+ ,50
+ ,20
+ ,51
+ ,42051
+ ,7
+ ,120362
+ ,438
+ ,48
+ ,25
+ ,75
+ ,49319
+ ,17
+ ,118807
+ ,468
+ ,56
+ ,25
+ ,81
+ ,55827
+ ,8
+ ,118522
+ ,388
+ ,58
+ ,25
+ ,41
+ ,63016
+ ,9
+ ,117926
+ ,320
+ ,65
+ ,15
+ ,35
+ ,40671
+ ,11
+ ,117815
+ ,729
+ ,108
+ ,27
+ ,92
+ ,99501
+ ,5
+ ,116502
+ ,580
+ ,37
+ ,19
+ ,68
+ ,77411
+ ,9
+ ,115971
+ ,445
+ ,48
+ ,25
+ ,63
+ ,40001
+ ,12
+ ,113853
+ ,338
+ ,78
+ ,19
+ ,53
+ ,82043
+ ,6
+ ,113461
+ ,414
+ ,64
+ ,19
+ ,72
+ ,89041
+ ,8
+ ,112004
+ ,403
+ ,28
+ ,21
+ ,63
+ ,37361
+ ,11
+ ,109237
+ ,641
+ ,24
+ ,21
+ ,62
+ ,15430
+ ,7
+ ,108278
+ ,307
+ ,81
+ ,30
+ ,120
+ ,70780
+ ,9
+ ,106888
+ ,406
+ ,42
+ ,21
+ ,71
+ ,26982
+ ,12
+ ,106351
+ ,341
+ ,30
+ ,20
+ ,37
+ ,29467
+ ,4
+ ,106193
+ ,271
+ ,57
+ ,23
+ ,70
+ ,202316
+ ,5
+ ,105477
+ ,341
+ ,39
+ ,16
+ ,29
+ ,49288
+ ,10
+ ,104367
+ ,443
+ ,38
+ ,23
+ ,69
+ ,50466
+ ,7
+ ,103239
+ ,506
+ ,41
+ ,24
+ ,63
+ ,43448
+ ,11
+ ,98791
+ ,447
+ ,48
+ ,18
+ ,55
+ ,36252
+ ,5
+ ,98724
+ ,251
+ ,46
+ ,23
+ ,86
+ ,72571
+ ,9
+ ,98393
+ ,335
+ ,94
+ ,23
+ ,79
+ ,56979
+ ,8
+ ,98066
+ ,434
+ ,30
+ ,14
+ ,41
+ ,31701
+ ,10
+ ,95297
+ ,275
+ ,42
+ ,15
+ ,51
+ ,37137
+ ,3
+ ,94006
+ ,355
+ ,83
+ ,24
+ ,76
+ ,46765
+ ,11
+ ,93125
+ ,836
+ ,30
+ ,21
+ ,29
+ ,50838
+ ,5
+ ,91838
+ ,400
+ ,100
+ ,18
+ ,62
+ ,59155
+ ,13
+ ,91290
+ ,290
+ ,57
+ ,27
+ ,66
+ ,21067
+ ,6
+ ,90961
+ ,298
+ ,42
+ ,22
+ ,78
+ ,63785
+ ,8
+ ,89318
+ ,292
+ ,75
+ ,22
+ ,78
+ ,44970
+ ,11
+ ,86621
+ ,223
+ ,54
+ ,20
+ ,72
+ ,54565
+ ,5
+ ,86206
+ ,186
+ ,41
+ ,15
+ ,30
+ ,31258
+ ,9
+ ,81106
+ ,300
+ ,31
+ ,21
+ ,59
+ ,35838
+ ,11
+ ,80964
+ ,216
+ ,30
+ ,8
+ ,18
+ ,26998
+ ,7
+ ,80953
+ ,437
+ ,49
+ ,8
+ ,27
+ ,56622
+ ,4
+ ,78800
+ ,330
+ ,20
+ ,26
+ ,66
+ ,33032
+ ,9
+ ,78256
+ ,242
+ ,3
+ ,12
+ ,19
+ ,47261
+ ,13
+ ,77166
+ ,248
+ ,16
+ ,24
+ ,71
+ ,62147
+ ,6
+ ,76470
+ ,312
+ ,28
+ ,20
+ ,57
+ ,35606
+ ,9
+ ,74567
+ ,353
+ ,18
+ ,20
+ ,50
+ ,62832
+ ,12
+ ,74112
+ ,215
+ ,28
+ ,19
+ ,54
+ ,174949
+ ,5
+ ,73567
+ ,187
+ ,37
+ ,23
+ ,31
+ ,23238
+ ,7
+ ,69471
+ ,364
+ ,22
+ ,20
+ ,63
+ ,22618
+ ,15
+ ,68538
+ ,172
+ ,29
+ ,20
+ ,75
+ ,36990
+ ,3
+ ,68388
+ ,376
+ ,105
+ ,32
+ ,112
+ ,78956
+ ,7
+ ,65029
+ ,255
+ ,21
+ ,18
+ ,61
+ ,32551
+ ,4
+ ,61857
+ ,192
+ ,23
+ ,11
+ ,30
+ ,25162
+ ,7
+ ,50999
+ ,225
+ ,2
+ ,20
+ ,66
+ ,63989
+ ,11
+ ,46660
+ ,259
+ ,12
+ ,5
+ ,13
+ ,6179
+ ,9
+ ,43287
+ ,214
+ ,13
+ ,19
+ ,64
+ ,43750
+ ,6
+ ,38214
+ ,276
+ ,16
+ ,8
+ ,21
+ ,8773
+ ,10
+ ,37257
+ ,111
+ ,0
+ ,16
+ ,53
+ ,52491
+ ,7
+ ,32750
+ ,102
+ ,1
+ ,18
+ ,22
+ ,22807
+ ,9
+ ,31414
+ ,200
+ ,18
+ ,8
+ ,9
+ ,14116)
+ ,dim=c(7
+ ,145)
+ ,dimnames=list(c('Score'
+ ,'Time'
+ ,'CCViews'
+ ,'Blogs'
+ ,'Reviews'
+ ,'LFM'
+ ,'Totalcharacters')
+ ,1:145))
> y <- array(NA,dim=c(7,145),dimnames=list(c('Score','Time','CCViews','Blogs','Reviews','LFM','Totalcharacters'),1:145))
> 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
Score Time CCViews Blogs Reviews LFM Totalcharacters
1 18 264528 749 70 30 106 59635
2 15 257677 592 67 31 111 84607
3 13 256402 801 111 35 124 162365
4 12 255100 823 93 22 56 58233
5 11 254825 1174 91 27 98 104911
6 10 254150 1155 126 35 122 70817
7 19 249232 1151 68 21 57 73586
8 18 247024 916 106 22 77 120087
9 13 245107 824 96 31 101 109104
10 15 244272 1024 104 31 109 72631
11 12 243625 835 89 27 100 85224
12 11 226191 939 44 24 88 67271
13 13 224205 1084 78 25 75 55071
14 14 223590 1033 81 34 113 117986
15 12 212060 689 116 26 90 81493
16 17 209795 772 87 24 91 63717
17 18 206879 824 94 21 57 114425
18 13 204030 521 88 30 107 64664
19 15 201748 569 121 33 104 86281
20 12 201744 713 95 40 150 83038
21 11 199232 571 122 24 69 123328
22 10 198797 627 76 20 75 79194
23 14 198432 767 74 22 45 73795
24 17 197266 753 87 24 87 101653
25 13 197197 566 94 30 91 63958
26 12 194652 613 78 33 118 65196
27 16 193518 622 56 24 91 70111
28 15 193024 690 76 36 108 62932
29 12 190926 603 98 25 85 72369
30 10 189461 768 86 24 82 57637
31 19 189401 595 87 30 113 96750
32 16 188150 573 95 30 100 54628
33 17 187714 655 108 24 80 74482
34 13 187483 580 49 24 85 76168
35 12 185366 537 114 29 100 111436
36 11 185288 582 97 27 55 38885
37 16 182581 603 108 26 81 103646
38 13 181110 486 85 24 91 105965
39 14 180042 478 87 36 136 101773
40 16 176625 397 51 23 87 90257
41 18 174150 596 56 19 40 85903
42 10 173587 654 70 20 70 71170
43 11 173535 592 51 26 92 70027
44 12 173260 716 41 21 78 37238
45 15 172071 549 49 30 59 43460
46 16 170588 333 65 26 84 95556
47 12 169613 735 79 24 88 48204
48 10 168059 391 84 26 85 60029
49 18 167255 669 71 25 69 37048
50 14 166822 465 79 27 82 82204
51 16 164604 528 64 30 102 52295
52 17 162716 391 93 27 98 56316
53 13 161756 695 75 21 59 65911
54 12 159940 485 100 30 112 74349
55 14 158835 477 84 30 106 61704
56 11 158054 432 73 31 103 91939
57 16 152510 873 99 25 85 79774
58 14 152366 446 93 24 74 83042
59 13 152193 450 110 25 91 76013
60 15 150999 567 98 24 80 68608
61 10 149006 616 82 22 61 71181
62 11 146342 850 103 28 99 55027
63 14 145908 527 61 24 65 65724
64 16 145696 710 51 31 61 36311
65 13 145285 636 66 28 88 57231
66 15 145142 704 70 24 86 56699
67 17 142339 397 75 20 67 125410
68 11 142064 390 38 24 80 73713
69 13 141933 427 90 27 75 51370
70 14 141582 470 54 22 76 55901
71 10 141574 393 62 29 59 38439
72 17 139409 678 70 24 79 99518
73 14 139144 344 57 21 76 56530
74 12 138191 451 57 21 72 54506
75 15 137885 450 42 20 48 42564
76 13 137544 388 40 31 110 94137
77 10 135261 311 31 33 102 73087
78 11 135251 339 85 25 38 64102
79 13 133561 454 42 24 40 28340
80 15 132798 570 27 22 83 38417
81 11 131108 646 79 30 101 56733
82 14 130539 420 60 20 47 48821
83 9 130533 387 64 20 76 85168
84 7 129762 511 55 26 74 38650
85 15 129484 394 44 33 92 53009
86 5 128734 342 72 18 65 55064
87 13 128274 358 71 37 123 63262
88 3 127930 441 75 21 35 66477
89 6 127493 507 69 15 22 34497
90 9 126630 449 51 25 91 58425
91 15 125927 474 87 24 61 51360
92 3 122024 368 50 20 51 42051
93 7 120362 438 48 25 75 49319
94 17 118807 468 56 25 81 55827
95 8 118522 388 58 25 41 63016
96 9 117926 320 65 15 35 40671
97 11 117815 729 108 27 92 99501
98 5 116502 580 37 19 68 77411
99 9 115971 445 48 25 63 40001
100 12 113853 338 78 19 53 82043
101 6 113461 414 64 19 72 89041
102 8 112004 403 28 21 63 37361
103 11 109237 641 24 21 62 15430
104 7 108278 307 81 30 120 70780
105 9 106888 406 42 21 71 26982
106 12 106351 341 30 20 37 29467
107 4 106193 271 57 23 70 202316
108 5 105477 341 39 16 29 49288
109 10 104367 443 38 23 69 50466
110 7 103239 506 41 24 63 43448
111 11 98791 447 48 18 55 36252
112 5 98724 251 46 23 86 72571
113 9 98393 335 94 23 79 56979
114 8 98066 434 30 14 41 31701
115 10 95297 275 42 15 51 37137
116 3 94006 355 83 24 76 46765
117 11 93125 836 30 21 29 50838
118 5 91838 400 100 18 62 59155
119 13 91290 290 57 27 66 21067
120 6 90961 298 42 22 78 63785
121 8 89318 292 75 22 78 44970
122 11 86621 223 54 20 72 54565
123 5 86206 186 41 15 30 31258
124 9 81106 300 31 21 59 35838
125 11 80964 216 30 8 18 26998
126 7 80953 437 49 8 27 56622
127 4 78800 330 20 26 66 33032
128 9 78256 242 3 12 19 47261
129 13 77166 248 16 24 71 62147
130 6 76470 312 28 20 57 35606
131 9 74567 353 18 20 50 62832
132 12 74112 215 28 19 54 174949
133 5 73567 187 37 23 31 23238
134 7 69471 364 22 20 63 22618
135 15 68538 172 29 20 75 36990
136 3 68388 376 105 32 112 78956
137 7 65029 255 21 18 61 32551
138 4 61857 192 23 11 30 25162
139 7 50999 225 2 20 66 63989
140 11 46660 259 12 5 13 6179
141 9 43287 214 13 19 64 43750
142 6 38214 276 16 8 21 8773
143 10 37257 111 0 16 53 52491
144 7 32750 102 1 18 22 22807
145 9 31414 200 18 8 9 14116
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Time CCViews Blogs
5.065e+00 4.540e-05 -2.305e-04 -1.665e-02
Reviews LFM Totalcharacters
3.325e-02 2.007e-03 1.176e-06
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.5039 -2.0887 -0.0047 2.5540 6.5225
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.065e+00 1.181e+00 4.288 3.36e-05 ***
Time 4.540e-05 1.048e-05 4.331 2.84e-05 ***
CCViews -2.305e-04 2.123e-03 -0.109 0.914
Blogs -1.665e-02 1.355e-02 -1.229 0.221
Reviews 3.325e-02 8.722e-02 0.381 0.704
LFM 2.007e-03 2.010e-02 0.100 0.921
Totalcharacters 1.176e-06 1.090e-05 0.108 0.914
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.21 on 138 degrees of freedom
Multiple R-squared: 0.3474, Adjusted R-squared: 0.319
F-statistic: 12.24 on 6 and 138 DF, p-value: 5.163e-11
> 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.747873053 0.50425389 0.2521269
[2,] 0.777218815 0.44556237 0.2227812
[3,] 0.783088108 0.43382378 0.2169119
[4,] 0.709739146 0.58052171 0.2902609
[5,] 0.658186600 0.68362680 0.3418134
[6,] 0.569348018 0.86130396 0.4306520
[7,] 0.619581924 0.76083615 0.3804181
[8,] 0.572747745 0.85450451 0.4272523
[9,] 0.484308947 0.96861789 0.5156911
[10,] 0.420255421 0.84051084 0.5797446
[11,] 0.349909187 0.69981837 0.6500908
[12,] 0.415184918 0.83036984 0.5848151
[13,] 0.485673068 0.97134614 0.5143269
[14,] 0.421604148 0.84320830 0.5783959
[15,] 0.436928611 0.87385722 0.5630714
[16,] 0.367219915 0.73443983 0.6327801
[17,] 0.313198130 0.62639626 0.6868019
[18,] 0.270464623 0.54092925 0.7295354
[19,] 0.229437636 0.45887527 0.7705624
[20,] 0.190407571 0.38081514 0.8095924
[21,] 0.202485943 0.40497189 0.7975141
[22,] 0.318046184 0.63609237 0.6819538
[23,] 0.310393507 0.62078701 0.6896065
[24,] 0.328805024 0.65761005 0.6711950
[25,] 0.302477024 0.60495405 0.6975230
[26,] 0.266930917 0.53386183 0.7330691
[27,] 0.248536439 0.49707288 0.7514636
[28,] 0.225712294 0.45142459 0.7742877
[29,] 0.193599716 0.38719943 0.8064003
[30,] 0.155461246 0.31092249 0.8445388
[31,] 0.125746497 0.25149299 0.8742535
[32,] 0.121755637 0.24351127 0.8782444
[33,] 0.153991660 0.30798332 0.8460083
[34,] 0.162642247 0.32528449 0.8373578
[35,] 0.144886624 0.28977325 0.8551134
[36,] 0.115602666 0.23120533 0.8843973
[37,] 0.096180006 0.19236001 0.9038200
[38,] 0.077897382 0.15579476 0.9221026
[39,] 0.082078354 0.16415671 0.9179216
[40,] 0.116822207 0.23364441 0.8831778
[41,] 0.092907681 0.18581536 0.9070923
[42,] 0.085681729 0.17136346 0.9143183
[43,] 0.107634908 0.21526982 0.8923651
[44,] 0.086691284 0.17338257 0.9133087
[45,] 0.068890700 0.13778140 0.9311093
[46,] 0.054551616 0.10910323 0.9454484
[47,] 0.053344561 0.10668912 0.9466554
[48,] 0.054611453 0.10922291 0.9453885
[49,] 0.044864340 0.08972868 0.9551357
[50,] 0.035760764 0.07152153 0.9642392
[51,] 0.033048687 0.06609737 0.9669513
[52,] 0.036685794 0.07337159 0.9633142
[53,] 0.028768613 0.05753723 0.9712314
[54,] 0.022442790 0.04488558 0.9775572
[55,] 0.020192311 0.04038462 0.9798077
[56,] 0.015035577 0.03007115 0.9849644
[57,] 0.013149557 0.02629911 0.9868504
[58,] 0.018704460 0.03740892 0.9812955
[59,] 0.018891666 0.03778333 0.9811083
[60,] 0.015890680 0.03178136 0.9841093
[61,] 0.012671552 0.02534310 0.9873284
[62,] 0.013633570 0.02726714 0.9863664
[63,] 0.021137570 0.04227514 0.9788624
[64,] 0.018478568 0.03695714 0.9815214
[65,] 0.015080634 0.03016127 0.9849194
[66,] 0.015078622 0.03015724 0.9849214
[67,] 0.012016725 0.02403345 0.9879833
[68,] 0.012381608 0.02476322 0.9876184
[69,] 0.012266967 0.02453393 0.9877330
[70,] 0.010275247 0.02055049 0.9897248
[71,] 0.009638800 0.01927760 0.9903612
[72,] 0.007657310 0.01531462 0.9923427
[73,] 0.009219385 0.01843877 0.9907806
[74,] 0.011392083 0.02278417 0.9886079
[75,] 0.018454670 0.03690934 0.9815453
[76,] 0.022468702 0.04493740 0.9775313
[77,] 0.051540302 0.10308060 0.9484597
[78,] 0.050119394 0.10023879 0.9498806
[79,] 0.161686687 0.32337337 0.8383133
[80,] 0.190028146 0.38005629 0.8099719
[81,] 0.174716702 0.34943340 0.8252833
[82,] 0.264758462 0.52951692 0.7352415
[83,] 0.459273354 0.91854671 0.5407266
[84,] 0.469288194 0.93857639 0.5307118
[85,] 0.697186889 0.60562622 0.3028131
[86,] 0.672217937 0.65556413 0.3277821
[87,] 0.629298149 0.74140370 0.3707019
[88,] 0.657949581 0.68410084 0.3420504
[89,] 0.742349322 0.51530136 0.2576507
[90,] 0.703263093 0.59347381 0.2967369
[91,] 0.751726914 0.49654617 0.2482731
[92,] 0.753880707 0.49223859 0.2461193
[93,] 0.728781982 0.54243604 0.2712180
[94,] 0.681935245 0.63612951 0.3180648
[95,] 0.652753877 0.69449225 0.3472461
[96,] 0.600337401 0.79932520 0.3996626
[97,] 0.600744184 0.79851163 0.3992558
[98,] 0.677933714 0.64413257 0.3220663
[99,] 0.707440027 0.58511995 0.2925600
[100,] 0.658291436 0.68341713 0.3417086
[101,] 0.623164121 0.75367176 0.3768359
[102,] 0.599781990 0.80043602 0.4002180
[103,] 0.654908155 0.69018369 0.3450918
[104,] 0.632283525 0.73543295 0.3677165
[105,] 0.583326424 0.83334715 0.4166736
[106,] 0.524212735 0.95157453 0.4757873
[107,] 0.563689057 0.87262189 0.4363109
[108,] 0.681609512 0.63678098 0.3183905
[109,] 0.631159063 0.73768187 0.3688409
[110,] 0.867794856 0.26441029 0.1322051
[111,] 0.882274703 0.23545059 0.1177253
[112,] 0.840543118 0.31891376 0.1594569
[113,] 0.801420686 0.39715863 0.1985793
[114,] 0.828144600 0.34371080 0.1718554
[115,] 0.781936500 0.43612700 0.2180635
[116,] 0.723630389 0.55273922 0.2763696
[117,] 0.644903948 0.71019210 0.3550961
[118,] 0.620067894 0.75986421 0.3799321
[119,] 0.534672958 0.93065408 0.4653270
[120,] 0.572513750 0.85497250 0.4274862
[121,] 0.489211347 0.97842269 0.5107887
[122,] 0.432082291 0.86416458 0.5679177
[123,] 0.634720759 0.73055848 0.3652792
[124,] 0.585419359 0.82916128 0.4145806
[125,] 0.450990722 0.90198144 0.5490093
[126,] 0.586782821 0.82643436 0.4132172
> postscript(file="/var/wessaorg/rcomp/tmp/18mmb1321989413.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/2ofd01321989413.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/3p3ge1321989413.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/4hp8u1321989413.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/5vp7h1321989413.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 = 145
Frequency = 1
1 2 3 4 5 6
0.984193511 -1.863588042 -3.275245410 -3.819707346 -5.065047820 -5.729942738
7 8 9 10 11 12
3.119109278 2.669990984 -2.765225194 -0.521154146 -3.648913414 -4.438008246
13 14 15 16 17 18
-1.740987003 -1.124336385 -1.742230658 2.982133389 4.351437925 -1.030068727
19 20 21 22 23 24
1.515049024 -2.205843958 -2.027695221 -3.588304127 0.427283781 3.509955691
25 26 27 28 29 30
-0.576630589 -1.872124027 2.162676698 1.109205972 -1.048403769 -3.087129418
31 32 33 34 35 36
5.584677708 2.845251997 4.316741637 -0.684695377 -0.753769518 -1.780869922
37 38 39 40 41 42
3.434983435 0.135441288 0.731022830 2.812023404 5.285961576 -2.518080691
43 44 45 46 47 48
-2.088748365 -0.981334932 1.898963239 3.204541515 -0.311228242 -2.311078403
49 50 51 52 53 54
5.665368718 1.625559956 3.386235146 5.026395930 1.106745150 0.141619968
55 56 57 58 59 60
1.950376027 -1.270519607 4.765748145 2.625419997 1.858221651 3.803570077
61 62 63 64 65 66
-1.259529045 0.008328079 2.442742121 4.137870716 1.410252805 3.636670778
67 68 69 70 71 72
5.866766611 -0.836881694 1.980190459 2.565380729 -1.496859370 5.854640962
73 74 75 76 77 78
2.729489479 0.807823004 3.667121626 1.084197457 -2.005491900 0.305760354
79 80 81 82 83 84
1.764125066 3.544032952 0.180658500 3.288125486 -1.753527481 -3.980619508
85 86 87 88 89 90
3.536083748 -5.425024001 1.825124814 -7.368700403 -4.170392300 -1.943465194
91 92 93 94 95 96
4.795539212 -7.503917924 -3.668598396 6.522451684 -2.377916409 -0.879148908
97 98 99 100 101 102
1.353756395 -5.463325810 -1.432607598 2.308646676 -3.935564011 -2.459190669
103 104 105 106 107 108
0.682455064 -2.882403676 -0.996935883 1.911167628 -6.017330682 -4.773519289
109 110 111 112 113 114
-0.030676227 -2.927939168 1.600978638 -4.745627559 0.120561177 -1.502444249
115 116 117 118 119 120
0.726757021 -5.874091047 1.583360740 -3.269149103 3.751744850 -3.389361110
121 122 123 124 125 126
-0.744433268 2.079609716 -3.848649407 -0.020472732 2.474869440 -1.210149584
127 128 129 130 131 132
-5.269065760 -0.004703306 3.741823864 -2.819674656 0.091656486 3.140444129
133 134 135 136 137 138
-3.599831668 -1.586653150 6.487048114 -4.715959093 -1.367945743 -3.901514479
139 140 141 142 143 144
-1.167874327 3.876556823 1.423951789 -0.788335127 2.568990313 -0.181205901
145
2.553956958
> postscript(file="/var/wessaorg/rcomp/tmp/6jcx11321989413.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 = 145
Frequency = 1
lag(myerror, k = 1) myerror
0 0.984193511 NA
1 -1.863588042 0.984193511
2 -3.275245410 -1.863588042
3 -3.819707346 -3.275245410
4 -5.065047820 -3.819707346
5 -5.729942738 -5.065047820
6 3.119109278 -5.729942738
7 2.669990984 3.119109278
8 -2.765225194 2.669990984
9 -0.521154146 -2.765225194
10 -3.648913414 -0.521154146
11 -4.438008246 -3.648913414
12 -1.740987003 -4.438008246
13 -1.124336385 -1.740987003
14 -1.742230658 -1.124336385
15 2.982133389 -1.742230658
16 4.351437925 2.982133389
17 -1.030068727 4.351437925
18 1.515049024 -1.030068727
19 -2.205843958 1.515049024
20 -2.027695221 -2.205843958
21 -3.588304127 -2.027695221
22 0.427283781 -3.588304127
23 3.509955691 0.427283781
24 -0.576630589 3.509955691
25 -1.872124027 -0.576630589
26 2.162676698 -1.872124027
27 1.109205972 2.162676698
28 -1.048403769 1.109205972
29 -3.087129418 -1.048403769
30 5.584677708 -3.087129418
31 2.845251997 5.584677708
32 4.316741637 2.845251997
33 -0.684695377 4.316741637
34 -0.753769518 -0.684695377
35 -1.780869922 -0.753769518
36 3.434983435 -1.780869922
37 0.135441288 3.434983435
38 0.731022830 0.135441288
39 2.812023404 0.731022830
40 5.285961576 2.812023404
41 -2.518080691 5.285961576
42 -2.088748365 -2.518080691
43 -0.981334932 -2.088748365
44 1.898963239 -0.981334932
45 3.204541515 1.898963239
46 -0.311228242 3.204541515
47 -2.311078403 -0.311228242
48 5.665368718 -2.311078403
49 1.625559956 5.665368718
50 3.386235146 1.625559956
51 5.026395930 3.386235146
52 1.106745150 5.026395930
53 0.141619968 1.106745150
54 1.950376027 0.141619968
55 -1.270519607 1.950376027
56 4.765748145 -1.270519607
57 2.625419997 4.765748145
58 1.858221651 2.625419997
59 3.803570077 1.858221651
60 -1.259529045 3.803570077
61 0.008328079 -1.259529045
62 2.442742121 0.008328079
63 4.137870716 2.442742121
64 1.410252805 4.137870716
65 3.636670778 1.410252805
66 5.866766611 3.636670778
67 -0.836881694 5.866766611
68 1.980190459 -0.836881694
69 2.565380729 1.980190459
70 -1.496859370 2.565380729
71 5.854640962 -1.496859370
72 2.729489479 5.854640962
73 0.807823004 2.729489479
74 3.667121626 0.807823004
75 1.084197457 3.667121626
76 -2.005491900 1.084197457
77 0.305760354 -2.005491900
78 1.764125066 0.305760354
79 3.544032952 1.764125066
80 0.180658500 3.544032952
81 3.288125486 0.180658500
82 -1.753527481 3.288125486
83 -3.980619508 -1.753527481
84 3.536083748 -3.980619508
85 -5.425024001 3.536083748
86 1.825124814 -5.425024001
87 -7.368700403 1.825124814
88 -4.170392300 -7.368700403
89 -1.943465194 -4.170392300
90 4.795539212 -1.943465194
91 -7.503917924 4.795539212
92 -3.668598396 -7.503917924
93 6.522451684 -3.668598396
94 -2.377916409 6.522451684
95 -0.879148908 -2.377916409
96 1.353756395 -0.879148908
97 -5.463325810 1.353756395
98 -1.432607598 -5.463325810
99 2.308646676 -1.432607598
100 -3.935564011 2.308646676
101 -2.459190669 -3.935564011
102 0.682455064 -2.459190669
103 -2.882403676 0.682455064
104 -0.996935883 -2.882403676
105 1.911167628 -0.996935883
106 -6.017330682 1.911167628
107 -4.773519289 -6.017330682
108 -0.030676227 -4.773519289
109 -2.927939168 -0.030676227
110 1.600978638 -2.927939168
111 -4.745627559 1.600978638
112 0.120561177 -4.745627559
113 -1.502444249 0.120561177
114 0.726757021 -1.502444249
115 -5.874091047 0.726757021
116 1.583360740 -5.874091047
117 -3.269149103 1.583360740
118 3.751744850 -3.269149103
119 -3.389361110 3.751744850
120 -0.744433268 -3.389361110
121 2.079609716 -0.744433268
122 -3.848649407 2.079609716
123 -0.020472732 -3.848649407
124 2.474869440 -0.020472732
125 -1.210149584 2.474869440
126 -5.269065760 -1.210149584
127 -0.004703306 -5.269065760
128 3.741823864 -0.004703306
129 -2.819674656 3.741823864
130 0.091656486 -2.819674656
131 3.140444129 0.091656486
132 -3.599831668 3.140444129
133 -1.586653150 -3.599831668
134 6.487048114 -1.586653150
135 -4.715959093 6.487048114
136 -1.367945743 -4.715959093
137 -3.901514479 -1.367945743
138 -1.167874327 -3.901514479
139 3.876556823 -1.167874327
140 1.423951789 3.876556823
141 -0.788335127 1.423951789
142 2.568990313 -0.788335127
143 -0.181205901 2.568990313
144 2.553956958 -0.181205901
145 NA 2.553956958
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.863588042 0.984193511
[2,] -3.275245410 -1.863588042
[3,] -3.819707346 -3.275245410
[4,] -5.065047820 -3.819707346
[5,] -5.729942738 -5.065047820
[6,] 3.119109278 -5.729942738
[7,] 2.669990984 3.119109278
[8,] -2.765225194 2.669990984
[9,] -0.521154146 -2.765225194
[10,] -3.648913414 -0.521154146
[11,] -4.438008246 -3.648913414
[12,] -1.740987003 -4.438008246
[13,] -1.124336385 -1.740987003
[14,] -1.742230658 -1.124336385
[15,] 2.982133389 -1.742230658
[16,] 4.351437925 2.982133389
[17,] -1.030068727 4.351437925
[18,] 1.515049024 -1.030068727
[19,] -2.205843958 1.515049024
[20,] -2.027695221 -2.205843958
[21,] -3.588304127 -2.027695221
[22,] 0.427283781 -3.588304127
[23,] 3.509955691 0.427283781
[24,] -0.576630589 3.509955691
[25,] -1.872124027 -0.576630589
[26,] 2.162676698 -1.872124027
[27,] 1.109205972 2.162676698
[28,] -1.048403769 1.109205972
[29,] -3.087129418 -1.048403769
[30,] 5.584677708 -3.087129418
[31,] 2.845251997 5.584677708
[32,] 4.316741637 2.845251997
[33,] -0.684695377 4.316741637
[34,] -0.753769518 -0.684695377
[35,] -1.780869922 -0.753769518
[36,] 3.434983435 -1.780869922
[37,] 0.135441288 3.434983435
[38,] 0.731022830 0.135441288
[39,] 2.812023404 0.731022830
[40,] 5.285961576 2.812023404
[41,] -2.518080691 5.285961576
[42,] -2.088748365 -2.518080691
[43,] -0.981334932 -2.088748365
[44,] 1.898963239 -0.981334932
[45,] 3.204541515 1.898963239
[46,] -0.311228242 3.204541515
[47,] -2.311078403 -0.311228242
[48,] 5.665368718 -2.311078403
[49,] 1.625559956 5.665368718
[50,] 3.386235146 1.625559956
[51,] 5.026395930 3.386235146
[52,] 1.106745150 5.026395930
[53,] 0.141619968 1.106745150
[54,] 1.950376027 0.141619968
[55,] -1.270519607 1.950376027
[56,] 4.765748145 -1.270519607
[57,] 2.625419997 4.765748145
[58,] 1.858221651 2.625419997
[59,] 3.803570077 1.858221651
[60,] -1.259529045 3.803570077
[61,] 0.008328079 -1.259529045
[62,] 2.442742121 0.008328079
[63,] 4.137870716 2.442742121
[64,] 1.410252805 4.137870716
[65,] 3.636670778 1.410252805
[66,] 5.866766611 3.636670778
[67,] -0.836881694 5.866766611
[68,] 1.980190459 -0.836881694
[69,] 2.565380729 1.980190459
[70,] -1.496859370 2.565380729
[71,] 5.854640962 -1.496859370
[72,] 2.729489479 5.854640962
[73,] 0.807823004 2.729489479
[74,] 3.667121626 0.807823004
[75,] 1.084197457 3.667121626
[76,] -2.005491900 1.084197457
[77,] 0.305760354 -2.005491900
[78,] 1.764125066 0.305760354
[79,] 3.544032952 1.764125066
[80,] 0.180658500 3.544032952
[81,] 3.288125486 0.180658500
[82,] -1.753527481 3.288125486
[83,] -3.980619508 -1.753527481
[84,] 3.536083748 -3.980619508
[85,] -5.425024001 3.536083748
[86,] 1.825124814 -5.425024001
[87,] -7.368700403 1.825124814
[88,] -4.170392300 -7.368700403
[89,] -1.943465194 -4.170392300
[90,] 4.795539212 -1.943465194
[91,] -7.503917924 4.795539212
[92,] -3.668598396 -7.503917924
[93,] 6.522451684 -3.668598396
[94,] -2.377916409 6.522451684
[95,] -0.879148908 -2.377916409
[96,] 1.353756395 -0.879148908
[97,] -5.463325810 1.353756395
[98,] -1.432607598 -5.463325810
[99,] 2.308646676 -1.432607598
[100,] -3.935564011 2.308646676
[101,] -2.459190669 -3.935564011
[102,] 0.682455064 -2.459190669
[103,] -2.882403676 0.682455064
[104,] -0.996935883 -2.882403676
[105,] 1.911167628 -0.996935883
[106,] -6.017330682 1.911167628
[107,] -4.773519289 -6.017330682
[108,] -0.030676227 -4.773519289
[109,] -2.927939168 -0.030676227
[110,] 1.600978638 -2.927939168
[111,] -4.745627559 1.600978638
[112,] 0.120561177 -4.745627559
[113,] -1.502444249 0.120561177
[114,] 0.726757021 -1.502444249
[115,] -5.874091047 0.726757021
[116,] 1.583360740 -5.874091047
[117,] -3.269149103 1.583360740
[118,] 3.751744850 -3.269149103
[119,] -3.389361110 3.751744850
[120,] -0.744433268 -3.389361110
[121,] 2.079609716 -0.744433268
[122,] -3.848649407 2.079609716
[123,] -0.020472732 -3.848649407
[124,] 2.474869440 -0.020472732
[125,] -1.210149584 2.474869440
[126,] -5.269065760 -1.210149584
[127,] -0.004703306 -5.269065760
[128,] 3.741823864 -0.004703306
[129,] -2.819674656 3.741823864
[130,] 0.091656486 -2.819674656
[131,] 3.140444129 0.091656486
[132,] -3.599831668 3.140444129
[133,] -1.586653150 -3.599831668
[134,] 6.487048114 -1.586653150
[135,] -4.715959093 6.487048114
[136,] -1.367945743 -4.715959093
[137,] -3.901514479 -1.367945743
[138,] -1.167874327 -3.901514479
[139,] 3.876556823 -1.167874327
[140,] 1.423951789 3.876556823
[141,] -0.788335127 1.423951789
[142,] 2.568990313 -0.788335127
[143,] -0.181205901 2.568990313
[144,] 2.553956958 -0.181205901
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.863588042 0.984193511
2 -3.275245410 -1.863588042
3 -3.819707346 -3.275245410
4 -5.065047820 -3.819707346
5 -5.729942738 -5.065047820
6 3.119109278 -5.729942738
7 2.669990984 3.119109278
8 -2.765225194 2.669990984
9 -0.521154146 -2.765225194
10 -3.648913414 -0.521154146
11 -4.438008246 -3.648913414
12 -1.740987003 -4.438008246
13 -1.124336385 -1.740987003
14 -1.742230658 -1.124336385
15 2.982133389 -1.742230658
16 4.351437925 2.982133389
17 -1.030068727 4.351437925
18 1.515049024 -1.030068727
19 -2.205843958 1.515049024
20 -2.027695221 -2.205843958
21 -3.588304127 -2.027695221
22 0.427283781 -3.588304127
23 3.509955691 0.427283781
24 -0.576630589 3.509955691
25 -1.872124027 -0.576630589
26 2.162676698 -1.872124027
27 1.109205972 2.162676698
28 -1.048403769 1.109205972
29 -3.087129418 -1.048403769
30 5.584677708 -3.087129418
31 2.845251997 5.584677708
32 4.316741637 2.845251997
33 -0.684695377 4.316741637
34 -0.753769518 -0.684695377
35 -1.780869922 -0.753769518
36 3.434983435 -1.780869922
37 0.135441288 3.434983435
38 0.731022830 0.135441288
39 2.812023404 0.731022830
40 5.285961576 2.812023404
41 -2.518080691 5.285961576
42 -2.088748365 -2.518080691
43 -0.981334932 -2.088748365
44 1.898963239 -0.981334932
45 3.204541515 1.898963239
46 -0.311228242 3.204541515
47 -2.311078403 -0.311228242
48 5.665368718 -2.311078403
49 1.625559956 5.665368718
50 3.386235146 1.625559956
51 5.026395930 3.386235146
52 1.106745150 5.026395930
53 0.141619968 1.106745150
54 1.950376027 0.141619968
55 -1.270519607 1.950376027
56 4.765748145 -1.270519607
57 2.625419997 4.765748145
58 1.858221651 2.625419997
59 3.803570077 1.858221651
60 -1.259529045 3.803570077
61 0.008328079 -1.259529045
62 2.442742121 0.008328079
63 4.137870716 2.442742121
64 1.410252805 4.137870716
65 3.636670778 1.410252805
66 5.866766611 3.636670778
67 -0.836881694 5.866766611
68 1.980190459 -0.836881694
69 2.565380729 1.980190459
70 -1.496859370 2.565380729
71 5.854640962 -1.496859370
72 2.729489479 5.854640962
73 0.807823004 2.729489479
74 3.667121626 0.807823004
75 1.084197457 3.667121626
76 -2.005491900 1.084197457
77 0.305760354 -2.005491900
78 1.764125066 0.305760354
79 3.544032952 1.764125066
80 0.180658500 3.544032952
81 3.288125486 0.180658500
82 -1.753527481 3.288125486
83 -3.980619508 -1.753527481
84 3.536083748 -3.980619508
85 -5.425024001 3.536083748
86 1.825124814 -5.425024001
87 -7.368700403 1.825124814
88 -4.170392300 -7.368700403
89 -1.943465194 -4.170392300
90 4.795539212 -1.943465194
91 -7.503917924 4.795539212
92 -3.668598396 -7.503917924
93 6.522451684 -3.668598396
94 -2.377916409 6.522451684
95 -0.879148908 -2.377916409
96 1.353756395 -0.879148908
97 -5.463325810 1.353756395
98 -1.432607598 -5.463325810
99 2.308646676 -1.432607598
100 -3.935564011 2.308646676
101 -2.459190669 -3.935564011
102 0.682455064 -2.459190669
103 -2.882403676 0.682455064
104 -0.996935883 -2.882403676
105 1.911167628 -0.996935883
106 -6.017330682 1.911167628
107 -4.773519289 -6.017330682
108 -0.030676227 -4.773519289
109 -2.927939168 -0.030676227
110 1.600978638 -2.927939168
111 -4.745627559 1.600978638
112 0.120561177 -4.745627559
113 -1.502444249 0.120561177
114 0.726757021 -1.502444249
115 -5.874091047 0.726757021
116 1.583360740 -5.874091047
117 -3.269149103 1.583360740
118 3.751744850 -3.269149103
119 -3.389361110 3.751744850
120 -0.744433268 -3.389361110
121 2.079609716 -0.744433268
122 -3.848649407 2.079609716
123 -0.020472732 -3.848649407
124 2.474869440 -0.020472732
125 -1.210149584 2.474869440
126 -5.269065760 -1.210149584
127 -0.004703306 -5.269065760
128 3.741823864 -0.004703306
129 -2.819674656 3.741823864
130 0.091656486 -2.819674656
131 3.140444129 0.091656486
132 -3.599831668 3.140444129
133 -1.586653150 -3.599831668
134 6.487048114 -1.586653150
135 -4.715959093 6.487048114
136 -1.367945743 -4.715959093
137 -3.901514479 -1.367945743
138 -1.167874327 -3.901514479
139 3.876556823 -1.167874327
140 1.423951789 3.876556823
141 -0.788335127 1.423951789
142 2.568990313 -0.788335127
143 -0.181205901 2.568990313
144 2.553956958 -0.181205901
> 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/7q5r41321989413.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/8ms5v1321989413.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/9fr731321989413.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/107k4x1321989413.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/11okb51321989413.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/129k041321989413.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/1397ms1321989413.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/14jkua1321989413.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/15qled1321989413.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/16ej8t1321989413.tab")
+ }
>
> try(system("convert tmp/18mmb1321989413.ps tmp/18mmb1321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ofd01321989413.ps tmp/2ofd01321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/3p3ge1321989413.ps tmp/3p3ge1321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/4hp8u1321989413.ps tmp/4hp8u1321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/5vp7h1321989413.ps tmp/5vp7h1321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/6jcx11321989413.ps tmp/6jcx11321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/7q5r41321989413.ps tmp/7q5r41321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ms5v1321989413.ps tmp/8ms5v1321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/9fr731321989413.ps tmp/9fr731321989413.png",intern=TRUE))
character(0)
> try(system("convert tmp/107k4x1321989413.ps tmp/107k4x1321989413.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.815 0.504 5.432