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(150596
+ ,535
+ ,18
+ ,20465
+ ,37
+ ,154801
+ ,396
+ ,20
+ ,33629
+ ,43
+ ,7215
+ ,72
+ ,0
+ ,1423
+ ,0
+ ,122139
+ ,617
+ ,26
+ ,25629
+ ,54
+ ,221399
+ ,1118
+ ,30
+ ,54002
+ ,86
+ ,441870
+ ,1755
+ ,34
+ ,151036
+ ,181
+ ,134379
+ ,498
+ ,23
+ ,33287
+ ,42
+ ,140428
+ ,355
+ ,30
+ ,31172
+ ,59
+ ,103255
+ ,413
+ ,30
+ ,28113
+ ,46
+ ,271630
+ ,891
+ ,26
+ ,57803
+ ,77
+ ,121593
+ ,629
+ ,24
+ ,49830
+ ,49
+ ,172071
+ ,611
+ ,30
+ ,52143
+ ,79
+ ,83707
+ ,564
+ ,19
+ ,21055
+ ,37
+ ,197412
+ ,964
+ ,25
+ ,47007
+ ,92
+ ,134398
+ ,362
+ ,17
+ ,28735
+ ,31
+ ,139224
+ ,442
+ ,19
+ ,59147
+ ,28
+ ,134153
+ ,391
+ ,33
+ ,78950
+ ,103
+ ,64149
+ ,305
+ ,15
+ ,13497
+ ,2
+ ,122294
+ ,721
+ ,34
+ ,46154
+ ,48
+ ,24889
+ ,206
+ ,15
+ ,53249
+ ,25
+ ,52197
+ ,310
+ ,15
+ ,10726
+ ,16
+ ,188915
+ ,686
+ ,27
+ ,83700
+ ,106
+ ,172874
+ ,590
+ ,25
+ ,40400
+ ,35
+ ,98575
+ ,558
+ ,34
+ ,33797
+ ,33
+ ,143546
+ ,569
+ ,21
+ ,36205
+ ,45
+ ,139780
+ ,513
+ ,21
+ ,30165
+ ,64
+ ,163784
+ ,602
+ ,25
+ ,58534
+ ,73
+ ,152479
+ ,276
+ ,28
+ ,44663
+ ,78
+ ,304108
+ ,791
+ ,26
+ ,92556
+ ,63
+ ,184024
+ ,815
+ ,20
+ ,40078
+ ,69
+ ,151621
+ ,427
+ ,28
+ ,34711
+ ,36
+ ,164516
+ ,496
+ ,20
+ ,31076
+ ,41
+ ,120289
+ ,655
+ ,17
+ ,74608
+ ,59
+ ,214701
+ ,857
+ ,25
+ ,58092
+ ,33
+ ,196865
+ ,736
+ ,24
+ ,42009
+ ,76
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,191678
+ ,884
+ ,27
+ ,36022
+ ,27
+ ,93107
+ ,483
+ ,14
+ ,23333
+ ,44
+ ,129352
+ ,495
+ ,32
+ ,53349
+ ,43
+ ,229143
+ ,749
+ ,31
+ ,92596
+ ,104
+ ,177063
+ ,627
+ ,21
+ ,49598
+ ,120
+ ,126602
+ ,597
+ ,34
+ ,44093
+ ,44
+ ,93742
+ ,348
+ ,23
+ ,84205
+ ,71
+ ,152153
+ ,711
+ ,24
+ ,63369
+ ,78
+ ,95704
+ ,322
+ ,22
+ ,60132
+ ,106
+ ,139793
+ ,280
+ ,22
+ ,37403
+ ,61
+ ,76348
+ ,205
+ ,35
+ ,24460
+ ,53
+ ,188980
+ ,648
+ ,21
+ ,46456
+ ,51
+ ,172100
+ ,580
+ ,31
+ ,66616
+ ,46
+ ,146552
+ ,875
+ ,26
+ ,41554
+ ,55
+ ,48188
+ ,205
+ ,22
+ ,22346
+ ,14
+ ,109185
+ ,363
+ ,21
+ ,30874
+ ,44
+ ,263652
+ ,757
+ ,27
+ ,68701
+ ,113
+ ,215609
+ ,647
+ ,26
+ ,35728
+ ,55
+ ,174876
+ ,584
+ ,33
+ ,29010
+ ,46
+ ,115124
+ ,457
+ ,11
+ ,23110
+ ,39
+ ,179712
+ ,438
+ ,26
+ ,38844
+ ,51
+ ,70369
+ ,235
+ ,26
+ ,27084
+ ,31
+ ,109215
+ ,312
+ ,21
+ ,35139
+ ,36
+ ,166096
+ ,877
+ ,38
+ ,57476
+ ,47
+ ,130414
+ ,454
+ ,29
+ ,33277
+ ,53
+ ,102057
+ ,668
+ ,19
+ ,31141
+ ,38
+ ,115310
+ ,346
+ ,19
+ ,61281
+ ,52
+ ,101181
+ ,377
+ ,24
+ ,25820
+ ,37
+ ,135228
+ ,365
+ ,26
+ ,23284
+ ,11
+ ,94982
+ ,391
+ ,29
+ ,35378
+ ,45
+ ,166919
+ ,476
+ ,34
+ ,74990
+ ,59
+ ,118169
+ ,747
+ ,25
+ ,29653
+ ,82
+ ,102361
+ ,246
+ ,24
+ ,64622
+ ,49
+ ,31970
+ ,101
+ ,21
+ ,4157
+ ,6
+ ,200413
+ ,901
+ ,19
+ ,29245
+ ,81
+ ,103381
+ ,334
+ ,12
+ ,50008
+ ,56
+ ,94940
+ ,404
+ ,28
+ ,52338
+ ,105
+ ,101560
+ ,442
+ ,21
+ ,13310
+ ,46
+ ,144176
+ ,627
+ ,34
+ ,92901
+ ,46
+ ,71921
+ ,345
+ ,32
+ ,10956
+ ,2
+ ,126905
+ ,538
+ ,27
+ ,34241
+ ,51
+ ,131184
+ ,741
+ ,26
+ ,75043
+ ,95
+ ,60138
+ ,253
+ ,21
+ ,21152
+ ,18
+ ,84971
+ ,395
+ ,31
+ ,42249
+ ,55
+ ,80420
+ ,211
+ ,26
+ ,42005
+ ,48
+ ,233569
+ ,670
+ ,26
+ ,41152
+ ,48
+ ,56252
+ ,244
+ ,23
+ ,14399
+ ,39
+ ,97181
+ ,438
+ ,25
+ ,28263
+ ,40
+ ,50800
+ ,255
+ ,22
+ ,17215
+ ,36
+ ,125941
+ ,434
+ ,26
+ ,48140
+ ,60
+ ,211032
+ ,613
+ ,33
+ ,62897
+ ,114
+ ,71960
+ ,233
+ ,22
+ ,22883
+ ,39
+ ,90379
+ ,360
+ ,24
+ ,41622
+ ,45
+ ,125650
+ ,486
+ ,21
+ ,40715
+ ,59
+ ,115572
+ ,535
+ ,28
+ ,65897
+ ,59
+ ,136266
+ ,585
+ ,22
+ ,76542
+ ,93
+ ,146715
+ ,402
+ ,22
+ ,37477
+ ,35
+ ,124626
+ ,466
+ ,15
+ ,53216
+ ,47
+ ,49176
+ ,291
+ ,13
+ ,40911
+ ,36
+ ,212926
+ ,691
+ ,36
+ ,57021
+ ,59
+ ,173884
+ ,515
+ ,24
+ ,73116
+ ,79
+ ,19349
+ ,67
+ ,1
+ ,3895
+ ,14
+ ,181141
+ ,712
+ ,24
+ ,46609
+ ,42
+ ,145502
+ ,770
+ ,31
+ ,29351
+ ,41
+ ,45448
+ ,247
+ ,4
+ ,2325
+ ,8
+ ,58280
+ ,240
+ ,20
+ ,31747
+ ,41
+ ,115944
+ ,360
+ ,23
+ ,32665
+ ,24
+ ,94341
+ ,249
+ ,23
+ ,19249
+ ,22
+ ,59090
+ ,138
+ ,12
+ ,15292
+ ,18
+ ,27676
+ ,194
+ ,16
+ ,5842
+ ,1
+ ,120586
+ ,285
+ ,28
+ ,33994
+ ,53
+ ,88011
+ ,227
+ ,10
+ ,13018
+ ,6
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,85610
+ ,306
+ ,25
+ ,98177
+ ,49
+ ,94530
+ ,355
+ ,21
+ ,37941
+ ,33
+ ,117769
+ ,397
+ ,21
+ ,31032
+ ,50
+ ,107653
+ ,369
+ ,21
+ ,32683
+ ,64
+ ,71894
+ ,287
+ ,21
+ ,34545
+ ,53
+ ,3616
+ ,14
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,154806
+ ,301
+ ,23
+ ,27525
+ ,48
+ ,136061
+ ,535
+ ,29
+ ,66856
+ ,90
+ ,141822
+ ,530
+ ,27
+ ,28549
+ ,46
+ ,106515
+ ,272
+ ,23
+ ,38610
+ ,29
+ ,43410
+ ,292
+ ,1
+ ,2781
+ ,1
+ ,146920
+ ,458
+ ,25
+ ,41211
+ ,64
+ ,88874
+ ,241
+ ,17
+ ,22698
+ ,29
+ ,111924
+ ,497
+ ,29
+ ,41194
+ ,27
+ ,60373
+ ,165
+ ,12
+ ,32689
+ ,4
+ ,19764
+ ,75
+ ,2
+ ,5752
+ ,10
+ ,121665
+ ,461
+ ,18
+ ,26757
+ ,47
+ ,108685
+ ,341
+ ,25
+ ,22527
+ ,44
+ ,124493
+ ,446
+ ,29
+ ,44810
+ ,51
+ ,11796
+ ,79
+ ,2
+ ,0
+ ,0
+ ,10674
+ ,33
+ ,0
+ ,0
+ ,0
+ ,131263
+ ,449
+ ,18
+ ,100674
+ ,38
+ ,6836
+ ,11
+ ,1
+ ,0
+ ,0
+ ,153278
+ ,606
+ ,21
+ ,57786
+ ,57
+ ,5118
+ ,6
+ ,0
+ ,0
+ ,0
+ ,40248
+ ,183
+ ,4
+ ,5444
+ ,6
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,100728
+ ,310
+ ,25
+ ,28470
+ ,22
+ ,84267
+ ,245
+ ,26
+ ,61849
+ ,34
+ ,7131
+ ,27
+ ,0
+ ,0
+ ,0
+ ,8812
+ ,97
+ ,4
+ ,2179
+ ,10
+ ,63952
+ ,247
+ ,17
+ ,8019
+ ,16
+ ,120111
+ ,273
+ ,21
+ ,39644
+ ,93
+ ,94127
+ ,386
+ ,22
+ ,23494
+ ,22)
+ ,dim=c(5
+ ,144)
+ ,dimnames=list(c('TimeInRFC'
+ ,'CompView'
+ ,'Reviews'
+ ,'CompChar'
+ ,'CompBlogs')
+ ,1:144))
> y <- array(NA,dim=c(5,144),dimnames=list(c('TimeInRFC','CompView','Reviews','CompChar','CompBlogs'),1:144))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
TimeInRFC CompView Reviews CompChar CompBlogs
1 150596 535 18 20465 37
2 154801 396 20 33629 43
3 7215 72 0 1423 0
4 122139 617 26 25629 54
5 221399 1118 30 54002 86
6 441870 1755 34 151036 181
7 134379 498 23 33287 42
8 140428 355 30 31172 59
9 103255 413 30 28113 46
10 271630 891 26 57803 77
11 121593 629 24 49830 49
12 172071 611 30 52143 79
13 83707 564 19 21055 37
14 197412 964 25 47007 92
15 134398 362 17 28735 31
16 139224 442 19 59147 28
17 134153 391 33 78950 103
18 64149 305 15 13497 2
19 122294 721 34 46154 48
20 24889 206 15 53249 25
21 52197 310 15 10726 16
22 188915 686 27 83700 106
23 172874 590 25 40400 35
24 98575 558 34 33797 33
25 143546 569 21 36205 45
26 139780 513 21 30165 64
27 163784 602 25 58534 73
28 152479 276 28 44663 78
29 304108 791 26 92556 63
30 184024 815 20 40078 69
31 151621 427 28 34711 36
32 164516 496 20 31076 41
33 120289 655 17 74608 59
34 214701 857 25 58092 33
35 196865 736 24 42009 76
36 0 0 0 0 0
37 191678 884 27 36022 27
38 93107 483 14 23333 44
39 129352 495 32 53349 43
40 229143 749 31 92596 104
41 177063 627 21 49598 120
42 126602 597 34 44093 44
43 93742 348 23 84205 71
44 152153 711 24 63369 78
45 95704 322 22 60132 106
46 139793 280 22 37403 61
47 76348 205 35 24460 53
48 188980 648 21 46456 51
49 172100 580 31 66616 46
50 146552 875 26 41554 55
51 48188 205 22 22346 14
52 109185 363 21 30874 44
53 263652 757 27 68701 113
54 215609 647 26 35728 55
55 174876 584 33 29010 46
56 115124 457 11 23110 39
57 179712 438 26 38844 51
58 70369 235 26 27084 31
59 109215 312 21 35139 36
60 166096 877 38 57476 47
61 130414 454 29 33277 53
62 102057 668 19 31141 38
63 115310 346 19 61281 52
64 101181 377 24 25820 37
65 135228 365 26 23284 11
66 94982 391 29 35378 45
67 166919 476 34 74990 59
68 118169 747 25 29653 82
69 102361 246 24 64622 49
70 31970 101 21 4157 6
71 200413 901 19 29245 81
72 103381 334 12 50008 56
73 94940 404 28 52338 105
74 101560 442 21 13310 46
75 144176 627 34 92901 46
76 71921 345 32 10956 2
77 126905 538 27 34241 51
78 131184 741 26 75043 95
79 60138 253 21 21152 18
80 84971 395 31 42249 55
81 80420 211 26 42005 48
82 233569 670 26 41152 48
83 56252 244 23 14399 39
84 97181 438 25 28263 40
85 50800 255 22 17215 36
86 125941 434 26 48140 60
87 211032 613 33 62897 114
88 71960 233 22 22883 39
89 90379 360 24 41622 45
90 125650 486 21 40715 59
91 115572 535 28 65897 59
92 136266 585 22 76542 93
93 146715 402 22 37477 35
94 124626 466 15 53216 47
95 49176 291 13 40911 36
96 212926 691 36 57021 59
97 173884 515 24 73116 79
98 19349 67 1 3895 14
99 181141 712 24 46609 42
100 145502 770 31 29351 41
101 45448 247 4 2325 8
102 58280 240 20 31747 41
103 115944 360 23 32665 24
104 94341 249 23 19249 22
105 59090 138 12 15292 18
106 27676 194 16 5842 1
107 120586 285 28 33994 53
108 88011 227 10 13018 6
109 0 0 0 0 0
110 85610 306 25 98177 49
111 94530 355 21 37941 33
112 117769 397 21 31032 50
113 107653 369 21 32683 64
114 71894 287 21 34545 53
115 3616 14 0 0 0
116 0 0 0 0 0
117 154806 301 23 27525 48
118 136061 535 29 66856 90
119 141822 530 27 28549 46
120 106515 272 23 38610 29
121 43410 292 1 2781 1
122 146920 458 25 41211 64
123 88874 241 17 22698 29
124 111924 497 29 41194 27
125 60373 165 12 32689 4
126 19764 75 2 5752 10
127 121665 461 18 26757 47
128 108685 341 25 22527 44
129 124493 446 29 44810 51
130 11796 79 2 0 0
131 10674 33 0 0 0
132 131263 449 18 100674 38
133 6836 11 1 0 0
134 153278 606 21 57786 57
135 5118 6 0 0 0
136 40248 183 4 5444 6
137 0 0 0 0 0
138 100728 310 25 28470 22
139 84267 245 26 61849 34
140 7131 27 0 0 0
141 8812 97 4 2179 10
142 63952 247 17 8019 16
143 120111 273 21 39644 93
144 94127 386 22 23494 22
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CompView Reviews CompChar CompBlogs
2672.4748 165.4739 716.9238 0.3275 313.7623
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-67127 -17040 -1655 16985 101828
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2672.4748 6061.8219 0.441 0.6600
CompView 165.4739 14.0503 11.777 <2e-16 ***
Reviews 716.9238 354.4869 2.022 0.0451 *
CompChar 0.3275 0.1536 2.132 0.0348 *
CompBlogs 313.7623 132.2644 2.372 0.0191 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 28460 on 139 degrees of freedom
Multiple R-squared: 0.8219, Adjusted R-squared: 0.8167
F-statistic: 160.3 on 4 and 139 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.6011358 7.977284e-01 3.988642e-01
[2,] 0.6404960 7.190080e-01 3.595040e-01
[3,] 0.8420651 3.158698e-01 1.579349e-01
[4,] 0.8999958 2.000084e-01 1.000042e-01
[5,] 0.8602792 2.794416e-01 1.397208e-01
[6,] 0.8742817 2.514366e-01 1.257183e-01
[7,] 0.8453773 3.092454e-01 1.546227e-01
[8,] 0.8420400 3.159200e-01 1.579600e-01
[9,] 0.7898506 4.202988e-01 2.101494e-01
[10,] 0.8691404 2.617193e-01 1.308596e-01
[11,] 0.8275514 3.448973e-01 1.724486e-01
[12,] 0.8733282 2.533435e-01 1.266718e-01
[13,] 0.9458175 1.083651e-01 5.418253e-02
[14,] 0.9313118 1.373763e-01 6.868817e-02
[15,] 0.9121700 1.756599e-01 8.782997e-02
[16,] 0.9261999 1.476002e-01 7.380009e-02
[17,] 0.9231975 1.536051e-01 7.680253e-02
[18,] 0.8981863 2.036274e-01 1.018137e-01
[19,] 0.8664471 2.671057e-01 1.335529e-01
[20,] 0.8281686 3.436627e-01 1.718314e-01
[21,] 0.8537643 2.924715e-01 1.462357e-01
[22,] 0.9927764 1.444710e-02 7.223551e-03
[23,] 0.9891787 2.164261e-02 1.082131e-02
[24,] 0.9909150 1.817004e-02 9.085019e-03
[25,] 0.9935797 1.284059e-02 6.420293e-03
[26,] 0.9977267 4.546686e-03 2.273343e-03
[27,] 0.9972349 5.530232e-03 2.765116e-03
[28,] 0.9964264 7.147244e-03 3.573622e-03
[29,] 0.9946799 1.064023e-02 5.320116e-03
[30,] 0.9922927 1.541461e-02 7.707303e-03
[31,] 0.9903733 1.925337e-02 9.626684e-03
[32,] 0.9872560 2.548803e-02 1.274401e-02
[33,] 0.9837842 3.243162e-02 1.621581e-02
[34,] 0.9776425 4.471496e-02 2.235748e-02
[35,] 0.9764950 4.700994e-02 2.350497e-02
[36,] 0.9818801 3.623983e-02 1.811992e-02
[37,] 0.9823030 3.539395e-02 1.769697e-02
[38,] 0.9816970 3.660603e-02 1.830302e-02
[39,] 0.9876689 2.466211e-02 1.233105e-02
[40,] 0.9836140 3.277205e-02 1.638602e-02
[41,] 0.9850974 2.980523e-02 1.490261e-02
[42,] 0.9811281 3.774384e-02 1.887192e-02
[43,] 0.9888745 2.225094e-02 1.112547e-02
[44,] 0.9860809 2.783828e-02 1.391914e-02
[45,] 0.9813318 3.733638e-02 1.866819e-02
[46,] 0.9938834 1.223318e-02 6.116591e-03
[47,] 0.9983106 3.378741e-03 1.689371e-03
[48,] 0.9983050 3.389976e-03 1.694988e-03
[49,] 0.9976799 4.640191e-03 2.320095e-03
[50,] 0.9993488 1.302353e-03 6.511764e-04
[51,] 0.9990690 1.861950e-03 9.309751e-04
[52,] 0.9987788 2.442350e-03 1.221175e-03
[53,] 0.9991726 1.654890e-03 8.274450e-04
[54,] 0.9987614 2.477291e-03 1.238645e-03
[55,] 0.9993356 1.328854e-03 6.644272e-04
[56,] 0.9990401 1.919738e-03 9.598691e-04
[57,] 0.9985559 2.888154e-03 1.444077e-03
[58,] 0.9990673 1.865353e-03 9.326766e-04
[59,] 0.9988453 2.309331e-03 1.154665e-03
[60,] 0.9985943 2.811492e-03 1.405746e-03
[61,] 0.9996949 6.102756e-04 3.051378e-04
[62,] 0.9995710 8.580523e-04 4.290262e-04
[63,] 0.9993612 1.277650e-03 6.388250e-04
[64,] 0.9990342 1.931669e-03 9.658343e-04
[65,] 0.9986264 2.747236e-03 1.373618e-03
[66,] 0.9992137 1.572541e-03 7.862705e-04
[67,] 0.9988910 2.217994e-03 1.108997e-03
[68,] 0.9989326 2.134774e-03 1.067387e-03
[69,] 0.9987681 2.463746e-03 1.231873e-03
[70,] 0.9983295 3.341099e-03 1.670550e-03
[71,] 0.9998170 3.660359e-04 1.830179e-04
[72,] 0.9997369 5.261143e-04 2.630571e-04
[73,] 0.9998453 3.093067e-04 1.546534e-04
[74,] 0.9997510 4.980795e-04 2.490398e-04
[75,] 0.9999917 1.664694e-05 8.323470e-06
[76,] 0.9999923 1.545926e-05 7.729630e-06
[77,] 0.9999911 1.778383e-05 8.891913e-06
[78,] 0.9999950 1.008923e-05 5.044614e-06
[79,] 0.9999909 1.817946e-05 9.089728e-06
[80,] 0.9999909 1.812830e-05 9.064148e-06
[81,] 0.9999859 2.823958e-05 1.411979e-05
[82,] 0.9999827 3.462594e-05 1.731297e-05
[83,] 0.9999693 6.132359e-05 3.066179e-05
[84,] 0.9999832 3.369504e-05 1.684752e-05
[85,] 0.9999864 2.722749e-05 1.361375e-05
[86,] 0.9999939 1.216263e-05 6.081316e-06
[87,] 0.9999892 2.155532e-05 1.077766e-05
[88,] 0.9999945 1.091039e-05 5.455193e-06
[89,] 0.9999964 7.154191e-06 3.577096e-06
[90,] 0.9999965 6.953976e-06 3.476988e-06
[91,] 0.9999931 1.371461e-05 6.857304e-06
[92,] 0.9999935 1.307160e-05 6.535798e-06
[93,] 0.9999963 7.323968e-06 3.661984e-06
[94,] 0.9999928 1.442486e-05 7.212431e-06
[95,] 0.9999947 1.060171e-05 5.300854e-06
[96,] 0.9999922 1.556804e-05 7.784021e-06
[97,] 0.9999874 2.529151e-05 1.264575e-05
[98,] 0.9999786 4.285995e-05 2.142997e-05
[99,] 0.9999871 2.574148e-05 1.287074e-05
[100,] 0.9999796 4.085679e-05 2.042840e-05
[101,] 0.9999928 1.445746e-05 7.228730e-06
[102,] 0.9999848 3.049298e-05 1.524649e-05
[103,] 0.9999884 2.320643e-05 1.160322e-05
[104,] 0.9999770 4.604665e-05 2.302332e-05
[105,] 0.9999537 9.254113e-05 4.627056e-05
[106,] 0.9999108 1.783080e-04 8.915398e-05
[107,] 0.9999548 9.034940e-05 4.517470e-05
[108,] 0.9999043 1.914428e-04 9.572140e-05
[109,] 0.9998065 3.870165e-04 1.935083e-04
[110,] 0.9999994 1.177096e-06 5.885481e-07
[111,] 1.0000000 3.983347e-08 1.991673e-08
[112,] 0.9999999 1.225647e-07 6.128233e-08
[113,] 1.0000000 8.113852e-08 4.056926e-08
[114,] 0.9999999 2.775336e-07 1.387668e-07
[115,] 0.9999997 5.084399e-07 2.542200e-07
[116,] 0.9999998 3.908221e-07 1.954111e-07
[117,] 0.9999998 3.329665e-07 1.664833e-07
[118,] 0.9999998 3.008931e-07 1.504465e-07
[119,] 0.9999993 1.348547e-06 6.742736e-07
[120,] 0.9999973 5.398530e-06 2.699265e-06
[121,] 0.9999916 1.671680e-05 8.358398e-06
[122,] 0.9999752 4.955122e-05 2.477561e-05
[123,] 0.9999070 1.860255e-04 9.301277e-05
[124,] 0.9996877 6.246608e-04 3.123304e-04
[125,] 0.9991641 1.671794e-03 8.358971e-04
[126,] 0.9972545 5.490904e-03 2.745452e-03
[127,] 0.9907106 1.857890e-02 9.289448e-03
[128,] 0.9733911 5.321785e-02 2.660892e-02
[129,] 0.9462008 1.075985e-01 5.379924e-02
> postscript(file="/var/wessaorg/rcomp/tmp/13cc31324665985.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/2jqmf1324665985.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/3bsvp1324665985.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/4gkki1324665985.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/5ez7k1324665985.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
28179.25711 47757.74223 -7837.60057 -26607.06459 -32449.19794 18163.00157
7 8 9 10 11 12
8732.39520 28784.35839 -12905.45191 59791.17398 -34061.46712 4923.18685
13 14 15 16 17 18
-44418.62340 -26960.44234 40499.46688 21635.63383 -15050.41571 -4794.40721
19 20 21 22 23 24
-54235.71923 -47907.06191 -21058.99814 -7298.49279 30436.91154 -42229.35465
25 26 27 28 29 30
5687.71946 7204.76056 1499.71164 44962.10920 101828.27724 -2622.56330
31 32 33 34 35 36
35554.66262 42388.93784 -45901.27626 22916.10898 17594.47612 -2672.47478
37 38 39 40 41 42
3101.55253 -20972.95799 -9134.18952 17351.20803 1689.10455 -27478.96902
43 44 45 46 47 48
-32857.32123 -30603.20188 -28974.29941 43627.22978 -9978.54921 32809.69774
49 50 51 52 53 54
14979.47252 -50415.22959 -15889.51469 7473.90540 58405.41715 58277.72283
55 56 57 58 59 60
27974.99119 9138.97431 57199.38277 -8425.99200 17056.46430 -42509.32188
61 62 63 64 65 66
4298.59298 -46894.64640 5377.98677 -1146.07384 42441.07754 -18886.49194
67 68 69 70 71 72
18035.74712 -61474.87527 5238.92838 -5714.65081 35.06354 2889.78755
73 74 75 76 77 78
-44742.54944 -8099.17473 -31480.41761 -14996.93735 -11364.53335 -67127.24189
79 80 81 82 83 84
-12029.37401 -36380.98210 -4623.92626 72851.90092 -20237.48365 -17698.22850
85 86 87 88 89 90
-26773.67307 -1777.84854 26899.05332 -4770.69845 -16819.97567 -4343.56072
91 92 93 94 95 96
-35794.88195 -33226.99011 38495.00164 1914.76367 -35662.41572 32916.52521
97 98 99 100 101 102
20054.95752 -795.36088 15003.35357 -29286.16391 -4235.71261 -21705.48691
103 104 105 106 107 108
18984.20641 20769.82166 14323.47770 -20796.09784 22917.79967 34460.98937
109 110 111 112 113 114
-2672.47478 -33146.06374 -4720.22858 8497.47739 -1918.59756 -21267.12369
115 116 117 118 119 120
-1373.10920 -2672.47478 61762.12451 -26063.49157 8309.09281 20601.22069
121 122 123 124 125 126
-9522.26153 16960.77071 17602.33648 -15741.63390 9834.16271 -1774.15937
127 128 129 130 131 132
6295.18946 10480.12215 -3447.93318 -5382.75949 2540.88694 -3503.69857
133 134 135 136 137 138
1626.38866 -1535.33592 1452.68190 760.72661 -2672.47478 12609.36184
139 140 141 142 143 144
-8508.90521 -9.26974 -16630.34181 573.50105 15046.19166 -2787.33525
> postscript(file="/var/wessaorg/rcomp/tmp/6bk3v1324665985.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 28179.25711 NA
1 47757.74223 28179.25711
2 -7837.60057 47757.74223
3 -26607.06459 -7837.60057
4 -32449.19794 -26607.06459
5 18163.00157 -32449.19794
6 8732.39520 18163.00157
7 28784.35839 8732.39520
8 -12905.45191 28784.35839
9 59791.17398 -12905.45191
10 -34061.46712 59791.17398
11 4923.18685 -34061.46712
12 -44418.62340 4923.18685
13 -26960.44234 -44418.62340
14 40499.46688 -26960.44234
15 21635.63383 40499.46688
16 -15050.41571 21635.63383
17 -4794.40721 -15050.41571
18 -54235.71923 -4794.40721
19 -47907.06191 -54235.71923
20 -21058.99814 -47907.06191
21 -7298.49279 -21058.99814
22 30436.91154 -7298.49279
23 -42229.35465 30436.91154
24 5687.71946 -42229.35465
25 7204.76056 5687.71946
26 1499.71164 7204.76056
27 44962.10920 1499.71164
28 101828.27724 44962.10920
29 -2622.56330 101828.27724
30 35554.66262 -2622.56330
31 42388.93784 35554.66262
32 -45901.27626 42388.93784
33 22916.10898 -45901.27626
34 17594.47612 22916.10898
35 -2672.47478 17594.47612
36 3101.55253 -2672.47478
37 -20972.95799 3101.55253
38 -9134.18952 -20972.95799
39 17351.20803 -9134.18952
40 1689.10455 17351.20803
41 -27478.96902 1689.10455
42 -32857.32123 -27478.96902
43 -30603.20188 -32857.32123
44 -28974.29941 -30603.20188
45 43627.22978 -28974.29941
46 -9978.54921 43627.22978
47 32809.69774 -9978.54921
48 14979.47252 32809.69774
49 -50415.22959 14979.47252
50 -15889.51469 -50415.22959
51 7473.90540 -15889.51469
52 58405.41715 7473.90540
53 58277.72283 58405.41715
54 27974.99119 58277.72283
55 9138.97431 27974.99119
56 57199.38277 9138.97431
57 -8425.99200 57199.38277
58 17056.46430 -8425.99200
59 -42509.32188 17056.46430
60 4298.59298 -42509.32188
61 -46894.64640 4298.59298
62 5377.98677 -46894.64640
63 -1146.07384 5377.98677
64 42441.07754 -1146.07384
65 -18886.49194 42441.07754
66 18035.74712 -18886.49194
67 -61474.87527 18035.74712
68 5238.92838 -61474.87527
69 -5714.65081 5238.92838
70 35.06354 -5714.65081
71 2889.78755 35.06354
72 -44742.54944 2889.78755
73 -8099.17473 -44742.54944
74 -31480.41761 -8099.17473
75 -14996.93735 -31480.41761
76 -11364.53335 -14996.93735
77 -67127.24189 -11364.53335
78 -12029.37401 -67127.24189
79 -36380.98210 -12029.37401
80 -4623.92626 -36380.98210
81 72851.90092 -4623.92626
82 -20237.48365 72851.90092
83 -17698.22850 -20237.48365
84 -26773.67307 -17698.22850
85 -1777.84854 -26773.67307
86 26899.05332 -1777.84854
87 -4770.69845 26899.05332
88 -16819.97567 -4770.69845
89 -4343.56072 -16819.97567
90 -35794.88195 -4343.56072
91 -33226.99011 -35794.88195
92 38495.00164 -33226.99011
93 1914.76367 38495.00164
94 -35662.41572 1914.76367
95 32916.52521 -35662.41572
96 20054.95752 32916.52521
97 -795.36088 20054.95752
98 15003.35357 -795.36088
99 -29286.16391 15003.35357
100 -4235.71261 -29286.16391
101 -21705.48691 -4235.71261
102 18984.20641 -21705.48691
103 20769.82166 18984.20641
104 14323.47770 20769.82166
105 -20796.09784 14323.47770
106 22917.79967 -20796.09784
107 34460.98937 22917.79967
108 -2672.47478 34460.98937
109 -33146.06374 -2672.47478
110 -4720.22858 -33146.06374
111 8497.47739 -4720.22858
112 -1918.59756 8497.47739
113 -21267.12369 -1918.59756
114 -1373.10920 -21267.12369
115 -2672.47478 -1373.10920
116 61762.12451 -2672.47478
117 -26063.49157 61762.12451
118 8309.09281 -26063.49157
119 20601.22069 8309.09281
120 -9522.26153 20601.22069
121 16960.77071 -9522.26153
122 17602.33648 16960.77071
123 -15741.63390 17602.33648
124 9834.16271 -15741.63390
125 -1774.15937 9834.16271
126 6295.18946 -1774.15937
127 10480.12215 6295.18946
128 -3447.93318 10480.12215
129 -5382.75949 -3447.93318
130 2540.88694 -5382.75949
131 -3503.69857 2540.88694
132 1626.38866 -3503.69857
133 -1535.33592 1626.38866
134 1452.68190 -1535.33592
135 760.72661 1452.68190
136 -2672.47478 760.72661
137 12609.36184 -2672.47478
138 -8508.90521 12609.36184
139 -9.26974 -8508.90521
140 -16630.34181 -9.26974
141 573.50105 -16630.34181
142 15046.19166 573.50105
143 -2787.33525 15046.19166
144 NA -2787.33525
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 47757.74223 28179.25711
[2,] -7837.60057 47757.74223
[3,] -26607.06459 -7837.60057
[4,] -32449.19794 -26607.06459
[5,] 18163.00157 -32449.19794
[6,] 8732.39520 18163.00157
[7,] 28784.35839 8732.39520
[8,] -12905.45191 28784.35839
[9,] 59791.17398 -12905.45191
[10,] -34061.46712 59791.17398
[11,] 4923.18685 -34061.46712
[12,] -44418.62340 4923.18685
[13,] -26960.44234 -44418.62340
[14,] 40499.46688 -26960.44234
[15,] 21635.63383 40499.46688
[16,] -15050.41571 21635.63383
[17,] -4794.40721 -15050.41571
[18,] -54235.71923 -4794.40721
[19,] -47907.06191 -54235.71923
[20,] -21058.99814 -47907.06191
[21,] -7298.49279 -21058.99814
[22,] 30436.91154 -7298.49279
[23,] -42229.35465 30436.91154
[24,] 5687.71946 -42229.35465
[25,] 7204.76056 5687.71946
[26,] 1499.71164 7204.76056
[27,] 44962.10920 1499.71164
[28,] 101828.27724 44962.10920
[29,] -2622.56330 101828.27724
[30,] 35554.66262 -2622.56330
[31,] 42388.93784 35554.66262
[32,] -45901.27626 42388.93784
[33,] 22916.10898 -45901.27626
[34,] 17594.47612 22916.10898
[35,] -2672.47478 17594.47612
[36,] 3101.55253 -2672.47478
[37,] -20972.95799 3101.55253
[38,] -9134.18952 -20972.95799
[39,] 17351.20803 -9134.18952
[40,] 1689.10455 17351.20803
[41,] -27478.96902 1689.10455
[42,] -32857.32123 -27478.96902
[43,] -30603.20188 -32857.32123
[44,] -28974.29941 -30603.20188
[45,] 43627.22978 -28974.29941
[46,] -9978.54921 43627.22978
[47,] 32809.69774 -9978.54921
[48,] 14979.47252 32809.69774
[49,] -50415.22959 14979.47252
[50,] -15889.51469 -50415.22959
[51,] 7473.90540 -15889.51469
[52,] 58405.41715 7473.90540
[53,] 58277.72283 58405.41715
[54,] 27974.99119 58277.72283
[55,] 9138.97431 27974.99119
[56,] 57199.38277 9138.97431
[57,] -8425.99200 57199.38277
[58,] 17056.46430 -8425.99200
[59,] -42509.32188 17056.46430
[60,] 4298.59298 -42509.32188
[61,] -46894.64640 4298.59298
[62,] 5377.98677 -46894.64640
[63,] -1146.07384 5377.98677
[64,] 42441.07754 -1146.07384
[65,] -18886.49194 42441.07754
[66,] 18035.74712 -18886.49194
[67,] -61474.87527 18035.74712
[68,] 5238.92838 -61474.87527
[69,] -5714.65081 5238.92838
[70,] 35.06354 -5714.65081
[71,] 2889.78755 35.06354
[72,] -44742.54944 2889.78755
[73,] -8099.17473 -44742.54944
[74,] -31480.41761 -8099.17473
[75,] -14996.93735 -31480.41761
[76,] -11364.53335 -14996.93735
[77,] -67127.24189 -11364.53335
[78,] -12029.37401 -67127.24189
[79,] -36380.98210 -12029.37401
[80,] -4623.92626 -36380.98210
[81,] 72851.90092 -4623.92626
[82,] -20237.48365 72851.90092
[83,] -17698.22850 -20237.48365
[84,] -26773.67307 -17698.22850
[85,] -1777.84854 -26773.67307
[86,] 26899.05332 -1777.84854
[87,] -4770.69845 26899.05332
[88,] -16819.97567 -4770.69845
[89,] -4343.56072 -16819.97567
[90,] -35794.88195 -4343.56072
[91,] -33226.99011 -35794.88195
[92,] 38495.00164 -33226.99011
[93,] 1914.76367 38495.00164
[94,] -35662.41572 1914.76367
[95,] 32916.52521 -35662.41572
[96,] 20054.95752 32916.52521
[97,] -795.36088 20054.95752
[98,] 15003.35357 -795.36088
[99,] -29286.16391 15003.35357
[100,] -4235.71261 -29286.16391
[101,] -21705.48691 -4235.71261
[102,] 18984.20641 -21705.48691
[103,] 20769.82166 18984.20641
[104,] 14323.47770 20769.82166
[105,] -20796.09784 14323.47770
[106,] 22917.79967 -20796.09784
[107,] 34460.98937 22917.79967
[108,] -2672.47478 34460.98937
[109,] -33146.06374 -2672.47478
[110,] -4720.22858 -33146.06374
[111,] 8497.47739 -4720.22858
[112,] -1918.59756 8497.47739
[113,] -21267.12369 -1918.59756
[114,] -1373.10920 -21267.12369
[115,] -2672.47478 -1373.10920
[116,] 61762.12451 -2672.47478
[117,] -26063.49157 61762.12451
[118,] 8309.09281 -26063.49157
[119,] 20601.22069 8309.09281
[120,] -9522.26153 20601.22069
[121,] 16960.77071 -9522.26153
[122,] 17602.33648 16960.77071
[123,] -15741.63390 17602.33648
[124,] 9834.16271 -15741.63390
[125,] -1774.15937 9834.16271
[126,] 6295.18946 -1774.15937
[127,] 10480.12215 6295.18946
[128,] -3447.93318 10480.12215
[129,] -5382.75949 -3447.93318
[130,] 2540.88694 -5382.75949
[131,] -3503.69857 2540.88694
[132,] 1626.38866 -3503.69857
[133,] -1535.33592 1626.38866
[134,] 1452.68190 -1535.33592
[135,] 760.72661 1452.68190
[136,] -2672.47478 760.72661
[137,] 12609.36184 -2672.47478
[138,] -8508.90521 12609.36184
[139,] -9.26974 -8508.90521
[140,] -16630.34181 -9.26974
[141,] 573.50105 -16630.34181
[142,] 15046.19166 573.50105
[143,] -2787.33525 15046.19166
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 47757.74223 28179.25711
2 -7837.60057 47757.74223
3 -26607.06459 -7837.60057
4 -32449.19794 -26607.06459
5 18163.00157 -32449.19794
6 8732.39520 18163.00157
7 28784.35839 8732.39520
8 -12905.45191 28784.35839
9 59791.17398 -12905.45191
10 -34061.46712 59791.17398
11 4923.18685 -34061.46712
12 -44418.62340 4923.18685
13 -26960.44234 -44418.62340
14 40499.46688 -26960.44234
15 21635.63383 40499.46688
16 -15050.41571 21635.63383
17 -4794.40721 -15050.41571
18 -54235.71923 -4794.40721
19 -47907.06191 -54235.71923
20 -21058.99814 -47907.06191
21 -7298.49279 -21058.99814
22 30436.91154 -7298.49279
23 -42229.35465 30436.91154
24 5687.71946 -42229.35465
25 7204.76056 5687.71946
26 1499.71164 7204.76056
27 44962.10920 1499.71164
28 101828.27724 44962.10920
29 -2622.56330 101828.27724
30 35554.66262 -2622.56330
31 42388.93784 35554.66262
32 -45901.27626 42388.93784
33 22916.10898 -45901.27626
34 17594.47612 22916.10898
35 -2672.47478 17594.47612
36 3101.55253 -2672.47478
37 -20972.95799 3101.55253
38 -9134.18952 -20972.95799
39 17351.20803 -9134.18952
40 1689.10455 17351.20803
41 -27478.96902 1689.10455
42 -32857.32123 -27478.96902
43 -30603.20188 -32857.32123
44 -28974.29941 -30603.20188
45 43627.22978 -28974.29941
46 -9978.54921 43627.22978
47 32809.69774 -9978.54921
48 14979.47252 32809.69774
49 -50415.22959 14979.47252
50 -15889.51469 -50415.22959
51 7473.90540 -15889.51469
52 58405.41715 7473.90540
53 58277.72283 58405.41715
54 27974.99119 58277.72283
55 9138.97431 27974.99119
56 57199.38277 9138.97431
57 -8425.99200 57199.38277
58 17056.46430 -8425.99200
59 -42509.32188 17056.46430
60 4298.59298 -42509.32188
61 -46894.64640 4298.59298
62 5377.98677 -46894.64640
63 -1146.07384 5377.98677
64 42441.07754 -1146.07384
65 -18886.49194 42441.07754
66 18035.74712 -18886.49194
67 -61474.87527 18035.74712
68 5238.92838 -61474.87527
69 -5714.65081 5238.92838
70 35.06354 -5714.65081
71 2889.78755 35.06354
72 -44742.54944 2889.78755
73 -8099.17473 -44742.54944
74 -31480.41761 -8099.17473
75 -14996.93735 -31480.41761
76 -11364.53335 -14996.93735
77 -67127.24189 -11364.53335
78 -12029.37401 -67127.24189
79 -36380.98210 -12029.37401
80 -4623.92626 -36380.98210
81 72851.90092 -4623.92626
82 -20237.48365 72851.90092
83 -17698.22850 -20237.48365
84 -26773.67307 -17698.22850
85 -1777.84854 -26773.67307
86 26899.05332 -1777.84854
87 -4770.69845 26899.05332
88 -16819.97567 -4770.69845
89 -4343.56072 -16819.97567
90 -35794.88195 -4343.56072
91 -33226.99011 -35794.88195
92 38495.00164 -33226.99011
93 1914.76367 38495.00164
94 -35662.41572 1914.76367
95 32916.52521 -35662.41572
96 20054.95752 32916.52521
97 -795.36088 20054.95752
98 15003.35357 -795.36088
99 -29286.16391 15003.35357
100 -4235.71261 -29286.16391
101 -21705.48691 -4235.71261
102 18984.20641 -21705.48691
103 20769.82166 18984.20641
104 14323.47770 20769.82166
105 -20796.09784 14323.47770
106 22917.79967 -20796.09784
107 34460.98937 22917.79967
108 -2672.47478 34460.98937
109 -33146.06374 -2672.47478
110 -4720.22858 -33146.06374
111 8497.47739 -4720.22858
112 -1918.59756 8497.47739
113 -21267.12369 -1918.59756
114 -1373.10920 -21267.12369
115 -2672.47478 -1373.10920
116 61762.12451 -2672.47478
117 -26063.49157 61762.12451
118 8309.09281 -26063.49157
119 20601.22069 8309.09281
120 -9522.26153 20601.22069
121 16960.77071 -9522.26153
122 17602.33648 16960.77071
123 -15741.63390 17602.33648
124 9834.16271 -15741.63390
125 -1774.15937 9834.16271
126 6295.18946 -1774.15937
127 10480.12215 6295.18946
128 -3447.93318 10480.12215
129 -5382.75949 -3447.93318
130 2540.88694 -5382.75949
131 -3503.69857 2540.88694
132 1626.38866 -3503.69857
133 -1535.33592 1626.38866
134 1452.68190 -1535.33592
135 760.72661 1452.68190
136 -2672.47478 760.72661
137 12609.36184 -2672.47478
138 -8508.90521 12609.36184
139 -9.26974 -8508.90521
140 -16630.34181 -9.26974
141 573.50105 -16630.34181
142 15046.19166 573.50105
143 -2787.33525 15046.19166
> 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/72qg31324665985.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/8ni0q1324665985.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/9udue1324665985.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/104gtf1324665985.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/119p4p1324665985.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/129p8n1324665985.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/13of8z1324665985.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/140bv21324665985.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/151b5o1324665985.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/16u6fp1324665985.tab")
+ }
>
> try(system("convert tmp/13cc31324665985.ps tmp/13cc31324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/2jqmf1324665985.ps tmp/2jqmf1324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bsvp1324665985.ps tmp/3bsvp1324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/4gkki1324665985.ps tmp/4gkki1324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ez7k1324665985.ps tmp/5ez7k1324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/6bk3v1324665985.ps tmp/6bk3v1324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/72qg31324665985.ps tmp/72qg31324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ni0q1324665985.ps tmp/8ni0q1324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/9udue1324665985.ps tmp/9udue1324665985.png",intern=TRUE))
character(0)
> try(system("convert tmp/104gtf1324665985.ps tmp/104gtf1324665985.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.775 0.863 5.669