R version 2.12.0 (2010-10-15)
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(4
+ ,0
+ ,5
+ ,5
+ ,0
+ ,4
+ ,6
+ ,0
+ ,5
+ ,6
+ ,0
+ ,6
+ ,6
+ ,0
+ ,6
+ ,7
+ ,0
+ ,6
+ ,8
+ ,0
+ ,7
+ ,7
+ ,0
+ ,8
+ ,8
+ ,0
+ ,7
+ ,7
+ ,0
+ ,8
+ ,8
+ ,0
+ ,7
+ ,8
+ ,0
+ ,8
+ ,9
+ ,0
+ ,8
+ ,9
+ ,0
+ ,9
+ ,8
+ ,0
+ ,9
+ ,9
+ ,0
+ ,8
+ ,9
+ ,0
+ ,9
+ ,10
+ ,0
+ ,9
+ ,11
+ ,0
+ ,10
+ ,12
+ ,0
+ ,11
+ ,13
+ ,0
+ ,12
+ ,13
+ ,0
+ ,13
+ ,13
+ ,0
+ ,13
+ ,14
+ ,0
+ ,13
+ ,14
+ ,0
+ ,14
+ ,15
+ ,0
+ ,14
+ ,15
+ ,0
+ ,15
+ ,16
+ ,0
+ ,15
+ ,16
+ ,0
+ ,16
+ ,17
+ ,0
+ ,16
+ ,18
+ ,0
+ ,17
+ ,19
+ ,0
+ ,18
+ ,20
+ ,0
+ ,19
+ ,22
+ ,0
+ ,20
+ ,20
+ ,0
+ ,22
+ ,22
+ ,0
+ ,20
+ ,25
+ ,0
+ ,22
+ ,24
+ ,0
+ ,25
+ ,25
+ ,0
+ ,24
+ ,28
+ ,0
+ ,25
+ ,26
+ ,0
+ ,28
+ ,27
+ ,0
+ ,26
+ ,26
+ ,0
+ ,27
+ ,25
+ ,0
+ ,26
+ ,27
+ ,0
+ ,25
+ ,28
+ ,0
+ ,27
+ ,30
+ ,0
+ ,28
+ ,31
+ ,0
+ ,30
+ ,32
+ ,0
+ ,31
+ ,34
+ ,0
+ ,32
+ ,34
+ ,0
+ ,34
+ ,33
+ ,0
+ ,34
+ ,32
+ ,0
+ ,33
+ ,34
+ ,0
+ ,32
+ ,36
+ ,0
+ ,34
+ ,37
+ ,0
+ ,36
+ ,40
+ ,0
+ ,37
+ ,38
+ ,0
+ ,40
+ ,38
+ ,0
+ ,38
+ ,36
+ ,0
+ ,38
+ ,40
+ ,0
+ ,36
+ ,40
+ ,0
+ ,40
+ ,42
+ ,0
+ ,40
+ ,44
+ ,0
+ ,42
+ ,45
+ ,0
+ ,44
+ ,47
+ ,0
+ ,45
+ ,49
+ ,0
+ ,47
+ ,47
+ ,0
+ ,49
+ ,49
+ ,0
+ ,47
+ ,52
+ ,0
+ ,49
+ ,50
+ ,0
+ ,52
+ ,50
+ ,0
+ ,50
+ ,57
+ ,0
+ ,50
+ ,58
+ ,0
+ ,57
+ ,58
+ ,0
+ ,58
+ ,58
+ ,0
+ ,58
+ ,61
+ ,0
+ ,58
+ ,61
+ ,0
+ ,61
+ ,64
+ ,0
+ ,61
+ ,68
+ ,0
+ ,64
+ ,40
+ ,0
+ ,68
+ ,34
+ ,0
+ ,40
+ ,46
+ ,0
+ ,34
+ ,36
+ ,0
+ ,46
+ ,34
+ ,0
+ ,36
+ ,45
+ ,0
+ ,34
+ ,55
+ ,0
+ ,45
+ ,50
+ ,0
+ ,55
+ ,56
+ ,0
+ ,50
+ ,72
+ ,0
+ ,56
+ ,76
+ ,0
+ ,72
+ ,78
+ ,0
+ ,76
+ ,77
+ ,0
+ ,78
+ ,90
+ ,0
+ ,77
+ ,88
+ ,0
+ ,90
+ ,97
+ ,0
+ ,88
+ ,93
+ ,0
+ ,97
+ ,84
+ ,0
+ ,93
+ ,67
+ ,0
+ ,84
+ ,72
+ ,0
+ ,67
+ ,75
+ ,0
+ ,72
+ ,71
+ ,0
+ ,75
+ ,75
+ ,0
+ ,71
+ ,90
+ ,0
+ ,75
+ ,78
+ ,0
+ ,90
+ ,73
+ ,0
+ ,78
+ ,62
+ ,0
+ ,73
+ ,65
+ ,0
+ ,62
+ ,61
+ ,0
+ ,65
+ ,58
+ ,0
+ ,61
+ ,33
+ ,0
+ ,58
+ ,39
+ ,0
+ ,33
+ ,56
+ ,0
+ ,39
+ ,79
+ ,0
+ ,56
+ ,82
+ ,0
+ ,79
+ ,79
+ ,0
+ ,82
+ ,73
+ ,0
+ ,79
+ ,87
+ ,0
+ ,73
+ ,85
+ ,0
+ ,87
+ ,83
+ ,0
+ ,85
+ ,82
+ ,0
+ ,83
+ ,83
+ ,0
+ ,82
+ ,92
+ ,0
+ ,83
+ ,95
+ ,0
+ ,92
+ ,97
+ ,0
+ ,95
+ ,87
+ ,0
+ ,97
+ ,84
+ ,0
+ ,87
+ ,84
+ ,0
+ ,84
+ ,89
+ ,0
+ ,84
+ ,103
+ ,0
+ ,89
+ ,106
+ ,0
+ ,103
+ ,109
+ ,0
+ ,106
+ ,106
+ ,0
+ ,109
+ ,105
+ ,0
+ ,106
+ ,115
+ ,0
+ ,105
+ ,120
+ ,0
+ ,115
+ ,124
+ ,0
+ ,120
+ ,121
+ ,0
+ ,124
+ ,131
+ ,0
+ ,121
+ ,139
+ ,0
+ ,131
+ ,133
+ ,0
+ ,139
+ ,119
+ ,0
+ ,133
+ ,123
+ ,0
+ ,119
+ ,120
+ ,0
+ ,123
+ ,128
+ ,0
+ ,120
+ ,134
+ ,0
+ ,128
+ ,126
+ ,0
+ ,134
+ ,115
+ ,0
+ ,126
+ ,106
+ ,0
+ ,115
+ ,99
+ ,0
+ ,106
+ ,100
+ ,0
+ ,99
+ ,99
+ ,0
+ ,100
+ ,99
+ ,0
+ ,99
+ ,100
+ ,0
+ ,99
+ ,100
+ ,0
+ ,100
+ ,108
+ ,0
+ ,100
+ ,109
+ ,0
+ ,108
+ ,115
+ ,0
+ ,109
+ ,114
+ ,0
+ ,115
+ ,108
+ ,0
+ ,114
+ ,113
+ ,0
+ ,108
+ ,118
+ ,0
+ ,113
+ ,122
+ ,0
+ ,118
+ ,118
+ ,0
+ ,122
+ ,121
+ ,0
+ ,118
+ ,118
+ ,0
+ ,121
+ ,121
+ ,0
+ ,118
+ ,121
+ ,0
+ ,121
+ ,112
+ ,0
+ ,121
+ ,119
+ ,0
+ ,112
+ ,116
+ ,0
+ ,119
+ ,110
+ ,1
+ ,116
+ ,111
+ ,1
+ ,110
+ ,106
+ ,1
+ ,111
+ ,108
+ ,1
+ ,106)
+ ,dim=c(3
+ ,175)
+ ,dimnames=list(c('CO2-uitstoot'
+ ,'Kyoto-protocol'
+ ,'Y-1')
+ ,1:175))
> y <- array(NA,dim=c(3,175),dimnames=list(c('CO2-uitstoot','Kyoto-protocol','Y-1'),1:175))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = '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
CO2-uitstoot Kyoto-protocol Y-1 t
1 4 0 5 1
2 5 0 4 2
3 6 0 5 3
4 6 0 6 4
5 6 0 6 5
6 7 0 6 6
7 8 0 7 7
8 7 0 8 8
9 8 0 7 9
10 7 0 8 10
11 8 0 7 11
12 8 0 8 12
13 9 0 8 13
14 9 0 9 14
15 8 0 9 15
16 9 0 8 16
17 9 0 9 17
18 10 0 9 18
19 11 0 10 19
20 12 0 11 20
21 13 0 12 21
22 13 0 13 22
23 13 0 13 23
24 14 0 13 24
25 14 0 14 25
26 15 0 14 26
27 15 0 15 27
28 16 0 15 28
29 16 0 16 29
30 17 0 16 30
31 18 0 17 31
32 19 0 18 32
33 20 0 19 33
34 22 0 20 34
35 20 0 22 35
36 22 0 20 36
37 25 0 22 37
38 24 0 25 38
39 25 0 24 39
40 28 0 25 40
41 26 0 28 41
42 27 0 26 42
43 26 0 27 43
44 25 0 26 44
45 27 0 25 45
46 28 0 27 46
47 30 0 28 47
48 31 0 30 48
49 32 0 31 49
50 34 0 32 50
51 34 0 34 51
52 33 0 34 52
53 32 0 33 53
54 34 0 32 54
55 36 0 34 55
56 37 0 36 56
57 40 0 37 57
58 38 0 40 58
59 38 0 38 59
60 36 0 38 60
61 40 0 36 61
62 40 0 40 62
63 42 0 40 63
64 44 0 42 64
65 45 0 44 65
66 47 0 45 66
67 49 0 47 67
68 47 0 49 68
69 49 0 47 69
70 52 0 49 70
71 50 0 52 71
72 50 0 50 72
73 57 0 50 73
74 58 0 57 74
75 58 0 58 75
76 58 0 58 76
77 61 0 58 77
78 61 0 61 78
79 64 0 61 79
80 68 0 64 80
81 40 0 68 81
82 34 0 40 82
83 46 0 34 83
84 36 0 46 84
85 34 0 36 85
86 45 0 34 86
87 55 0 45 87
88 50 0 55 88
89 56 0 50 89
90 72 0 56 90
91 76 0 72 91
92 78 0 76 92
93 77 0 78 93
94 90 0 77 94
95 88 0 90 95
96 97 0 88 96
97 93 0 97 97
98 84 0 93 98
99 67 0 84 99
100 72 0 67 100
101 75 0 72 101
102 71 0 75 102
103 75 0 71 103
104 90 0 75 104
105 78 0 90 105
106 73 0 78 106
107 62 0 73 107
108 65 0 62 108
109 61 0 65 109
110 58 0 61 110
111 33 0 58 111
112 39 0 33 112
113 56 0 39 113
114 79 0 56 114
115 82 0 79 115
116 79 0 82 116
117 73 0 79 117
118 87 0 73 118
119 85 0 87 119
120 83 0 85 120
121 82 0 83 121
122 83 0 82 122
123 92 0 83 123
124 95 0 92 124
125 97 0 95 125
126 87 0 97 126
127 84 0 87 127
128 84 0 84 128
129 89 0 84 129
130 103 0 89 130
131 106 0 103 131
132 109 0 106 132
133 106 0 109 133
134 105 0 106 134
135 115 0 105 135
136 120 0 115 136
137 124 0 120 137
138 121 0 124 138
139 131 0 121 139
140 139 0 131 140
141 133 0 139 141
142 119 0 133 142
143 123 0 119 143
144 120 0 123 144
145 128 0 120 145
146 134 0 128 146
147 126 0 134 147
148 115 0 126 148
149 106 0 115 149
150 99 0 106 150
151 100 0 99 151
152 99 0 100 152
153 99 0 99 153
154 100 0 99 154
155 100 0 100 155
156 108 0 100 156
157 109 0 108 157
158 115 0 109 158
159 114 0 115 159
160 108 0 114 160
161 113 0 108 161
162 118 0 113 162
163 122 0 118 163
164 118 0 122 164
165 121 0 118 165
166 118 0 121 166
167 121 0 118 167
168 121 0 121 168
169 112 0 121 169
170 119 0 112 170
171 116 0 119 171
172 110 1 116 172
173 111 1 110 173
174 106 1 111 174
175 108 1 106 175
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `Kyoto-protocol` `Y-1` t
0.04243 -5.07185 0.85168 0.11214
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-28.8872 -2.0142 0.0751 2.2454 18.4798
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.04243 0.93853 0.045 0.963994
`Kyoto-protocol` -5.07185 3.21478 -1.578 0.116490
`Y-1` 0.85168 0.04001 21.288 < 2e-16 ***
t 0.11214 0.03172 3.535 0.000524 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.008 on 171 degrees of freedom
Multiple R-squared: 0.9772, Adjusted R-squared: 0.9768
F-statistic: 2440 on 3 and 171 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,] 8.218301e-04 1.643660e-03 0.999178170
[2,] 1.588124e-04 3.176248e-04 0.999841188
[3,] 1.893818e-05 3.787636e-05 0.999981062
[4,] 1.250298e-05 2.500597e-05 0.999987497
[5,] 1.843116e-06 3.686232e-06 0.999998157
[6,] 2.613055e-07 5.226110e-07 0.999999739
[7,] 2.742778e-08 5.485555e-08 0.999999973
[8,] 2.690472e-09 5.380944e-09 0.999999997
[9,] 1.608058e-09 3.216117e-09 0.999999998
[10,] 1.948993e-10 3.897987e-10 1.000000000
[11,] 2.624462e-11 5.248925e-11 1.000000000
[12,] 2.848609e-12 5.697218e-12 1.000000000
[13,] 6.365551e-13 1.273110e-12 1.000000000
[14,] 3.020057e-13 6.040113e-13 1.000000000
[15,] 1.401879e-13 2.803758e-13 1.000000000
[16,] 1.686892e-14 3.373784e-14 1.000000000
[17,] 1.844477e-15 3.688954e-15 1.000000000
[18,] 3.441432e-16 6.882865e-16 1.000000000
[19,] 3.664806e-17 7.329611e-17 1.000000000
[20,] 6.479972e-18 1.295994e-17 1.000000000
[21,] 6.756112e-19 1.351222e-18 1.000000000
[22,] 1.141091e-19 2.282181e-19 1.000000000
[23,] 1.168731e-20 2.337462e-20 1.000000000
[24,] 1.897662e-21 3.795324e-21 1.000000000
[25,] 3.576414e-22 7.152827e-22 1.000000000
[26,] 6.973218e-23 1.394644e-22 1.000000000
[27,] 1.260840e-23 2.521679e-23 1.000000000
[28,] 1.309326e-23 2.618652e-23 1.000000000
[29,] 4.722606e-23 9.445211e-23 1.000000000
[30,] 3.004224e-23 6.008448e-23 1.000000000
[31,] 2.318575e-22 4.637150e-22 1.000000000
[32,] 5.932075e-23 1.186415e-22 1.000000000
[33,] 1.047755e-23 2.095510e-23 1.000000000
[34,] 3.492950e-23 6.985900e-23 1.000000000
[35,] 3.749629e-23 7.499258e-23 1.000000000
[36,] 6.581430e-24 1.316286e-23 1.000000000
[37,] 1.988407e-24 3.976813e-24 1.000000000
[38,] 8.031289e-25 1.606258e-24 1.000000000
[39,] 2.050701e-25 4.101402e-25 1.000000000
[40,] 3.296636e-26 6.593272e-26 1.000000000
[41,] 1.223644e-26 2.447288e-26 1.000000000
[42,] 2.235755e-27 4.471510e-27 1.000000000
[43,] 4.066161e-28 8.132323e-28 1.000000000
[44,] 1.900424e-28 3.800849e-28 1.000000000
[45,] 2.830371e-29 5.660742e-29 1.000000000
[46,] 7.972160e-30 1.594432e-29 1.000000000
[47,] 2.881991e-30 5.763981e-30 1.000000000
[48,] 7.747813e-31 1.549563e-30 1.000000000
[49,] 2.666358e-31 5.332717e-31 1.000000000
[50,] 4.621281e-32 9.242562e-32 1.000000000
[51,] 9.609146e-32 1.921829e-31 1.000000000
[52,] 6.609399e-32 1.321880e-31 1.000000000
[53,] 1.066383e-32 2.132766e-32 1.000000000
[54,] 1.489680e-32 2.979360e-32 1.000000000
[55,] 4.179645e-32 8.359290e-32 1.000000000
[56,] 6.938448e-33 1.387690e-32 1.000000000
[57,] 2.304150e-33 4.608299e-33 1.000000000
[58,] 9.562561e-34 1.912512e-33 1.000000000
[59,] 1.978486e-34 3.956973e-34 1.000000000
[60,] 9.007237e-35 1.801447e-34 1.000000000
[61,] 4.058984e-35 8.117969e-35 1.000000000
[62,] 2.129864e-35 4.259728e-35 1.000000000
[63,] 7.649524e-36 1.529905e-35 1.000000000
[64,] 9.870623e-36 1.974125e-35 1.000000000
[65,] 5.150014e-36 1.030003e-35 1.000000000
[66,] 8.755285e-37 1.751057e-36 1.000000000
[67,] 3.264785e-33 6.529570e-33 1.000000000
[68,] 7.372379e-34 1.474476e-33 1.000000000
[69,] 1.373573e-34 2.747146e-34 1.000000000
[70,] 2.542269e-35 5.084538e-35 1.000000000
[71,] 1.986773e-35 3.973545e-35 1.000000000
[72,] 3.727853e-36 7.455705e-36 1.000000000
[73,] 2.607332e-36 5.214665e-36 1.000000000
[74,] 4.798355e-36 9.596710e-36 1.000000000
[75,] 1.236454e-12 2.472909e-12 1.000000000
[76,] 3.028487e-11 6.056975e-11 1.000000000
[77,] 4.364501e-11 8.729002e-11 1.000000000
[78,] 2.500947e-09 5.001895e-09 0.999999997
[79,] 3.495492e-09 6.990985e-09 0.999999997
[80,] 4.489085e-09 8.978170e-09 0.999999996
[81,] 6.590539e-09 1.318108e-08 0.999999993
[82,] 8.764205e-09 1.752841e-08 0.999999991
[83,] 5.923327e-09 1.184665e-08 0.999999994
[84,] 2.494531e-07 4.989061e-07 0.999999751
[85,] 2.572147e-07 5.144293e-07 0.999999743
[86,] 1.932343e-07 3.864685e-07 0.999999807
[87,] 1.093314e-07 2.186627e-07 0.999999891
[88,] 2.102929e-06 4.205859e-06 0.999997897
[89,] 1.234820e-06 2.469639e-06 0.999998765
[90,] 4.746843e-06 9.493685e-06 0.999995253
[91,] 3.020680e-06 6.041360e-06 0.999996979
[92,] 3.590368e-06 7.180737e-06 0.999996410
[93,] 6.929416e-05 1.385883e-04 0.999930706
[94,] 5.186681e-05 1.037336e-04 0.999948133
[95,] 3.500611e-05 7.001222e-05 0.999964994
[96,] 2.829737e-05 5.659475e-05 0.999971703
[97,] 1.963062e-05 3.926123e-05 0.999980369
[98,] 1.731203e-04 3.462407e-04 0.999826880
[99,] 3.683066e-04 7.366131e-04 0.999631693
[100,] 3.370062e-04 6.740125e-04 0.999662994
[101,] 1.139181e-03 2.278362e-03 0.998860819
[102,] 7.831386e-04 1.566277e-03 0.999216861
[103,] 8.746121e-04 1.749224e-03 0.999125388
[104,] 9.423942e-04 1.884788e-03 0.999057606
[105,] 2.842994e-01 5.685987e-01 0.715700646
[106,] 2.766253e-01 5.532505e-01 0.723374729
[107,] 3.147473e-01 6.294946e-01 0.685252716
[108,] 6.301940e-01 7.396119e-01 0.369805973
[109,] 5.879801e-01 8.240397e-01 0.412019864
[110,] 5.732964e-01 8.534071e-01 0.426703556
[111,] 6.271603e-01 7.456794e-01 0.372839708
[112,] 7.123361e-01 5.753279e-01 0.287663946
[113,] 6.880873e-01 6.238254e-01 0.311912720
[114,] 6.693959e-01 6.612082e-01 0.330604077
[115,] 6.476312e-01 7.047376e-01 0.352368780
[116,] 6.136345e-01 7.727310e-01 0.386365489
[117,] 6.112342e-01 7.775315e-01 0.388765763
[118,] 5.682471e-01 8.635059e-01 0.431752948
[119,] 5.227375e-01 9.545250e-01 0.477262496
[120,] 6.645496e-01 6.709008e-01 0.335450405
[121,] 6.957032e-01 6.085936e-01 0.304296816
[122,] 7.063140e-01 5.873719e-01 0.293685962
[123,] 6.775492e-01 6.449016e-01 0.322450812
[124,] 7.320320e-01 5.359361e-01 0.267968043
[125,] 6.934925e-01 6.130150e-01 0.306507522
[126,] 6.526822e-01 6.946356e-01 0.347317788
[127,] 6.388032e-01 7.223936e-01 0.361196777
[128,] 6.156909e-01 7.686182e-01 0.384309121
[129,] 6.416896e-01 7.166207e-01 0.358310374
[130,] 6.220419e-01 7.559162e-01 0.377958107
[131,] 6.032706e-01 7.934588e-01 0.396729395
[132,] 5.527527e-01 8.944945e-01 0.447247274
[133,] 6.919014e-01 6.161972e-01 0.308098613
[134,] 8.438685e-01 3.122631e-01 0.156131541
[135,] 8.105300e-01 3.789401e-01 0.189470028
[136,] 8.635498e-01 2.729005e-01 0.136450227
[137,] 8.678168e-01 2.643665e-01 0.132183233
[138,] 8.324719e-01 3.350561e-01 0.167528059
[139,] 9.288504e-01 1.422992e-01 0.071149577
[140,] 9.945254e-01 1.094921e-02 0.005474605
[141,] 9.966853e-01 6.629380e-03 0.003314690
[142,] 9.960066e-01 7.986764e-03 0.003993382
[143,] 9.939591e-01 1.208174e-02 0.006040872
[144,] 9.937320e-01 1.253607e-02 0.006268035
[145,] 9.897084e-01 2.058321e-02 0.010291603
[146,] 9.866107e-01 2.677857e-02 0.013389286
[147,] 9.842797e-01 3.144068e-02 0.015720340
[148,] 9.831451e-01 3.370980e-02 0.016854900
[149,] 9.916727e-01 1.665450e-02 0.008327252
[150,] 9.862056e-01 2.758877e-02 0.013794386
[151,] 9.828924e-01 3.421514e-02 0.017107572
[152,] 9.716589e-01 5.668215e-02 0.028341073
[153,] 9.536051e-01 9.278985e-02 0.046394926
[154,] 9.899273e-01 2.014534e-02 0.010072668
[155,] 9.957508e-01 8.498430e-03 0.004249215
[156,] 9.971263e-01 5.747315e-03 0.002873657
[157,] 9.926753e-01 1.464942e-02 0.007324708
[158,] 9.886206e-01 2.275887e-02 0.011379435
[159,] 9.739923e-01 5.201549e-02 0.026007745
[160,] 9.607771e-01 7.844578e-02 0.039222891
[161,] 9.089368e-01 1.821264e-01 0.091063199
[162,] 8.656777e-01 2.686446e-01 0.134322290
> postscript(file="/var/www/rcomp/tmp/1mvmt1292440203.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/2emlw1292440203.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/3emlw1292440203.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/4emlw1292440203.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/57vkh1292440203.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 = 175
Frequency = 1
1 2 3 4 5
-0.412951590 1.326585060 1.362768834 0.398952607 0.286812819
6 7 8 9 10
1.174673031 1.210856804 -0.752959422 0.986577228 -0.977238999
11 12 13 14 15
0.762297651 -0.201518575 0.686341636 -0.277474590 -1.389614378
16 17 18 19 20
0.349922272 -0.613893955 0.273966257 0.310150030 0.346333804
21 22 23 24 25
0.382517577 -0.581298649 -0.693438438 0.194421774 -0.769394452
26 27 28 29 30
0.118465759 -0.845350467 0.042509745 -0.921306482 -0.033446270
31 32 33 34 35
0.002737503 0.038921277 0.075105050 1.111288824 -2.704203841
36 37 38 39 40
0.887009247 2.071516582 -1.595652521 0.143884129 2.180067903
41 42 43 44 45
-2.487101201 0.104111888 -1.859704339 -2.120167689 0.619368961
46 47 48 49 50
-0.196123704 0.840060070 0.024567405 0.060751178 1.096934952
51 52 53 54 55
-0.718557713 -1.830697501 -2.091160851 0.648375799 0.832883134
56 57 58 59 60
0.017390469 2.053574243 -2.613594861 -1.022381772 -3.134521560
61 62 63 64 65
2.456691528 -1.062154014 0.825706198 1.010213533 0.194720868
66 67 68 69 70
1.230904642 1.415411977 -2.400080688 1.191132401 2.375639736
71 72 73 74 75
-2.291529368 -0.700316279 6.187543933 1.113669076 0.149852850
76 77 78 79 80
0.037713061 2.925573273 0.258404170 3.146264382 4.479095278
81 82 83 84 85
-27.039750263 -9.304949778 7.692969063 -12.639287985 -6.234663390
86 87 88 89 90
6.356549698 6.875969089 -6.752935083 3.393307321 14.171108903
91 92 93 94 95
4.432146101 2.913300560 0.097807895 13.837344545 0.653411059
96 97 98 99 100
11.244624147 -0.532603586 -6.238037621 -15.685089464 3.681270199
101 102 103 104 105
2.310748219 -4.356420884 2.938145081 14.419299539 -10.467986824
106 107 108 109 110
-5.360009352 -12.213766949 0.042534084 -6.624635019 -6.330069054
111 112 113 114 115
-28.887179527 -1.707408358 10.070393224 18.479753985 1.779056115
116 117 118 119 120
-3.888112988 -7.445223461 11.552695380 -2.482914544 -2.891701456
121 122 123 124 125
-2.300488367 -0.560951717 7.475232056 2.698004323 2.030835220
126 127 128 129 130
-9.784657445 -4.380032850 -1.937143324 2.950716888 12.580194908
131 132 133 134 135
3.544584984 3.877415881 -1.789753223 -0.346863696 10.392672954
136 137 138 139 140
6.763768783 6.393246803 -0.125598739 12.317290788 11.688386617
141 142 143 144 145
-1.237164678 -10.239245836 5.572084512 -0.946761030 9.496128497
146 147 148 149 150
8.570577202 -4.651621216 -8.950349498 -8.694048464 -8.141100308
151 152 153 154 155
-1.291505028 -3.255321254 -2.515784604 -1.627924393 -2.591740619
156 157 158 159 160
5.296119593 -0.629431702 4.406752071 -1.815446347 -7.075909697
161 162 163 164 165
2.922009145 3.551487165 3.180965185 -4.337880356 1.956685609
166 167 168 169 170
-3.710483494 1.732406032 -0.934763071 -10.046902859 4.506045297
171 172 173 174 175
-4.567829559 -3.053091619 2.944827223 -3.018989004 3.127253400
> postscript(file="/var/www/rcomp/tmp/67vkh1292440203.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 = 175
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.412951590 NA
1 1.326585060 -0.412951590
2 1.362768834 1.326585060
3 0.398952607 1.362768834
4 0.286812819 0.398952607
5 1.174673031 0.286812819
6 1.210856804 1.174673031
7 -0.752959422 1.210856804
8 0.986577228 -0.752959422
9 -0.977238999 0.986577228
10 0.762297651 -0.977238999
11 -0.201518575 0.762297651
12 0.686341636 -0.201518575
13 -0.277474590 0.686341636
14 -1.389614378 -0.277474590
15 0.349922272 -1.389614378
16 -0.613893955 0.349922272
17 0.273966257 -0.613893955
18 0.310150030 0.273966257
19 0.346333804 0.310150030
20 0.382517577 0.346333804
21 -0.581298649 0.382517577
22 -0.693438438 -0.581298649
23 0.194421774 -0.693438438
24 -0.769394452 0.194421774
25 0.118465759 -0.769394452
26 -0.845350467 0.118465759
27 0.042509745 -0.845350467
28 -0.921306482 0.042509745
29 -0.033446270 -0.921306482
30 0.002737503 -0.033446270
31 0.038921277 0.002737503
32 0.075105050 0.038921277
33 1.111288824 0.075105050
34 -2.704203841 1.111288824
35 0.887009247 -2.704203841
36 2.071516582 0.887009247
37 -1.595652521 2.071516582
38 0.143884129 -1.595652521
39 2.180067903 0.143884129
40 -2.487101201 2.180067903
41 0.104111888 -2.487101201
42 -1.859704339 0.104111888
43 -2.120167689 -1.859704339
44 0.619368961 -2.120167689
45 -0.196123704 0.619368961
46 0.840060070 -0.196123704
47 0.024567405 0.840060070
48 0.060751178 0.024567405
49 1.096934952 0.060751178
50 -0.718557713 1.096934952
51 -1.830697501 -0.718557713
52 -2.091160851 -1.830697501
53 0.648375799 -2.091160851
54 0.832883134 0.648375799
55 0.017390469 0.832883134
56 2.053574243 0.017390469
57 -2.613594861 2.053574243
58 -1.022381772 -2.613594861
59 -3.134521560 -1.022381772
60 2.456691528 -3.134521560
61 -1.062154014 2.456691528
62 0.825706198 -1.062154014
63 1.010213533 0.825706198
64 0.194720868 1.010213533
65 1.230904642 0.194720868
66 1.415411977 1.230904642
67 -2.400080688 1.415411977
68 1.191132401 -2.400080688
69 2.375639736 1.191132401
70 -2.291529368 2.375639736
71 -0.700316279 -2.291529368
72 6.187543933 -0.700316279
73 1.113669076 6.187543933
74 0.149852850 1.113669076
75 0.037713061 0.149852850
76 2.925573273 0.037713061
77 0.258404170 2.925573273
78 3.146264382 0.258404170
79 4.479095278 3.146264382
80 -27.039750263 4.479095278
81 -9.304949778 -27.039750263
82 7.692969063 -9.304949778
83 -12.639287985 7.692969063
84 -6.234663390 -12.639287985
85 6.356549698 -6.234663390
86 6.875969089 6.356549698
87 -6.752935083 6.875969089
88 3.393307321 -6.752935083
89 14.171108903 3.393307321
90 4.432146101 14.171108903
91 2.913300560 4.432146101
92 0.097807895 2.913300560
93 13.837344545 0.097807895
94 0.653411059 13.837344545
95 11.244624147 0.653411059
96 -0.532603586 11.244624147
97 -6.238037621 -0.532603586
98 -15.685089464 -6.238037621
99 3.681270199 -15.685089464
100 2.310748219 3.681270199
101 -4.356420884 2.310748219
102 2.938145081 -4.356420884
103 14.419299539 2.938145081
104 -10.467986824 14.419299539
105 -5.360009352 -10.467986824
106 -12.213766949 -5.360009352
107 0.042534084 -12.213766949
108 -6.624635019 0.042534084
109 -6.330069054 -6.624635019
110 -28.887179527 -6.330069054
111 -1.707408358 -28.887179527
112 10.070393224 -1.707408358
113 18.479753985 10.070393224
114 1.779056115 18.479753985
115 -3.888112988 1.779056115
116 -7.445223461 -3.888112988
117 11.552695380 -7.445223461
118 -2.482914544 11.552695380
119 -2.891701456 -2.482914544
120 -2.300488367 -2.891701456
121 -0.560951717 -2.300488367
122 7.475232056 -0.560951717
123 2.698004323 7.475232056
124 2.030835220 2.698004323
125 -9.784657445 2.030835220
126 -4.380032850 -9.784657445
127 -1.937143324 -4.380032850
128 2.950716888 -1.937143324
129 12.580194908 2.950716888
130 3.544584984 12.580194908
131 3.877415881 3.544584984
132 -1.789753223 3.877415881
133 -0.346863696 -1.789753223
134 10.392672954 -0.346863696
135 6.763768783 10.392672954
136 6.393246803 6.763768783
137 -0.125598739 6.393246803
138 12.317290788 -0.125598739
139 11.688386617 12.317290788
140 -1.237164678 11.688386617
141 -10.239245836 -1.237164678
142 5.572084512 -10.239245836
143 -0.946761030 5.572084512
144 9.496128497 -0.946761030
145 8.570577202 9.496128497
146 -4.651621216 8.570577202
147 -8.950349498 -4.651621216
148 -8.694048464 -8.950349498
149 -8.141100308 -8.694048464
150 -1.291505028 -8.141100308
151 -3.255321254 -1.291505028
152 -2.515784604 -3.255321254
153 -1.627924393 -2.515784604
154 -2.591740619 -1.627924393
155 5.296119593 -2.591740619
156 -0.629431702 5.296119593
157 4.406752071 -0.629431702
158 -1.815446347 4.406752071
159 -7.075909697 -1.815446347
160 2.922009145 -7.075909697
161 3.551487165 2.922009145
162 3.180965185 3.551487165
163 -4.337880356 3.180965185
164 1.956685609 -4.337880356
165 -3.710483494 1.956685609
166 1.732406032 -3.710483494
167 -0.934763071 1.732406032
168 -10.046902859 -0.934763071
169 4.506045297 -10.046902859
170 -4.567829559 4.506045297
171 -3.053091619 -4.567829559
172 2.944827223 -3.053091619
173 -3.018989004 2.944827223
174 3.127253400 -3.018989004
175 NA 3.127253400
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.326585060 -0.412951590
[2,] 1.362768834 1.326585060
[3,] 0.398952607 1.362768834
[4,] 0.286812819 0.398952607
[5,] 1.174673031 0.286812819
[6,] 1.210856804 1.174673031
[7,] -0.752959422 1.210856804
[8,] 0.986577228 -0.752959422
[9,] -0.977238999 0.986577228
[10,] 0.762297651 -0.977238999
[11,] -0.201518575 0.762297651
[12,] 0.686341636 -0.201518575
[13,] -0.277474590 0.686341636
[14,] -1.389614378 -0.277474590
[15,] 0.349922272 -1.389614378
[16,] -0.613893955 0.349922272
[17,] 0.273966257 -0.613893955
[18,] 0.310150030 0.273966257
[19,] 0.346333804 0.310150030
[20,] 0.382517577 0.346333804
[21,] -0.581298649 0.382517577
[22,] -0.693438438 -0.581298649
[23,] 0.194421774 -0.693438438
[24,] -0.769394452 0.194421774
[25,] 0.118465759 -0.769394452
[26,] -0.845350467 0.118465759
[27,] 0.042509745 -0.845350467
[28,] -0.921306482 0.042509745
[29,] -0.033446270 -0.921306482
[30,] 0.002737503 -0.033446270
[31,] 0.038921277 0.002737503
[32,] 0.075105050 0.038921277
[33,] 1.111288824 0.075105050
[34,] -2.704203841 1.111288824
[35,] 0.887009247 -2.704203841
[36,] 2.071516582 0.887009247
[37,] -1.595652521 2.071516582
[38,] 0.143884129 -1.595652521
[39,] 2.180067903 0.143884129
[40,] -2.487101201 2.180067903
[41,] 0.104111888 -2.487101201
[42,] -1.859704339 0.104111888
[43,] -2.120167689 -1.859704339
[44,] 0.619368961 -2.120167689
[45,] -0.196123704 0.619368961
[46,] 0.840060070 -0.196123704
[47,] 0.024567405 0.840060070
[48,] 0.060751178 0.024567405
[49,] 1.096934952 0.060751178
[50,] -0.718557713 1.096934952
[51,] -1.830697501 -0.718557713
[52,] -2.091160851 -1.830697501
[53,] 0.648375799 -2.091160851
[54,] 0.832883134 0.648375799
[55,] 0.017390469 0.832883134
[56,] 2.053574243 0.017390469
[57,] -2.613594861 2.053574243
[58,] -1.022381772 -2.613594861
[59,] -3.134521560 -1.022381772
[60,] 2.456691528 -3.134521560
[61,] -1.062154014 2.456691528
[62,] 0.825706198 -1.062154014
[63,] 1.010213533 0.825706198
[64,] 0.194720868 1.010213533
[65,] 1.230904642 0.194720868
[66,] 1.415411977 1.230904642
[67,] -2.400080688 1.415411977
[68,] 1.191132401 -2.400080688
[69,] 2.375639736 1.191132401
[70,] -2.291529368 2.375639736
[71,] -0.700316279 -2.291529368
[72,] 6.187543933 -0.700316279
[73,] 1.113669076 6.187543933
[74,] 0.149852850 1.113669076
[75,] 0.037713061 0.149852850
[76,] 2.925573273 0.037713061
[77,] 0.258404170 2.925573273
[78,] 3.146264382 0.258404170
[79,] 4.479095278 3.146264382
[80,] -27.039750263 4.479095278
[81,] -9.304949778 -27.039750263
[82,] 7.692969063 -9.304949778
[83,] -12.639287985 7.692969063
[84,] -6.234663390 -12.639287985
[85,] 6.356549698 -6.234663390
[86,] 6.875969089 6.356549698
[87,] -6.752935083 6.875969089
[88,] 3.393307321 -6.752935083
[89,] 14.171108903 3.393307321
[90,] 4.432146101 14.171108903
[91,] 2.913300560 4.432146101
[92,] 0.097807895 2.913300560
[93,] 13.837344545 0.097807895
[94,] 0.653411059 13.837344545
[95,] 11.244624147 0.653411059
[96,] -0.532603586 11.244624147
[97,] -6.238037621 -0.532603586
[98,] -15.685089464 -6.238037621
[99,] 3.681270199 -15.685089464
[100,] 2.310748219 3.681270199
[101,] -4.356420884 2.310748219
[102,] 2.938145081 -4.356420884
[103,] 14.419299539 2.938145081
[104,] -10.467986824 14.419299539
[105,] -5.360009352 -10.467986824
[106,] -12.213766949 -5.360009352
[107,] 0.042534084 -12.213766949
[108,] -6.624635019 0.042534084
[109,] -6.330069054 -6.624635019
[110,] -28.887179527 -6.330069054
[111,] -1.707408358 -28.887179527
[112,] 10.070393224 -1.707408358
[113,] 18.479753985 10.070393224
[114,] 1.779056115 18.479753985
[115,] -3.888112988 1.779056115
[116,] -7.445223461 -3.888112988
[117,] 11.552695380 -7.445223461
[118,] -2.482914544 11.552695380
[119,] -2.891701456 -2.482914544
[120,] -2.300488367 -2.891701456
[121,] -0.560951717 -2.300488367
[122,] 7.475232056 -0.560951717
[123,] 2.698004323 7.475232056
[124,] 2.030835220 2.698004323
[125,] -9.784657445 2.030835220
[126,] -4.380032850 -9.784657445
[127,] -1.937143324 -4.380032850
[128,] 2.950716888 -1.937143324
[129,] 12.580194908 2.950716888
[130,] 3.544584984 12.580194908
[131,] 3.877415881 3.544584984
[132,] -1.789753223 3.877415881
[133,] -0.346863696 -1.789753223
[134,] 10.392672954 -0.346863696
[135,] 6.763768783 10.392672954
[136,] 6.393246803 6.763768783
[137,] -0.125598739 6.393246803
[138,] 12.317290788 -0.125598739
[139,] 11.688386617 12.317290788
[140,] -1.237164678 11.688386617
[141,] -10.239245836 -1.237164678
[142,] 5.572084512 -10.239245836
[143,] -0.946761030 5.572084512
[144,] 9.496128497 -0.946761030
[145,] 8.570577202 9.496128497
[146,] -4.651621216 8.570577202
[147,] -8.950349498 -4.651621216
[148,] -8.694048464 -8.950349498
[149,] -8.141100308 -8.694048464
[150,] -1.291505028 -8.141100308
[151,] -3.255321254 -1.291505028
[152,] -2.515784604 -3.255321254
[153,] -1.627924393 -2.515784604
[154,] -2.591740619 -1.627924393
[155,] 5.296119593 -2.591740619
[156,] -0.629431702 5.296119593
[157,] 4.406752071 -0.629431702
[158,] -1.815446347 4.406752071
[159,] -7.075909697 -1.815446347
[160,] 2.922009145 -7.075909697
[161,] 3.551487165 2.922009145
[162,] 3.180965185 3.551487165
[163,] -4.337880356 3.180965185
[164,] 1.956685609 -4.337880356
[165,] -3.710483494 1.956685609
[166,] 1.732406032 -3.710483494
[167,] -0.934763071 1.732406032
[168,] -10.046902859 -0.934763071
[169,] 4.506045297 -10.046902859
[170,] -4.567829559 4.506045297
[171,] -3.053091619 -4.567829559
[172,] 2.944827223 -3.053091619
[173,] -3.018989004 2.944827223
[174,] 3.127253400 -3.018989004
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.326585060 -0.412951590
2 1.362768834 1.326585060
3 0.398952607 1.362768834
4 0.286812819 0.398952607
5 1.174673031 0.286812819
6 1.210856804 1.174673031
7 -0.752959422 1.210856804
8 0.986577228 -0.752959422
9 -0.977238999 0.986577228
10 0.762297651 -0.977238999
11 -0.201518575 0.762297651
12 0.686341636 -0.201518575
13 -0.277474590 0.686341636
14 -1.389614378 -0.277474590
15 0.349922272 -1.389614378
16 -0.613893955 0.349922272
17 0.273966257 -0.613893955
18 0.310150030 0.273966257
19 0.346333804 0.310150030
20 0.382517577 0.346333804
21 -0.581298649 0.382517577
22 -0.693438438 -0.581298649
23 0.194421774 -0.693438438
24 -0.769394452 0.194421774
25 0.118465759 -0.769394452
26 -0.845350467 0.118465759
27 0.042509745 -0.845350467
28 -0.921306482 0.042509745
29 -0.033446270 -0.921306482
30 0.002737503 -0.033446270
31 0.038921277 0.002737503
32 0.075105050 0.038921277
33 1.111288824 0.075105050
34 -2.704203841 1.111288824
35 0.887009247 -2.704203841
36 2.071516582 0.887009247
37 -1.595652521 2.071516582
38 0.143884129 -1.595652521
39 2.180067903 0.143884129
40 -2.487101201 2.180067903
41 0.104111888 -2.487101201
42 -1.859704339 0.104111888
43 -2.120167689 -1.859704339
44 0.619368961 -2.120167689
45 -0.196123704 0.619368961
46 0.840060070 -0.196123704
47 0.024567405 0.840060070
48 0.060751178 0.024567405
49 1.096934952 0.060751178
50 -0.718557713 1.096934952
51 -1.830697501 -0.718557713
52 -2.091160851 -1.830697501
53 0.648375799 -2.091160851
54 0.832883134 0.648375799
55 0.017390469 0.832883134
56 2.053574243 0.017390469
57 -2.613594861 2.053574243
58 -1.022381772 -2.613594861
59 -3.134521560 -1.022381772
60 2.456691528 -3.134521560
61 -1.062154014 2.456691528
62 0.825706198 -1.062154014
63 1.010213533 0.825706198
64 0.194720868 1.010213533
65 1.230904642 0.194720868
66 1.415411977 1.230904642
67 -2.400080688 1.415411977
68 1.191132401 -2.400080688
69 2.375639736 1.191132401
70 -2.291529368 2.375639736
71 -0.700316279 -2.291529368
72 6.187543933 -0.700316279
73 1.113669076 6.187543933
74 0.149852850 1.113669076
75 0.037713061 0.149852850
76 2.925573273 0.037713061
77 0.258404170 2.925573273
78 3.146264382 0.258404170
79 4.479095278 3.146264382
80 -27.039750263 4.479095278
81 -9.304949778 -27.039750263
82 7.692969063 -9.304949778
83 -12.639287985 7.692969063
84 -6.234663390 -12.639287985
85 6.356549698 -6.234663390
86 6.875969089 6.356549698
87 -6.752935083 6.875969089
88 3.393307321 -6.752935083
89 14.171108903 3.393307321
90 4.432146101 14.171108903
91 2.913300560 4.432146101
92 0.097807895 2.913300560
93 13.837344545 0.097807895
94 0.653411059 13.837344545
95 11.244624147 0.653411059
96 -0.532603586 11.244624147
97 -6.238037621 -0.532603586
98 -15.685089464 -6.238037621
99 3.681270199 -15.685089464
100 2.310748219 3.681270199
101 -4.356420884 2.310748219
102 2.938145081 -4.356420884
103 14.419299539 2.938145081
104 -10.467986824 14.419299539
105 -5.360009352 -10.467986824
106 -12.213766949 -5.360009352
107 0.042534084 -12.213766949
108 -6.624635019 0.042534084
109 -6.330069054 -6.624635019
110 -28.887179527 -6.330069054
111 -1.707408358 -28.887179527
112 10.070393224 -1.707408358
113 18.479753985 10.070393224
114 1.779056115 18.479753985
115 -3.888112988 1.779056115
116 -7.445223461 -3.888112988
117 11.552695380 -7.445223461
118 -2.482914544 11.552695380
119 -2.891701456 -2.482914544
120 -2.300488367 -2.891701456
121 -0.560951717 -2.300488367
122 7.475232056 -0.560951717
123 2.698004323 7.475232056
124 2.030835220 2.698004323
125 -9.784657445 2.030835220
126 -4.380032850 -9.784657445
127 -1.937143324 -4.380032850
128 2.950716888 -1.937143324
129 12.580194908 2.950716888
130 3.544584984 12.580194908
131 3.877415881 3.544584984
132 -1.789753223 3.877415881
133 -0.346863696 -1.789753223
134 10.392672954 -0.346863696
135 6.763768783 10.392672954
136 6.393246803 6.763768783
137 -0.125598739 6.393246803
138 12.317290788 -0.125598739
139 11.688386617 12.317290788
140 -1.237164678 11.688386617
141 -10.239245836 -1.237164678
142 5.572084512 -10.239245836
143 -0.946761030 5.572084512
144 9.496128497 -0.946761030
145 8.570577202 9.496128497
146 -4.651621216 8.570577202
147 -8.950349498 -4.651621216
148 -8.694048464 -8.950349498
149 -8.141100308 -8.694048464
150 -1.291505028 -8.141100308
151 -3.255321254 -1.291505028
152 -2.515784604 -3.255321254
153 -1.627924393 -2.515784604
154 -2.591740619 -1.627924393
155 5.296119593 -2.591740619
156 -0.629431702 5.296119593
157 4.406752071 -0.629431702
158 -1.815446347 4.406752071
159 -7.075909697 -1.815446347
160 2.922009145 -7.075909697
161 3.551487165 2.922009145
162 3.180965185 3.551487165
163 -4.337880356 3.180965185
164 1.956685609 -4.337880356
165 -3.710483494 1.956685609
166 1.732406032 -3.710483494
167 -0.934763071 1.732406032
168 -10.046902859 -0.934763071
169 4.506045297 -10.046902859
170 -4.567829559 4.506045297
171 -3.053091619 -4.567829559
172 2.944827223 -3.053091619
173 -3.018989004 2.944827223
174 3.127253400 -3.018989004
> 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/70m2k1292440203.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/80m2k1292440203.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/9svjn1292440203.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/10svjn1292440203.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/11pnhw1292440203.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/12dowp1292440203.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/13k8tj1292440203.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/14vha41292440203.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/15ghra1292440203.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/16u9611292440203.tab")
+ }
>
> try(system("convert tmp/1mvmt1292440203.ps tmp/1mvmt1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/2emlw1292440203.ps tmp/2emlw1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/3emlw1292440203.ps tmp/3emlw1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/4emlw1292440203.ps tmp/4emlw1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/57vkh1292440203.ps tmp/57vkh1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/67vkh1292440203.ps tmp/67vkh1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/70m2k1292440203.ps tmp/70m2k1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/80m2k1292440203.ps tmp/80m2k1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/9svjn1292440203.ps tmp/9svjn1292440203.png",intern=TRUE))
character(0)
> try(system("convert tmp/10svjn1292440203.ps tmp/10svjn1292440203.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.570 1.750 6.336