R version 2.12.1 (2010-12-16)
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(129988
+ ,81
+ ,18158
+ ,22622
+ ,130358
+ ,46
+ ,30461
+ ,73570
+ ,7215
+ ,18
+ ,1423
+ ,1929
+ ,112976
+ ,87
+ ,25629
+ ,36294
+ ,220191
+ ,127
+ ,48758
+ ,62378
+ ,402036
+ ,218
+ ,129230
+ ,167760
+ ,125071
+ ,51
+ ,27376
+ ,52443
+ ,131822
+ ,50
+ ,26706
+ ,57283
+ ,99738
+ ,39
+ ,26505
+ ,36614
+ ,269166
+ ,88
+ ,49801
+ ,93268
+ ,113066
+ ,69
+ ,46580
+ ,35439
+ ,165392
+ ,62
+ ,48352
+ ,72405
+ ,78240
+ ,90
+ ,13899
+ ,24044
+ ,170854
+ ,86
+ ,39342
+ ,55909
+ ,134368
+ ,47
+ ,27465
+ ,44689
+ ,125769
+ ,68
+ ,55211
+ ,49319
+ ,123467
+ ,50
+ ,74098
+ ,62075
+ ,57396
+ ,49
+ ,13497
+ ,2341
+ ,108458
+ ,79
+ ,38338
+ ,40551
+ ,22762
+ ,21
+ ,52505
+ ,11621
+ ,48633
+ ,50
+ ,10663
+ ,18741
+ ,182081
+ ,83
+ ,74484
+ ,84202
+ ,149507
+ ,62
+ ,28895
+ ,15334
+ ,93773
+ ,46
+ ,32827
+ ,28024
+ ,133428
+ ,79
+ ,36188
+ ,53306
+ ,126660
+ ,24
+ ,28173
+ ,37918
+ ,153851
+ ,140
+ ,54926
+ ,54819
+ ,140711
+ ,75
+ ,38900
+ ,89058
+ ,303952
+ ,108
+ ,88530
+ ,103354
+ ,163810
+ ,38
+ ,35482
+ ,70239
+ ,134521
+ ,41
+ ,26730
+ ,33045
+ ,157640
+ ,39
+ ,29806
+ ,63852
+ ,103274
+ ,90
+ ,41799
+ ,30905
+ ,193500
+ ,105
+ ,54289
+ ,24242
+ ,182027
+ ,44
+ ,36805
+ ,78907
+ ,0
+ ,1
+ ,0
+ ,0
+ ,181496
+ ,56
+ ,33146
+ ,36005
+ ,92342
+ ,47
+ ,23333
+ ,31972
+ ,115762
+ ,42
+ ,47686
+ ,35853
+ ,179089
+ ,51
+ ,77783
+ ,115301
+ ,145067
+ ,58
+ ,36042
+ ,47689
+ ,114146
+ ,50
+ ,34541
+ ,34223
+ ,86039
+ ,26
+ ,75620
+ ,43431
+ ,125481
+ ,66
+ ,60610
+ ,52220
+ ,95535
+ ,42
+ ,55041
+ ,33863
+ ,129236
+ ,79
+ ,32087
+ ,46879
+ ,61554
+ ,26
+ ,16356
+ ,23228
+ ,170811
+ ,83
+ ,40161
+ ,42827
+ ,161746
+ ,76
+ ,55459
+ ,65765
+ ,137317
+ ,52
+ ,36679
+ ,38167
+ ,48188
+ ,28
+ ,22346
+ ,14812
+ ,97793
+ ,57
+ ,27377
+ ,32615
+ ,249356
+ ,65
+ ,50273
+ ,82188
+ ,196791
+ ,69
+ ,32104
+ ,51763
+ ,161082
+ ,51
+ ,27016
+ ,59325
+ ,111388
+ ,47
+ ,19715
+ ,48976
+ ,172614
+ ,58
+ ,33629
+ ,43384
+ ,63681
+ ,19
+ ,27084
+ ,26692
+ ,109102
+ ,56
+ ,32352
+ ,53279
+ ,142391
+ ,76
+ ,51845
+ ,20652
+ ,125777
+ ,51
+ ,26591
+ ,38338
+ ,88650
+ ,66
+ ,29677
+ ,36735
+ ,95845
+ ,50
+ ,54237
+ ,42764
+ ,83419
+ ,29
+ ,20284
+ ,44331
+ ,101723
+ ,25
+ ,22741
+ ,41354
+ ,94982
+ ,37
+ ,34178
+ ,47879
+ ,145568
+ ,62
+ ,69551
+ ,103793
+ ,113325
+ ,63
+ ,29653
+ ,52235
+ ,92480
+ ,34
+ ,38071
+ ,49825
+ ,31970
+ ,15
+ ,4157
+ ,4105
+ ,196420
+ ,104
+ ,28321
+ ,58687
+ ,98324
+ ,56
+ ,40195
+ ,40745
+ ,80820
+ ,56
+ ,48158
+ ,33187
+ ,89319
+ ,61
+ ,13310
+ ,14063
+ ,118147
+ ,55
+ ,78474
+ ,37407
+ ,56544
+ ,32
+ ,6386
+ ,7190
+ ,118838
+ ,52
+ ,31588
+ ,49562
+ ,118781
+ ,80
+ ,61254
+ ,76324
+ ,60138
+ ,23
+ ,21152
+ ,21928
+ ,73422
+ ,66
+ ,41272
+ ,27860
+ ,70248
+ ,60
+ ,34165
+ ,28078
+ ,225857
+ ,54
+ ,37054
+ ,49577
+ ,51185
+ ,24
+ ,12368
+ ,28145
+ ,97181
+ ,32
+ ,23168
+ ,36241
+ ,45100
+ ,40
+ ,16380
+ ,10824
+ ,115801
+ ,43
+ ,41242
+ ,46892
+ ,187201
+ ,191
+ ,48450
+ ,61264
+ ,71960
+ ,86
+ ,20790
+ ,22933
+ ,81701
+ ,49
+ ,34585
+ ,20787
+ ,110416
+ ,43
+ ,35672
+ ,43978
+ ,98707
+ ,34
+ ,52168
+ ,51305
+ ,136234
+ ,67
+ ,53933
+ ,55593
+ ,136781
+ ,53
+ ,34474
+ ,51648
+ ,116132
+ ,54
+ ,43753
+ ,30552
+ ,49164
+ ,33
+ ,36456
+ ,23470
+ ,189493
+ ,93
+ ,51183
+ ,77530
+ ,169406
+ ,50
+ ,52742
+ ,57299
+ ,19349
+ ,12
+ ,3895
+ ,9604
+ ,160902
+ ,88
+ ,37076
+ ,34684
+ ,109510
+ ,53
+ ,24079
+ ,41094
+ ,43803
+ ,25
+ ,2325
+ ,3439
+ ,47062
+ ,19
+ ,29354
+ ,25171
+ ,110845
+ ,44
+ ,30341
+ ,23437
+ ,92517
+ ,52
+ ,18992
+ ,34086
+ ,58660
+ ,36
+ ,15292
+ ,24649
+ ,27676
+ ,22
+ ,5842
+ ,2342
+ ,98550
+ ,33
+ ,28918
+ ,45571
+ ,43863
+ ,25
+ ,3738
+ ,3255
+ ,0
+ ,0
+ ,0
+ ,0
+ ,75566
+ ,28
+ ,95352
+ ,30002
+ ,57359
+ ,49
+ ,37478
+ ,19360
+ ,104330
+ ,36
+ ,26839
+ ,43320
+ ,70369
+ ,47
+ ,26783
+ ,35513
+ ,65494
+ ,56
+ ,33392
+ ,23536
+ ,3616
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,148117
+ ,38
+ ,25446
+ ,54438
+ ,117946
+ ,66
+ ,59847
+ ,56812
+ ,138702
+ ,86
+ ,28162
+ ,33838
+ ,84336
+ ,33
+ ,33298
+ ,32366
+ ,43410
+ ,19
+ ,2781
+ ,13
+ ,139695
+ ,61
+ ,37121
+ ,55082
+ ,79015
+ ,34
+ ,22698
+ ,31334
+ ,106116
+ ,47
+ ,27615
+ ,16612
+ ,57586
+ ,38
+ ,32689
+ ,5084
+ ,19764
+ ,12
+ ,5752
+ ,9927
+ ,112195
+ ,43
+ ,23164
+ ,47413
+ ,103651
+ ,25
+ ,20304
+ ,27389
+ ,113402
+ ,35
+ ,34409
+ ,30425
+ ,11796
+ ,9
+ ,0
+ ,0
+ ,7627
+ ,9
+ ,0
+ ,0
+ ,121085
+ ,50
+ ,92538
+ ,33510
+ ,6836
+ ,3
+ ,0
+ ,0
+ ,139563
+ ,46
+ ,46037
+ ,40389
+ ,5118
+ ,3
+ ,0
+ ,0
+ ,40248
+ ,16
+ ,5444
+ ,6012
+ ,0
+ ,0
+ ,0
+ ,0
+ ,95079
+ ,42
+ ,23924
+ ,22205
+ ,80763
+ ,32
+ ,52230
+ ,17231
+ ,7131
+ ,4
+ ,0
+ ,0
+ ,4194
+ ,11
+ ,0
+ ,0
+ ,60378
+ ,20
+ ,8019
+ ,11017
+ ,109214
+ ,45
+ ,34542
+ ,46741
+ ,83484
+ ,16
+ ,21157
+ ,39869)
+ ,dim=c(4
+ ,144)
+ ,dimnames=list(c('A'
+ ,'B'
+ ,'C'
+ ,'D')
+ ,1:144))
> y <- array(NA,dim=c(4,144),dimnames=list(c('A','B','C','D'),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
A B C D
1 129988 81 18158 22622
2 130358 46 30461 73570
3 7215 18 1423 1929
4 112976 87 25629 36294
5 220191 127 48758 62378
6 402036 218 129230 167760
7 125071 51 27376 52443
8 131822 50 26706 57283
9 99738 39 26505 36614
10 269166 88 49801 93268
11 113066 69 46580 35439
12 165392 62 48352 72405
13 78240 90 13899 24044
14 170854 86 39342 55909
15 134368 47 27465 44689
16 125769 68 55211 49319
17 123467 50 74098 62075
18 57396 49 13497 2341
19 108458 79 38338 40551
20 22762 21 52505 11621
21 48633 50 10663 18741
22 182081 83 74484 84202
23 149507 62 28895 15334
24 93773 46 32827 28024
25 133428 79 36188 53306
26 126660 24 28173 37918
27 153851 140 54926 54819
28 140711 75 38900 89058
29 303952 108 88530 103354
30 163810 38 35482 70239
31 134521 41 26730 33045
32 157640 39 29806 63852
33 103274 90 41799 30905
34 193500 105 54289 24242
35 182027 44 36805 78907
36 0 1 0 0
37 181496 56 33146 36005
38 92342 47 23333 31972
39 115762 42 47686 35853
40 179089 51 77783 115301
41 145067 58 36042 47689
42 114146 50 34541 34223
43 86039 26 75620 43431
44 125481 66 60610 52220
45 95535 42 55041 33863
46 129236 79 32087 46879
47 61554 26 16356 23228
48 170811 83 40161 42827
49 161746 76 55459 65765
50 137317 52 36679 38167
51 48188 28 22346 14812
52 97793 57 27377 32615
53 249356 65 50273 82188
54 196791 69 32104 51763
55 161082 51 27016 59325
56 111388 47 19715 48976
57 172614 58 33629 43384
58 63681 19 27084 26692
59 109102 56 32352 53279
60 142391 76 51845 20652
61 125777 51 26591 38338
62 88650 66 29677 36735
63 95845 50 54237 42764
64 83419 29 20284 44331
65 101723 25 22741 41354
66 94982 37 34178 47879
67 145568 62 69551 103793
68 113325 63 29653 52235
69 92480 34 38071 49825
70 31970 15 4157 4105
71 196420 104 28321 58687
72 98324 56 40195 40745
73 80820 56 48158 33187
74 89319 61 13310 14063
75 118147 55 78474 37407
76 56544 32 6386 7190
77 118838 52 31588 49562
78 118781 80 61254 76324
79 60138 23 21152 21928
80 73422 66 41272 27860
81 70248 60 34165 28078
82 225857 54 37054 49577
83 51185 24 12368 28145
84 97181 32 23168 36241
85 45100 40 16380 10824
86 115801 43 41242 46892
87 187201 191 48450 61264
88 71960 86 20790 22933
89 81701 49 34585 20787
90 110416 43 35672 43978
91 98707 34 52168 51305
92 136234 67 53933 55593
93 136781 53 34474 51648
94 116132 54 43753 30552
95 49164 33 36456 23470
96 189493 93 51183 77530
97 169406 50 52742 57299
98 19349 12 3895 9604
99 160902 88 37076 34684
100 109510 53 24079 41094
101 43803 25 2325 3439
102 47062 19 29354 25171
103 110845 44 30341 23437
104 92517 52 18992 34086
105 58660 36 15292 24649
106 27676 22 5842 2342
107 98550 33 28918 45571
108 43863 25 3738 3255
109 0 0 0 0
110 75566 28 95352 30002
111 57359 49 37478 19360
112 104330 36 26839 43320
113 70369 47 26783 35513
114 65494 56 33392 23536
115 3616 5 0 0
116 0 0 0 0
117 148117 38 25446 54438
118 117946 66 59847 56812
119 138702 86 28162 33838
120 84336 33 33298 32366
121 43410 19 2781 13
122 139695 61 37121 55082
123 79015 34 22698 31334
124 106116 47 27615 16612
125 57586 38 32689 5084
126 19764 12 5752 9927
127 112195 43 23164 47413
128 103651 25 20304 27389
129 113402 35 34409 30425
130 11796 9 0 0
131 7627 9 0 0
132 121085 50 92538 33510
133 6836 3 0 0
134 139563 46 46037 40389
135 5118 3 0 0
136 40248 16 5444 6012
137 0 0 0 0
138 95079 42 23924 22205
139 80763 32 52230 17231
140 7131 4 0 0
141 4194 11 0 0
142 60378 20 8019 11017
143 109214 45 34542 46741
144 83484 16 21157 39869
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) B C D
1.410e+04 7.247e+02 1.153e-01 1.384e+00
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-66032 -17250 -4575 15287 99708
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.410e+04 4.580e+03 3.079 0.0025 **
B 7.247e+02 9.619e+01 7.535 5.52e-12 ***
C 1.153e-01 1.568e-01 0.735 0.4634
D 1.385e+00 1.357e-01 10.202 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 27300 on 140 degrees of freedom
Multiple R-squared: 0.8107, Adjusted R-squared: 0.8066
F-statistic: 199.8 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.3431924 6.863849e-01 6.568076e-01
[2,] 0.2242419 4.484838e-01 7.757581e-01
[3,] 0.2076736 4.153473e-01 7.923264e-01
[4,] 0.6165743 7.668515e-01 3.834257e-01
[5,] 0.5524402 8.951195e-01 4.475598e-01
[6,] 0.4478277 8.956554e-01 5.521723e-01
[7,] 0.5541773 8.916454e-01 4.458227e-01
[8,] 0.4803062 9.606125e-01 5.196938e-01
[9,] 0.4393463 8.786925e-01 5.606537e-01
[10,] 0.3576256 7.152511e-01 6.423744e-01
[11,] 0.2898340 5.796679e-01 7.101660e-01
[12,] 0.2319754 4.639508e-01 7.680246e-01
[13,] 0.2025476 4.050952e-01 7.974524e-01
[14,] 0.1560019 3.120038e-01 8.439981e-01
[15,] 0.1596201 3.192402e-01 8.403799e-01
[16,] 0.1241365 2.482730e-01 8.758635e-01
[17,] 0.5349127 9.301747e-01 4.650873e-01
[18,] 0.4711939 9.423879e-01 5.288061e-01
[19,] 0.4268442 8.536884e-01 5.731558e-01
[20,] 0.5092621 9.814757e-01 4.907379e-01
[21,] 0.5621988 8.756023e-01 4.378012e-01
[22,] 0.7540436 4.919128e-01 2.459564e-01
[23,] 0.8883349 2.233301e-01 1.116651e-01
[24,] 0.8701598 2.596804e-01 1.298402e-01
[25,] 0.8994015 2.011970e-01 1.005985e-01
[26,] 0.8842649 2.314702e-01 1.157351e-01
[27,] 0.8691791 2.616418e-01 1.308209e-01
[28,] 0.9570935 8.581308e-02 4.290654e-02
[29,] 0.9502321 9.953588e-02 4.976794e-02
[30,] 0.9401853 1.196294e-01 5.981468e-02
[31,] 0.9875943 2.481131e-02 1.240566e-02
[32,] 0.9826898 3.462045e-02 1.731023e-02
[33,] 0.9773515 4.529699e-02 2.264849e-02
[34,] 0.9852063 2.958745e-02 1.479372e-02
[35,] 0.9816980 3.660392e-02 1.830196e-02
[36,] 0.9758882 4.822363e-02 2.411181e-02
[37,] 0.9717564 5.648714e-02 2.824357e-02
[38,] 0.9657870 6.842597e-02 3.421299e-02
[39,] 0.9549238 9.015238e-02 4.507619e-02
[40,] 0.9438895 1.122210e-01 5.611048e-02
[41,] 0.9290386 1.419228e-01 7.096139e-02
[42,] 0.9333845 1.332311e-01 6.661554e-02
[43,] 0.9159658 1.680685e-01 8.403423e-02
[44,] 0.9145926 1.708148e-01 8.540739e-02
[45,] 0.8970677 2.058647e-01 1.029323e-01
[46,] 0.8745940 2.508119e-01 1.254060e-01
[47,] 0.9618571 7.628573e-02 3.814286e-02
[48,] 0.9852143 2.957142e-02 1.478571e-02
[49,] 0.9846366 3.072672e-02 1.536336e-02
[50,] 0.9799787 4.004257e-02 2.002129e-02
[51,] 0.9916319 1.673611e-02 8.368056e-03
[52,] 0.9886063 2.278747e-02 1.139373e-02
[53,] 0.9874611 2.507786e-02 1.253893e-02
[54,] 0.9909698 1.806033e-02 9.030165e-03
[55,] 0.9895255 2.094902e-02 1.047451e-02
[56,] 0.9895580 2.088396e-02 1.044198e-02
[57,] 0.9878348 2.433032e-02 1.216516e-02
[58,] 0.9849873 3.002539e-02 1.501269e-02
[59,] 0.9806218 3.875632e-02 1.937816e-02
[60,] 0.9764213 4.715734e-02 2.357867e-02
[61,] 0.9942731 1.145390e-02 5.726948e-03
[62,] 0.9935861 1.282783e-02 6.413915e-03
[63,] 0.9927386 1.452287e-02 7.261437e-03
[64,] 0.9899448 2.011033e-02 1.005516e-02
[65,] 0.9900958 1.980842e-02 9.904208e-03
[66,] 0.9879477 2.410462e-02 1.205231e-02
[67,] 0.9872372 2.552567e-02 1.276283e-02
[68,] 0.9846035 3.079295e-02 1.539647e-02
[69,] 0.9793026 4.139483e-02 2.069742e-02
[70,] 0.9739966 5.200676e-02 2.600338e-02
[71,] 0.9659793 6.804130e-02 3.402065e-02
[72,] 0.9944496 1.110081e-02 5.550406e-03
[73,] 0.9921990 1.560206e-02 7.801028e-03
[74,] 0.9927706 1.445887e-02 7.229434e-03
[75,] 0.9931334 1.373320e-02 6.866600e-03
[76,] 0.9999917 1.665394e-05 8.326972e-06
[77,] 0.9999903 1.936297e-05 9.681484e-06
[78,] 0.9999834 3.311170e-05 1.655585e-05
[79,] 0.9999743 5.146744e-05 2.573372e-05
[80,] 0.9999554 8.921703e-05 4.460851e-05
[81,] 0.9999922 1.564696e-05 7.823480e-06
[82,] 0.9999985 2.991626e-06 1.495813e-06
[83,] 0.9999972 5.623800e-06 2.811900e-06
[84,] 0.9999947 1.062858e-05 5.314289e-06
[85,] 0.9999926 1.477871e-05 7.389353e-06
[86,] 0.9999897 2.054951e-05 1.027475e-05
[87,] 0.9999818 3.642837e-05 1.821419e-05
[88,] 0.9999715 5.694966e-05 2.847483e-05
[89,] 0.9999759 4.826497e-05 2.413249e-05
[90,] 0.9999694 6.122223e-05 3.061112e-05
[91,] 0.9999809 3.819422e-05 1.909711e-05
[92,] 0.9999714 5.717682e-05 2.858841e-05
[93,] 0.9999688 6.230703e-05 3.115352e-05
[94,] 0.9999443 1.113423e-04 5.567114e-05
[95,] 0.9999072 1.856995e-04 9.284973e-05
[96,] 0.9998809 2.382284e-04 1.191142e-04
[97,] 0.9999141 1.718697e-04 8.593485e-05
[98,] 0.9998606 2.787954e-04 1.393977e-04
[99,] 0.9998225 3.550043e-04 1.775021e-04
[100,] 0.9996883 6.234607e-04 3.117303e-04
[101,] 0.9994824 1.035155e-03 5.175773e-04
[102,] 0.9991829 1.634168e-03 8.170841e-04
[103,] 0.9987228 2.554351e-03 1.277175e-03
[104,] 0.9983775 3.244992e-03 1.622496e-03
[105,] 0.9986252 2.749626e-03 1.374813e-03
[106,] 0.9976590 4.682032e-03 2.341016e-03
[107,] 0.9987583 2.483395e-03 1.241697e-03
[108,] 0.9994305 1.138918e-03 5.694589e-04
[109,] 0.9990811 1.837738e-03 9.188688e-04
[110,] 0.9985175 2.965013e-03 1.482507e-03
[111,] 0.9990392 1.921522e-03 9.607612e-04
[112,] 0.9999237 1.526932e-04 7.634661e-05
[113,] 0.9998986 2.028082e-04 1.014041e-04
[114,] 0.9998058 3.884453e-04 1.942226e-04
[115,] 0.9997196 5.607211e-04 2.803606e-04
[116,] 0.9997305 5.390957e-04 2.695479e-04
[117,] 0.9996304 7.391254e-04 3.695627e-04
[118,] 0.9995018 9.964031e-04 4.982016e-04
[119,] 0.9989852 2.029631e-03 1.014816e-03
[120,] 0.9985158 2.968449e-03 1.484225e-03
[121,] 0.9984824 3.035289e-03 1.517645e-03
[122,] 0.9993962 1.207616e-03 6.038080e-04
[123,] 0.9994691 1.061760e-03 5.308801e-04
[124,] 0.9985820 2.836090e-03 1.418045e-03
[125,] 0.9969090 6.182085e-03 3.091042e-03
[126,] 0.9946551 1.068988e-02 5.344938e-03
[127,] 0.9863432 2.731351e-02 1.365676e-02
[128,] 0.9820113 3.597730e-02 1.798865e-02
[129,] 0.9560484 8.790322e-02 4.395161e-02
[130,] 0.9088855 1.822290e-01 9.111449e-02
[131,] 0.8066603 3.866795e-01 1.933397e-01
> postscript(file="/var/www/rcomp/tmp/1zmib1323964202.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/2k63i1323964203.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/3obgp1323964203.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/49t4w1323964203.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/5xzcl1323964203.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
23767.9224 -22451.6230 -22767.8788 -17382.5500 22063.4900 -17220.0176
7 8 9 10 11 12
-1756.4448 -904.4451 3623.0880 56416.0821 -5478.3827 537.2014
13 14 15 16 17 18
-35980.5988 12482.6102 21164.6669 -12262.3408 -21356.6694 2983.9560
19 20 21 22 23 24
-23461.3389 -28701.7060 -28882.8931 -17338.4653 65909.6415 3749.0144
25 26 27 28 29 30
-15902.7913 39418.5787 -43943.7067 -55532.0050 58279.0229 20831.3296
31 32 33 34 35 36
41871.9419 23433.6297 -23661.5759 63478.5169 22546.5447 -14827.5311
37 38 39 40 41 42
73138.1365 -2778.3876 16085.0039 -40575.4736 18749.3616 12442.9720
43 44 45 46 47 48
-15753.6939 -15739.6085 -2234.6294 -10723.9132 -5436.5234 32631.4414
49 50 51 52 53 54
-4881.3271 28457.5857 -9290.5176 -5931.1849 68560.9998 57314.6650
55 56 57 58 59 60
24767.9341 -6857.3620 52534.7646 -4268.8050 -23080.1649 38639.1160
61 62 63 64 65 66
18568.3874 -27566.1152 -19953.3161 -15415.5851 9625.8274 -16164.2391
67 68 69 70 71 72
-65186.9640 -22173.8436 -19634.9769 833.5426 22427.4567 -17408.8987
73 74 75 76 77 78
-25366.7277 10002.5094 3348.0140 8558.8101 -5210.9504 -66032.1844
79 80 81 82 83 84
-3431.2654 -31843.2078 -30151.3733 99707.7501 -20703.9332 7040.3492
85 86 87 88 89 90
-14866.3715 858.5620 -55732.2114 -38617.7516 -680.2383 150.0242
91 92 93 94 95 96
-17081.9458 -9611.6296 8786.5845 15550.6595 -25551.6271 -5250.6961
97 98 99 100 101 102
33656.3251 -17196.3854 30728.2942 -2674.2259 6552.3593 -19043.6380
103 104 105 106 107 108
28907.7458 -8653.5588 -17422.6791 -6287.0101 -5895.5445 6704.2355
109 110 111 112 113 114
-14102.7884 -11358.1902 -23380.0252 1066.3719 -30051.5653 -25628.9103
115 116 117 118 119 120
-14110.5020 -14102.7884 28171.6009 -29544.2762 12176.5505 -2332.1121
121 122 123 124 125 126
15198.5452 843.1652 -5727.2281 31767.9347 5136.2531 -17442.6281
127 128 129 130 131 132
-1384.9743 31169.2501 27843.6525 -8829.4730 -12998.4730 13684.0098
133 134 135 136 137 138
-9441.0166 30897.0233 -11159.0166 5598.2137 -14102.7884 17036.5981
139 140 141 142 143 144
13591.7870 -9870.7593 -17880.9584 15603.0179 -6196.5789 148.0740
> postscript(file="/var/www/rcomp/tmp/6ek5m1323964203.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 23767.9224 NA
1 -22451.6230 23767.9224
2 -22767.8788 -22451.6230
3 -17382.5500 -22767.8788
4 22063.4900 -17382.5500
5 -17220.0176 22063.4900
6 -1756.4448 -17220.0176
7 -904.4451 -1756.4448
8 3623.0880 -904.4451
9 56416.0821 3623.0880
10 -5478.3827 56416.0821
11 537.2014 -5478.3827
12 -35980.5988 537.2014
13 12482.6102 -35980.5988
14 21164.6669 12482.6102
15 -12262.3408 21164.6669
16 -21356.6694 -12262.3408
17 2983.9560 -21356.6694
18 -23461.3389 2983.9560
19 -28701.7060 -23461.3389
20 -28882.8931 -28701.7060
21 -17338.4653 -28882.8931
22 65909.6415 -17338.4653
23 3749.0144 65909.6415
24 -15902.7913 3749.0144
25 39418.5787 -15902.7913
26 -43943.7067 39418.5787
27 -55532.0050 -43943.7067
28 58279.0229 -55532.0050
29 20831.3296 58279.0229
30 41871.9419 20831.3296
31 23433.6297 41871.9419
32 -23661.5759 23433.6297
33 63478.5169 -23661.5759
34 22546.5447 63478.5169
35 -14827.5311 22546.5447
36 73138.1365 -14827.5311
37 -2778.3876 73138.1365
38 16085.0039 -2778.3876
39 -40575.4736 16085.0039
40 18749.3616 -40575.4736
41 12442.9720 18749.3616
42 -15753.6939 12442.9720
43 -15739.6085 -15753.6939
44 -2234.6294 -15739.6085
45 -10723.9132 -2234.6294
46 -5436.5234 -10723.9132
47 32631.4414 -5436.5234
48 -4881.3271 32631.4414
49 28457.5857 -4881.3271
50 -9290.5176 28457.5857
51 -5931.1849 -9290.5176
52 68560.9998 -5931.1849
53 57314.6650 68560.9998
54 24767.9341 57314.6650
55 -6857.3620 24767.9341
56 52534.7646 -6857.3620
57 -4268.8050 52534.7646
58 -23080.1649 -4268.8050
59 38639.1160 -23080.1649
60 18568.3874 38639.1160
61 -27566.1152 18568.3874
62 -19953.3161 -27566.1152
63 -15415.5851 -19953.3161
64 9625.8274 -15415.5851
65 -16164.2391 9625.8274
66 -65186.9640 -16164.2391
67 -22173.8436 -65186.9640
68 -19634.9769 -22173.8436
69 833.5426 -19634.9769
70 22427.4567 833.5426
71 -17408.8987 22427.4567
72 -25366.7277 -17408.8987
73 10002.5094 -25366.7277
74 3348.0140 10002.5094
75 8558.8101 3348.0140
76 -5210.9504 8558.8101
77 -66032.1844 -5210.9504
78 -3431.2654 -66032.1844
79 -31843.2078 -3431.2654
80 -30151.3733 -31843.2078
81 99707.7501 -30151.3733
82 -20703.9332 99707.7501
83 7040.3492 -20703.9332
84 -14866.3715 7040.3492
85 858.5620 -14866.3715
86 -55732.2114 858.5620
87 -38617.7516 -55732.2114
88 -680.2383 -38617.7516
89 150.0242 -680.2383
90 -17081.9458 150.0242
91 -9611.6296 -17081.9458
92 8786.5845 -9611.6296
93 15550.6595 8786.5845
94 -25551.6271 15550.6595
95 -5250.6961 -25551.6271
96 33656.3251 -5250.6961
97 -17196.3854 33656.3251
98 30728.2942 -17196.3854
99 -2674.2259 30728.2942
100 6552.3593 -2674.2259
101 -19043.6380 6552.3593
102 28907.7458 -19043.6380
103 -8653.5588 28907.7458
104 -17422.6791 -8653.5588
105 -6287.0101 -17422.6791
106 -5895.5445 -6287.0101
107 6704.2355 -5895.5445
108 -14102.7884 6704.2355
109 -11358.1902 -14102.7884
110 -23380.0252 -11358.1902
111 1066.3719 -23380.0252
112 -30051.5653 1066.3719
113 -25628.9103 -30051.5653
114 -14110.5020 -25628.9103
115 -14102.7884 -14110.5020
116 28171.6009 -14102.7884
117 -29544.2762 28171.6009
118 12176.5505 -29544.2762
119 -2332.1121 12176.5505
120 15198.5452 -2332.1121
121 843.1652 15198.5452
122 -5727.2281 843.1652
123 31767.9347 -5727.2281
124 5136.2531 31767.9347
125 -17442.6281 5136.2531
126 -1384.9743 -17442.6281
127 31169.2501 -1384.9743
128 27843.6525 31169.2501
129 -8829.4730 27843.6525
130 -12998.4730 -8829.4730
131 13684.0098 -12998.4730
132 -9441.0166 13684.0098
133 30897.0233 -9441.0166
134 -11159.0166 30897.0233
135 5598.2137 -11159.0166
136 -14102.7884 5598.2137
137 17036.5981 -14102.7884
138 13591.7870 17036.5981
139 -9870.7593 13591.7870
140 -17880.9584 -9870.7593
141 15603.0179 -17880.9584
142 -6196.5789 15603.0179
143 148.0740 -6196.5789
144 NA 148.0740
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -22451.6230 23767.9224
[2,] -22767.8788 -22451.6230
[3,] -17382.5500 -22767.8788
[4,] 22063.4900 -17382.5500
[5,] -17220.0176 22063.4900
[6,] -1756.4448 -17220.0176
[7,] -904.4451 -1756.4448
[8,] 3623.0880 -904.4451
[9,] 56416.0821 3623.0880
[10,] -5478.3827 56416.0821
[11,] 537.2014 -5478.3827
[12,] -35980.5988 537.2014
[13,] 12482.6102 -35980.5988
[14,] 21164.6669 12482.6102
[15,] -12262.3408 21164.6669
[16,] -21356.6694 -12262.3408
[17,] 2983.9560 -21356.6694
[18,] -23461.3389 2983.9560
[19,] -28701.7060 -23461.3389
[20,] -28882.8931 -28701.7060
[21,] -17338.4653 -28882.8931
[22,] 65909.6415 -17338.4653
[23,] 3749.0144 65909.6415
[24,] -15902.7913 3749.0144
[25,] 39418.5787 -15902.7913
[26,] -43943.7067 39418.5787
[27,] -55532.0050 -43943.7067
[28,] 58279.0229 -55532.0050
[29,] 20831.3296 58279.0229
[30,] 41871.9419 20831.3296
[31,] 23433.6297 41871.9419
[32,] -23661.5759 23433.6297
[33,] 63478.5169 -23661.5759
[34,] 22546.5447 63478.5169
[35,] -14827.5311 22546.5447
[36,] 73138.1365 -14827.5311
[37,] -2778.3876 73138.1365
[38,] 16085.0039 -2778.3876
[39,] -40575.4736 16085.0039
[40,] 18749.3616 -40575.4736
[41,] 12442.9720 18749.3616
[42,] -15753.6939 12442.9720
[43,] -15739.6085 -15753.6939
[44,] -2234.6294 -15739.6085
[45,] -10723.9132 -2234.6294
[46,] -5436.5234 -10723.9132
[47,] 32631.4414 -5436.5234
[48,] -4881.3271 32631.4414
[49,] 28457.5857 -4881.3271
[50,] -9290.5176 28457.5857
[51,] -5931.1849 -9290.5176
[52,] 68560.9998 -5931.1849
[53,] 57314.6650 68560.9998
[54,] 24767.9341 57314.6650
[55,] -6857.3620 24767.9341
[56,] 52534.7646 -6857.3620
[57,] -4268.8050 52534.7646
[58,] -23080.1649 -4268.8050
[59,] 38639.1160 -23080.1649
[60,] 18568.3874 38639.1160
[61,] -27566.1152 18568.3874
[62,] -19953.3161 -27566.1152
[63,] -15415.5851 -19953.3161
[64,] 9625.8274 -15415.5851
[65,] -16164.2391 9625.8274
[66,] -65186.9640 -16164.2391
[67,] -22173.8436 -65186.9640
[68,] -19634.9769 -22173.8436
[69,] 833.5426 -19634.9769
[70,] 22427.4567 833.5426
[71,] -17408.8987 22427.4567
[72,] -25366.7277 -17408.8987
[73,] 10002.5094 -25366.7277
[74,] 3348.0140 10002.5094
[75,] 8558.8101 3348.0140
[76,] -5210.9504 8558.8101
[77,] -66032.1844 -5210.9504
[78,] -3431.2654 -66032.1844
[79,] -31843.2078 -3431.2654
[80,] -30151.3733 -31843.2078
[81,] 99707.7501 -30151.3733
[82,] -20703.9332 99707.7501
[83,] 7040.3492 -20703.9332
[84,] -14866.3715 7040.3492
[85,] 858.5620 -14866.3715
[86,] -55732.2114 858.5620
[87,] -38617.7516 -55732.2114
[88,] -680.2383 -38617.7516
[89,] 150.0242 -680.2383
[90,] -17081.9458 150.0242
[91,] -9611.6296 -17081.9458
[92,] 8786.5845 -9611.6296
[93,] 15550.6595 8786.5845
[94,] -25551.6271 15550.6595
[95,] -5250.6961 -25551.6271
[96,] 33656.3251 -5250.6961
[97,] -17196.3854 33656.3251
[98,] 30728.2942 -17196.3854
[99,] -2674.2259 30728.2942
[100,] 6552.3593 -2674.2259
[101,] -19043.6380 6552.3593
[102,] 28907.7458 -19043.6380
[103,] -8653.5588 28907.7458
[104,] -17422.6791 -8653.5588
[105,] -6287.0101 -17422.6791
[106,] -5895.5445 -6287.0101
[107,] 6704.2355 -5895.5445
[108,] -14102.7884 6704.2355
[109,] -11358.1902 -14102.7884
[110,] -23380.0252 -11358.1902
[111,] 1066.3719 -23380.0252
[112,] -30051.5653 1066.3719
[113,] -25628.9103 -30051.5653
[114,] -14110.5020 -25628.9103
[115,] -14102.7884 -14110.5020
[116,] 28171.6009 -14102.7884
[117,] -29544.2762 28171.6009
[118,] 12176.5505 -29544.2762
[119,] -2332.1121 12176.5505
[120,] 15198.5452 -2332.1121
[121,] 843.1652 15198.5452
[122,] -5727.2281 843.1652
[123,] 31767.9347 -5727.2281
[124,] 5136.2531 31767.9347
[125,] -17442.6281 5136.2531
[126,] -1384.9743 -17442.6281
[127,] 31169.2501 -1384.9743
[128,] 27843.6525 31169.2501
[129,] -8829.4730 27843.6525
[130,] -12998.4730 -8829.4730
[131,] 13684.0098 -12998.4730
[132,] -9441.0166 13684.0098
[133,] 30897.0233 -9441.0166
[134,] -11159.0166 30897.0233
[135,] 5598.2137 -11159.0166
[136,] -14102.7884 5598.2137
[137,] 17036.5981 -14102.7884
[138,] 13591.7870 17036.5981
[139,] -9870.7593 13591.7870
[140,] -17880.9584 -9870.7593
[141,] 15603.0179 -17880.9584
[142,] -6196.5789 15603.0179
[143,] 148.0740 -6196.5789
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -22451.6230 23767.9224
2 -22767.8788 -22451.6230
3 -17382.5500 -22767.8788
4 22063.4900 -17382.5500
5 -17220.0176 22063.4900
6 -1756.4448 -17220.0176
7 -904.4451 -1756.4448
8 3623.0880 -904.4451
9 56416.0821 3623.0880
10 -5478.3827 56416.0821
11 537.2014 -5478.3827
12 -35980.5988 537.2014
13 12482.6102 -35980.5988
14 21164.6669 12482.6102
15 -12262.3408 21164.6669
16 -21356.6694 -12262.3408
17 2983.9560 -21356.6694
18 -23461.3389 2983.9560
19 -28701.7060 -23461.3389
20 -28882.8931 -28701.7060
21 -17338.4653 -28882.8931
22 65909.6415 -17338.4653
23 3749.0144 65909.6415
24 -15902.7913 3749.0144
25 39418.5787 -15902.7913
26 -43943.7067 39418.5787
27 -55532.0050 -43943.7067
28 58279.0229 -55532.0050
29 20831.3296 58279.0229
30 41871.9419 20831.3296
31 23433.6297 41871.9419
32 -23661.5759 23433.6297
33 63478.5169 -23661.5759
34 22546.5447 63478.5169
35 -14827.5311 22546.5447
36 73138.1365 -14827.5311
37 -2778.3876 73138.1365
38 16085.0039 -2778.3876
39 -40575.4736 16085.0039
40 18749.3616 -40575.4736
41 12442.9720 18749.3616
42 -15753.6939 12442.9720
43 -15739.6085 -15753.6939
44 -2234.6294 -15739.6085
45 -10723.9132 -2234.6294
46 -5436.5234 -10723.9132
47 32631.4414 -5436.5234
48 -4881.3271 32631.4414
49 28457.5857 -4881.3271
50 -9290.5176 28457.5857
51 -5931.1849 -9290.5176
52 68560.9998 -5931.1849
53 57314.6650 68560.9998
54 24767.9341 57314.6650
55 -6857.3620 24767.9341
56 52534.7646 -6857.3620
57 -4268.8050 52534.7646
58 -23080.1649 -4268.8050
59 38639.1160 -23080.1649
60 18568.3874 38639.1160
61 -27566.1152 18568.3874
62 -19953.3161 -27566.1152
63 -15415.5851 -19953.3161
64 9625.8274 -15415.5851
65 -16164.2391 9625.8274
66 -65186.9640 -16164.2391
67 -22173.8436 -65186.9640
68 -19634.9769 -22173.8436
69 833.5426 -19634.9769
70 22427.4567 833.5426
71 -17408.8987 22427.4567
72 -25366.7277 -17408.8987
73 10002.5094 -25366.7277
74 3348.0140 10002.5094
75 8558.8101 3348.0140
76 -5210.9504 8558.8101
77 -66032.1844 -5210.9504
78 -3431.2654 -66032.1844
79 -31843.2078 -3431.2654
80 -30151.3733 -31843.2078
81 99707.7501 -30151.3733
82 -20703.9332 99707.7501
83 7040.3492 -20703.9332
84 -14866.3715 7040.3492
85 858.5620 -14866.3715
86 -55732.2114 858.5620
87 -38617.7516 -55732.2114
88 -680.2383 -38617.7516
89 150.0242 -680.2383
90 -17081.9458 150.0242
91 -9611.6296 -17081.9458
92 8786.5845 -9611.6296
93 15550.6595 8786.5845
94 -25551.6271 15550.6595
95 -5250.6961 -25551.6271
96 33656.3251 -5250.6961
97 -17196.3854 33656.3251
98 30728.2942 -17196.3854
99 -2674.2259 30728.2942
100 6552.3593 -2674.2259
101 -19043.6380 6552.3593
102 28907.7458 -19043.6380
103 -8653.5588 28907.7458
104 -17422.6791 -8653.5588
105 -6287.0101 -17422.6791
106 -5895.5445 -6287.0101
107 6704.2355 -5895.5445
108 -14102.7884 6704.2355
109 -11358.1902 -14102.7884
110 -23380.0252 -11358.1902
111 1066.3719 -23380.0252
112 -30051.5653 1066.3719
113 -25628.9103 -30051.5653
114 -14110.5020 -25628.9103
115 -14102.7884 -14110.5020
116 28171.6009 -14102.7884
117 -29544.2762 28171.6009
118 12176.5505 -29544.2762
119 -2332.1121 12176.5505
120 15198.5452 -2332.1121
121 843.1652 15198.5452
122 -5727.2281 843.1652
123 31767.9347 -5727.2281
124 5136.2531 31767.9347
125 -17442.6281 5136.2531
126 -1384.9743 -17442.6281
127 31169.2501 -1384.9743
128 27843.6525 31169.2501
129 -8829.4730 27843.6525
130 -12998.4730 -8829.4730
131 13684.0098 -12998.4730
132 -9441.0166 13684.0098
133 30897.0233 -9441.0166
134 -11159.0166 30897.0233
135 5598.2137 -11159.0166
136 -14102.7884 5598.2137
137 17036.5981 -14102.7884
138 13591.7870 17036.5981
139 -9870.7593 13591.7870
140 -17880.9584 -9870.7593
141 15603.0179 -17880.9584
142 -6196.5789 15603.0179
143 148.0740 -6196.5789
> 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/7g56b1323964203.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/8grgg1323964203.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/9ezsz1323964203.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/105vht1323964203.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/117yjg1323964203.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/12rodp1323964203.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/13npa21323964203.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/149goq1323964203.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/15lv211323964203.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/16nii21323964203.tab")
+ }
>
> try(system("convert tmp/1zmib1323964202.ps tmp/1zmib1323964202.png",intern=TRUE))
character(0)
> try(system("convert tmp/2k63i1323964203.ps tmp/2k63i1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/3obgp1323964203.ps tmp/3obgp1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/49t4w1323964203.ps tmp/49t4w1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/5xzcl1323964203.ps tmp/5xzcl1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ek5m1323964203.ps tmp/6ek5m1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/7g56b1323964203.ps tmp/7g56b1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/8grgg1323964203.ps tmp/8grgg1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ezsz1323964203.ps tmp/9ezsz1323964203.png",intern=TRUE))
character(0)
> try(system("convert tmp/105vht1323964203.ps tmp/105vht1323964203.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.620 0.760 7.181