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(158258
+ ,0
+ ,48
+ ,18
+ ,20465
+ ,23975
+ ,186930
+ ,1
+ ,53
+ ,20
+ ,33629
+ ,85634
+ ,7215
+ ,0
+ ,0
+ ,0
+ ,1423
+ ,1929
+ ,129098
+ ,0
+ ,51
+ ,27
+ ,25629
+ ,36294
+ ,230632
+ ,0
+ ,76
+ ,31
+ ,54002
+ ,72255
+ ,508313
+ ,1
+ ,128
+ ,36
+ ,151036
+ ,189748
+ ,180745
+ ,1
+ ,62
+ ,23
+ ,33287
+ ,61834
+ ,185559
+ ,0
+ ,83
+ ,30
+ ,31172
+ ,68167
+ ,154581
+ ,0
+ ,55
+ ,30
+ ,28113
+ ,38462
+ ,290658
+ ,1
+ ,67
+ ,26
+ ,57803
+ ,101219
+ ,121844
+ ,2
+ ,50
+ ,24
+ ,49830
+ ,43270
+ ,184039
+ ,0
+ ,77
+ ,30
+ ,52143
+ ,76183
+ ,100324
+ ,0
+ ,46
+ ,22
+ ,21055
+ ,31476
+ ,209427
+ ,4
+ ,79
+ ,25
+ ,47007
+ ,62157
+ ,168265
+ ,4
+ ,56
+ ,18
+ ,28735
+ ,46261
+ ,154593
+ ,3
+ ,54
+ ,22
+ ,59147
+ ,50063
+ ,142018
+ ,0
+ ,81
+ ,33
+ ,78950
+ ,64483
+ ,78604
+ ,5
+ ,6
+ ,15
+ ,13497
+ ,2341
+ ,167047
+ ,0
+ ,74
+ ,34
+ ,46154
+ ,48149
+ ,27997
+ ,0
+ ,13
+ ,18
+ ,53249
+ ,12743
+ ,73019
+ ,0
+ ,22
+ ,15
+ ,10726
+ ,18743
+ ,241082
+ ,0
+ ,99
+ ,30
+ ,83700
+ ,97057
+ ,195820
+ ,0
+ ,38
+ ,25
+ ,40400
+ ,17675
+ ,141899
+ ,1
+ ,59
+ ,34
+ ,33797
+ ,33106
+ ,145433
+ ,1
+ ,50
+ ,21
+ ,36205
+ ,53311
+ ,183744
+ ,0
+ ,50
+ ,21
+ ,30165
+ ,42754
+ ,202232
+ ,0
+ ,61
+ ,25
+ ,58534
+ ,59056
+ ,190230
+ ,0
+ ,81
+ ,31
+ ,44663
+ ,101621
+ ,354924
+ ,0
+ ,60
+ ,31
+ ,92556
+ ,118120
+ ,192399
+ ,0
+ ,52
+ ,20
+ ,40078
+ ,79572
+ ,182286
+ ,0
+ ,61
+ ,28
+ ,34711
+ ,42744
+ ,181590
+ ,2
+ ,60
+ ,22
+ ,31076
+ ,65931
+ ,133801
+ ,4
+ ,53
+ ,17
+ ,74608
+ ,38575
+ ,233686
+ ,0
+ ,76
+ ,25
+ ,58092
+ ,28795
+ ,219428
+ ,1
+ ,63
+ ,24
+ ,42009
+ ,94440
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,223044
+ ,0
+ ,54
+ ,28
+ ,36022
+ ,38229
+ ,100129
+ ,3
+ ,44
+ ,14
+ ,23333
+ ,31972
+ ,136733
+ ,9
+ ,36
+ ,35
+ ,53349
+ ,40071
+ ,249965
+ ,0
+ ,83
+ ,34
+ ,92596
+ ,132480
+ ,242379
+ ,2
+ ,105
+ ,22
+ ,49598
+ ,62797
+ ,145794
+ ,0
+ ,37
+ ,34
+ ,44093
+ ,40429
+ ,96404
+ ,2
+ ,25
+ ,23
+ ,84205
+ ,45545
+ ,195891
+ ,1
+ ,64
+ ,24
+ ,63369
+ ,57568
+ ,117156
+ ,2
+ ,55
+ ,26
+ ,60132
+ ,39019
+ ,157787
+ ,2
+ ,41
+ ,22
+ ,37403
+ ,53866
+ ,81293
+ ,1
+ ,23
+ ,35
+ ,24460
+ ,38345
+ ,224049
+ ,0
+ ,67
+ ,24
+ ,46456
+ ,50210
+ ,223789
+ ,1
+ ,54
+ ,31
+ ,66616
+ ,80947
+ ,160344
+ ,8
+ ,68
+ ,26
+ ,41554
+ ,43461
+ ,48188
+ ,0
+ ,12
+ ,22
+ ,22346
+ ,14812
+ ,152206
+ ,0
+ ,86
+ ,21
+ ,30874
+ ,37819
+ ,294283
+ ,0
+ ,74
+ ,27
+ ,68701
+ ,102738
+ ,235223
+ ,0
+ ,56
+ ,30
+ ,35728
+ ,54509
+ ,195583
+ ,1
+ ,67
+ ,33
+ ,29010
+ ,62956
+ ,145942
+ ,8
+ ,40
+ ,11
+ ,23110
+ ,55411
+ ,208834
+ ,0
+ ,53
+ ,26
+ ,38844
+ ,50611
+ ,93764
+ ,1
+ ,26
+ ,26
+ ,27084
+ ,26692
+ ,151985
+ ,0
+ ,67
+ ,23
+ ,35139
+ ,60056
+ ,190545
+ ,10
+ ,36
+ ,38
+ ,57476
+ ,25155
+ ,148922
+ ,6
+ ,50
+ ,31
+ ,33277
+ ,42840
+ ,132856
+ ,0
+ ,48
+ ,20
+ ,31141
+ ,39358
+ ,126107
+ ,11
+ ,46
+ ,19
+ ,61281
+ ,47241
+ ,112718
+ ,3
+ ,53
+ ,26
+ ,25820
+ ,49611
+ ,160930
+ ,0
+ ,27
+ ,26
+ ,23284
+ ,41833
+ ,99184
+ ,0
+ ,38
+ ,33
+ ,35378
+ ,48930
+ ,182022
+ ,8
+ ,69
+ ,36
+ ,74990
+ ,110600
+ ,138708
+ ,2
+ ,93
+ ,25
+ ,29653
+ ,52235
+ ,114408
+ ,0
+ ,59
+ ,24
+ ,64622
+ ,53986
+ ,31970
+ ,0
+ ,5
+ ,21
+ ,4157
+ ,4105
+ ,225558
+ ,3
+ ,53
+ ,19
+ ,29245
+ ,59331
+ ,137011
+ ,1
+ ,40
+ ,12
+ ,50008
+ ,47796
+ ,113612
+ ,2
+ ,72
+ ,30
+ ,52338
+ ,38302
+ ,108641
+ ,1
+ ,51
+ ,21
+ ,13310
+ ,14063
+ ,162203
+ ,0
+ ,81
+ ,34
+ ,92901
+ ,54414
+ ,100098
+ ,2
+ ,27
+ ,32
+ ,10956
+ ,9903
+ ,174768
+ ,1
+ ,94
+ ,28
+ ,34241
+ ,53987
+ ,158459
+ ,0
+ ,71
+ ,28
+ ,75043
+ ,88937
+ ,80934
+ ,0
+ ,20
+ ,21
+ ,21152
+ ,21928
+ ,84971
+ ,0
+ ,34
+ ,31
+ ,42249
+ ,29487
+ ,80545
+ ,0
+ ,54
+ ,26
+ ,42005
+ ,35334
+ ,287191
+ ,0
+ ,49
+ ,29
+ ,41152
+ ,57596
+ ,62974
+ ,1
+ ,26
+ ,23
+ ,14399
+ ,29750
+ ,130982
+ ,0
+ ,47
+ ,25
+ ,28263
+ ,41029
+ ,75555
+ ,0
+ ,35
+ ,22
+ ,17215
+ ,12416
+ ,162154
+ ,0
+ ,32
+ ,26
+ ,48140
+ ,51158
+ ,226638
+ ,0
+ ,55
+ ,33
+ ,62897
+ ,79935
+ ,115019
+ ,0
+ ,58
+ ,24
+ ,22883
+ ,26552
+ ,105038
+ ,7
+ ,44
+ ,24
+ ,41622
+ ,25807
+ ,155537
+ ,0
+ ,45
+ ,21
+ ,40715
+ ,50620
+ ,153133
+ ,5
+ ,49
+ ,28
+ ,65897
+ ,61467
+ ,165577
+ ,1
+ ,72
+ ,27
+ ,76542
+ ,65292
+ ,151517
+ ,0
+ ,39
+ ,25
+ ,37477
+ ,55516
+ ,133686
+ ,0
+ ,28
+ ,15
+ ,53216
+ ,42006
+ ,58128
+ ,0
+ ,24
+ ,13
+ ,40911
+ ,26273
+ ,245196
+ ,0
+ ,52
+ ,36
+ ,57021
+ ,90248
+ ,195576
+ ,0
+ ,96
+ ,24
+ ,73116
+ ,61476
+ ,19349
+ ,0
+ ,13
+ ,1
+ ,3895
+ ,9604
+ ,225371
+ ,3
+ ,38
+ ,24
+ ,46609
+ ,45108
+ ,152796
+ ,0
+ ,41
+ ,31
+ ,29351
+ ,47232
+ ,59117
+ ,0
+ ,24
+ ,4
+ ,2325
+ ,3439
+ ,91762
+ ,0
+ ,54
+ ,21
+ ,31747
+ ,30553
+ ,127987
+ ,0
+ ,59
+ ,23
+ ,32665
+ ,24751
+ ,113552
+ ,1
+ ,28
+ ,23
+ ,19249
+ ,34458
+ ,85338
+ ,1
+ ,36
+ ,12
+ ,15292
+ ,24649
+ ,27676
+ ,0
+ ,2
+ ,16
+ ,5842
+ ,2342
+ ,147984
+ ,0
+ ,83
+ ,29
+ ,33994
+ ,52739
+ ,122417
+ ,0
+ ,29
+ ,26
+ ,13018
+ ,6245
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,91529
+ ,0
+ ,46
+ ,25
+ ,98177
+ ,35381
+ ,107205
+ ,0
+ ,25
+ ,21
+ ,37941
+ ,19595
+ ,144664
+ ,0
+ ,51
+ ,23
+ ,31032
+ ,50848
+ ,136540
+ ,0
+ ,59
+ ,21
+ ,32683
+ ,39443
+ ,76656
+ ,0
+ ,36
+ ,21
+ ,34545
+ ,27023
+ ,3616
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,183065
+ ,0
+ ,40
+ ,23
+ ,27525
+ ,61022
+ ,144636
+ ,0
+ ,68
+ ,33
+ ,66856
+ ,63528
+ ,159104
+ ,2
+ ,28
+ ,30
+ ,28549
+ ,34835
+ ,113273
+ ,0
+ ,36
+ ,23
+ ,38610
+ ,37172
+ ,43410
+ ,0
+ ,7
+ ,1
+ ,2781
+ ,13
+ ,175774
+ ,1
+ ,70
+ ,29
+ ,41211
+ ,62548
+ ,95401
+ ,0
+ ,30
+ ,18
+ ,22698
+ ,31334
+ ,118893
+ ,8
+ ,59
+ ,32
+ ,41194
+ ,20839
+ ,60493
+ ,3
+ ,3
+ ,12
+ ,32689
+ ,5084
+ ,19764
+ ,1
+ ,10
+ ,2
+ ,5752
+ ,9927
+ ,164062
+ ,3
+ ,46
+ ,21
+ ,26757
+ ,53229
+ ,132696
+ ,0
+ ,34
+ ,28
+ ,22527
+ ,29877
+ ,155367
+ ,0
+ ,54
+ ,29
+ ,44810
+ ,37310
+ ,11796
+ ,0
+ ,1
+ ,2
+ ,0
+ ,0
+ ,10674
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,142261
+ ,0
+ ,39
+ ,18
+ ,100674
+ ,50067
+ ,6836
+ ,0
+ ,0
+ ,1
+ ,0
+ ,0
+ ,154206
+ ,6
+ ,48
+ ,21
+ ,57786
+ ,47708
+ ,5118
+ ,0
+ ,5
+ ,0
+ ,0
+ ,0
+ ,40248
+ ,1
+ ,8
+ ,4
+ ,5444
+ ,6012
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,122641
+ ,0
+ ,38
+ ,25
+ ,28470
+ ,27749
+ ,88837
+ ,0
+ ,21
+ ,26
+ ,61849
+ ,47555
+ ,7131
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,9056
+ ,0
+ ,0
+ ,4
+ ,2179
+ ,1336
+ ,76611
+ ,1
+ ,15
+ ,17
+ ,8019
+ ,11017
+ ,132697
+ ,0
+ ,50
+ ,21
+ ,39644
+ ,55184
+ ,100681
+ ,1
+ ,17
+ ,22
+ ,23494
+ ,43485)
+ ,dim=c(6
+ ,144)
+ ,dimnames=list(c('Time'
+ ,'shared'
+ ,'computations'
+ ,'reviewed'
+ ,'characters'
+ ,'seconds')
+ ,1:144))
> y <- array(NA,dim=c(6,144),dimnames=list(c('Time','shared','computations','reviewed','characters','seconds'),1:144))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> 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
characters Time shared computations reviewed seconds
1 20465 158258 0 48 18 23975
2 33629 186930 1 53 20 85634
3 1423 7215 0 0 0 1929
4 25629 129098 0 51 27 36294
5 54002 230632 0 76 31 72255
6 151036 508313 1 128 36 189748
7 33287 180745 1 62 23 61834
8 31172 185559 0 83 30 68167
9 28113 154581 0 55 30 38462
10 57803 290658 1 67 26 101219
11 49830 121844 2 50 24 43270
12 52143 184039 0 77 30 76183
13 21055 100324 0 46 22 31476
14 47007 209427 4 79 25 62157
15 28735 168265 4 56 18 46261
16 59147 154593 3 54 22 50063
17 78950 142018 0 81 33 64483
18 13497 78604 5 6 15 2341
19 46154 167047 0 74 34 48149
20 53249 27997 0 13 18 12743
21 10726 73019 0 22 15 18743
22 83700 241082 0 99 30 97057
23 40400 195820 0 38 25 17675
24 33797 141899 1 59 34 33106
25 36205 145433 1 50 21 53311
26 30165 183744 0 50 21 42754
27 58534 202232 0 61 25 59056
28 44663 190230 0 81 31 101621
29 92556 354924 0 60 31 118120
30 40078 192399 0 52 20 79572
31 34711 182286 0 61 28 42744
32 31076 181590 2 60 22 65931
33 74608 133801 4 53 17 38575
34 58092 233686 0 76 25 28795
35 42009 219428 1 63 24 94440
36 0 0 0 0 0 0
37 36022 223044 0 54 28 38229
38 23333 100129 3 44 14 31972
39 53349 136733 9 36 35 40071
40 92596 249965 0 83 34 132480
41 49598 242379 2 105 22 62797
42 44093 145794 0 37 34 40429
43 84205 96404 2 25 23 45545
44 63369 195891 1 64 24 57568
45 60132 117156 2 55 26 39019
46 37403 157787 2 41 22 53866
47 24460 81293 1 23 35 38345
48 46456 224049 0 67 24 50210
49 66616 223789 1 54 31 80947
50 41554 160344 8 68 26 43461
51 22346 48188 0 12 22 14812
52 30874 152206 0 86 21 37819
53 68701 294283 0 74 27 102738
54 35728 235223 0 56 30 54509
55 29010 195583 1 67 33 62956
56 23110 145942 8 40 11 55411
57 38844 208834 0 53 26 50611
58 27084 93764 1 26 26 26692
59 35139 151985 0 67 23 60056
60 57476 190545 10 36 38 25155
61 33277 148922 6 50 31 42840
62 31141 132856 0 48 20 39358
63 61281 126107 11 46 19 47241
64 25820 112718 3 53 26 49611
65 23284 160930 0 27 26 41833
66 35378 99184 0 38 33 48930
67 74990 182022 8 69 36 110600
68 29653 138708 2 93 25 52235
69 64622 114408 0 59 24 53986
70 4157 31970 0 5 21 4105
71 29245 225558 3 53 19 59331
72 50008 137011 1 40 12 47796
73 52338 113612 2 72 30 38302
74 13310 108641 1 51 21 14063
75 92901 162203 0 81 34 54414
76 10956 100098 2 27 32 9903
77 34241 174768 1 94 28 53987
78 75043 158459 0 71 28 88937
79 21152 80934 0 20 21 21928
80 42249 84971 0 34 31 29487
81 42005 80545 0 54 26 35334
82 41152 287191 0 49 29 57596
83 14399 62974 1 26 23 29750
84 28263 130982 0 47 25 41029
85 17215 75555 0 35 22 12416
86 48140 162154 0 32 26 51158
87 62897 226638 0 55 33 79935
88 22883 115019 0 58 24 26552
89 41622 105038 7 44 24 25807
90 40715 155537 0 45 21 50620
91 65897 153133 5 49 28 61467
92 76542 165577 1 72 27 65292
93 37477 151517 0 39 25 55516
94 53216 133686 0 28 15 42006
95 40911 58128 0 24 13 26273
96 57021 245196 0 52 36 90248
97 73116 195576 0 96 24 61476
98 3895 19349 0 13 1 9604
99 46609 225371 3 38 24 45108
100 29351 152796 0 41 31 47232
101 2325 59117 0 24 4 3439
102 31747 91762 0 54 21 30553
103 32665 127987 0 59 23 24751
104 19249 113552 1 28 23 34458
105 15292 85338 1 36 12 24649
106 5842 27676 0 2 16 2342
107 33994 147984 0 83 29 52739
108 13018 122417 0 29 26 6245
109 0 0 0 0 0 0
110 98177 91529 0 46 25 35381
111 37941 107205 0 25 21 19595
112 31032 144664 0 51 23 50848
113 32683 136540 0 59 21 39443
114 34545 76656 0 36 21 27023
115 0 3616 0 0 0 0
116 0 0 0 0 0 0
117 27525 183065 0 40 23 61022
118 66856 144636 0 68 33 63528
119 28549 159104 2 28 30 34835
120 38610 113273 0 36 23 37172
121 2781 43410 0 7 1 13
122 41211 175774 1 70 29 62548
123 22698 95401 0 30 18 31334
124 41194 118893 8 59 32 20839
125 32689 60493 3 3 12 5084
126 5752 19764 1 10 2 9927
127 26757 164062 3 46 21 53229
128 22527 132696 0 34 28 29877
129 44810 155367 0 54 29 37310
130 0 11796 0 1 2 0
131 0 10674 0 0 0 0
132 100674 142261 0 39 18 50067
133 0 6836 0 0 1 0
134 57786 154206 6 48 21 47708
135 0 5118 0 5 0 0
136 5444 40248 1 8 4 6012
137 0 0 0 0 0 0
138 28470 122641 0 38 25 27749
139 61849 88837 0 21 26 47555
140 0 7131 1 0 0 0
141 2179 9056 0 0 4 1336
142 8019 76611 1 15 17 11017
143 39644 132697 0 50 21 55184
144 23494 100681 1 17 22 43485
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Time shared computations reviewed
1.166e+03 -6.489e-03 9.175e+02 1.063e+02 5.075e+02
seconds
4.786e-01
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-28253 -9917 -2901 6370 63185
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.166e+03 3.425e+03 0.340 0.7340
Time -6.489e-03 3.785e-02 -0.171 0.8641
shared 9.175e+02 6.019e+02 1.524 0.1297
computations 1.063e+02 9.104e+01 1.168 0.2449
reviewed 5.075e+02 2.010e+02 2.525 0.0127 *
seconds 4.786e-01 9.101e-02 5.259 5.38e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 15820 on 138 degrees of freedom
Multiple R-squared: 0.6168, Adjusted R-squared: 0.6029
F-statistic: 44.43 on 5 and 138 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.20416275 0.4083255 0.795837249
[2,] 0.21898668 0.4379734 0.781013322
[3,] 0.60515915 0.7896817 0.394840845
[4,] 0.54058188 0.9188362 0.459418117
[5,] 0.43574317 0.8714863 0.564256831
[6,] 0.38530803 0.7706161 0.614691973
[7,] 0.31528261 0.6305652 0.684717388
[8,] 0.41515966 0.8303193 0.584840343
[9,] 0.66870802 0.6625840 0.331291982
[10,] 0.60003553 0.7999289 0.399964475
[11,] 0.51990231 0.9601954 0.480097692
[12,] 0.80396509 0.3920698 0.196034911
[13,] 0.75545794 0.4890841 0.244542058
[14,] 0.73970889 0.5205822 0.260291112
[15,] 0.75759028 0.4848194 0.242409724
[16,] 0.71306611 0.5738678 0.286933885
[17,] 0.65710800 0.6857840 0.342892000
[18,] 0.59559075 0.8088185 0.404409246
[19,] 0.56280809 0.8743838 0.437191910
[20,] 0.67629302 0.6474140 0.323706975
[21,] 0.63077588 0.7384482 0.369224119
[22,] 0.60415538 0.7916892 0.395844618
[23,] 0.55198061 0.8960388 0.448019391
[24,] 0.55529541 0.8894092 0.444704592
[25,] 0.82409213 0.3518157 0.175907869
[26,] 0.83981793 0.3203641 0.160182069
[27,] 0.85411382 0.2917724 0.145886177
[28,] 0.82156813 0.3568637 0.178431867
[29,] 0.79181562 0.4163688 0.208184384
[30,] 0.75533480 0.4893304 0.244665200
[31,] 0.71009105 0.5798179 0.289908953
[32,] 0.68969203 0.6206159 0.310307974
[33,] 0.64523934 0.7095213 0.354760661
[34,] 0.59450350 0.8109930 0.405496500
[35,] 0.88299665 0.2340067 0.117003353
[36,] 0.88158134 0.2368373 0.118418656
[37,] 0.89482998 0.2103400 0.105170016
[38,] 0.87433034 0.2513393 0.125669655
[39,] 0.87711536 0.2457693 0.122884635
[40,] 0.85030528 0.2993894 0.149694716
[41,] 0.82074620 0.3585076 0.179253796
[42,] 0.79699224 0.4060155 0.203007760
[43,] 0.75877898 0.4824420 0.241221018
[44,] 0.72083771 0.5583246 0.279162287
[45,] 0.67710931 0.6457814 0.322890691
[46,] 0.66204649 0.6759070 0.337953513
[47,] 0.72914995 0.5417001 0.270850048
[48,] 0.75916451 0.4816710 0.240835492
[49,] 0.72246340 0.5550732 0.277536601
[50,] 0.68020488 0.6395902 0.319795123
[51,] 0.65991358 0.6801728 0.340086415
[52,] 0.65055653 0.6988869 0.349443467
[53,] 0.63585896 0.7282821 0.364141043
[54,] 0.58992651 0.8201470 0.410073491
[55,] 0.58615384 0.8276923 0.413846162
[56,] 0.60645323 0.7870935 0.393546773
[57,] 0.59237983 0.8152403 0.407620172
[58,] 0.56245903 0.8750819 0.437540973
[59,] 0.56430332 0.8713934 0.435696683
[60,] 0.60571637 0.7885673 0.394283635
[61,] 0.63955506 0.7208899 0.360444944
[62,] 0.60586499 0.7882700 0.394135005
[63,] 0.61996383 0.7600723 0.380036173
[64,] 0.61337539 0.7732492 0.386624609
[65,] 0.58404349 0.8319130 0.415956508
[66,] 0.55244951 0.8951010 0.447550489
[67,] 0.78872432 0.4225514 0.211275678
[68,] 0.77812963 0.4437407 0.221870369
[69,] 0.79249222 0.4150156 0.207507780
[70,] 0.76979165 0.4604167 0.230208353
[71,] 0.73065249 0.5386950 0.269347512
[72,] 0.70054741 0.5989052 0.299452594
[73,] 0.66082785 0.6783443 0.339172147
[74,] 0.61878576 0.7624285 0.381214244
[75,] 0.62895457 0.7420909 0.371045432
[76,] 0.60107411 0.7978518 0.398925886
[77,] 0.55413392 0.8917322 0.445866081
[78,] 0.51382584 0.9723483 0.486174157
[79,] 0.46372733 0.9274547 0.536272667
[80,] 0.43128849 0.8625770 0.568711514
[81,] 0.38523171 0.7704634 0.614768290
[82,] 0.33794653 0.6758931 0.662053475
[83,] 0.30644594 0.6128919 0.693554057
[84,] 0.32757444 0.6551489 0.672425562
[85,] 0.29157774 0.5831555 0.708422263
[86,] 0.33809095 0.6761819 0.661909050
[87,] 0.34198216 0.6839643 0.658017836
[88,] 0.31350176 0.6270035 0.686498239
[89,] 0.34344317 0.6868863 0.656556831
[90,] 0.29848389 0.5969678 0.701516110
[91,] 0.28630863 0.5726173 0.713691367
[92,] 0.27876194 0.5575239 0.721238055
[93,] 0.23649568 0.4729914 0.763504318
[94,] 0.19834894 0.3966979 0.801651063
[95,] 0.16546581 0.3309316 0.834534187
[96,] 0.16089358 0.3217872 0.839106420
[97,] 0.13442636 0.2688527 0.865573642
[98,] 0.11674248 0.2334850 0.883257523
[99,] 0.13083370 0.2616674 0.869166304
[100,] 0.10429664 0.2085933 0.895703364
[101,] 0.08117069 0.1623414 0.918829309
[102,] 0.60253578 0.7949284 0.397464216
[103,] 0.60781583 0.7843683 0.392184172
[104,] 0.58064789 0.8387042 0.419352114
[105,] 0.52002297 0.9599541 0.479977030
[106,] 0.46175217 0.9235043 0.538247830
[107,] 0.39864625 0.7972925 0.601353752
[108,] 0.33781018 0.6756204 0.662189821
[109,] 0.38869294 0.7773859 0.611307065
[110,] 0.34715700 0.6943140 0.652843001
[111,] 0.32556634 0.6511327 0.674433657
[112,] 0.26781630 0.5356326 0.732183701
[113,] 0.21226298 0.4245260 0.787737023
[114,] 0.20283026 0.4056605 0.797169738
[115,] 0.16507263 0.3301453 0.834927365
[116,] 0.16565133 0.3313027 0.834348668
[117,] 0.24140633 0.4828127 0.758593668
[118,] 0.18321233 0.3664247 0.816787665
[119,] 0.47734956 0.9546991 0.522650443
[120,] 0.42960990 0.8592198 0.570390095
[121,] 0.34445307 0.6889061 0.655546934
[122,] 0.25709993 0.5141999 0.742900068
[123,] 0.18498850 0.3699770 0.815011495
[124,] 0.99011140 0.0197772 0.009888601
[125,] 0.97485455 0.0502909 0.025145451
[126,] 0.93531338 0.1293732 0.064686620
[127,] 0.85311386 0.2937723 0.146886138
> postscript(file="/var/wessaorg/rcomp/tmp/1v9tl1324549672.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/2tz801324549672.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/3etec1324549672.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/47u211324549672.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/5fjk81324549672.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
-5388.1039 -24014.9097 -619.7531 -11196.2599 -4064.8552 29550.1733
7 8 9 10 11 12
-15484.6599 -25467.3251 -11532.3883 -11160.9608 9412.4444 -7705.1145
13 14 15 16 17 18
-10581.7473 -7308.0747 -12240.8403 15362.7538 22481.5738 -1117.8299
19 20 21 22 23 24
-2097.1404 35647.7984 -8889.2344 11891.8803 15316.6829 -6739.8717
25 26 27 28 29 30
-6425.5148 -6246.3483 11240.2599 -28253.4694 15043.6649 -13605.0438
31 32 33 34 35 36
-6427.0418 -19848.5660 37913.8411 23891.9035 -22732.1577 -1166.2651
37 38 39 40 41 42
-1946.2842 -7022.2857 4042.4182 3561.4980 -4216.2041 3332.7327
43 44 45 46 47 48
45698.8273 16017.3809 20172.1525 -5881.1943 -15657.9337 3407.5376
49 50 51 52 53 54
5765.7671 -7138.9561 1961.7821 -7207.2147 -1300.6910 -11181.2353
55 56 57 58 59 60
-25809.0722 -20806.7767 -4021.7373 -3126.7366 -12582.3041 13218.0163
61 62 63 64 65 66
-13981.6693 -3254.9404 13695.5286 -19943.3390 -12926.8558 -9352.4785
67 68 69 70 71 72
-10879.4036 -20025.2176 19905.2451 -9955.8960 -16886.0007 15593.2813
73 74 75 76 77 78
8860.9608 -10879.7270 40875.5160 -15246.5560 -16753.1326 10577.1716
79 80 81 82 83 84
-2768.7771 8172.8564 5512.7477 -5645.8850 -15952.7002 -9376.1416
85 86 87 88 89 90
-4290.0431 6942.1523 2345.8312 -8592.3404 5504.2506 887.1752
91 92 93 94 95 96
12296.3023 22923.5837 -6112.4981 22221.8302 18397.3328 -9549.5896
97 98 99 100 101 102
21407.2422 -3632.2137 6341.7280 -13522.7856 -4685.3064 153.4740
103 104 105 106 107 108
2537.0398 -13240.5931 -7953.5745 -4598.4240 -14997.1086 -6621.3892
109 110 111 112 113 114
-1166.2651 63091.5514 14775.7966 -10628.4143 -3406.6904 6456.7334
115 116 117 118 119 120
-1142.8013 -1166.2651 -17586.5020 12243.7589 -8295.5372 4886.5572
121 122 123 124 125 126
638.4839 -11830.2353 -5171.6561 971.7540 20320.2364 -3033.2070
127 128 129 130 131 132
-17123.1655 -9903.6082 6334.9334 -2211.0532 -1097.0027 63185.1320
133 134 135 136 137 138
-1629.4152 13519.2872 -1664.6287 -2136.7819 -1166.2651 -1910.0329
139 140 141 142 143 144
23069.4248 -2037.5128 -1598.0034 -9063.2515 -3048.1386 -11722.8658
> postscript(file="/var/wessaorg/rcomp/tmp/6zzmb1324549672.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 -5388.1039 NA
1 -24014.9097 -5388.1039
2 -619.7531 -24014.9097
3 -11196.2599 -619.7531
4 -4064.8552 -11196.2599
5 29550.1733 -4064.8552
6 -15484.6599 29550.1733
7 -25467.3251 -15484.6599
8 -11532.3883 -25467.3251
9 -11160.9608 -11532.3883
10 9412.4444 -11160.9608
11 -7705.1145 9412.4444
12 -10581.7473 -7705.1145
13 -7308.0747 -10581.7473
14 -12240.8403 -7308.0747
15 15362.7538 -12240.8403
16 22481.5738 15362.7538
17 -1117.8299 22481.5738
18 -2097.1404 -1117.8299
19 35647.7984 -2097.1404
20 -8889.2344 35647.7984
21 11891.8803 -8889.2344
22 15316.6829 11891.8803
23 -6739.8717 15316.6829
24 -6425.5148 -6739.8717
25 -6246.3483 -6425.5148
26 11240.2599 -6246.3483
27 -28253.4694 11240.2599
28 15043.6649 -28253.4694
29 -13605.0438 15043.6649
30 -6427.0418 -13605.0438
31 -19848.5660 -6427.0418
32 37913.8411 -19848.5660
33 23891.9035 37913.8411
34 -22732.1577 23891.9035
35 -1166.2651 -22732.1577
36 -1946.2842 -1166.2651
37 -7022.2857 -1946.2842
38 4042.4182 -7022.2857
39 3561.4980 4042.4182
40 -4216.2041 3561.4980
41 3332.7327 -4216.2041
42 45698.8273 3332.7327
43 16017.3809 45698.8273
44 20172.1525 16017.3809
45 -5881.1943 20172.1525
46 -15657.9337 -5881.1943
47 3407.5376 -15657.9337
48 5765.7671 3407.5376
49 -7138.9561 5765.7671
50 1961.7821 -7138.9561
51 -7207.2147 1961.7821
52 -1300.6910 -7207.2147
53 -11181.2353 -1300.6910
54 -25809.0722 -11181.2353
55 -20806.7767 -25809.0722
56 -4021.7373 -20806.7767
57 -3126.7366 -4021.7373
58 -12582.3041 -3126.7366
59 13218.0163 -12582.3041
60 -13981.6693 13218.0163
61 -3254.9404 -13981.6693
62 13695.5286 -3254.9404
63 -19943.3390 13695.5286
64 -12926.8558 -19943.3390
65 -9352.4785 -12926.8558
66 -10879.4036 -9352.4785
67 -20025.2176 -10879.4036
68 19905.2451 -20025.2176
69 -9955.8960 19905.2451
70 -16886.0007 -9955.8960
71 15593.2813 -16886.0007
72 8860.9608 15593.2813
73 -10879.7270 8860.9608
74 40875.5160 -10879.7270
75 -15246.5560 40875.5160
76 -16753.1326 -15246.5560
77 10577.1716 -16753.1326
78 -2768.7771 10577.1716
79 8172.8564 -2768.7771
80 5512.7477 8172.8564
81 -5645.8850 5512.7477
82 -15952.7002 -5645.8850
83 -9376.1416 -15952.7002
84 -4290.0431 -9376.1416
85 6942.1523 -4290.0431
86 2345.8312 6942.1523
87 -8592.3404 2345.8312
88 5504.2506 -8592.3404
89 887.1752 5504.2506
90 12296.3023 887.1752
91 22923.5837 12296.3023
92 -6112.4981 22923.5837
93 22221.8302 -6112.4981
94 18397.3328 22221.8302
95 -9549.5896 18397.3328
96 21407.2422 -9549.5896
97 -3632.2137 21407.2422
98 6341.7280 -3632.2137
99 -13522.7856 6341.7280
100 -4685.3064 -13522.7856
101 153.4740 -4685.3064
102 2537.0398 153.4740
103 -13240.5931 2537.0398
104 -7953.5745 -13240.5931
105 -4598.4240 -7953.5745
106 -14997.1086 -4598.4240
107 -6621.3892 -14997.1086
108 -1166.2651 -6621.3892
109 63091.5514 -1166.2651
110 14775.7966 63091.5514
111 -10628.4143 14775.7966
112 -3406.6904 -10628.4143
113 6456.7334 -3406.6904
114 -1142.8013 6456.7334
115 -1166.2651 -1142.8013
116 -17586.5020 -1166.2651
117 12243.7589 -17586.5020
118 -8295.5372 12243.7589
119 4886.5572 -8295.5372
120 638.4839 4886.5572
121 -11830.2353 638.4839
122 -5171.6561 -11830.2353
123 971.7540 -5171.6561
124 20320.2364 971.7540
125 -3033.2070 20320.2364
126 -17123.1655 -3033.2070
127 -9903.6082 -17123.1655
128 6334.9334 -9903.6082
129 -2211.0532 6334.9334
130 -1097.0027 -2211.0532
131 63185.1320 -1097.0027
132 -1629.4152 63185.1320
133 13519.2872 -1629.4152
134 -1664.6287 13519.2872
135 -2136.7819 -1664.6287
136 -1166.2651 -2136.7819
137 -1910.0329 -1166.2651
138 23069.4248 -1910.0329
139 -2037.5128 23069.4248
140 -1598.0034 -2037.5128
141 -9063.2515 -1598.0034
142 -3048.1386 -9063.2515
143 -11722.8658 -3048.1386
144 NA -11722.8658
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -24014.9097 -5388.1039
[2,] -619.7531 -24014.9097
[3,] -11196.2599 -619.7531
[4,] -4064.8552 -11196.2599
[5,] 29550.1733 -4064.8552
[6,] -15484.6599 29550.1733
[7,] -25467.3251 -15484.6599
[8,] -11532.3883 -25467.3251
[9,] -11160.9608 -11532.3883
[10,] 9412.4444 -11160.9608
[11,] -7705.1145 9412.4444
[12,] -10581.7473 -7705.1145
[13,] -7308.0747 -10581.7473
[14,] -12240.8403 -7308.0747
[15,] 15362.7538 -12240.8403
[16,] 22481.5738 15362.7538
[17,] -1117.8299 22481.5738
[18,] -2097.1404 -1117.8299
[19,] 35647.7984 -2097.1404
[20,] -8889.2344 35647.7984
[21,] 11891.8803 -8889.2344
[22,] 15316.6829 11891.8803
[23,] -6739.8717 15316.6829
[24,] -6425.5148 -6739.8717
[25,] -6246.3483 -6425.5148
[26,] 11240.2599 -6246.3483
[27,] -28253.4694 11240.2599
[28,] 15043.6649 -28253.4694
[29,] -13605.0438 15043.6649
[30,] -6427.0418 -13605.0438
[31,] -19848.5660 -6427.0418
[32,] 37913.8411 -19848.5660
[33,] 23891.9035 37913.8411
[34,] -22732.1577 23891.9035
[35,] -1166.2651 -22732.1577
[36,] -1946.2842 -1166.2651
[37,] -7022.2857 -1946.2842
[38,] 4042.4182 -7022.2857
[39,] 3561.4980 4042.4182
[40,] -4216.2041 3561.4980
[41,] 3332.7327 -4216.2041
[42,] 45698.8273 3332.7327
[43,] 16017.3809 45698.8273
[44,] 20172.1525 16017.3809
[45,] -5881.1943 20172.1525
[46,] -15657.9337 -5881.1943
[47,] 3407.5376 -15657.9337
[48,] 5765.7671 3407.5376
[49,] -7138.9561 5765.7671
[50,] 1961.7821 -7138.9561
[51,] -7207.2147 1961.7821
[52,] -1300.6910 -7207.2147
[53,] -11181.2353 -1300.6910
[54,] -25809.0722 -11181.2353
[55,] -20806.7767 -25809.0722
[56,] -4021.7373 -20806.7767
[57,] -3126.7366 -4021.7373
[58,] -12582.3041 -3126.7366
[59,] 13218.0163 -12582.3041
[60,] -13981.6693 13218.0163
[61,] -3254.9404 -13981.6693
[62,] 13695.5286 -3254.9404
[63,] -19943.3390 13695.5286
[64,] -12926.8558 -19943.3390
[65,] -9352.4785 -12926.8558
[66,] -10879.4036 -9352.4785
[67,] -20025.2176 -10879.4036
[68,] 19905.2451 -20025.2176
[69,] -9955.8960 19905.2451
[70,] -16886.0007 -9955.8960
[71,] 15593.2813 -16886.0007
[72,] 8860.9608 15593.2813
[73,] -10879.7270 8860.9608
[74,] 40875.5160 -10879.7270
[75,] -15246.5560 40875.5160
[76,] -16753.1326 -15246.5560
[77,] 10577.1716 -16753.1326
[78,] -2768.7771 10577.1716
[79,] 8172.8564 -2768.7771
[80,] 5512.7477 8172.8564
[81,] -5645.8850 5512.7477
[82,] -15952.7002 -5645.8850
[83,] -9376.1416 -15952.7002
[84,] -4290.0431 -9376.1416
[85,] 6942.1523 -4290.0431
[86,] 2345.8312 6942.1523
[87,] -8592.3404 2345.8312
[88,] 5504.2506 -8592.3404
[89,] 887.1752 5504.2506
[90,] 12296.3023 887.1752
[91,] 22923.5837 12296.3023
[92,] -6112.4981 22923.5837
[93,] 22221.8302 -6112.4981
[94,] 18397.3328 22221.8302
[95,] -9549.5896 18397.3328
[96,] 21407.2422 -9549.5896
[97,] -3632.2137 21407.2422
[98,] 6341.7280 -3632.2137
[99,] -13522.7856 6341.7280
[100,] -4685.3064 -13522.7856
[101,] 153.4740 -4685.3064
[102,] 2537.0398 153.4740
[103,] -13240.5931 2537.0398
[104,] -7953.5745 -13240.5931
[105,] -4598.4240 -7953.5745
[106,] -14997.1086 -4598.4240
[107,] -6621.3892 -14997.1086
[108,] -1166.2651 -6621.3892
[109,] 63091.5514 -1166.2651
[110,] 14775.7966 63091.5514
[111,] -10628.4143 14775.7966
[112,] -3406.6904 -10628.4143
[113,] 6456.7334 -3406.6904
[114,] -1142.8013 6456.7334
[115,] -1166.2651 -1142.8013
[116,] -17586.5020 -1166.2651
[117,] 12243.7589 -17586.5020
[118,] -8295.5372 12243.7589
[119,] 4886.5572 -8295.5372
[120,] 638.4839 4886.5572
[121,] -11830.2353 638.4839
[122,] -5171.6561 -11830.2353
[123,] 971.7540 -5171.6561
[124,] 20320.2364 971.7540
[125,] -3033.2070 20320.2364
[126,] -17123.1655 -3033.2070
[127,] -9903.6082 -17123.1655
[128,] 6334.9334 -9903.6082
[129,] -2211.0532 6334.9334
[130,] -1097.0027 -2211.0532
[131,] 63185.1320 -1097.0027
[132,] -1629.4152 63185.1320
[133,] 13519.2872 -1629.4152
[134,] -1664.6287 13519.2872
[135,] -2136.7819 -1664.6287
[136,] -1166.2651 -2136.7819
[137,] -1910.0329 -1166.2651
[138,] 23069.4248 -1910.0329
[139,] -2037.5128 23069.4248
[140,] -1598.0034 -2037.5128
[141,] -9063.2515 -1598.0034
[142,] -3048.1386 -9063.2515
[143,] -11722.8658 -3048.1386
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -24014.9097 -5388.1039
2 -619.7531 -24014.9097
3 -11196.2599 -619.7531
4 -4064.8552 -11196.2599
5 29550.1733 -4064.8552
6 -15484.6599 29550.1733
7 -25467.3251 -15484.6599
8 -11532.3883 -25467.3251
9 -11160.9608 -11532.3883
10 9412.4444 -11160.9608
11 -7705.1145 9412.4444
12 -10581.7473 -7705.1145
13 -7308.0747 -10581.7473
14 -12240.8403 -7308.0747
15 15362.7538 -12240.8403
16 22481.5738 15362.7538
17 -1117.8299 22481.5738
18 -2097.1404 -1117.8299
19 35647.7984 -2097.1404
20 -8889.2344 35647.7984
21 11891.8803 -8889.2344
22 15316.6829 11891.8803
23 -6739.8717 15316.6829
24 -6425.5148 -6739.8717
25 -6246.3483 -6425.5148
26 11240.2599 -6246.3483
27 -28253.4694 11240.2599
28 15043.6649 -28253.4694
29 -13605.0438 15043.6649
30 -6427.0418 -13605.0438
31 -19848.5660 -6427.0418
32 37913.8411 -19848.5660
33 23891.9035 37913.8411
34 -22732.1577 23891.9035
35 -1166.2651 -22732.1577
36 -1946.2842 -1166.2651
37 -7022.2857 -1946.2842
38 4042.4182 -7022.2857
39 3561.4980 4042.4182
40 -4216.2041 3561.4980
41 3332.7327 -4216.2041
42 45698.8273 3332.7327
43 16017.3809 45698.8273
44 20172.1525 16017.3809
45 -5881.1943 20172.1525
46 -15657.9337 -5881.1943
47 3407.5376 -15657.9337
48 5765.7671 3407.5376
49 -7138.9561 5765.7671
50 1961.7821 -7138.9561
51 -7207.2147 1961.7821
52 -1300.6910 -7207.2147
53 -11181.2353 -1300.6910
54 -25809.0722 -11181.2353
55 -20806.7767 -25809.0722
56 -4021.7373 -20806.7767
57 -3126.7366 -4021.7373
58 -12582.3041 -3126.7366
59 13218.0163 -12582.3041
60 -13981.6693 13218.0163
61 -3254.9404 -13981.6693
62 13695.5286 -3254.9404
63 -19943.3390 13695.5286
64 -12926.8558 -19943.3390
65 -9352.4785 -12926.8558
66 -10879.4036 -9352.4785
67 -20025.2176 -10879.4036
68 19905.2451 -20025.2176
69 -9955.8960 19905.2451
70 -16886.0007 -9955.8960
71 15593.2813 -16886.0007
72 8860.9608 15593.2813
73 -10879.7270 8860.9608
74 40875.5160 -10879.7270
75 -15246.5560 40875.5160
76 -16753.1326 -15246.5560
77 10577.1716 -16753.1326
78 -2768.7771 10577.1716
79 8172.8564 -2768.7771
80 5512.7477 8172.8564
81 -5645.8850 5512.7477
82 -15952.7002 -5645.8850
83 -9376.1416 -15952.7002
84 -4290.0431 -9376.1416
85 6942.1523 -4290.0431
86 2345.8312 6942.1523
87 -8592.3404 2345.8312
88 5504.2506 -8592.3404
89 887.1752 5504.2506
90 12296.3023 887.1752
91 22923.5837 12296.3023
92 -6112.4981 22923.5837
93 22221.8302 -6112.4981
94 18397.3328 22221.8302
95 -9549.5896 18397.3328
96 21407.2422 -9549.5896
97 -3632.2137 21407.2422
98 6341.7280 -3632.2137
99 -13522.7856 6341.7280
100 -4685.3064 -13522.7856
101 153.4740 -4685.3064
102 2537.0398 153.4740
103 -13240.5931 2537.0398
104 -7953.5745 -13240.5931
105 -4598.4240 -7953.5745
106 -14997.1086 -4598.4240
107 -6621.3892 -14997.1086
108 -1166.2651 -6621.3892
109 63091.5514 -1166.2651
110 14775.7966 63091.5514
111 -10628.4143 14775.7966
112 -3406.6904 -10628.4143
113 6456.7334 -3406.6904
114 -1142.8013 6456.7334
115 -1166.2651 -1142.8013
116 -17586.5020 -1166.2651
117 12243.7589 -17586.5020
118 -8295.5372 12243.7589
119 4886.5572 -8295.5372
120 638.4839 4886.5572
121 -11830.2353 638.4839
122 -5171.6561 -11830.2353
123 971.7540 -5171.6561
124 20320.2364 971.7540
125 -3033.2070 20320.2364
126 -17123.1655 -3033.2070
127 -9903.6082 -17123.1655
128 6334.9334 -9903.6082
129 -2211.0532 6334.9334
130 -1097.0027 -2211.0532
131 63185.1320 -1097.0027
132 -1629.4152 63185.1320
133 13519.2872 -1629.4152
134 -1664.6287 13519.2872
135 -2136.7819 -1664.6287
136 -1166.2651 -2136.7819
137 -1910.0329 -1166.2651
138 23069.4248 -1910.0329
139 -2037.5128 23069.4248
140 -1598.0034 -2037.5128
141 -9063.2515 -1598.0034
142 -3048.1386 -9063.2515
143 -11722.8658 -3048.1386
> 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/70dfs1324549672.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/8c9t71324549672.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/9intc1324549672.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/10m1c01324549672.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/11vrd31324549672.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/12mg411324549672.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/130oa01324549672.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/14oxbo1324549672.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/15aqgm1324549672.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/1609uj1324549672.tab")
+ }
>
> try(system("convert tmp/1v9tl1324549672.ps tmp/1v9tl1324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/2tz801324549672.ps tmp/2tz801324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/3etec1324549672.ps tmp/3etec1324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/47u211324549672.ps tmp/47u211324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/5fjk81324549672.ps tmp/5fjk81324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/6zzmb1324549672.ps tmp/6zzmb1324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/70dfs1324549672.ps tmp/70dfs1324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/8c9t71324549672.ps tmp/8c9t71324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/9intc1324549672.ps tmp/9intc1324549672.png",intern=TRUE))
character(0)
> try(system("convert tmp/10m1c01324549672.ps tmp/10m1c01324549672.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.168 0.739 5.922