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(127476
+ ,20
+ ,17
+ ,59
+ ,22622
+ ,130358
+ ,38
+ ,17
+ ,50
+ ,73570
+ ,7215
+ ,0
+ ,0
+ ,0
+ ,1929
+ ,112861
+ ,49
+ ,22
+ ,51
+ ,36294
+ ,210171
+ ,74
+ ,30
+ ,112
+ ,62378
+ ,393802
+ ,104
+ ,31
+ ,118
+ ,167760
+ ,117604
+ ,37
+ ,19
+ ,59
+ ,52443
+ ,126029
+ ,53
+ ,25
+ ,90
+ ,57283
+ ,99729
+ ,42
+ ,30
+ ,50
+ ,36614
+ ,256310
+ ,62
+ ,26
+ ,79
+ ,93268
+ ,113066
+ ,50
+ ,20
+ ,49
+ ,35439
+ ,156212
+ ,65
+ ,25
+ ,74
+ ,72405
+ ,69952
+ ,28
+ ,15
+ ,32
+ ,24044
+ ,152673
+ ,48
+ ,22
+ ,82
+ ,55909
+ ,125841
+ ,42
+ ,12
+ ,43
+ ,44689
+ ,125769
+ ,47
+ ,19
+ ,65
+ ,49319
+ ,123467
+ ,71
+ ,28
+ ,111
+ ,62075
+ ,56232
+ ,0
+ ,12
+ ,36
+ ,2341
+ ,108244
+ ,50
+ ,28
+ ,89
+ ,40551
+ ,22762
+ ,12
+ ,13
+ ,28
+ ,11621
+ ,48554
+ ,16
+ ,14
+ ,35
+ ,18741
+ ,178697
+ ,76
+ ,27
+ ,78
+ ,84202
+ ,139115
+ ,29
+ ,25
+ ,67
+ ,15334
+ ,93773
+ ,38
+ ,30
+ ,61
+ ,28024
+ ,133398
+ ,50
+ ,21
+ ,58
+ ,53306
+ ,113933
+ ,33
+ ,17
+ ,49
+ ,37918
+ ,144781
+ ,45
+ ,22
+ ,77
+ ,54819
+ ,140711
+ ,59
+ ,28
+ ,71
+ ,89058
+ ,283337
+ ,49
+ ,25
+ ,82
+ ,103354
+ ,158146
+ ,40
+ ,16
+ ,53
+ ,70239
+ ,123344
+ ,40
+ ,23
+ ,71
+ ,33045
+ ,157640
+ ,51
+ ,20
+ ,58
+ ,63852
+ ,91279
+ ,41
+ ,11
+ ,25
+ ,30905
+ ,189374
+ ,73
+ ,20
+ ,59
+ ,24242
+ ,167915
+ ,43
+ ,21
+ ,77
+ ,78907
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,175403
+ ,46
+ ,27
+ ,75
+ ,36005
+ ,92342
+ ,44
+ ,14
+ ,39
+ ,31972
+ ,100023
+ ,31
+ ,29
+ ,83
+ ,35853
+ ,178277
+ ,71
+ ,31
+ ,123
+ ,115301
+ ,145062
+ ,61
+ ,19
+ ,67
+ ,47689
+ ,110980
+ ,28
+ ,30
+ ,105
+ ,34223
+ ,86039
+ ,21
+ ,23
+ ,76
+ ,43431
+ ,119514
+ ,42
+ ,20
+ ,54
+ ,52220
+ ,95535
+ ,44
+ ,22
+ ,82
+ ,33863
+ ,109894
+ ,34
+ ,19
+ ,57
+ ,46879
+ ,61554
+ ,15
+ ,32
+ ,57
+ ,23228
+ ,156520
+ ,46
+ ,18
+ ,72
+ ,42827
+ ,159121
+ ,43
+ ,26
+ ,94
+ ,65765
+ ,129362
+ ,47
+ ,25
+ ,72
+ ,38167
+ ,48188
+ ,12
+ ,22
+ ,39
+ ,14812
+ ,91198
+ ,42
+ ,19
+ ,60
+ ,32615
+ ,229864
+ ,56
+ ,24
+ ,84
+ ,82188
+ ,180317
+ ,41
+ ,26
+ ,69
+ ,51763
+ ,150640
+ ,48
+ ,27
+ ,102
+ ,59325
+ ,104416
+ ,30
+ ,10
+ ,28
+ ,48976
+ ,159645
+ ,44
+ ,26
+ ,65
+ ,43384
+ ,63205
+ ,25
+ ,23
+ ,67
+ ,26692
+ ,100056
+ ,42
+ ,21
+ ,80
+ ,53279
+ ,137214
+ ,28
+ ,34
+ ,79
+ ,20652
+ ,99630
+ ,33
+ ,29
+ ,107
+ ,38338
+ ,84557
+ ,32
+ ,18
+ ,57
+ ,36735
+ ,91199
+ ,28
+ ,16
+ ,44
+ ,42764
+ ,83419
+ ,31
+ ,23
+ ,59
+ ,44331
+ ,101723
+ ,13
+ ,22
+ ,80
+ ,41354
+ ,94982
+ ,38
+ ,29
+ ,89
+ ,47879
+ ,129700
+ ,39
+ ,31
+ ,115
+ ,103793
+ ,110708
+ ,68
+ ,21
+ ,59
+ ,52235
+ ,81518
+ ,32
+ ,21
+ ,66
+ ,49825
+ ,31970
+ ,5
+ ,21
+ ,42
+ ,4105
+ ,192268
+ ,53
+ ,15
+ ,35
+ ,58687
+ ,87611
+ ,33
+ ,9
+ ,3
+ ,40745
+ ,77890
+ ,48
+ ,21
+ ,68
+ ,33187
+ ,83261
+ ,36
+ ,18
+ ,38
+ ,14063
+ ,116290
+ ,52
+ ,31
+ ,107
+ ,37407
+ ,55254
+ ,0
+ ,24
+ ,69
+ ,7190
+ ,116173
+ ,52
+ ,24
+ ,80
+ ,49562
+ ,111488
+ ,45
+ ,22
+ ,69
+ ,76324
+ ,60138
+ ,16
+ ,21
+ ,46
+ ,21928
+ ,73422
+ ,33
+ ,26
+ ,52
+ ,27860
+ ,67751
+ ,48
+ ,22
+ ,58
+ ,28078
+ ,213351
+ ,33
+ ,26
+ ,85
+ ,49577
+ ,51185
+ ,24
+ ,20
+ ,13
+ ,28145
+ ,97181
+ ,37
+ ,25
+ ,61
+ ,36241
+ ,42311
+ ,16
+ ,19
+ ,49
+ ,10824
+ ,115801
+ ,32
+ ,22
+ ,47
+ ,46892
+ ,183637
+ ,55
+ ,25
+ ,93
+ ,61264
+ ,68161
+ ,36
+ ,22
+ ,65
+ ,22933
+ ,76441
+ ,29
+ ,21
+ ,64
+ ,20787
+ ,103613
+ ,26
+ ,20
+ ,64
+ ,43978
+ ,98707
+ ,37
+ ,23
+ ,57
+ ,51305
+ ,126527
+ ,58
+ ,22
+ ,61
+ ,55593
+ ,136781
+ ,35
+ ,21
+ ,71
+ ,51648
+ ,105863
+ ,24
+ ,12
+ ,43
+ ,30552
+ ,38775
+ ,18
+ ,9
+ ,18
+ ,23470
+ ,179984
+ ,37
+ ,32
+ ,103
+ ,77530
+ ,164808
+ ,86
+ ,24
+ ,76
+ ,57299
+ ,19349
+ ,13
+ ,1
+ ,0
+ ,9604
+ ,143902
+ ,20
+ ,24
+ ,83
+ ,34684
+ ,108660
+ ,32
+ ,22
+ ,70
+ ,41094
+ ,43803
+ ,8
+ ,4
+ ,4
+ ,3439
+ ,47062
+ ,38
+ ,15
+ ,41
+ ,25171
+ ,110845
+ ,45
+ ,21
+ ,57
+ ,23437
+ ,92517
+ ,24
+ ,23
+ ,52
+ ,34086
+ ,58660
+ ,23
+ ,12
+ ,24
+ ,24649
+ ,27676
+ ,2
+ ,16
+ ,17
+ ,2342
+ ,98550
+ ,52
+ ,24
+ ,89
+ ,45571
+ ,43284
+ ,5
+ ,9
+ ,20
+ ,3255
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,66016
+ ,43
+ ,22
+ ,45
+ ,30002
+ ,57359
+ ,18
+ ,17
+ ,63
+ ,19360
+ ,96933
+ ,41
+ ,18
+ ,48
+ ,43320
+ ,70369
+ ,45
+ ,21
+ ,70
+ ,35513
+ ,65494
+ ,29
+ ,17
+ ,32
+ ,23536
+ ,3616
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,143931
+ ,32
+ ,20
+ ,72
+ ,54438
+ ,109894
+ ,58
+ ,26
+ ,56
+ ,56812
+ ,122973
+ ,17
+ ,26
+ ,64
+ ,33838
+ ,84336
+ ,24
+ ,20
+ ,77
+ ,32366
+ ,43410
+ ,7
+ ,1
+ ,3
+ ,13
+ ,136250
+ ,62
+ ,24
+ ,73
+ ,55082
+ ,79015
+ ,30
+ ,14
+ ,37
+ ,31334
+ ,92937
+ ,49
+ ,26
+ ,54
+ ,16612
+ ,57586
+ ,3
+ ,12
+ ,32
+ ,5084
+ ,19764
+ ,10
+ ,2
+ ,4
+ ,9927
+ ,105757
+ ,42
+ ,16
+ ,55
+ ,47413
+ ,96410
+ ,18
+ ,22
+ ,81
+ ,27389
+ ,113402
+ ,40
+ ,28
+ ,90
+ ,30425
+ ,11796
+ ,1
+ ,2
+ ,1
+ ,0
+ ,7627
+ ,0
+ ,0
+ ,0
+ ,0
+ ,121085
+ ,29
+ ,17
+ ,38
+ ,33510
+ ,6836
+ ,0
+ ,1
+ ,0
+ ,0
+ ,139563
+ ,46
+ ,17
+ ,36
+ ,40389
+ ,5118
+ ,5
+ ,0
+ ,0
+ ,0
+ ,40248
+ ,8
+ ,4
+ ,7
+ ,6012
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,95079
+ ,21
+ ,25
+ ,75
+ ,22205
+ ,80750
+ ,21
+ ,26
+ ,52
+ ,17231
+ ,7131
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4194
+ ,0
+ ,0
+ ,0
+ ,0
+ ,60378
+ ,15
+ ,15
+ ,45
+ ,11017
+ ,96971
+ ,40
+ ,18
+ ,60
+ ,46741
+ ,83484
+ ,17
+ ,19
+ ,48
+ ,39869)
+ ,dim=c(5
+ ,144)
+ ,dimnames=list(c('TimeRFC'
+ ,'Blogs'
+ ,'ReviewedComp'
+ ,'Longfeedback'
+ ,'Comptime')
+ ,1:144))
> y <- array(NA,dim=c(5,144),dimnames=list(c('TimeRFC','Blogs','ReviewedComp','Longfeedback','Comptime'),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
TimeRFC Blogs ReviewedComp Longfeedback Comptime
1 127476 20 17 59 22622
2 130358 38 17 50 73570
3 7215 0 0 0 1929
4 112861 49 22 51 36294
5 210171 74 30 112 62378
6 393802 104 31 118 167760
7 117604 37 19 59 52443
8 126029 53 25 90 57283
9 99729 42 30 50 36614
10 256310 62 26 79 93268
11 113066 50 20 49 35439
12 156212 65 25 74 72405
13 69952 28 15 32 24044
14 152673 48 22 82 55909
15 125841 42 12 43 44689
16 125769 47 19 65 49319
17 123467 71 28 111 62075
18 56232 0 12 36 2341
19 108244 50 28 89 40551
20 22762 12 13 28 11621
21 48554 16 14 35 18741
22 178697 76 27 78 84202
23 139115 29 25 67 15334
24 93773 38 30 61 28024
25 133398 50 21 58 53306
26 113933 33 17 49 37918
27 144781 45 22 77 54819
28 140711 59 28 71 89058
29 283337 49 25 82 103354
30 158146 40 16 53 70239
31 123344 40 23 71 33045
32 157640 51 20 58 63852
33 91279 41 11 25 30905
34 189374 73 20 59 24242
35 167915 43 21 77 78907
36 0 0 0 0 0
37 175403 46 27 75 36005
38 92342 44 14 39 31972
39 100023 31 29 83 35853
40 178277 71 31 123 115301
41 145062 61 19 67 47689
42 110980 28 30 105 34223
43 86039 21 23 76 43431
44 119514 42 20 54 52220
45 95535 44 22 82 33863
46 109894 34 19 57 46879
47 61554 15 32 57 23228
48 156520 46 18 72 42827
49 159121 43 26 94 65765
50 129362 47 25 72 38167
51 48188 12 22 39 14812
52 91198 42 19 60 32615
53 229864 56 24 84 82188
54 180317 41 26 69 51763
55 150640 48 27 102 59325
56 104416 30 10 28 48976
57 159645 44 26 65 43384
58 63205 25 23 67 26692
59 100056 42 21 80 53279
60 137214 28 34 79 20652
61 99630 33 29 107 38338
62 84557 32 18 57 36735
63 91199 28 16 44 42764
64 83419 31 23 59 44331
65 101723 13 22 80 41354
66 94982 38 29 89 47879
67 129700 39 31 115 103793
68 110708 68 21 59 52235
69 81518 32 21 66 49825
70 31970 5 21 42 4105
71 192268 53 15 35 58687
72 87611 33 9 3 40745
73 77890 48 21 68 33187
74 83261 36 18 38 14063
75 116290 52 31 107 37407
76 55254 0 24 69 7190
77 116173 52 24 80 49562
78 111488 45 22 69 76324
79 60138 16 21 46 21928
80 73422 33 26 52 27860
81 67751 48 22 58 28078
82 213351 33 26 85 49577
83 51185 24 20 13 28145
84 97181 37 25 61 36241
85 42311 16 19 49 10824
86 115801 32 22 47 46892
87 183637 55 25 93 61264
88 68161 36 22 65 22933
89 76441 29 21 64 20787
90 103613 26 20 64 43978
91 98707 37 23 57 51305
92 126527 58 22 61 55593
93 136781 35 21 71 51648
94 105863 24 12 43 30552
95 38775 18 9 18 23470
96 179984 37 32 103 77530
97 164808 86 24 76 57299
98 19349 13 1 0 9604
99 143902 20 24 83 34684
100 108660 32 22 70 41094
101 43803 8 4 4 3439
102 47062 38 15 41 25171
103 110845 45 21 57 23437
104 92517 24 23 52 34086
105 58660 23 12 24 24649
106 27676 2 16 17 2342
107 98550 52 24 89 45571
108 43284 5 9 20 3255
109 0 0 0 0 0
110 66016 43 22 45 30002
111 57359 18 17 63 19360
112 96933 41 18 48 43320
113 70369 45 21 70 35513
114 65494 29 17 32 23536
115 3616 0 0 0 0
116 0 0 0 0 0
117 143931 32 20 72 54438
118 109894 58 26 56 56812
119 122973 17 26 64 33838
120 84336 24 20 77 32366
121 43410 7 1 3 13
122 136250 62 24 73 55082
123 79015 30 14 37 31334
124 92937 49 26 54 16612
125 57586 3 12 32 5084
126 19764 10 2 4 9927
127 105757 42 16 55 47413
128 96410 18 22 81 27389
129 113402 40 28 90 30425
130 11796 1 2 1 0
131 7627 0 0 0 0
132 121085 29 17 38 33510
133 6836 0 1 0 0
134 139563 46 17 36 40389
135 5118 5 0 0 0
136 40248 8 4 7 6012
137 0 0 0 0 0
138 95079 21 25 75 22205
139 80750 21 26 52 17231
140 7131 0 0 0 0
141 4194 0 0 0 0
142 60378 15 15 45 11017
143 96971 40 18 60 46741
144 83484 17 19 48 39869
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Blogs ReviewedComp Longfeedback Comptime
9868.059 712.196 467.660 233.756 1.222
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-76128 -15704 -3992 11396 87383
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9868.0593 5889.9857 1.675 0.096105 .
Blogs 712.1960 199.7182 3.566 0.000498 ***
ReviewedComp 467.6596 619.4495 0.755 0.451550
Longfeedback 233.7559 194.4250 1.202 0.231294
Comptime 1.2217 0.1578 7.741 1.84e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 27930 on 139 degrees of freedom
Multiple R-squared: 0.7828, Adjusted R-squared: 0.7765
F-statistic: 125.2 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.9202410 1.595179e-01 7.975896e-02
[2,] 0.8601147 2.797706e-01 1.398853e-01
[3,] 0.8916790 2.166419e-01 1.083210e-01
[4,] 0.8277585 3.444831e-01 1.722415e-01
[5,] 0.8212373 3.575253e-01 1.787627e-01
[6,] 0.7454840 5.090321e-01 2.545160e-01
[7,] 0.6688982 6.622036e-01 3.311018e-01
[8,] 0.5935917 8.128166e-01 4.064083e-01
[9,] 0.5186713 9.626575e-01 4.813287e-01
[10,] 0.7761711 4.476578e-01 2.238289e-01
[11,] 0.7490371 5.019258e-01 2.509629e-01
[12,] 0.7100316 5.799367e-01 2.899684e-01
[13,] 0.6913425 6.173149e-01 3.086575e-01
[14,] 0.6346178 7.307645e-01 3.653822e-01
[15,] 0.5967728 8.064544e-01 4.032272e-01
[16,] 0.8170656 3.658689e-01 1.829344e-01
[17,] 0.7729032 4.541936e-01 2.270968e-01
[18,] 0.7180104 5.639792e-01 2.819896e-01
[19,] 0.6679113 6.641774e-01 3.320887e-01
[20,] 0.6093656 7.812687e-01 3.906344e-01
[21,] 0.7940734 4.118532e-01 2.059266e-01
[22,] 0.9018614 1.962772e-01 9.813860e-02
[23,] 0.8801344 2.397311e-01 1.198656e-01
[24,] 0.8554569 2.890862e-01 1.445431e-01
[25,] 0.8261606 3.476789e-01 1.738394e-01
[26,] 0.8117517 3.764966e-01 1.882483e-01
[27,] 0.9812926 3.741477e-02 1.870739e-02
[28,] 0.9758560 4.828809e-02 2.414404e-02
[29,] 0.9689598 6.208030e-02 3.104015e-02
[30,] 0.9870834 2.583315e-02 1.291658e-02
[31,] 0.9820705 3.585890e-02 1.792945e-02
[32,] 0.9772644 4.547120e-02 2.273560e-02
[33,] 0.9960077 7.984600e-03 3.992300e-03
[34,] 0.9944527 1.109467e-02 5.547335e-03
[35,] 0.9919604 1.607919e-02 8.039593e-03
[36,] 0.9903067 1.938662e-02 9.693309e-03
[37,] 0.9867507 2.649862e-02 1.324931e-02
[38,] 0.9838701 3.225971e-02 1.612985e-02
[39,] 0.9780773 4.384539e-02 2.192269e-02
[40,] 0.9728205 5.435894e-02 2.717947e-02
[41,] 0.9771867 4.562669e-02 2.281334e-02
[42,] 0.9698680 6.026397e-02 3.013199e-02
[43,] 0.9617789 7.644227e-02 3.822113e-02
[44,] 0.9515674 9.686525e-02 4.843263e-02
[45,] 0.9412022 1.175956e-01 5.879779e-02
[46,] 0.9703397 5.932070e-02 2.966035e-02
[47,] 0.9855382 2.892366e-02 1.446183e-02
[48,] 0.9808505 3.829894e-02 1.914947e-02
[49,] 0.9753734 4.925319e-02 2.462659e-02
[50,] 0.9817697 3.646068e-02 1.823034e-02
[51,] 0.9804350 3.912991e-02 1.956495e-02
[52,] 0.9816236 3.675284e-02 1.837642e-02
[53,] 0.9889425 2.211499e-02 1.105750e-02
[54,] 0.9865899 2.682020e-02 1.341010e-02
[55,] 0.9830483 3.390337e-02 1.695169e-02
[56,] 0.9776938 4.461241e-02 2.230620e-02
[57,] 0.9769545 4.609103e-02 2.304551e-02
[58,] 0.9699630 6.007393e-02 3.003697e-02
[59,] 0.9734705 5.305907e-02 2.652954e-02
[60,] 0.9962641 7.471847e-03 3.735924e-03
[61,] 0.9971085 5.783020e-03 2.891510e-03
[62,] 0.9980760 3.847930e-03 1.923965e-03
[63,] 0.9972991 5.401743e-03 2.700871e-03
[64,] 0.9996864 6.271708e-04 3.135854e-04
[65,] 0.9995884 8.232302e-04 4.116151e-04
[66,] 0.9996349 7.301165e-04 3.650583e-04
[67,] 0.9995735 8.530261e-04 4.265130e-04
[68,] 0.9994435 1.112927e-03 5.564636e-04
[69,] 0.9993002 1.399614e-03 6.998068e-04
[70,] 0.9991295 1.741009e-03 8.705046e-04
[71,] 0.9997451 5.097926e-04 2.548963e-04
[72,] 0.9996381 7.238579e-04 3.619289e-04
[73,] 0.9995354 9.292093e-04 4.646046e-04
[74,] 0.9995921 8.157482e-04 4.078741e-04
[75,] 0.9999983 3.400404e-06 1.700202e-06
[76,] 0.9999979 4.165131e-06 2.082566e-06
[77,] 0.9999964 7.177087e-06 3.588543e-06
[78,] 0.9999953 9.491985e-06 4.745993e-06
[79,] 0.9999915 1.709148e-05 8.545741e-06
[80,] 0.9999951 9.751406e-06 4.875703e-06
[81,] 0.9999943 1.145070e-05 5.725348e-06
[82,] 0.9999900 2.002420e-05 1.001210e-05
[83,] 0.9999823 3.543076e-05 1.771538e-05
[84,] 0.9999822 3.553455e-05 1.776727e-05
[85,] 0.9999706 5.872516e-05 2.936258e-05
[86,] 0.9999560 8.805034e-05 4.402517e-05
[87,] 0.9999680 6.402166e-05 3.201083e-05
[88,] 0.9999606 7.874916e-05 3.937458e-05
[89,] 0.9999324 1.351275e-04 6.756376e-05
[90,] 0.9999539 9.213933e-05 4.606967e-05
[91,] 0.9999197 1.605333e-04 8.026667e-05
[92,] 0.9999747 5.063118e-05 2.531559e-05
[93,] 0.9999528 9.439563e-05 4.719781e-05
[94,] 0.9999500 1.000830e-04 5.004149e-05
[95,] 0.9999630 7.397922e-05 3.698961e-05
[96,] 0.9999743 5.146219e-05 2.573110e-05
[97,] 0.9999548 9.038093e-05 4.519046e-05
[98,] 0.9999202 1.596802e-04 7.984012e-05
[99,] 0.9999136 1.728766e-04 8.643829e-05
[100,] 0.9998936 2.128319e-04 1.064160e-04
[101,] 0.9998275 3.450517e-04 1.725258e-04
[102,] 0.9997151 5.697456e-04 2.848728e-04
[103,] 0.9998242 3.515247e-04 1.757624e-04
[104,] 0.9997285 5.430836e-04 2.715418e-04
[105,] 0.9995342 9.316976e-04 4.658488e-04
[106,] 0.9997969 4.062447e-04 2.031223e-04
[107,] 0.9996924 6.152901e-04 3.076450e-04
[108,] 0.9994438 1.112317e-03 5.561583e-04
[109,] 0.9991108 1.778374e-03 8.891869e-04
[110,] 0.9992200 1.560042e-03 7.800211e-04
[111,] 0.9998444 3.112111e-04 1.556055e-04
[112,] 0.9997892 4.215970e-04 2.107985e-04
[113,] 0.9995688 8.624794e-04 4.312397e-04
[114,] 0.9998269 3.462046e-04 1.731023e-04
[115,] 0.9996625 6.750293e-04 3.375147e-04
[116,] 0.9993252 1.349609e-03 6.748047e-04
[117,] 0.9994518 1.096361e-03 5.481806e-04
[118,] 0.9995577 8.846323e-04 4.423161e-04
[119,] 0.9991341 1.731824e-03 8.659118e-04
[120,] 0.9984552 3.089629e-03 1.544815e-03
[121,] 0.9990848 1.830303e-03 9.151515e-04
[122,] 0.9977224 4.555250e-03 2.277625e-03
[123,] 0.9943257 1.134865e-02 5.674325e-03
[124,] 0.9866878 2.662434e-02 1.331217e-02
[125,] 0.9912683 1.746339e-02 8.731696e-03
[126,] 0.9774428 4.511447e-02 2.255724e-02
[127,] 0.9921198 1.576030e-02 7.880150e-03
[128,] 0.9765085 4.698292e-02 2.349146e-02
[129,] 0.9980092 3.981643e-03 1.990821e-03
> postscript(file="/var/wessaorg/rcomp/tmp/1qkmw1323874067.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/2je7y1323874067.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/30dci1323874067.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/4aubu1323874067.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/50db21323874067.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
53984.73245 -16092.56581 -5009.73384 1544.60701 31182.29045 62831.19481
7 8 9 10 11 12
-5362.46983 -24298.06329 -10500.48813 57713.66991 3484.80223 -17395.98748
13 14 15 16 17 18
-3727.37543 10858.56955 15800.38473 -1905.35015 -51845.86890 29476.79447
19 20 21 22 23 24
-20674.08182 -22474.61920 -10333.91441 -19027.97445 62506.45123 -5684.54842
25 26 27 28 29 30
-582.91530 14833.49957 7603.59879 -49670.62368 81443.46439 14106.94292
31 32 33 34 35 36
17263.92221 10530.41696 3465.86826 74754.19764 3201.15101 -9868.05934
37 38 39 40 41 42
58627.82872 -3586.84372 -8688.89782 -66270.54229 8940.77752 785.78434
43 44 45 46 47 48
-20366.79096 -6039.88910 -16496.87443 -3670.78728 -15664.02438 36320.54160
49 50 51 52 53 54
4150.68745 10869.88719 -7727.34042 -11339.18202 48843.90896 49721.33115
55 56 57 58 59 60
-2361.20084 2125.93326 38084.45708 -23495.60360 -33336.99116 47806.59746
61 62 63 64 65 66
-19152.37595 -14722.73091 -8623.47753 -27234.43771 3084.90042 -34810.06446
67 68 69 70 71 72
-76127.80790 -35017.75052 -37260.66907 -6112.75014 57758.83013 -448.21975
73 74 75 76 77 78
-32424.54158 13272.40847 -15822.00955 9248.87266 -21203.84197 -50092.18184
79 80 81 82 83 84
-8488.42962 -18299.76661 -34451.93644 87383.45811 -22552.75087 -9264.82811
85 86 87 88 89 90
-12515.53389 4579.30297 26320.65784 -20846.18852 -4257.61574 -2813.99553
91 92 93 94 95 96
-24272.29278 -17114.45676 12469.78981 25913.19747 -21002.61450 10003.70961
97 98 99 100 101 102
-5300.83700 -11978.54972 46790.73289 -854.62082 21230.25706 -37220.00370
103 104 105 106 107 108
17150.01341 1001.62311 -8924.50248 2065.90478 -36054.80907 16994.24678
109 110 111 112 113 114
-9868.05934 -31937.69537 -11657.68806 -14697.63827 -41118.15787 -9212.26302
115 116 117 118 119 120
-6252.05934 -9868.05934 18581.71657 -35938.57743 32537.92907 -9518.95849
121 122 123 124 125 126
27371.75896 -13356.33830 -5696.13792 3094.35540 26278.08535 -11224.25654
127 128 129 130 131 132
-12287.25688 11038.31493 3743.13650 46.66955 -2241.05934 32790.88708
133 134 135 136 137 138
-3499.71892 31224.93800 -8311.03946 13830.53493 -9868.05934 13903.61725
139 140 141 142 143 144
10560.11874 -2737.05934 -5674.05934 8833.53453 -20931.97590 -7305.47938
> postscript(file="/var/wessaorg/rcomp/tmp/6gzen1323874067.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 53984.73245 NA
1 -16092.56581 53984.73245
2 -5009.73384 -16092.56581
3 1544.60701 -5009.73384
4 31182.29045 1544.60701
5 62831.19481 31182.29045
6 -5362.46983 62831.19481
7 -24298.06329 -5362.46983
8 -10500.48813 -24298.06329
9 57713.66991 -10500.48813
10 3484.80223 57713.66991
11 -17395.98748 3484.80223
12 -3727.37543 -17395.98748
13 10858.56955 -3727.37543
14 15800.38473 10858.56955
15 -1905.35015 15800.38473
16 -51845.86890 -1905.35015
17 29476.79447 -51845.86890
18 -20674.08182 29476.79447
19 -22474.61920 -20674.08182
20 -10333.91441 -22474.61920
21 -19027.97445 -10333.91441
22 62506.45123 -19027.97445
23 -5684.54842 62506.45123
24 -582.91530 -5684.54842
25 14833.49957 -582.91530
26 7603.59879 14833.49957
27 -49670.62368 7603.59879
28 81443.46439 -49670.62368
29 14106.94292 81443.46439
30 17263.92221 14106.94292
31 10530.41696 17263.92221
32 3465.86826 10530.41696
33 74754.19764 3465.86826
34 3201.15101 74754.19764
35 -9868.05934 3201.15101
36 58627.82872 -9868.05934
37 -3586.84372 58627.82872
38 -8688.89782 -3586.84372
39 -66270.54229 -8688.89782
40 8940.77752 -66270.54229
41 785.78434 8940.77752
42 -20366.79096 785.78434
43 -6039.88910 -20366.79096
44 -16496.87443 -6039.88910
45 -3670.78728 -16496.87443
46 -15664.02438 -3670.78728
47 36320.54160 -15664.02438
48 4150.68745 36320.54160
49 10869.88719 4150.68745
50 -7727.34042 10869.88719
51 -11339.18202 -7727.34042
52 48843.90896 -11339.18202
53 49721.33115 48843.90896
54 -2361.20084 49721.33115
55 2125.93326 -2361.20084
56 38084.45708 2125.93326
57 -23495.60360 38084.45708
58 -33336.99116 -23495.60360
59 47806.59746 -33336.99116
60 -19152.37595 47806.59746
61 -14722.73091 -19152.37595
62 -8623.47753 -14722.73091
63 -27234.43771 -8623.47753
64 3084.90042 -27234.43771
65 -34810.06446 3084.90042
66 -76127.80790 -34810.06446
67 -35017.75052 -76127.80790
68 -37260.66907 -35017.75052
69 -6112.75014 -37260.66907
70 57758.83013 -6112.75014
71 -448.21975 57758.83013
72 -32424.54158 -448.21975
73 13272.40847 -32424.54158
74 -15822.00955 13272.40847
75 9248.87266 -15822.00955
76 -21203.84197 9248.87266
77 -50092.18184 -21203.84197
78 -8488.42962 -50092.18184
79 -18299.76661 -8488.42962
80 -34451.93644 -18299.76661
81 87383.45811 -34451.93644
82 -22552.75087 87383.45811
83 -9264.82811 -22552.75087
84 -12515.53389 -9264.82811
85 4579.30297 -12515.53389
86 26320.65784 4579.30297
87 -20846.18852 26320.65784
88 -4257.61574 -20846.18852
89 -2813.99553 -4257.61574
90 -24272.29278 -2813.99553
91 -17114.45676 -24272.29278
92 12469.78981 -17114.45676
93 25913.19747 12469.78981
94 -21002.61450 25913.19747
95 10003.70961 -21002.61450
96 -5300.83700 10003.70961
97 -11978.54972 -5300.83700
98 46790.73289 -11978.54972
99 -854.62082 46790.73289
100 21230.25706 -854.62082
101 -37220.00370 21230.25706
102 17150.01341 -37220.00370
103 1001.62311 17150.01341
104 -8924.50248 1001.62311
105 2065.90478 -8924.50248
106 -36054.80907 2065.90478
107 16994.24678 -36054.80907
108 -9868.05934 16994.24678
109 -31937.69537 -9868.05934
110 -11657.68806 -31937.69537
111 -14697.63827 -11657.68806
112 -41118.15787 -14697.63827
113 -9212.26302 -41118.15787
114 -6252.05934 -9212.26302
115 -9868.05934 -6252.05934
116 18581.71657 -9868.05934
117 -35938.57743 18581.71657
118 32537.92907 -35938.57743
119 -9518.95849 32537.92907
120 27371.75896 -9518.95849
121 -13356.33830 27371.75896
122 -5696.13792 -13356.33830
123 3094.35540 -5696.13792
124 26278.08535 3094.35540
125 -11224.25654 26278.08535
126 -12287.25688 -11224.25654
127 11038.31493 -12287.25688
128 3743.13650 11038.31493
129 46.66955 3743.13650
130 -2241.05934 46.66955
131 32790.88708 -2241.05934
132 -3499.71892 32790.88708
133 31224.93800 -3499.71892
134 -8311.03946 31224.93800
135 13830.53493 -8311.03946
136 -9868.05934 13830.53493
137 13903.61725 -9868.05934
138 10560.11874 13903.61725
139 -2737.05934 10560.11874
140 -5674.05934 -2737.05934
141 8833.53453 -5674.05934
142 -20931.97590 8833.53453
143 -7305.47938 -20931.97590
144 NA -7305.47938
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -16092.56581 53984.73245
[2,] -5009.73384 -16092.56581
[3,] 1544.60701 -5009.73384
[4,] 31182.29045 1544.60701
[5,] 62831.19481 31182.29045
[6,] -5362.46983 62831.19481
[7,] -24298.06329 -5362.46983
[8,] -10500.48813 -24298.06329
[9,] 57713.66991 -10500.48813
[10,] 3484.80223 57713.66991
[11,] -17395.98748 3484.80223
[12,] -3727.37543 -17395.98748
[13,] 10858.56955 -3727.37543
[14,] 15800.38473 10858.56955
[15,] -1905.35015 15800.38473
[16,] -51845.86890 -1905.35015
[17,] 29476.79447 -51845.86890
[18,] -20674.08182 29476.79447
[19,] -22474.61920 -20674.08182
[20,] -10333.91441 -22474.61920
[21,] -19027.97445 -10333.91441
[22,] 62506.45123 -19027.97445
[23,] -5684.54842 62506.45123
[24,] -582.91530 -5684.54842
[25,] 14833.49957 -582.91530
[26,] 7603.59879 14833.49957
[27,] -49670.62368 7603.59879
[28,] 81443.46439 -49670.62368
[29,] 14106.94292 81443.46439
[30,] 17263.92221 14106.94292
[31,] 10530.41696 17263.92221
[32,] 3465.86826 10530.41696
[33,] 74754.19764 3465.86826
[34,] 3201.15101 74754.19764
[35,] -9868.05934 3201.15101
[36,] 58627.82872 -9868.05934
[37,] -3586.84372 58627.82872
[38,] -8688.89782 -3586.84372
[39,] -66270.54229 -8688.89782
[40,] 8940.77752 -66270.54229
[41,] 785.78434 8940.77752
[42,] -20366.79096 785.78434
[43,] -6039.88910 -20366.79096
[44,] -16496.87443 -6039.88910
[45,] -3670.78728 -16496.87443
[46,] -15664.02438 -3670.78728
[47,] 36320.54160 -15664.02438
[48,] 4150.68745 36320.54160
[49,] 10869.88719 4150.68745
[50,] -7727.34042 10869.88719
[51,] -11339.18202 -7727.34042
[52,] 48843.90896 -11339.18202
[53,] 49721.33115 48843.90896
[54,] -2361.20084 49721.33115
[55,] 2125.93326 -2361.20084
[56,] 38084.45708 2125.93326
[57,] -23495.60360 38084.45708
[58,] -33336.99116 -23495.60360
[59,] 47806.59746 -33336.99116
[60,] -19152.37595 47806.59746
[61,] -14722.73091 -19152.37595
[62,] -8623.47753 -14722.73091
[63,] -27234.43771 -8623.47753
[64,] 3084.90042 -27234.43771
[65,] -34810.06446 3084.90042
[66,] -76127.80790 -34810.06446
[67,] -35017.75052 -76127.80790
[68,] -37260.66907 -35017.75052
[69,] -6112.75014 -37260.66907
[70,] 57758.83013 -6112.75014
[71,] -448.21975 57758.83013
[72,] -32424.54158 -448.21975
[73,] 13272.40847 -32424.54158
[74,] -15822.00955 13272.40847
[75,] 9248.87266 -15822.00955
[76,] -21203.84197 9248.87266
[77,] -50092.18184 -21203.84197
[78,] -8488.42962 -50092.18184
[79,] -18299.76661 -8488.42962
[80,] -34451.93644 -18299.76661
[81,] 87383.45811 -34451.93644
[82,] -22552.75087 87383.45811
[83,] -9264.82811 -22552.75087
[84,] -12515.53389 -9264.82811
[85,] 4579.30297 -12515.53389
[86,] 26320.65784 4579.30297
[87,] -20846.18852 26320.65784
[88,] -4257.61574 -20846.18852
[89,] -2813.99553 -4257.61574
[90,] -24272.29278 -2813.99553
[91,] -17114.45676 -24272.29278
[92,] 12469.78981 -17114.45676
[93,] 25913.19747 12469.78981
[94,] -21002.61450 25913.19747
[95,] 10003.70961 -21002.61450
[96,] -5300.83700 10003.70961
[97,] -11978.54972 -5300.83700
[98,] 46790.73289 -11978.54972
[99,] -854.62082 46790.73289
[100,] 21230.25706 -854.62082
[101,] -37220.00370 21230.25706
[102,] 17150.01341 -37220.00370
[103,] 1001.62311 17150.01341
[104,] -8924.50248 1001.62311
[105,] 2065.90478 -8924.50248
[106,] -36054.80907 2065.90478
[107,] 16994.24678 -36054.80907
[108,] -9868.05934 16994.24678
[109,] -31937.69537 -9868.05934
[110,] -11657.68806 -31937.69537
[111,] -14697.63827 -11657.68806
[112,] -41118.15787 -14697.63827
[113,] -9212.26302 -41118.15787
[114,] -6252.05934 -9212.26302
[115,] -9868.05934 -6252.05934
[116,] 18581.71657 -9868.05934
[117,] -35938.57743 18581.71657
[118,] 32537.92907 -35938.57743
[119,] -9518.95849 32537.92907
[120,] 27371.75896 -9518.95849
[121,] -13356.33830 27371.75896
[122,] -5696.13792 -13356.33830
[123,] 3094.35540 -5696.13792
[124,] 26278.08535 3094.35540
[125,] -11224.25654 26278.08535
[126,] -12287.25688 -11224.25654
[127,] 11038.31493 -12287.25688
[128,] 3743.13650 11038.31493
[129,] 46.66955 3743.13650
[130,] -2241.05934 46.66955
[131,] 32790.88708 -2241.05934
[132,] -3499.71892 32790.88708
[133,] 31224.93800 -3499.71892
[134,] -8311.03946 31224.93800
[135,] 13830.53493 -8311.03946
[136,] -9868.05934 13830.53493
[137,] 13903.61725 -9868.05934
[138,] 10560.11874 13903.61725
[139,] -2737.05934 10560.11874
[140,] -5674.05934 -2737.05934
[141,] 8833.53453 -5674.05934
[142,] -20931.97590 8833.53453
[143,] -7305.47938 -20931.97590
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -16092.56581 53984.73245
2 -5009.73384 -16092.56581
3 1544.60701 -5009.73384
4 31182.29045 1544.60701
5 62831.19481 31182.29045
6 -5362.46983 62831.19481
7 -24298.06329 -5362.46983
8 -10500.48813 -24298.06329
9 57713.66991 -10500.48813
10 3484.80223 57713.66991
11 -17395.98748 3484.80223
12 -3727.37543 -17395.98748
13 10858.56955 -3727.37543
14 15800.38473 10858.56955
15 -1905.35015 15800.38473
16 -51845.86890 -1905.35015
17 29476.79447 -51845.86890
18 -20674.08182 29476.79447
19 -22474.61920 -20674.08182
20 -10333.91441 -22474.61920
21 -19027.97445 -10333.91441
22 62506.45123 -19027.97445
23 -5684.54842 62506.45123
24 -582.91530 -5684.54842
25 14833.49957 -582.91530
26 7603.59879 14833.49957
27 -49670.62368 7603.59879
28 81443.46439 -49670.62368
29 14106.94292 81443.46439
30 17263.92221 14106.94292
31 10530.41696 17263.92221
32 3465.86826 10530.41696
33 74754.19764 3465.86826
34 3201.15101 74754.19764
35 -9868.05934 3201.15101
36 58627.82872 -9868.05934
37 -3586.84372 58627.82872
38 -8688.89782 -3586.84372
39 -66270.54229 -8688.89782
40 8940.77752 -66270.54229
41 785.78434 8940.77752
42 -20366.79096 785.78434
43 -6039.88910 -20366.79096
44 -16496.87443 -6039.88910
45 -3670.78728 -16496.87443
46 -15664.02438 -3670.78728
47 36320.54160 -15664.02438
48 4150.68745 36320.54160
49 10869.88719 4150.68745
50 -7727.34042 10869.88719
51 -11339.18202 -7727.34042
52 48843.90896 -11339.18202
53 49721.33115 48843.90896
54 -2361.20084 49721.33115
55 2125.93326 -2361.20084
56 38084.45708 2125.93326
57 -23495.60360 38084.45708
58 -33336.99116 -23495.60360
59 47806.59746 -33336.99116
60 -19152.37595 47806.59746
61 -14722.73091 -19152.37595
62 -8623.47753 -14722.73091
63 -27234.43771 -8623.47753
64 3084.90042 -27234.43771
65 -34810.06446 3084.90042
66 -76127.80790 -34810.06446
67 -35017.75052 -76127.80790
68 -37260.66907 -35017.75052
69 -6112.75014 -37260.66907
70 57758.83013 -6112.75014
71 -448.21975 57758.83013
72 -32424.54158 -448.21975
73 13272.40847 -32424.54158
74 -15822.00955 13272.40847
75 9248.87266 -15822.00955
76 -21203.84197 9248.87266
77 -50092.18184 -21203.84197
78 -8488.42962 -50092.18184
79 -18299.76661 -8488.42962
80 -34451.93644 -18299.76661
81 87383.45811 -34451.93644
82 -22552.75087 87383.45811
83 -9264.82811 -22552.75087
84 -12515.53389 -9264.82811
85 4579.30297 -12515.53389
86 26320.65784 4579.30297
87 -20846.18852 26320.65784
88 -4257.61574 -20846.18852
89 -2813.99553 -4257.61574
90 -24272.29278 -2813.99553
91 -17114.45676 -24272.29278
92 12469.78981 -17114.45676
93 25913.19747 12469.78981
94 -21002.61450 25913.19747
95 10003.70961 -21002.61450
96 -5300.83700 10003.70961
97 -11978.54972 -5300.83700
98 46790.73289 -11978.54972
99 -854.62082 46790.73289
100 21230.25706 -854.62082
101 -37220.00370 21230.25706
102 17150.01341 -37220.00370
103 1001.62311 17150.01341
104 -8924.50248 1001.62311
105 2065.90478 -8924.50248
106 -36054.80907 2065.90478
107 16994.24678 -36054.80907
108 -9868.05934 16994.24678
109 -31937.69537 -9868.05934
110 -11657.68806 -31937.69537
111 -14697.63827 -11657.68806
112 -41118.15787 -14697.63827
113 -9212.26302 -41118.15787
114 -6252.05934 -9212.26302
115 -9868.05934 -6252.05934
116 18581.71657 -9868.05934
117 -35938.57743 18581.71657
118 32537.92907 -35938.57743
119 -9518.95849 32537.92907
120 27371.75896 -9518.95849
121 -13356.33830 27371.75896
122 -5696.13792 -13356.33830
123 3094.35540 -5696.13792
124 26278.08535 3094.35540
125 -11224.25654 26278.08535
126 -12287.25688 -11224.25654
127 11038.31493 -12287.25688
128 3743.13650 11038.31493
129 46.66955 3743.13650
130 -2241.05934 46.66955
131 32790.88708 -2241.05934
132 -3499.71892 32790.88708
133 31224.93800 -3499.71892
134 -8311.03946 31224.93800
135 13830.53493 -8311.03946
136 -9868.05934 13830.53493
137 13903.61725 -9868.05934
138 10560.11874 13903.61725
139 -2737.05934 10560.11874
140 -5674.05934 -2737.05934
141 8833.53453 -5674.05934
142 -20931.97590 8833.53453
143 -7305.47938 -20931.97590
> 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/7e5e41323874067.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/8qmng1323874067.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/96adq1323874067.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/10okpp1323874067.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/11x2781323874067.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/12wi2w1323874067.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/13weyc1323874067.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/14ed0s1323874067.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/15iew81323874067.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/161kp81323874067.tab")
+ }
>
> try(system("convert tmp/1qkmw1323874067.ps tmp/1qkmw1323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/2je7y1323874067.ps tmp/2je7y1323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/30dci1323874067.ps tmp/30dci1323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/4aubu1323874067.ps tmp/4aubu1323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/50db21323874067.ps tmp/50db21323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/6gzen1323874067.ps tmp/6gzen1323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/7e5e41323874067.ps tmp/7e5e41323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qmng1323874067.ps tmp/8qmng1323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/96adq1323874067.ps tmp/96adq1323874067.png",intern=TRUE))
character(0)
> try(system("convert tmp/10okpp1323874067.ps tmp/10okpp1323874067.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.474 0.569 5.058