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(47.38555556
+ ,46
+ ,26
+ ,95556
+ ,24.06138889
+ ,48
+ ,20
+ ,54565
+ ,31.4825
+ ,37
+ ,24
+ ,63016
+ ,42.36388889
+ ,75
+ ,25
+ ,79774
+ ,23.94611111
+ ,31
+ ,15
+ ,31258
+ ,10.34916667
+ ,18
+ ,16
+ ,52491
+ ,85.01527778
+ ,79
+ ,20
+ ,91256
+ ,9.097222222
+ ,16
+ ,18
+ ,22807
+ ,32.36166667
+ ,38
+ ,19
+ ,77411
+ ,36.26083333
+ ,24
+ ,20
+ ,48821
+ ,44.96555556
+ ,65
+ ,30
+ ,52295
+ ,35.63166667
+ ,74
+ ,37
+ ,63262
+ ,28.43055556
+ ,43
+ ,23
+ ,50466
+ ,53.61777778
+ ,42
+ ,36
+ ,62932
+ ,39.32611111
+ ,55
+ ,29
+ ,38439
+ ,70.43305556
+ ,121
+ ,35
+ ,70817
+ ,50.30833333
+ ,42
+ ,24
+ ,105965
+ ,55.12
+ ,102
+ ,22
+ ,73795
+ ,31.62583333
+ ,36
+ ,19
+ ,82043
+ ,44.42777778
+ ,50
+ ,30
+ ,74349
+ ,46.33944444
+ ,48
+ ,27
+ ,82204
+ ,79.63194444
+ ,56
+ ,26
+ ,55709
+ ,25.46027778
+ ,19
+ ,15
+ ,37137
+ ,30.07722222
+ ,32
+ ,30
+ ,70780
+ ,40.65055556
+ ,77
+ ,28
+ ,55027
+ ,40.31722222
+ ,90
+ ,24
+ ,56699
+ ,44.92777778
+ ,81
+ ,21
+ ,65911
+ ,44.69583333
+ ,55
+ ,27
+ ,56316
+ ,29.69111111
+ ,34
+ ,21
+ ,26982
+ ,52.26388889
+ ,38
+ ,30
+ ,54628
+ ,52.61138889
+ ,53
+ ,30
+ ,96750
+ ,35.96777778
+ ,48
+ ,33
+ ,53009
+ ,56.675
+ ,63
+ ,30
+ ,64664
+ ,17.42527778
+ ,25
+ ,20
+ ,36990
+ ,67.67361111
+ ,56
+ ,27
+ ,85224
+ ,46.45972222
+ ,37
+ ,25
+ ,37048
+ ,73.48
+ ,83
+ ,30
+ ,59635
+ ,33.89555556
+ ,50
+ ,20
+ ,42051
+ ,22.49
+ ,26
+ ,8
+ ,26998
+ ,58.27638889
+ ,108
+ ,24
+ ,63717
+ ,62.27916667
+ ,55
+ ,25
+ ,55071
+ ,32.21416667
+ ,41
+ ,25
+ ,40001
+ ,38.38638889
+ ,49
+ ,21
+ ,54506
+ ,22.52944444
+ ,31
+ ,21
+ ,35838
+ ,25.86805556
+ ,49
+ ,21
+ ,50838
+ ,84.93222222
+ ,96
+ ,26
+ ,86997
+ ,21.88888889
+ ,42
+ ,26
+ ,33032
+ ,44.12083333
+ ,55
+ ,30
+ ,61704
+ ,61.59583333
+ ,70
+ ,34
+ ,117986
+ ,36.41888889
+ ,39
+ ,30
+ ,56733
+ ,35.75944444
+ ,53
+ ,18
+ ,55064
+ ,6.718888889
+ ,24
+ ,4
+ ,5950
+ ,71.57277778
+ ,209
+ ,31
+ ,84607
+ ,18.06361111
+ ,17
+ ,18
+ ,32551
+ ,27.24055556
+ ,58
+ ,14
+ ,31701
+ ,48.21861111
+ ,27
+ ,20
+ ,71170
+ ,50.01166667
+ ,58
+ ,36
+ ,101773
+ ,54.79611111
+ ,114
+ ,24
+ ,101653
+ ,58.90555556
+ ,75
+ ,26
+ ,81493
+ ,39.32833333
+ ,51
+ ,22
+ ,55901
+ ,68.08527778
+ ,86
+ ,31
+ ,109104
+ ,57.46638889
+ ,77
+ ,21
+ ,114425
+ ,40.47111111
+ ,62
+ ,31
+ ,36311
+ ,47.39861111
+ ,60
+ ,26
+ ,70027
+ ,39.46222222
+ ,39
+ ,24
+ ,73713
+ ,31.89444444
+ ,35
+ ,15
+ ,40671
+ ,31.51694444
+ ,86
+ ,19
+ ,89041
+ ,40.35694444
+ ,102
+ ,28
+ ,57231
+ ,41.94416667
+ ,49
+ ,24
+ ,68608
+ ,25.50333333
+ ,35
+ ,18
+ ,59155
+ ,33.00194444
+ ,33
+ ,25
+ ,55827
+ ,19.2975
+ ,28
+ ,20
+ ,22618
+ ,35.175
+ ,44
+ ,25
+ ,58425
+ ,40.53
+ ,37
+ ,24
+ ,65724
+ ,27.33138889
+ ,33
+ ,23
+ ,56979
+ ,53.035
+ ,45
+ ,25
+ ,72369
+ ,55.22138889
+ ,57
+ ,20
+ ,79194
+ ,29.49805556
+ ,58
+ ,23
+ ,202316
+ ,24.81055556
+ ,36
+ ,22
+ ,44970
+ ,33.43388889
+ ,42
+ ,25
+ ,49319
+ ,27.44194444
+ ,30
+ ,18
+ ,36252
+ ,76.37583333
+ ,67
+ ,30
+ ,75741
+ ,36.88833333
+ ,53
+ ,22
+ ,38417
+ ,37.56972222
+ ,59
+ ,25
+ ,64102
+ ,22.48694444
+ ,25
+ ,8
+ ,56622
+ ,30.34361111
+ ,39
+ ,21
+ ,15430
+ ,26.84277778
+ ,36
+ ,22
+ ,72571
+ ,62.83083333
+ ,114
+ ,24
+ ,67271
+ ,47.57944444
+ ,54
+ ,30
+ ,43460
+ ,32.72638889
+ ,70
+ ,27
+ ,99501
+ ,37.10027778
+ ,51
+ ,24
+ ,28340
+ ,42.27583333
+ ,49
+ ,25
+ ,76013
+ ,31.11222222
+ ,42
+ ,21
+ ,37361
+ ,47.11472222
+ ,51
+ ,24
+ ,48204
+ ,52.07861111
+ ,51
+ ,24
+ ,76168
+ ,36.25916667
+ ,27
+ ,20
+ ,85168
+ ,39.53861111
+ ,29
+ ,20
+ ,125410
+ ,52.71222222
+ ,54
+ ,24
+ ,123328
+ ,56.00083333
+ ,92
+ ,40
+ ,83038
+ ,68.565
+ ,72
+ ,22
+ ,120087
+ ,43.31861111
+ ,63
+ ,31
+ ,91939
+ ,50.71694444
+ ,41
+ ,26
+ ,103646
+ ,29.54194444
+ ,111
+ ,20
+ ,29467
+ ,12.02416667
+ ,14
+ ,19
+ ,43750
+ ,35.41472222
+ ,45
+ ,15
+ ,34497
+ ,35.53611111
+ ,91
+ ,21
+ ,66477
+ ,41.39055556
+ ,29
+ ,22
+ ,71181
+ ,52.12583333
+ ,64
+ ,24
+ ,74482
+ ,20.58666667
+ ,32
+ ,19
+ ,174949
+ ,26.11277778
+ ,65
+ ,24
+ ,46765
+ ,49.0625
+ ,42
+ ,23
+ ,90257
+ ,39.42583333
+ ,55
+ ,27
+ ,51370
+ ,6.371666667
+ ,10
+ ,1
+ ,1168
+ ,34.97972222
+ ,53
+ ,24
+ ,51360
+ ,17.1825
+ ,25
+ ,11
+ ,25162
+ ,25.35833333
+ ,33
+ ,27
+ ,21067
+ ,70.86111111
+ ,66
+ ,22
+ ,58233
+ ,5.848333333
+ ,16
+ ,0
+ ,855
+ ,46.97027778
+ ,35
+ ,17
+ ,85903
+ ,8.726111111
+ ,19
+ ,8
+ ,14116
+ ,52.41694444
+ ,76
+ ,24
+ ,57637
+ ,38.20666667
+ ,35
+ ,31
+ ,94137
+ ,21.435
+ ,46
+ ,24
+ ,62147
+ ,20.71305556
+ ,29
+ ,20
+ ,62832
+ ,10.615
+ ,34
+ ,8
+ ,8773
+ ,25.26694444
+ ,25
+ ,22
+ ,63785
+ ,53.95111111
+ ,48
+ ,33
+ ,65196
+ ,37.5725
+ ,38
+ ,33
+ ,73087
+ ,67.85333333
+ ,50
+ ,31
+ ,72631
+ ,56.04111111
+ ,65
+ ,33
+ ,86281
+ ,71.22277778
+ ,72
+ ,35
+ ,162365
+ ,38.65111111
+ ,23
+ ,21
+ ,56530
+ ,21.24166667
+ ,29
+ ,20
+ ,35606
+ ,52.63944444
+ ,194
+ ,24
+ ,70111
+ ,77.87055556
+ ,114
+ ,29
+ ,92046
+ ,14.16638889
+ ,15
+ ,20
+ ,63989
+ ,70.35388889
+ ,86
+ ,27
+ ,104911
+ ,28.6775
+ ,50
+ ,24
+ ,43448
+ ,46.68305556
+ ,33
+ ,26
+ ,60029
+ ,35.76888889
+ ,50
+ ,26
+ ,38650
+ ,21.04055556
+ ,72
+ ,12
+ ,47261
+ ,69.23111111
+ ,81
+ ,21
+ ,73586
+ ,42.32388889
+ ,54
+ ,24
+ ,83042
+ ,48.12777778
+ ,63
+ ,21
+ ,37238
+ ,54.77694444
+ ,69
+ ,30
+ ,63958
+ ,18.75194444
+ ,39
+ ,32
+ ,78956
+ ,38.72472222
+ ,49
+ ,24
+ ,99518
+ ,51.49055556
+ ,67
+ ,29
+ ,111436
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4.08
+ ,10
+ ,0
+ ,6023
+ ,0.027222222
+ ,1
+ ,0
+ ,0
+ ,0.126388889
+ ,2
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,38.30138889
+ ,58
+ ,20
+ ,42564
+ ,51.46888889
+ ,72
+ ,27
+ ,38885
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0.056388889
+ ,4
+ ,0
+ ,0
+ ,1.999722222
+ ,5
+ ,0
+ ,1644
+ ,12.96111111
+ ,20
+ ,5
+ ,6179
+ ,4.874166667
+ ,5
+ ,1
+ ,3926
+ ,20.43527778
+ ,27
+ ,23
+ ,23238
+ ,0.269166667
+ ,2
+ ,0
+ ,0
+ ,29.29916667
+ ,33
+ ,16
+ ,49288)
+ ,dim=c(4
+ ,164)
+ ,dimnames=list(c('AantalurenRFC'
+ ,'#logins'
+ ,'otaal#peer_reviews'
+ ,'totaal#karakterscompendium')
+ ,1:164))
> y <- array(NA,dim=c(4,164),dimnames=list(c('AantalurenRFC','#logins','otaal#peer_reviews','totaal#karakterscompendium'),1:164))
> 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 = '3'
> 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
otaal#peer_reviews AantalurenRFC #logins totaal#karakterscompendium
1 26 47.38555556 46 95556
2 20 24.06138889 48 54565
3 24 31.48250000 37 63016
4 25 42.36388889 75 79774
5 15 23.94611111 31 31258
6 16 10.34916667 18 52491
7 20 85.01527778 79 91256
8 18 9.09722222 16 22807
9 19 32.36166667 38 77411
10 20 36.26083333 24 48821
11 30 44.96555556 65 52295
12 37 35.63166667 74 63262
13 23 28.43055556 43 50466
14 36 53.61777778 42 62932
15 29 39.32611111 55 38439
16 35 70.43305556 121 70817
17 24 50.30833333 42 105965
18 22 55.12000000 102 73795
19 19 31.62583333 36 82043
20 30 44.42777778 50 74349
21 27 46.33944444 48 82204
22 26 79.63194444 56 55709
23 15 25.46027778 19 37137
24 30 30.07722222 32 70780
25 28 40.65055556 77 55027
26 24 40.31722222 90 56699
27 21 44.92777778 81 65911
28 27 44.69583333 55 56316
29 21 29.69111111 34 26982
30 30 52.26388889 38 54628
31 30 52.61138889 53 96750
32 33 35.96777778 48 53009
33 30 56.67500000 63 64664
34 20 17.42527778 25 36990
35 27 67.67361111 56 85224
36 25 46.45972222 37 37048
37 30 73.48000000 83 59635
38 20 33.89555556 50 42051
39 8 22.49000000 26 26998
40 24 58.27638889 108 63717
41 25 62.27916667 55 55071
42 25 32.21416667 41 40001
43 21 38.38638889 49 54506
44 21 22.52944444 31 35838
45 21 25.86805556 49 50838
46 26 84.93222222 96 86997
47 26 21.88888889 42 33032
48 30 44.12083333 55 61704
49 34 61.59583333 70 117986
50 30 36.41888889 39 56733
51 18 35.75944444 53 55064
52 4 6.71888889 24 5950
53 31 71.57277778 209 84607
54 18 18.06361111 17 32551
55 14 27.24055556 58 31701
56 20 48.21861111 27 71170
57 36 50.01166667 58 101773
58 24 54.79611111 114 101653
59 26 58.90555556 75 81493
60 22 39.32833333 51 55901
61 31 68.08527778 86 109104
62 21 57.46638889 77 114425
63 31 40.47111111 62 36311
64 26 47.39861111 60 70027
65 24 39.46222222 39 73713
66 15 31.89444444 35 40671
67 19 31.51694444 86 89041
68 28 40.35694444 102 57231
69 24 41.94416667 49 68608
70 18 25.50333333 35 59155
71 25 33.00194444 33 55827
72 20 19.29750000 28 22618
73 25 35.17500000 44 58425
74 24 40.53000000 37 65724
75 23 27.33138889 33 56979
76 25 53.03500000 45 72369
77 20 55.22138889 57 79194
78 23 29.49805556 58 202316
79 22 24.81055556 36 44970
80 25 33.43388889 42 49319
81 18 27.44194444 30 36252
82 30 76.37583333 67 75741
83 22 36.88833333 53 38417
84 25 37.56972222 59 64102
85 8 22.48694444 25 56622
86 21 30.34361111 39 15430
87 22 26.84277778 36 72571
88 24 62.83083333 114 67271
89 30 47.57944444 54 43460
90 27 32.72638889 70 99501
91 24 37.10027778 51 28340
92 25 42.27583333 49 76013
93 21 31.11222222 42 37361
94 24 47.11472222 51 48204
95 24 52.07861111 51 76168
96 20 36.25916667 27 85168
97 20 39.53861111 29 125410
98 24 52.71222222 54 123328
99 40 56.00083333 92 83038
100 22 68.56500000 72 120087
101 31 43.31861111 63 91939
102 26 50.71694444 41 103646
103 20 29.54194444 111 29467
104 19 12.02416667 14 43750
105 15 35.41472222 45 34497
106 21 35.53611111 91 66477
107 22 41.39055556 29 71181
108 24 52.12583333 64 74482
109 19 20.58666667 32 174949
110 24 26.11277778 65 46765
111 23 49.06250000 42 90257
112 27 39.42583333 55 51370
113 1 6.37166667 10 1168
114 24 34.97972222 53 51360
115 11 17.18250000 25 25162
116 27 25.35833333 33 21067
117 22 70.86111111 66 58233
118 0 5.84833333 16 855
119 17 46.97027778 35 85903
120 8 8.72611111 19 14116
121 24 52.41694444 76 57637
122 31 38.20666667 35 94137
123 24 21.43500000 46 62147
124 20 20.71305556 29 62832
125 8 10.61500000 34 8773
126 22 25.26694444 25 63785
127 33 53.95111111 48 65196
128 33 37.57250000 38 73087
129 31 67.85333333 50 72631
130 33 56.04111111 65 86281
131 35 71.22277778 72 162365
132 21 38.65111111 23 56530
133 20 21.24166667 29 35606
134 24 52.63944444 194 70111
135 29 77.87055556 114 92046
136 20 14.16638889 15 63989
137 27 70.35388889 86 104911
138 24 28.67750000 50 43448
139 26 46.68305556 33 60029
140 26 35.76888889 50 38650
141 12 21.04055556 72 47261
142 21 69.23111111 81 73586
143 24 42.32388889 54 83042
144 21 48.12777778 63 37238
145 30 54.77694444 69 63958
146 32 18.75194444 39 78956
147 24 38.72472222 49 99518
148 29 51.49055556 67 111436
149 0 0.00000000 0 0
150 0 4.08000000 10 6023
151 0 0.02722222 1 0
152 0 0.12638889 2 0
153 0 0.00000000 0 0
154 0 0.00000000 0 0
155 20 38.30138889 58 42564
156 27 51.46888889 72 38885
157 0 0.00000000 0 0
158 0 0.05638889 4 0
159 0 1.99972222 5 1644
160 5 12.96111111 20 6179
161 1 4.87416667 5 3926
162 23 20.43527778 27 23238
163 0 0.26916667 2 0
164 16 29.29916667 33 49288
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) AantalurenRFC
8.115e+00 2.233e-01
`#logins` `totaal#karakterscompendium`
2.680e-02 6.625e-05
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-15.2616 -4.2583 0.1604 4.0911 14.7544
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.115e+00 1.062e+00 7.643 1.84e-12 ***
AantalurenRFC 2.233e-01 3.771e-02 5.921 1.89e-08 ***
`#logins` 2.680e-02 2.067e-02 1.297 0.196642
`totaal#karakterscompendium` 6.625e-05 1.743e-05 3.801 0.000205 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.819 on 160 degrees of freedom
Multiple R-squared: 0.5623, Adjusted R-squared: 0.5541
F-statistic: 68.53 on 3 and 160 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.17950674 0.35901348 0.82049326
[2,] 0.13082484 0.26164967 0.86917516
[3,] 0.09815479 0.19630957 0.90184521
[4,] 0.06244460 0.12488920 0.93755540
[5,] 0.20016261 0.40032522 0.79983739
[6,] 0.38698223 0.77396446 0.61301777
[7,] 0.29199361 0.58398721 0.70800639
[8,] 0.78483193 0.43033613 0.21516807
[9,] 0.73920435 0.52159130 0.26079565
[10,] 0.67695287 0.64609427 0.32304713
[11,] 0.60781002 0.78437996 0.39218998
[12,] 0.70484119 0.59031762 0.29515881
[13,] 0.64504125 0.70991750 0.35495875
[14,] 0.64525704 0.70948592 0.35474296
[15,] 0.59065300 0.81869400 0.40934700
[16,] 0.53516354 0.92967292 0.46483646
[17,] 0.51733932 0.96532137 0.48266068
[18,] 0.59333223 0.81333553 0.40666777
[19,] 0.53605185 0.92789629 0.46394815
[20,] 0.50087321 0.99825359 0.49912679
[21,] 0.50126699 0.99746603 0.49873301
[22,] 0.44991301 0.89982603 0.55008699
[23,] 0.39324384 0.78648767 0.60675616
[24,] 0.39321330 0.78642661 0.60678670
[25,] 0.36002484 0.72004967 0.63997516
[26,] 0.47360256 0.94720512 0.52639744
[27,] 0.43058143 0.86116285 0.56941857
[28,] 0.38517283 0.77034566 0.61482717
[29,] 0.33618655 0.67237311 0.66381345
[30,] 0.28865221 0.57730442 0.71134779
[31,] 0.24193673 0.48387347 0.75806327
[32,] 0.21743550 0.43487099 0.78256450
[33,] 0.37584306 0.75168613 0.62415694
[34,] 0.36882426 0.73764852 0.63117574
[35,] 0.32331070 0.64662139 0.67668930
[36,] 0.29882280 0.59764561 0.70117720
[37,] 0.26227935 0.52455870 0.73772065
[38,] 0.22948584 0.45897168 0.77051416
[39,] 0.19587184 0.39174367 0.80412816
[40,] 0.21852137 0.43704274 0.78147863
[41,] 0.23776635 0.47553270 0.76223365
[42,] 0.23939944 0.47879889 0.76060056
[43,] 0.22246497 0.44492994 0.77753503
[44,] 0.25559369 0.51118738 0.74440631
[45,] 0.25301662 0.50603324 0.74698338
[46,] 0.38910132 0.77820264 0.61089868
[47,] 0.36022158 0.72044316 0.63977842
[48,] 0.32497393 0.64994787 0.67502607
[49,] 0.32752620 0.65505241 0.67247380
[50,] 0.31717412 0.63434825 0.68282588
[51,] 0.35644465 0.71288929 0.64355535
[52,] 0.37003465 0.74006931 0.62996535
[53,] 0.33423918 0.66847836 0.66576082
[54,] 0.29395098 0.58790197 0.70604902
[55,] 0.25706657 0.51413313 0.74293343
[56,] 0.33205536 0.66411072 0.66794464
[57,] 0.40078312 0.80156623 0.59921688
[58,] 0.35698169 0.71396339 0.64301831
[59,] 0.31582140 0.63164280 0.68417860
[60,] 0.31348076 0.62696153 0.68651924
[61,] 0.30598980 0.61197960 0.69401020
[62,] 0.28493792 0.56987584 0.71506208
[63,] 0.24746350 0.49492700 0.75253650
[64,] 0.21984327 0.43968654 0.78015673
[65,] 0.20545449 0.41090898 0.79454551
[66,] 0.19319119 0.38638239 0.80680881
[67,] 0.17437557 0.34875114 0.82562443
[68,] 0.14811588 0.29623177 0.85188412
[69,] 0.13334084 0.26668168 0.86665916
[70,] 0.11077135 0.22154270 0.88922865
[71,] 0.12382146 0.24764291 0.87617854
[72,] 0.12174374 0.24348748 0.87825626
[73,] 0.11018017 0.22036034 0.88981983
[74,] 0.10308910 0.20617821 0.89691090
[75,] 0.08799691 0.17599382 0.91200309
[76,] 0.07257426 0.14514852 0.92742574
[77,] 0.05965945 0.11931890 0.94034055
[78,] 0.04955050 0.09910100 0.95044950
[79,] 0.09065624 0.18131247 0.90934376
[80,] 0.08194549 0.16389097 0.91805451
[81,] 0.06819570 0.13639141 0.93180430
[82,] 0.06775836 0.13551673 0.93224164
[83,] 0.07530577 0.15061153 0.92469423
[84,] 0.06507230 0.13014461 0.93492770
[85,] 0.05941116 0.11882233 0.94058884
[86,] 0.04769874 0.09539749 0.95230126
[87,] 0.03995469 0.07990938 0.96004531
[88,] 0.03162971 0.06325942 0.96837029
[89,] 0.02497048 0.04994096 0.97502952
[90,] 0.02012910 0.04025821 0.97987090
[91,] 0.02006909 0.04013817 0.97993091
[92,] 0.01939793 0.03879586 0.98060207
[93,] 0.04973967 0.09947934 0.95026033
[94,] 0.09478642 0.18957284 0.90521358
[95,] 0.09484305 0.18968611 0.90515695
[96,] 0.07900104 0.15800207 0.92099896
[97,] 0.06875622 0.13751243 0.93124378
[98,] 0.06722453 0.13444907 0.93277547
[99,] 0.06545050 0.13090100 0.93454950
[100,] 0.05354839 0.10709679 0.94645161
[101,] 0.04224408 0.08448816 0.95775592
[102,] 0.03413097 0.06826193 0.96586903
[103,] 0.06015248 0.12030497 0.93984752
[104,] 0.06047377 0.12094755 0.93952623
[105,] 0.05551033 0.11102066 0.94448967
[106,] 0.05715279 0.11430559 0.94284721
[107,] 0.09472501 0.18945001 0.90527499
[108,] 0.08464880 0.16929759 0.91535120
[109,] 0.07691295 0.15382589 0.92308705
[110,] 0.19251385 0.38502769 0.80748615
[111,] 0.19721497 0.39442994 0.80278503
[112,] 0.26971479 0.53942957 0.73028521
[113,] 0.36990182 0.73980364 0.63009818
[114,] 0.34605838 0.69211675 0.65394162
[115,] 0.30095532 0.60191063 0.69904468
[116,] 0.29581547 0.59163094 0.70418453
[117,] 0.29848006 0.59696013 0.70151994
[118,] 0.25977575 0.51955149 0.74022425
[119,] 0.24026044 0.48052088 0.75973956
[120,] 0.21105252 0.42210505 0.78894748
[121,] 0.24098102 0.48196203 0.75901898
[122,] 0.36051872 0.72103744 0.63948128
[123,] 0.31614868 0.63229737 0.68385132
[124,] 0.30727224 0.61454447 0.69272776
[125,] 0.36312719 0.72625439 0.63687281
[126,] 0.31048316 0.62096632 0.68951684
[127,] 0.32466645 0.64933290 0.67533355
[128,] 0.28979436 0.57958872 0.71020564
[129,] 0.30710354 0.61420707 0.69289646
[130,] 0.28693621 0.57387242 0.71306379
[131,] 0.38762380 0.77524759 0.61237620
[132,] 0.41532873 0.83065746 0.58467127
[133,] 0.38683592 0.77367184 0.61316408
[134,] 0.48578516 0.97157032 0.51421484
[135,] 0.87991786 0.24016428 0.12008214
[136,] 0.90939739 0.18120522 0.09060261
[137,] 0.87803211 0.24393578 0.12196789
[138,] 0.83896418 0.32207165 0.16103582
[139,] 0.81288513 0.37422975 0.18711487
[140,] 0.98207628 0.03584743 0.01792372
[141,] 0.97026341 0.05947319 0.02973659
[142,] 0.95108570 0.09782860 0.04891430
[143,] 0.93045525 0.13908950 0.06954475
[144,] 0.90800834 0.18398332 0.09199166
[145,] 0.86653483 0.26693034 0.13346517
[146,] 0.80847482 0.38305035 0.19152518
[147,] 0.73059229 0.53881542 0.26940771
[148,] 0.63117908 0.73764184 0.36882092
[149,] 0.52223954 0.95552091 0.47776046
[150,] 0.49668436 0.99336872 0.50331564
[151,] 0.36350087 0.72700175 0.63649913
> postscript(file="/var/wessaorg/rcomp/tmp/1a0ug1321904390.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/22stg1321904390.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/3rt3n1321904390.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/4aku51321904390.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/5ntz71321904390.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 = 164
Frequency = 1
1 2 3 4 5 6
-0.25934473 1.61096283 3.68870594 0.13043673 -1.36374172 1.61422616
7 8 9 10 11 12
-15.26159594 5.91386017 -2.48803780 -0.08958614 6.63783985 14.75443266
13 14 15 16 17 18
4.04084014 10.61740805 8.08302692 3.22325406 -3.49439265 -6.04544784
19 20 21 22 23 24
-2.57698814 5.69885484 1.80519443 -5.08828528 -1.76977438 9.62214706
25 26 27 28 29 30
5.09885441 0.71417521 -3.68448123 3.69965062 3.55626476 5.57703599
31 32 33 34 35 36
2.30703769 12.05530636 3.25726316 4.87343039 -3.37323171 3.06454586
37 38 39 40 41 42
-0.69811445 0.19038408 -7.62239439 -4.24341828 -2.14428960 5.94281481
43 44 45 46 47 48
-0.61074561 4.64919309 2.42763489 -9.41643572 9.68336418 6.47111077
49 50 51 52 53 54
2.43842502 8.94903195 -3.16829007 -6.65269116 -4.30284874 3.23932754
55 56 57 58 59 60
-3.85224289 -4.32074263 8.42082514 -6.14018617 -2.67725215 0.03290824
61 62 63 64 65 66
-1.85101993 -9.59112248 9.78074605 1.05381719 1.14456980 -3.86939943
67 68 69 70 71 72
-4.35607207 4.34850915 0.66057417 -0.66675383 4.93284332 5.32707182
73 74 75 76 77 78
3.98072627 1.48897146 4.12278092 -0.95801757 -7.21993447 -6.65909683
79 80 81 82 83 84
4.40086466 5.02636032 0.55158497 -1.98300273 1.68244046 2.66795137
85 86 87 88 89 90
-9.55741970 4.04186543 2.11857675 -5.65665953 6.93419908 3.10964704
91 92 93 94 95 96
4.35627652 1.09595221 2.33697900 0.80408507 -2.15690162 -2.57748492
97 98 99 100 101 102
-6.02930327 -5.50298982 11.41349770 -11.31059069 5.43290073 -1.40521386
103 104 105 106 107 108
0.36165497 4.92644293 -4.51444028 -1.89274655 -0.85033552 -2.40410246
109 110 111 112 113 114
-6.15947246 5.21407531 -3.17558462 5.20411754 -8.88321712 3.25120375
115 116 117 118 119 120
-3.28878598 10.94243625 -7.56489657 -9.90639592 -8.23237222 -3.50790417
121 122 123 124 125 126
-1.67472889 7.17909329 5.74875103 2.32011712 -3.97768189 3.34726902
127 128 129 130 131 132
7.23221394 10.63481789 1.58166151 4.91315736 -1.70487575 -0.10724600
133 134 135 136 137 138
4.00571963 -5.71271295 -5.65635195 4.08050665 -6.07983444 5.26304637
139 140 141 142 143 144
2.59943466 5.99736875 -5.87371115 -9.61994419 -0.51440973 -2.01722062
145 146 147 148 149 150
3.56709958 13.42191144 -0.66821042 0.20927428 -8.11506538 -9.69310980
151 152 153 154 155 156
-8.14794023 -8.19688053 -8.11506538 -8.11506538 -1.04180650 2.88642464
157 158 159 160 161 162
-8.11506538 -8.23484137 -8.80450053 -6.95458692 -8.59754955 8.05872504
163 164
-8.22876329 -2.80712418
> postscript(file="/var/wessaorg/rcomp/tmp/6isad1321904390.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 = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.25934473 NA
1 1.61096283 -0.25934473
2 3.68870594 1.61096283
3 0.13043673 3.68870594
4 -1.36374172 0.13043673
5 1.61422616 -1.36374172
6 -15.26159594 1.61422616
7 5.91386017 -15.26159594
8 -2.48803780 5.91386017
9 -0.08958614 -2.48803780
10 6.63783985 -0.08958614
11 14.75443266 6.63783985
12 4.04084014 14.75443266
13 10.61740805 4.04084014
14 8.08302692 10.61740805
15 3.22325406 8.08302692
16 -3.49439265 3.22325406
17 -6.04544784 -3.49439265
18 -2.57698814 -6.04544784
19 5.69885484 -2.57698814
20 1.80519443 5.69885484
21 -5.08828528 1.80519443
22 -1.76977438 -5.08828528
23 9.62214706 -1.76977438
24 5.09885441 9.62214706
25 0.71417521 5.09885441
26 -3.68448123 0.71417521
27 3.69965062 -3.68448123
28 3.55626476 3.69965062
29 5.57703599 3.55626476
30 2.30703769 5.57703599
31 12.05530636 2.30703769
32 3.25726316 12.05530636
33 4.87343039 3.25726316
34 -3.37323171 4.87343039
35 3.06454586 -3.37323171
36 -0.69811445 3.06454586
37 0.19038408 -0.69811445
38 -7.62239439 0.19038408
39 -4.24341828 -7.62239439
40 -2.14428960 -4.24341828
41 5.94281481 -2.14428960
42 -0.61074561 5.94281481
43 4.64919309 -0.61074561
44 2.42763489 4.64919309
45 -9.41643572 2.42763489
46 9.68336418 -9.41643572
47 6.47111077 9.68336418
48 2.43842502 6.47111077
49 8.94903195 2.43842502
50 -3.16829007 8.94903195
51 -6.65269116 -3.16829007
52 -4.30284874 -6.65269116
53 3.23932754 -4.30284874
54 -3.85224289 3.23932754
55 -4.32074263 -3.85224289
56 8.42082514 -4.32074263
57 -6.14018617 8.42082514
58 -2.67725215 -6.14018617
59 0.03290824 -2.67725215
60 -1.85101993 0.03290824
61 -9.59112248 -1.85101993
62 9.78074605 -9.59112248
63 1.05381719 9.78074605
64 1.14456980 1.05381719
65 -3.86939943 1.14456980
66 -4.35607207 -3.86939943
67 4.34850915 -4.35607207
68 0.66057417 4.34850915
69 -0.66675383 0.66057417
70 4.93284332 -0.66675383
71 5.32707182 4.93284332
72 3.98072627 5.32707182
73 1.48897146 3.98072627
74 4.12278092 1.48897146
75 -0.95801757 4.12278092
76 -7.21993447 -0.95801757
77 -6.65909683 -7.21993447
78 4.40086466 -6.65909683
79 5.02636032 4.40086466
80 0.55158497 5.02636032
81 -1.98300273 0.55158497
82 1.68244046 -1.98300273
83 2.66795137 1.68244046
84 -9.55741970 2.66795137
85 4.04186543 -9.55741970
86 2.11857675 4.04186543
87 -5.65665953 2.11857675
88 6.93419908 -5.65665953
89 3.10964704 6.93419908
90 4.35627652 3.10964704
91 1.09595221 4.35627652
92 2.33697900 1.09595221
93 0.80408507 2.33697900
94 -2.15690162 0.80408507
95 -2.57748492 -2.15690162
96 -6.02930327 -2.57748492
97 -5.50298982 -6.02930327
98 11.41349770 -5.50298982
99 -11.31059069 11.41349770
100 5.43290073 -11.31059069
101 -1.40521386 5.43290073
102 0.36165497 -1.40521386
103 4.92644293 0.36165497
104 -4.51444028 4.92644293
105 -1.89274655 -4.51444028
106 -0.85033552 -1.89274655
107 -2.40410246 -0.85033552
108 -6.15947246 -2.40410246
109 5.21407531 -6.15947246
110 -3.17558462 5.21407531
111 5.20411754 -3.17558462
112 -8.88321712 5.20411754
113 3.25120375 -8.88321712
114 -3.28878598 3.25120375
115 10.94243625 -3.28878598
116 -7.56489657 10.94243625
117 -9.90639592 -7.56489657
118 -8.23237222 -9.90639592
119 -3.50790417 -8.23237222
120 -1.67472889 -3.50790417
121 7.17909329 -1.67472889
122 5.74875103 7.17909329
123 2.32011712 5.74875103
124 -3.97768189 2.32011712
125 3.34726902 -3.97768189
126 7.23221394 3.34726902
127 10.63481789 7.23221394
128 1.58166151 10.63481789
129 4.91315736 1.58166151
130 -1.70487575 4.91315736
131 -0.10724600 -1.70487575
132 4.00571963 -0.10724600
133 -5.71271295 4.00571963
134 -5.65635195 -5.71271295
135 4.08050665 -5.65635195
136 -6.07983444 4.08050665
137 5.26304637 -6.07983444
138 2.59943466 5.26304637
139 5.99736875 2.59943466
140 -5.87371115 5.99736875
141 -9.61994419 -5.87371115
142 -0.51440973 -9.61994419
143 -2.01722062 -0.51440973
144 3.56709958 -2.01722062
145 13.42191144 3.56709958
146 -0.66821042 13.42191144
147 0.20927428 -0.66821042
148 -8.11506538 0.20927428
149 -9.69310980 -8.11506538
150 -8.14794023 -9.69310980
151 -8.19688053 -8.14794023
152 -8.11506538 -8.19688053
153 -8.11506538 -8.11506538
154 -1.04180650 -8.11506538
155 2.88642464 -1.04180650
156 -8.11506538 2.88642464
157 -8.23484137 -8.11506538
158 -8.80450053 -8.23484137
159 -6.95458692 -8.80450053
160 -8.59754955 -6.95458692
161 8.05872504 -8.59754955
162 -8.22876329 8.05872504
163 -2.80712418 -8.22876329
164 NA -2.80712418
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.61096283 -0.25934473
[2,] 3.68870594 1.61096283
[3,] 0.13043673 3.68870594
[4,] -1.36374172 0.13043673
[5,] 1.61422616 -1.36374172
[6,] -15.26159594 1.61422616
[7,] 5.91386017 -15.26159594
[8,] -2.48803780 5.91386017
[9,] -0.08958614 -2.48803780
[10,] 6.63783985 -0.08958614
[11,] 14.75443266 6.63783985
[12,] 4.04084014 14.75443266
[13,] 10.61740805 4.04084014
[14,] 8.08302692 10.61740805
[15,] 3.22325406 8.08302692
[16,] -3.49439265 3.22325406
[17,] -6.04544784 -3.49439265
[18,] -2.57698814 -6.04544784
[19,] 5.69885484 -2.57698814
[20,] 1.80519443 5.69885484
[21,] -5.08828528 1.80519443
[22,] -1.76977438 -5.08828528
[23,] 9.62214706 -1.76977438
[24,] 5.09885441 9.62214706
[25,] 0.71417521 5.09885441
[26,] -3.68448123 0.71417521
[27,] 3.69965062 -3.68448123
[28,] 3.55626476 3.69965062
[29,] 5.57703599 3.55626476
[30,] 2.30703769 5.57703599
[31,] 12.05530636 2.30703769
[32,] 3.25726316 12.05530636
[33,] 4.87343039 3.25726316
[34,] -3.37323171 4.87343039
[35,] 3.06454586 -3.37323171
[36,] -0.69811445 3.06454586
[37,] 0.19038408 -0.69811445
[38,] -7.62239439 0.19038408
[39,] -4.24341828 -7.62239439
[40,] -2.14428960 -4.24341828
[41,] 5.94281481 -2.14428960
[42,] -0.61074561 5.94281481
[43,] 4.64919309 -0.61074561
[44,] 2.42763489 4.64919309
[45,] -9.41643572 2.42763489
[46,] 9.68336418 -9.41643572
[47,] 6.47111077 9.68336418
[48,] 2.43842502 6.47111077
[49,] 8.94903195 2.43842502
[50,] -3.16829007 8.94903195
[51,] -6.65269116 -3.16829007
[52,] -4.30284874 -6.65269116
[53,] 3.23932754 -4.30284874
[54,] -3.85224289 3.23932754
[55,] -4.32074263 -3.85224289
[56,] 8.42082514 -4.32074263
[57,] -6.14018617 8.42082514
[58,] -2.67725215 -6.14018617
[59,] 0.03290824 -2.67725215
[60,] -1.85101993 0.03290824
[61,] -9.59112248 -1.85101993
[62,] 9.78074605 -9.59112248
[63,] 1.05381719 9.78074605
[64,] 1.14456980 1.05381719
[65,] -3.86939943 1.14456980
[66,] -4.35607207 -3.86939943
[67,] 4.34850915 -4.35607207
[68,] 0.66057417 4.34850915
[69,] -0.66675383 0.66057417
[70,] 4.93284332 -0.66675383
[71,] 5.32707182 4.93284332
[72,] 3.98072627 5.32707182
[73,] 1.48897146 3.98072627
[74,] 4.12278092 1.48897146
[75,] -0.95801757 4.12278092
[76,] -7.21993447 -0.95801757
[77,] -6.65909683 -7.21993447
[78,] 4.40086466 -6.65909683
[79,] 5.02636032 4.40086466
[80,] 0.55158497 5.02636032
[81,] -1.98300273 0.55158497
[82,] 1.68244046 -1.98300273
[83,] 2.66795137 1.68244046
[84,] -9.55741970 2.66795137
[85,] 4.04186543 -9.55741970
[86,] 2.11857675 4.04186543
[87,] -5.65665953 2.11857675
[88,] 6.93419908 -5.65665953
[89,] 3.10964704 6.93419908
[90,] 4.35627652 3.10964704
[91,] 1.09595221 4.35627652
[92,] 2.33697900 1.09595221
[93,] 0.80408507 2.33697900
[94,] -2.15690162 0.80408507
[95,] -2.57748492 -2.15690162
[96,] -6.02930327 -2.57748492
[97,] -5.50298982 -6.02930327
[98,] 11.41349770 -5.50298982
[99,] -11.31059069 11.41349770
[100,] 5.43290073 -11.31059069
[101,] -1.40521386 5.43290073
[102,] 0.36165497 -1.40521386
[103,] 4.92644293 0.36165497
[104,] -4.51444028 4.92644293
[105,] -1.89274655 -4.51444028
[106,] -0.85033552 -1.89274655
[107,] -2.40410246 -0.85033552
[108,] -6.15947246 -2.40410246
[109,] 5.21407531 -6.15947246
[110,] -3.17558462 5.21407531
[111,] 5.20411754 -3.17558462
[112,] -8.88321712 5.20411754
[113,] 3.25120375 -8.88321712
[114,] -3.28878598 3.25120375
[115,] 10.94243625 -3.28878598
[116,] -7.56489657 10.94243625
[117,] -9.90639592 -7.56489657
[118,] -8.23237222 -9.90639592
[119,] -3.50790417 -8.23237222
[120,] -1.67472889 -3.50790417
[121,] 7.17909329 -1.67472889
[122,] 5.74875103 7.17909329
[123,] 2.32011712 5.74875103
[124,] -3.97768189 2.32011712
[125,] 3.34726902 -3.97768189
[126,] 7.23221394 3.34726902
[127,] 10.63481789 7.23221394
[128,] 1.58166151 10.63481789
[129,] 4.91315736 1.58166151
[130,] -1.70487575 4.91315736
[131,] -0.10724600 -1.70487575
[132,] 4.00571963 -0.10724600
[133,] -5.71271295 4.00571963
[134,] -5.65635195 -5.71271295
[135,] 4.08050665 -5.65635195
[136,] -6.07983444 4.08050665
[137,] 5.26304637 -6.07983444
[138,] 2.59943466 5.26304637
[139,] 5.99736875 2.59943466
[140,] -5.87371115 5.99736875
[141,] -9.61994419 -5.87371115
[142,] -0.51440973 -9.61994419
[143,] -2.01722062 -0.51440973
[144,] 3.56709958 -2.01722062
[145,] 13.42191144 3.56709958
[146,] -0.66821042 13.42191144
[147,] 0.20927428 -0.66821042
[148,] -8.11506538 0.20927428
[149,] -9.69310980 -8.11506538
[150,] -8.14794023 -9.69310980
[151,] -8.19688053 -8.14794023
[152,] -8.11506538 -8.19688053
[153,] -8.11506538 -8.11506538
[154,] -1.04180650 -8.11506538
[155,] 2.88642464 -1.04180650
[156,] -8.11506538 2.88642464
[157,] -8.23484137 -8.11506538
[158,] -8.80450053 -8.23484137
[159,] -6.95458692 -8.80450053
[160,] -8.59754955 -6.95458692
[161,] 8.05872504 -8.59754955
[162,] -8.22876329 8.05872504
[163,] -2.80712418 -8.22876329
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.61096283 -0.25934473
2 3.68870594 1.61096283
3 0.13043673 3.68870594
4 -1.36374172 0.13043673
5 1.61422616 -1.36374172
6 -15.26159594 1.61422616
7 5.91386017 -15.26159594
8 -2.48803780 5.91386017
9 -0.08958614 -2.48803780
10 6.63783985 -0.08958614
11 14.75443266 6.63783985
12 4.04084014 14.75443266
13 10.61740805 4.04084014
14 8.08302692 10.61740805
15 3.22325406 8.08302692
16 -3.49439265 3.22325406
17 -6.04544784 -3.49439265
18 -2.57698814 -6.04544784
19 5.69885484 -2.57698814
20 1.80519443 5.69885484
21 -5.08828528 1.80519443
22 -1.76977438 -5.08828528
23 9.62214706 -1.76977438
24 5.09885441 9.62214706
25 0.71417521 5.09885441
26 -3.68448123 0.71417521
27 3.69965062 -3.68448123
28 3.55626476 3.69965062
29 5.57703599 3.55626476
30 2.30703769 5.57703599
31 12.05530636 2.30703769
32 3.25726316 12.05530636
33 4.87343039 3.25726316
34 -3.37323171 4.87343039
35 3.06454586 -3.37323171
36 -0.69811445 3.06454586
37 0.19038408 -0.69811445
38 -7.62239439 0.19038408
39 -4.24341828 -7.62239439
40 -2.14428960 -4.24341828
41 5.94281481 -2.14428960
42 -0.61074561 5.94281481
43 4.64919309 -0.61074561
44 2.42763489 4.64919309
45 -9.41643572 2.42763489
46 9.68336418 -9.41643572
47 6.47111077 9.68336418
48 2.43842502 6.47111077
49 8.94903195 2.43842502
50 -3.16829007 8.94903195
51 -6.65269116 -3.16829007
52 -4.30284874 -6.65269116
53 3.23932754 -4.30284874
54 -3.85224289 3.23932754
55 -4.32074263 -3.85224289
56 8.42082514 -4.32074263
57 -6.14018617 8.42082514
58 -2.67725215 -6.14018617
59 0.03290824 -2.67725215
60 -1.85101993 0.03290824
61 -9.59112248 -1.85101993
62 9.78074605 -9.59112248
63 1.05381719 9.78074605
64 1.14456980 1.05381719
65 -3.86939943 1.14456980
66 -4.35607207 -3.86939943
67 4.34850915 -4.35607207
68 0.66057417 4.34850915
69 -0.66675383 0.66057417
70 4.93284332 -0.66675383
71 5.32707182 4.93284332
72 3.98072627 5.32707182
73 1.48897146 3.98072627
74 4.12278092 1.48897146
75 -0.95801757 4.12278092
76 -7.21993447 -0.95801757
77 -6.65909683 -7.21993447
78 4.40086466 -6.65909683
79 5.02636032 4.40086466
80 0.55158497 5.02636032
81 -1.98300273 0.55158497
82 1.68244046 -1.98300273
83 2.66795137 1.68244046
84 -9.55741970 2.66795137
85 4.04186543 -9.55741970
86 2.11857675 4.04186543
87 -5.65665953 2.11857675
88 6.93419908 -5.65665953
89 3.10964704 6.93419908
90 4.35627652 3.10964704
91 1.09595221 4.35627652
92 2.33697900 1.09595221
93 0.80408507 2.33697900
94 -2.15690162 0.80408507
95 -2.57748492 -2.15690162
96 -6.02930327 -2.57748492
97 -5.50298982 -6.02930327
98 11.41349770 -5.50298982
99 -11.31059069 11.41349770
100 5.43290073 -11.31059069
101 -1.40521386 5.43290073
102 0.36165497 -1.40521386
103 4.92644293 0.36165497
104 -4.51444028 4.92644293
105 -1.89274655 -4.51444028
106 -0.85033552 -1.89274655
107 -2.40410246 -0.85033552
108 -6.15947246 -2.40410246
109 5.21407531 -6.15947246
110 -3.17558462 5.21407531
111 5.20411754 -3.17558462
112 -8.88321712 5.20411754
113 3.25120375 -8.88321712
114 -3.28878598 3.25120375
115 10.94243625 -3.28878598
116 -7.56489657 10.94243625
117 -9.90639592 -7.56489657
118 -8.23237222 -9.90639592
119 -3.50790417 -8.23237222
120 -1.67472889 -3.50790417
121 7.17909329 -1.67472889
122 5.74875103 7.17909329
123 2.32011712 5.74875103
124 -3.97768189 2.32011712
125 3.34726902 -3.97768189
126 7.23221394 3.34726902
127 10.63481789 7.23221394
128 1.58166151 10.63481789
129 4.91315736 1.58166151
130 -1.70487575 4.91315736
131 -0.10724600 -1.70487575
132 4.00571963 -0.10724600
133 -5.71271295 4.00571963
134 -5.65635195 -5.71271295
135 4.08050665 -5.65635195
136 -6.07983444 4.08050665
137 5.26304637 -6.07983444
138 2.59943466 5.26304637
139 5.99736875 2.59943466
140 -5.87371115 5.99736875
141 -9.61994419 -5.87371115
142 -0.51440973 -9.61994419
143 -2.01722062 -0.51440973
144 3.56709958 -2.01722062
145 13.42191144 3.56709958
146 -0.66821042 13.42191144
147 0.20927428 -0.66821042
148 -8.11506538 0.20927428
149 -9.69310980 -8.11506538
150 -8.14794023 -9.69310980
151 -8.19688053 -8.14794023
152 -8.11506538 -8.19688053
153 -8.11506538 -8.11506538
154 -1.04180650 -8.11506538
155 2.88642464 -1.04180650
156 -8.11506538 2.88642464
157 -8.23484137 -8.11506538
158 -8.80450053 -8.23484137
159 -6.95458692 -8.80450053
160 -8.59754955 -6.95458692
161 8.05872504 -8.59754955
162 -8.22876329 8.05872504
163 -2.80712418 -8.22876329
> 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/7vh7e1321904390.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/8ws671321904390.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/9t1nv1321904390.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/10tgcl1321904390.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/11af8l1321904390.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/1203ro1321904390.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/13wqwe1321904390.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/14j6se1321904390.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/15n0tj1321904390.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/16s0qm1321904390.tab")
+ }
>
> try(system("convert tmp/1a0ug1321904390.ps tmp/1a0ug1321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/22stg1321904390.ps tmp/22stg1321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/3rt3n1321904390.ps tmp/3rt3n1321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/4aku51321904390.ps tmp/4aku51321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ntz71321904390.ps tmp/5ntz71321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/6isad1321904390.ps tmp/6isad1321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/7vh7e1321904390.ps tmp/7vh7e1321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ws671321904390.ps tmp/8ws671321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/9t1nv1321904390.ps tmp/9t1nv1321904390.png",intern=TRUE))
character(0)
> try(system("convert tmp/10tgcl1321904390.ps tmp/10tgcl1321904390.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.843 0.539 5.415