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(829
+ ,58198
+ ,49
+ ,233
+ ,538
+ ,65968
+ ,24
+ ,157
+ ,186
+ ,7176
+ ,17
+ ,70
+ ,1405
+ ,78306
+ ,66
+ ,360
+ ,1947
+ ,127587
+ ,83
+ ,683
+ ,3534
+ ,250877
+ ,127
+ ,906
+ ,811
+ ,65936
+ ,33
+ ,275
+ ,609
+ ,72513
+ ,30
+ ,142
+ ,1151
+ ,72507
+ ,32
+ ,297
+ ,1779
+ ,170683
+ ,63
+ ,604
+ ,834
+ ,66288
+ ,34
+ ,256
+ ,1211
+ ,94815
+ ,43
+ ,380
+ ,897
+ ,45496
+ ,67
+ ,330
+ ,1574
+ ,83049
+ ,59
+ ,525
+ ,688
+ ,66960
+ ,24
+ ,202
+ ,854
+ ,72377
+ ,38
+ ,313
+ ,848
+ ,61175
+ ,32
+ ,197
+ ,324
+ ,15580
+ ,20
+ ,85
+ ,1602
+ ,71693
+ ,54
+ ,494
+ ,412
+ ,13397
+ ,13
+ ,131
+ ,618
+ ,38921
+ ,35
+ ,233
+ ,1244
+ ,97709
+ ,49
+ ,351
+ ,616
+ ,47899
+ ,27
+ ,227
+ ,1107
+ ,61674
+ ,30
+ ,317
+ ,1079
+ ,77395
+ ,50
+ ,367
+ ,611
+ ,65152
+ ,11
+ ,223
+ ,1188
+ ,88286
+ ,94
+ ,390
+ ,618
+ ,75108
+ ,50
+ ,145
+ ,1392
+ ,182314
+ ,58
+ ,445
+ ,1189
+ ,91721
+ ,25
+ ,481
+ ,752
+ ,56374
+ ,27
+ ,223
+ ,1055
+ ,104756
+ ,23
+ ,361
+ ,1044
+ ,50485
+ ,56
+ ,325
+ ,580
+ ,29013
+ ,39
+ ,169
+ ,1116
+ ,90349
+ ,29
+ ,380
+ ,0
+ ,0
+ ,0
+ ,0
+ ,626
+ ,61484
+ ,33
+ ,280
+ ,1183
+ ,65245
+ ,34
+ ,363
+ ,1016
+ ,35361
+ ,20
+ ,211
+ ,1076
+ ,106880
+ ,34
+ ,381
+ ,1061
+ ,82577
+ ,33
+ ,340
+ ,680
+ ,53655
+ ,25
+ ,277
+ ,404
+ ,40064
+ ,12
+ ,140
+ ,1026
+ ,66118
+ ,44
+ ,397
+ ,643
+ ,55561
+ ,28
+ ,218
+ ,415
+ ,31331
+ ,30
+ ,140
+ ,328
+ ,31350
+ ,12
+ ,92
+ ,960
+ ,93341
+ ,53
+ ,333
+ ,769
+ ,57002
+ ,39
+ ,256
+ ,1066
+ ,60206
+ ,27
+ ,414
+ ,425
+ ,33820
+ ,20
+ ,129
+ ,696
+ ,49791
+ ,35
+ ,189
+ ,1020
+ ,113697
+ ,41
+ ,422
+ ,890
+ ,97673
+ ,43
+ ,310
+ ,916
+ ,89612
+ ,32
+ ,333
+ ,898
+ ,66268
+ ,29
+ ,285
+ ,696
+ ,64319
+ ,24
+ ,204
+ ,383
+ ,25090
+ ,11
+ ,118
+ ,566
+ ,62131
+ ,37
+ ,193
+ ,548
+ ,23630
+ ,22
+ ,194
+ ,457
+ ,31969
+ ,21
+ ,139
+ ,782
+ ,32592
+ ,34
+ ,291
+ ,535
+ ,35738
+ ,19
+ ,176
+ ,475
+ ,42406
+ ,18
+ ,145
+ ,374
+ ,47859
+ ,12
+ ,122
+ ,771
+ ,55240
+ ,22
+ ,256
+ ,1140
+ ,65341
+ ,42
+ ,296
+ ,1502
+ ,61854
+ ,44
+ ,425
+ ,500
+ ,35185
+ ,19
+ ,138
+ ,82
+ ,12207
+ ,10
+ ,25
+ ,1569
+ ,112537
+ ,72
+ ,490
+ ,568
+ ,43886
+ ,24
+ ,179
+ ,606
+ ,49028
+ ,33
+ ,224
+ ,918
+ ,40699
+ ,39
+ ,265
+ ,833
+ ,46357
+ ,20
+ ,293
+ ,460
+ ,17667
+ ,19
+ ,136
+ ,685
+ ,59058
+ ,27
+ ,209
+ ,888
+ ,54106
+ ,38
+ ,301
+ ,410
+ ,23795
+ ,13
+ ,118
+ ,615
+ ,34323
+ ,34
+ ,241
+ ,447
+ ,37071
+ ,29
+ ,106
+ ,650
+ ,78258
+ ,26
+ ,254
+ ,545
+ ,32392
+ ,15
+ ,172
+ ,830
+ ,55020
+ ,19
+ ,307
+ ,515
+ ,29613
+ ,25
+ ,176
+ ,853
+ ,56879
+ ,28
+ ,260
+ ,1312
+ ,109785
+ ,108
+ ,291
+ ,400
+ ,24612
+ ,25
+ ,107
+ ,404
+ ,38010
+ ,22
+ ,139
+ ,639
+ ,53398
+ ,22
+ ,194
+ ,773
+ ,54198
+ ,20
+ ,295
+ ,1075
+ ,66038
+ ,43
+ ,317
+ ,510
+ ,61352
+ ,28
+ ,166
+ ,573
+ ,48096
+ ,29
+ ,210
+ ,434
+ ,25194
+ ,22
+ ,182
+ ,1294
+ ,118291
+ ,57
+ ,442
+ ,718
+ ,71876
+ ,27
+ ,225
+ ,222
+ ,19349
+ ,11
+ ,67
+ ,880
+ ,67369
+ ,51
+ ,271
+ ,816
+ ,54015
+ ,35
+ ,332
+ ,305
+ ,19719
+ ,14
+ ,111
+ ,425
+ ,25497
+ ,11
+ ,141
+ ,578
+ ,55049
+ ,36
+ ,182
+ ,306
+ ,24912
+ ,21
+ ,83
+ ,367
+ ,28591
+ ,19
+ ,80
+ ,463
+ ,24716
+ ,13
+ ,152
+ ,520
+ ,52452
+ ,16
+ ,130
+ ,294
+ ,17850
+ ,16
+ ,71
+ ,0
+ ,0
+ ,0
+ ,0
+ ,566
+ ,35269
+ ,12
+ ,152
+ ,463
+ ,27554
+ ,31
+ ,149
+ ,630
+ ,55167
+ ,12
+ ,196
+ ,632
+ ,42982
+ ,33
+ ,179
+ ,462
+ ,42115
+ ,40
+ ,163
+ ,38
+ ,3058
+ ,4
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,592
+ ,96347
+ ,24
+ ,196
+ ,631
+ ,43490
+ ,26
+ ,238
+ ,925
+ ,62694
+ ,47
+ ,263
+ ,441
+ ,36901
+ ,20
+ ,170
+ ,778
+ ,43410
+ ,19
+ ,292
+ ,797
+ ,78320
+ ,31
+ ,224
+ ,469
+ ,37972
+ ,20
+ ,136
+ ,639
+ ,34563
+ ,21
+ ,173
+ ,484
+ ,39841
+ ,18
+ ,129
+ ,214
+ ,16145
+ ,9
+ ,56
+ ,696
+ ,45310
+ ,17
+ ,233
+ ,492
+ ,57938
+ ,14
+ ,172
+ ,638
+ ,48187
+ ,14
+ ,221
+ ,256
+ ,11796
+ ,9
+ ,79
+ ,80
+ ,7627
+ ,8
+ ,25
+ ,587
+ ,62522
+ ,28
+ ,207
+ ,41
+ ,6836
+ ,3
+ ,11
+ ,497
+ ,28834
+ ,14
+ ,209
+ ,42
+ ,5118
+ ,3
+ ,6
+ ,340
+ ,20825
+ ,13
+ ,112
+ ,0
+ ,0
+ ,0
+ ,0
+ ,395
+ ,34363
+ ,17
+ ,154
+ ,226
+ ,12137
+ ,10
+ ,65
+ ,81
+ ,7131
+ ,4
+ ,27
+ ,61
+ ,4194
+ ,11
+ ,14
+ ,313
+ ,21416
+ ,9
+ ,96
+ ,239
+ ,19205
+ ,10
+ ,76
+ ,462
+ ,38232
+ ,8
+ ,185)
+ ,dim=c(4
+ ,144)
+ ,dimnames=list(c('Pageviews'
+ ,'time'
+ ,'logins'
+ ,'compendiumviews')
+ ,1:144))
> y <- array(NA,dim=c(4,144),dimnames=list(c('Pageviews','time','logins','compendiumviews'),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
Pageviews time logins compendiumviews
1 829 58198 49 233
2 538 65968 24 157
3 186 7176 17 70
4 1405 78306 66 360
5 1947 127587 83 683
6 3534 250877 127 906
7 811 65936 33 275
8 609 72513 30 142
9 1151 72507 32 297
10 1779 170683 63 604
11 834 66288 34 256
12 1211 94815 43 380
13 897 45496 67 330
14 1574 83049 59 525
15 688 66960 24 202
16 854 72377 38 313
17 848 61175 32 197
18 324 15580 20 85
19 1602 71693 54 494
20 412 13397 13 131
21 618 38921 35 233
22 1244 97709 49 351
23 616 47899 27 227
24 1107 61674 30 317
25 1079 77395 50 367
26 611 65152 11 223
27 1188 88286 94 390
28 618 75108 50 145
29 1392 182314 58 445
30 1189 91721 25 481
31 752 56374 27 223
32 1055 104756 23 361
33 1044 50485 56 325
34 580 29013 39 169
35 1116 90349 29 380
36 0 0 0 0
37 626 61484 33 280
38 1183 65245 34 363
39 1016 35361 20 211
40 1076 106880 34 381
41 1061 82577 33 340
42 680 53655 25 277
43 404 40064 12 140
44 1026 66118 44 397
45 643 55561 28 218
46 415 31331 30 140
47 328 31350 12 92
48 960 93341 53 333
49 769 57002 39 256
50 1066 60206 27 414
51 425 33820 20 129
52 696 49791 35 189
53 1020 113697 41 422
54 890 97673 43 310
55 916 89612 32 333
56 898 66268 29 285
57 696 64319 24 204
58 383 25090 11 118
59 566 62131 37 193
60 548 23630 22 194
61 457 31969 21 139
62 782 32592 34 291
63 535 35738 19 176
64 475 42406 18 145
65 374 47859 12 122
66 771 55240 22 256
67 1140 65341 42 296
68 1502 61854 44 425
69 500 35185 19 138
70 82 12207 10 25
71 1569 112537 72 490
72 568 43886 24 179
73 606 49028 33 224
74 918 40699 39 265
75 833 46357 20 293
76 460 17667 19 136
77 685 59058 27 209
78 888 54106 38 301
79 410 23795 13 118
80 615 34323 34 241
81 447 37071 29 106
82 650 78258 26 254
83 545 32392 15 172
84 830 55020 19 307
85 515 29613 25 176
86 853 56879 28 260
87 1312 109785 108 291
88 400 24612 25 107
89 404 38010 22 139
90 639 53398 22 194
91 773 54198 20 295
92 1075 66038 43 317
93 510 61352 28 166
94 573 48096 29 210
95 434 25194 22 182
96 1294 118291 57 442
97 718 71876 27 225
98 222 19349 11 67
99 880 67369 51 271
100 816 54015 35 332
101 305 19719 14 111
102 425 25497 11 141
103 578 55049 36 182
104 306 24912 21 83
105 367 28591 19 80
106 463 24716 13 152
107 520 52452 16 130
108 294 17850 16 71
109 0 0 0 0
110 566 35269 12 152
111 463 27554 31 149
112 630 55167 12 196
113 632 42982 33 179
114 462 42115 40 163
115 38 3058 4 1
116 0 0 0 0
117 592 96347 24 196
118 631 43490 26 238
119 925 62694 47 263
120 441 36901 20 170
121 778 43410 19 292
122 797 78320 31 224
123 469 37972 20 136
124 639 34563 21 173
125 484 39841 18 129
126 214 16145 9 56
127 696 45310 17 233
128 492 57938 14 172
129 638 48187 14 221
130 256 11796 9 79
131 80 7627 8 25
132 587 62522 28 207
133 41 6836 3 11
134 497 28834 14 209
135 42 5118 3 6
136 340 20825 13 112
137 0 0 0 0
138 395 34363 17 154
139 226 12137 10 65
140 81 7131 4 27
141 61 4194 11 14
142 313 21416 9 96
143 239 19205 10 76
144 462 38232 8 185
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) time logins compendiumviews
-16.418563 0.001535 4.330579 2.275536
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-275.95 -62.07 8.76 39.14 553.68
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.642e+01 1.700e+01 -0.966 0.33572
time 1.535e-03 5.285e-04 2.904 0.00428 **
logins 4.331e+00 7.739e-01 5.596 1.12e-07 ***
compendiumviews 2.276e+00 1.404e-01 16.212 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 106.3 on 140 degrees of freedom
Multiple R-squared: 0.9451, Adjusted R-squared: 0.9439
F-statistic: 803.7 on 3 and 140 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.7293763 5.412474e-01 2.706237e-01
[2,] 0.6990293 6.019414e-01 3.009707e-01
[3,] 0.9921210 1.575800e-02 7.878998e-03
[4,] 0.9985609 2.878212e-03 1.439106e-03
[5,] 0.9970795 5.841000e-03 2.920500e-03
[6,] 0.9950571 9.885814e-03 4.942907e-03
[7,] 0.9990758 1.848312e-03 9.241559e-04
[8,] 0.9992528 1.494486e-03 7.472431e-04
[9,] 0.9986278 2.744338e-03 1.372169e-03
[10,] 0.9983194 3.361276e-03 1.680638e-03
[11,] 0.9991080 1.784027e-03 8.920133e-04
[12,] 0.9987679 2.464229e-03 1.232114e-03
[13,] 0.9998329 3.341821e-04 1.670910e-04
[14,] 0.9998363 3.274896e-04 1.637448e-04
[15,] 0.9998007 3.985573e-04 1.992787e-04
[16,] 0.9997480 5.039545e-04 2.519772e-04
[17,] 0.9996200 7.600957e-04 3.800479e-04
[18,] 0.9998981 2.037541e-04 1.018770e-04
[19,] 0.9998768 2.464779e-04 1.232389e-04
[20,] 0.9997891 4.217467e-04 2.108734e-04
[21,] 0.9999756 4.887969e-05 2.443985e-05
[22,] 0.9999598 8.033834e-05 4.016917e-05
[23,] 0.9999957 8.554292e-06 4.277146e-06
[24,] 0.9999976 4.842074e-06 2.421037e-06
[25,] 0.9999963 7.417743e-06 3.708872e-06
[26,] 0.9999940 1.209772e-05 6.048858e-06
[27,] 0.9999888 2.232098e-05 1.116049e-05
[28,] 0.9999803 3.947594e-05 1.973797e-05
[29,] 0.9999674 6.513069e-05 3.256535e-05
[30,] 0.9999489 1.022426e-04 5.112128e-05
[31,] 0.9999914 1.721334e-05 8.606672e-06
[32,] 0.9999940 1.200428e-05 6.002141e-06
[33,] 1.0000000 5.483421e-10 2.741710e-10
[34,] 1.0000000 7.820652e-10 3.910326e-10
[35,] 1.0000000 1.240055e-09 6.200277e-10
[36,] 1.0000000 1.038205e-09 5.191023e-10
[37,] 1.0000000 2.272238e-09 1.136119e-09
[38,] 1.0000000 1.133770e-09 5.668850e-10
[39,] 1.0000000 2.276539e-09 1.138269e-09
[40,] 1.0000000 3.376952e-09 1.688476e-09
[41,] 1.0000000 6.434673e-09 3.217337e-09
[42,] 1.0000000 3.677927e-09 1.838963e-09
[43,] 1.0000000 6.621840e-09 3.310920e-09
[44,] 1.0000000 1.085630e-08 5.428151e-09
[45,] 1.0000000 2.202350e-08 1.101175e-08
[46,] 1.0000000 3.522569e-08 1.761285e-08
[47,] 1.0000000 8.726518e-10 4.363259e-10
[48,] 1.0000000 6.561309e-10 3.280654e-10
[49,] 1.0000000 7.863034e-10 3.931517e-10
[50,] 1.0000000 1.439479e-09 7.197393e-10
[51,] 1.0000000 2.393913e-09 1.196956e-09
[52,] 1.0000000 4.311819e-09 2.155910e-09
[53,] 1.0000000 3.817416e-09 1.908708e-09
[54,] 1.0000000 7.696783e-09 3.848392e-09
[55,] 1.0000000 1.550497e-08 7.752485e-09
[56,] 1.0000000 2.052926e-08 1.026463e-08
[57,] 1.0000000 4.087034e-08 2.043517e-08
[58,] 1.0000000 7.867326e-08 3.933663e-08
[59,] 0.9999999 1.553308e-07 7.766540e-08
[60,] 0.9999999 2.847912e-07 1.423956e-07
[61,] 1.0000000 2.436490e-08 1.218245e-08
[62,] 1.0000000 3.118226e-11 1.559113e-11
[63,] 1.0000000 4.578702e-11 2.289351e-11
[64,] 1.0000000 8.879780e-11 4.439890e-11
[65,] 1.0000000 1.559614e-10 7.798068e-11
[66,] 1.0000000 3.527831e-10 1.763916e-10
[67,] 1.0000000 3.086704e-10 1.543352e-10
[68,] 1.0000000 1.464778e-10 7.323891e-11
[69,] 1.0000000 2.409323e-10 1.204661e-10
[70,] 1.0000000 3.761114e-10 1.880557e-10
[71,] 1.0000000 7.791523e-10 3.895761e-10
[72,] 1.0000000 1.701081e-09 8.505407e-10
[73,] 1.0000000 2.499369e-09 1.249685e-09
[74,] 1.0000000 2.030631e-09 1.015315e-09
[75,] 1.0000000 4.030998e-09 2.015499e-09
[76,] 1.0000000 1.404642e-09 7.023212e-10
[77,] 1.0000000 2.065352e-09 1.032676e-09
[78,] 1.0000000 4.532633e-09 2.266316e-09
[79,] 1.0000000 9.959732e-09 4.979866e-09
[80,] 1.0000000 8.243970e-09 4.121985e-09
[81,] 1.0000000 7.685422e-09 3.842711e-09
[82,] 1.0000000 1.504811e-08 7.524056e-09
[83,] 1.0000000 2.638510e-08 1.319255e-08
[84,] 1.0000000 4.603451e-08 2.301726e-08
[85,] 1.0000000 8.976030e-08 4.488015e-08
[86,] 1.0000000 1.907105e-08 9.535523e-09
[87,] 1.0000000 2.820832e-08 1.410416e-08
[88,] 1.0000000 3.872092e-08 1.936046e-08
[89,] 1.0000000 3.936304e-08 1.968152e-08
[90,] 1.0000000 5.736374e-08 2.868187e-08
[91,] 0.9999999 1.299284e-07 6.496421e-08
[92,] 0.9999999 2.847642e-07 1.423821e-07
[93,] 0.9999997 6.003124e-07 3.001562e-07
[94,] 0.9999999 2.009932e-07 1.004966e-07
[95,] 0.9999998 3.968571e-07 1.984286e-07
[96,] 0.9999996 8.332156e-07 4.166078e-07
[97,] 0.9999993 1.420976e-06 7.104878e-07
[98,] 0.9999985 3.090462e-06 1.545231e-06
[99,] 0.9999981 3.722975e-06 1.861487e-06
[100,] 0.9999964 7.150341e-06 3.575170e-06
[101,] 0.9999969 6.132118e-06 3.066059e-06
[102,] 0.9999950 1.007260e-05 5.036300e-06
[103,] 0.9999894 2.124675e-05 1.062337e-05
[104,] 0.9999969 6.233404e-06 3.116702e-06
[105,] 0.9999937 1.265891e-05 6.329453e-06
[106,] 0.9999931 1.384296e-05 6.921481e-06
[107,] 0.9999883 2.341303e-05 1.170652e-05
[108,] 0.9999986 2.797334e-06 1.398667e-06
[109,] 0.9999966 6.816619e-06 3.408309e-06
[110,] 0.9999917 1.651991e-05 8.259954e-06
[111,] 0.9999910 1.799911e-05 8.999555e-06
[112,] 0.9999912 1.751996e-05 8.759981e-06
[113,] 0.9999793 4.145757e-05 2.072878e-05
[114,] 0.9999852 2.969066e-05 1.484533e-05
[115,] 0.9999632 7.360283e-05 3.680141e-05
[116,] 0.9999419 1.161232e-04 5.806161e-05
[117,] 0.9998711 2.577827e-04 1.288913e-04
[118,] 0.9999860 2.794335e-05 1.397168e-05
[119,] 0.9999963 7.460199e-06 3.730099e-06
[120,] 0.9999923 1.534984e-05 7.674920e-06
[121,] 0.9999965 6.973624e-06 3.486812e-06
[122,] 0.9999869 2.616723e-05 1.308361e-05
[123,] 0.9999907 1.865870e-05 9.329352e-06
[124,] 0.9999824 3.513088e-05 1.756544e-05
[125,] 0.9999400 1.199495e-04 5.997475e-05
[126,] 0.9997945 4.110430e-04 2.055215e-04
[127,] 0.9993005 1.398919e-03 6.994593e-04
[128,] 0.9985355 2.928931e-03 1.464465e-03
[129,] 0.9945818 1.083640e-02 5.418201e-03
[130,] 0.9809768 3.804636e-02 1.902318e-02
[131,] 0.9496027 1.007946e-01 5.039728e-02
> postscript(file="/var/www/rcomp/tmp/15jiy1322067264.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/28dys1322067264.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/3r61b1322067264.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/4njhs1322067264.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/5y4fq1322067264.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
13.6816464 -8.0406862 -41.5045566 196.2013073 -146.0670204 553.6828962
7 8 9 10 11 12
-42.4800532 61.0617822 241.7017187 -113.8438768 18.8842075 30.9512741
13 14 15 16 17 18
-197.4972113 12.7710015 38.0373842 -117.4907771 183.6508676 36.4698496
19 20 21 22 23 24
150.3978898 53.4603187 -107.0985050 99.5158267 -74.5826003 177.4816743
25 26 27 28 29 30
-75.0397177 -27.6759195 -225.6411014 -27.3599474 -135.2352348 -138.1779178
31 32 33 34 35 36
57.5097418 -10.4621792 0.8583295 -1.5769318 3.4350532 16.4185633
37 38 39 40 41 42
-232.0235583 126.0029196 411.3868680 -85.8697873 34.0648261 -124.5341732
43 44 45 46 47 48
-11.6249056 -153.0112311 -43.1951365 -65.1694818 34.9775202 -154.1416096
49 50 51 52 53 54
-53.5139369 -69.0001040 9.3463969 54.3387696 -275.9454687 -135.1484486
55 56 57 58 59 60
-101.4751285 38.5772556 45.5404580 44.7537583 -112.3674210 -8.5821518
61 62 63 64 65 66
17.1018882 -61.0335056 13.7824902 18.4187794 -12.6312020 24.8107241
67 68 69 70 71 72
200.6718438 265.8193356 66.1017661 -20.5143578 -14.1492014 5.7951528
73 74 75 76 77 78
-105.4725734 100.0326459 24.9131580 57.5443695 18.2470943 -28.1368961
79 80 81 82 83 84
65.0805281 -116.9139177 39.7179703 -144.2949920 55.3433304 -18.9121676
85 86 87 88 89 90
-22.7986214 69.2091066 30.0061887 26.8903132 -49.5021093 36.7215875
91 92 93 94 95 96
-51.6744766 82.4850529 -66.7569008 -87.8620540 -97.6765821 -123.7976214
97 98 99 100 101 102
-4.8381404 8.6190000 -44.5281075 -157.5470886 -22.0643118 33.7916476
103 104 105 106 107 108
-60.1345067 4.3649763 75.2051846 39.2984877 90.7915682 52.1650429
109 110 111 112 113 114
16.4185633 130.4293681 -36.1818902 63.7607528 32.2076503 -130.3669117
115 116 117 118 119 120
30.1264349 16.4185633 -89.4207937 -73.5147518 43.1749989 -72.6801698
121 122 123 124 125 126
-18.9568457 49.2230227 31.0439912 117.7516590 67.7648392 39.2294536
127 128 129 130 131 132
39.0442986 -32.5412432 16.9260465 35.5681832 -6.8225327 -84.8499297
133 134 135 136 137 138
8.9021199 -67.0591160 23.9170684 13.2929329 16.4185633 -65.3838190
139 140 141 142 143 144
32.5716487 7.7101122 -8.5134429 39.1165980 9.6908049 -35.8894517
> postscript(file="/var/www/rcomp/tmp/6afso1322067264.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 13.6816464 NA
1 -8.0406862 13.6816464
2 -41.5045566 -8.0406862
3 196.2013073 -41.5045566
4 -146.0670204 196.2013073
5 553.6828962 -146.0670204
6 -42.4800532 553.6828962
7 61.0617822 -42.4800532
8 241.7017187 61.0617822
9 -113.8438768 241.7017187
10 18.8842075 -113.8438768
11 30.9512741 18.8842075
12 -197.4972113 30.9512741
13 12.7710015 -197.4972113
14 38.0373842 12.7710015
15 -117.4907771 38.0373842
16 183.6508676 -117.4907771
17 36.4698496 183.6508676
18 150.3978898 36.4698496
19 53.4603187 150.3978898
20 -107.0985050 53.4603187
21 99.5158267 -107.0985050
22 -74.5826003 99.5158267
23 177.4816743 -74.5826003
24 -75.0397177 177.4816743
25 -27.6759195 -75.0397177
26 -225.6411014 -27.6759195
27 -27.3599474 -225.6411014
28 -135.2352348 -27.3599474
29 -138.1779178 -135.2352348
30 57.5097418 -138.1779178
31 -10.4621792 57.5097418
32 0.8583295 -10.4621792
33 -1.5769318 0.8583295
34 3.4350532 -1.5769318
35 16.4185633 3.4350532
36 -232.0235583 16.4185633
37 126.0029196 -232.0235583
38 411.3868680 126.0029196
39 -85.8697873 411.3868680
40 34.0648261 -85.8697873
41 -124.5341732 34.0648261
42 -11.6249056 -124.5341732
43 -153.0112311 -11.6249056
44 -43.1951365 -153.0112311
45 -65.1694818 -43.1951365
46 34.9775202 -65.1694818
47 -154.1416096 34.9775202
48 -53.5139369 -154.1416096
49 -69.0001040 -53.5139369
50 9.3463969 -69.0001040
51 54.3387696 9.3463969
52 -275.9454687 54.3387696
53 -135.1484486 -275.9454687
54 -101.4751285 -135.1484486
55 38.5772556 -101.4751285
56 45.5404580 38.5772556
57 44.7537583 45.5404580
58 -112.3674210 44.7537583
59 -8.5821518 -112.3674210
60 17.1018882 -8.5821518
61 -61.0335056 17.1018882
62 13.7824902 -61.0335056
63 18.4187794 13.7824902
64 -12.6312020 18.4187794
65 24.8107241 -12.6312020
66 200.6718438 24.8107241
67 265.8193356 200.6718438
68 66.1017661 265.8193356
69 -20.5143578 66.1017661
70 -14.1492014 -20.5143578
71 5.7951528 -14.1492014
72 -105.4725734 5.7951528
73 100.0326459 -105.4725734
74 24.9131580 100.0326459
75 57.5443695 24.9131580
76 18.2470943 57.5443695
77 -28.1368961 18.2470943
78 65.0805281 -28.1368961
79 -116.9139177 65.0805281
80 39.7179703 -116.9139177
81 -144.2949920 39.7179703
82 55.3433304 -144.2949920
83 -18.9121676 55.3433304
84 -22.7986214 -18.9121676
85 69.2091066 -22.7986214
86 30.0061887 69.2091066
87 26.8903132 30.0061887
88 -49.5021093 26.8903132
89 36.7215875 -49.5021093
90 -51.6744766 36.7215875
91 82.4850529 -51.6744766
92 -66.7569008 82.4850529
93 -87.8620540 -66.7569008
94 -97.6765821 -87.8620540
95 -123.7976214 -97.6765821
96 -4.8381404 -123.7976214
97 8.6190000 -4.8381404
98 -44.5281075 8.6190000
99 -157.5470886 -44.5281075
100 -22.0643118 -157.5470886
101 33.7916476 -22.0643118
102 -60.1345067 33.7916476
103 4.3649763 -60.1345067
104 75.2051846 4.3649763
105 39.2984877 75.2051846
106 90.7915682 39.2984877
107 52.1650429 90.7915682
108 16.4185633 52.1650429
109 130.4293681 16.4185633
110 -36.1818902 130.4293681
111 63.7607528 -36.1818902
112 32.2076503 63.7607528
113 -130.3669117 32.2076503
114 30.1264349 -130.3669117
115 16.4185633 30.1264349
116 -89.4207937 16.4185633
117 -73.5147518 -89.4207937
118 43.1749989 -73.5147518
119 -72.6801698 43.1749989
120 -18.9568457 -72.6801698
121 49.2230227 -18.9568457
122 31.0439912 49.2230227
123 117.7516590 31.0439912
124 67.7648392 117.7516590
125 39.2294536 67.7648392
126 39.0442986 39.2294536
127 -32.5412432 39.0442986
128 16.9260465 -32.5412432
129 35.5681832 16.9260465
130 -6.8225327 35.5681832
131 -84.8499297 -6.8225327
132 8.9021199 -84.8499297
133 -67.0591160 8.9021199
134 23.9170684 -67.0591160
135 13.2929329 23.9170684
136 16.4185633 13.2929329
137 -65.3838190 16.4185633
138 32.5716487 -65.3838190
139 7.7101122 32.5716487
140 -8.5134429 7.7101122
141 39.1165980 -8.5134429
142 9.6908049 39.1165980
143 -35.8894517 9.6908049
144 NA -35.8894517
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -8.0406862 13.6816464
[2,] -41.5045566 -8.0406862
[3,] 196.2013073 -41.5045566
[4,] -146.0670204 196.2013073
[5,] 553.6828962 -146.0670204
[6,] -42.4800532 553.6828962
[7,] 61.0617822 -42.4800532
[8,] 241.7017187 61.0617822
[9,] -113.8438768 241.7017187
[10,] 18.8842075 -113.8438768
[11,] 30.9512741 18.8842075
[12,] -197.4972113 30.9512741
[13,] 12.7710015 -197.4972113
[14,] 38.0373842 12.7710015
[15,] -117.4907771 38.0373842
[16,] 183.6508676 -117.4907771
[17,] 36.4698496 183.6508676
[18,] 150.3978898 36.4698496
[19,] 53.4603187 150.3978898
[20,] -107.0985050 53.4603187
[21,] 99.5158267 -107.0985050
[22,] -74.5826003 99.5158267
[23,] 177.4816743 -74.5826003
[24,] -75.0397177 177.4816743
[25,] -27.6759195 -75.0397177
[26,] -225.6411014 -27.6759195
[27,] -27.3599474 -225.6411014
[28,] -135.2352348 -27.3599474
[29,] -138.1779178 -135.2352348
[30,] 57.5097418 -138.1779178
[31,] -10.4621792 57.5097418
[32,] 0.8583295 -10.4621792
[33,] -1.5769318 0.8583295
[34,] 3.4350532 -1.5769318
[35,] 16.4185633 3.4350532
[36,] -232.0235583 16.4185633
[37,] 126.0029196 -232.0235583
[38,] 411.3868680 126.0029196
[39,] -85.8697873 411.3868680
[40,] 34.0648261 -85.8697873
[41,] -124.5341732 34.0648261
[42,] -11.6249056 -124.5341732
[43,] -153.0112311 -11.6249056
[44,] -43.1951365 -153.0112311
[45,] -65.1694818 -43.1951365
[46,] 34.9775202 -65.1694818
[47,] -154.1416096 34.9775202
[48,] -53.5139369 -154.1416096
[49,] -69.0001040 -53.5139369
[50,] 9.3463969 -69.0001040
[51,] 54.3387696 9.3463969
[52,] -275.9454687 54.3387696
[53,] -135.1484486 -275.9454687
[54,] -101.4751285 -135.1484486
[55,] 38.5772556 -101.4751285
[56,] 45.5404580 38.5772556
[57,] 44.7537583 45.5404580
[58,] -112.3674210 44.7537583
[59,] -8.5821518 -112.3674210
[60,] 17.1018882 -8.5821518
[61,] -61.0335056 17.1018882
[62,] 13.7824902 -61.0335056
[63,] 18.4187794 13.7824902
[64,] -12.6312020 18.4187794
[65,] 24.8107241 -12.6312020
[66,] 200.6718438 24.8107241
[67,] 265.8193356 200.6718438
[68,] 66.1017661 265.8193356
[69,] -20.5143578 66.1017661
[70,] -14.1492014 -20.5143578
[71,] 5.7951528 -14.1492014
[72,] -105.4725734 5.7951528
[73,] 100.0326459 -105.4725734
[74,] 24.9131580 100.0326459
[75,] 57.5443695 24.9131580
[76,] 18.2470943 57.5443695
[77,] -28.1368961 18.2470943
[78,] 65.0805281 -28.1368961
[79,] -116.9139177 65.0805281
[80,] 39.7179703 -116.9139177
[81,] -144.2949920 39.7179703
[82,] 55.3433304 -144.2949920
[83,] -18.9121676 55.3433304
[84,] -22.7986214 -18.9121676
[85,] 69.2091066 -22.7986214
[86,] 30.0061887 69.2091066
[87,] 26.8903132 30.0061887
[88,] -49.5021093 26.8903132
[89,] 36.7215875 -49.5021093
[90,] -51.6744766 36.7215875
[91,] 82.4850529 -51.6744766
[92,] -66.7569008 82.4850529
[93,] -87.8620540 -66.7569008
[94,] -97.6765821 -87.8620540
[95,] -123.7976214 -97.6765821
[96,] -4.8381404 -123.7976214
[97,] 8.6190000 -4.8381404
[98,] -44.5281075 8.6190000
[99,] -157.5470886 -44.5281075
[100,] -22.0643118 -157.5470886
[101,] 33.7916476 -22.0643118
[102,] -60.1345067 33.7916476
[103,] 4.3649763 -60.1345067
[104,] 75.2051846 4.3649763
[105,] 39.2984877 75.2051846
[106,] 90.7915682 39.2984877
[107,] 52.1650429 90.7915682
[108,] 16.4185633 52.1650429
[109,] 130.4293681 16.4185633
[110,] -36.1818902 130.4293681
[111,] 63.7607528 -36.1818902
[112,] 32.2076503 63.7607528
[113,] -130.3669117 32.2076503
[114,] 30.1264349 -130.3669117
[115,] 16.4185633 30.1264349
[116,] -89.4207937 16.4185633
[117,] -73.5147518 -89.4207937
[118,] 43.1749989 -73.5147518
[119,] -72.6801698 43.1749989
[120,] -18.9568457 -72.6801698
[121,] 49.2230227 -18.9568457
[122,] 31.0439912 49.2230227
[123,] 117.7516590 31.0439912
[124,] 67.7648392 117.7516590
[125,] 39.2294536 67.7648392
[126,] 39.0442986 39.2294536
[127,] -32.5412432 39.0442986
[128,] 16.9260465 -32.5412432
[129,] 35.5681832 16.9260465
[130,] -6.8225327 35.5681832
[131,] -84.8499297 -6.8225327
[132,] 8.9021199 -84.8499297
[133,] -67.0591160 8.9021199
[134,] 23.9170684 -67.0591160
[135,] 13.2929329 23.9170684
[136,] 16.4185633 13.2929329
[137,] -65.3838190 16.4185633
[138,] 32.5716487 -65.3838190
[139,] 7.7101122 32.5716487
[140,] -8.5134429 7.7101122
[141,] 39.1165980 -8.5134429
[142,] 9.6908049 39.1165980
[143,] -35.8894517 9.6908049
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -8.0406862 13.6816464
2 -41.5045566 -8.0406862
3 196.2013073 -41.5045566
4 -146.0670204 196.2013073
5 553.6828962 -146.0670204
6 -42.4800532 553.6828962
7 61.0617822 -42.4800532
8 241.7017187 61.0617822
9 -113.8438768 241.7017187
10 18.8842075 -113.8438768
11 30.9512741 18.8842075
12 -197.4972113 30.9512741
13 12.7710015 -197.4972113
14 38.0373842 12.7710015
15 -117.4907771 38.0373842
16 183.6508676 -117.4907771
17 36.4698496 183.6508676
18 150.3978898 36.4698496
19 53.4603187 150.3978898
20 -107.0985050 53.4603187
21 99.5158267 -107.0985050
22 -74.5826003 99.5158267
23 177.4816743 -74.5826003
24 -75.0397177 177.4816743
25 -27.6759195 -75.0397177
26 -225.6411014 -27.6759195
27 -27.3599474 -225.6411014
28 -135.2352348 -27.3599474
29 -138.1779178 -135.2352348
30 57.5097418 -138.1779178
31 -10.4621792 57.5097418
32 0.8583295 -10.4621792
33 -1.5769318 0.8583295
34 3.4350532 -1.5769318
35 16.4185633 3.4350532
36 -232.0235583 16.4185633
37 126.0029196 -232.0235583
38 411.3868680 126.0029196
39 -85.8697873 411.3868680
40 34.0648261 -85.8697873
41 -124.5341732 34.0648261
42 -11.6249056 -124.5341732
43 -153.0112311 -11.6249056
44 -43.1951365 -153.0112311
45 -65.1694818 -43.1951365
46 34.9775202 -65.1694818
47 -154.1416096 34.9775202
48 -53.5139369 -154.1416096
49 -69.0001040 -53.5139369
50 9.3463969 -69.0001040
51 54.3387696 9.3463969
52 -275.9454687 54.3387696
53 -135.1484486 -275.9454687
54 -101.4751285 -135.1484486
55 38.5772556 -101.4751285
56 45.5404580 38.5772556
57 44.7537583 45.5404580
58 -112.3674210 44.7537583
59 -8.5821518 -112.3674210
60 17.1018882 -8.5821518
61 -61.0335056 17.1018882
62 13.7824902 -61.0335056
63 18.4187794 13.7824902
64 -12.6312020 18.4187794
65 24.8107241 -12.6312020
66 200.6718438 24.8107241
67 265.8193356 200.6718438
68 66.1017661 265.8193356
69 -20.5143578 66.1017661
70 -14.1492014 -20.5143578
71 5.7951528 -14.1492014
72 -105.4725734 5.7951528
73 100.0326459 -105.4725734
74 24.9131580 100.0326459
75 57.5443695 24.9131580
76 18.2470943 57.5443695
77 -28.1368961 18.2470943
78 65.0805281 -28.1368961
79 -116.9139177 65.0805281
80 39.7179703 -116.9139177
81 -144.2949920 39.7179703
82 55.3433304 -144.2949920
83 -18.9121676 55.3433304
84 -22.7986214 -18.9121676
85 69.2091066 -22.7986214
86 30.0061887 69.2091066
87 26.8903132 30.0061887
88 -49.5021093 26.8903132
89 36.7215875 -49.5021093
90 -51.6744766 36.7215875
91 82.4850529 -51.6744766
92 -66.7569008 82.4850529
93 -87.8620540 -66.7569008
94 -97.6765821 -87.8620540
95 -123.7976214 -97.6765821
96 -4.8381404 -123.7976214
97 8.6190000 -4.8381404
98 -44.5281075 8.6190000
99 -157.5470886 -44.5281075
100 -22.0643118 -157.5470886
101 33.7916476 -22.0643118
102 -60.1345067 33.7916476
103 4.3649763 -60.1345067
104 75.2051846 4.3649763
105 39.2984877 75.2051846
106 90.7915682 39.2984877
107 52.1650429 90.7915682
108 16.4185633 52.1650429
109 130.4293681 16.4185633
110 -36.1818902 130.4293681
111 63.7607528 -36.1818902
112 32.2076503 63.7607528
113 -130.3669117 32.2076503
114 30.1264349 -130.3669117
115 16.4185633 30.1264349
116 -89.4207937 16.4185633
117 -73.5147518 -89.4207937
118 43.1749989 -73.5147518
119 -72.6801698 43.1749989
120 -18.9568457 -72.6801698
121 49.2230227 -18.9568457
122 31.0439912 49.2230227
123 117.7516590 31.0439912
124 67.7648392 117.7516590
125 39.2294536 67.7648392
126 39.0442986 39.2294536
127 -32.5412432 39.0442986
128 16.9260465 -32.5412432
129 35.5681832 16.9260465
130 -6.8225327 35.5681832
131 -84.8499297 -6.8225327
132 8.9021199 -84.8499297
133 -67.0591160 8.9021199
134 23.9170684 -67.0591160
135 13.2929329 23.9170684
136 16.4185633 13.2929329
137 -65.3838190 16.4185633
138 32.5716487 -65.3838190
139 7.7101122 32.5716487
140 -8.5134429 7.7101122
141 39.1165980 -8.5134429
142 9.6908049 39.1165980
143 -35.8894517 9.6908049
> 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/716rn1322067264.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/8e38j1322067264.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/9mriv1322067264.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/104gnv1322067264.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/11np6a1322067264.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/128o271322067264.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/13six21322067264.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/14yqr01322067264.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/15wina1322067264.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/16mwt91322067264.tab")
+ }
>
> try(system("convert tmp/15jiy1322067264.ps tmp/15jiy1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/28dys1322067264.ps tmp/28dys1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/3r61b1322067264.ps tmp/3r61b1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/4njhs1322067264.ps tmp/4njhs1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/5y4fq1322067264.ps tmp/5y4fq1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/6afso1322067264.ps tmp/6afso1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/716rn1322067264.ps tmp/716rn1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/8e38j1322067264.ps tmp/8e38j1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/9mriv1322067264.ps tmp/9mriv1322067264.png",intern=TRUE))
character(0)
> try(system("convert tmp/104gnv1322067264.ps tmp/104gnv1322067264.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.380 0.410 5.772