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(9.1
+ ,9.27
+ ,9.59
+ ,10.64
+ ,12.17
+ ,12.81
+ ,12.33
+ ,11.92
+ ,11.92
+ ,12.17
+ ,12.33
+ ,10.39
+ ,10.96
+ ,11.44
+ ,11.36
+ ,11.84
+ ,11.2
+ ,12.17
+ ,11.92
+ ,11.92
+ ,12.73
+ ,12.89
+ ,15.47
+ ,17
+ ,14.91
+ ,13.62
+ ,12.89
+ ,12.33
+ ,12.33
+ ,11.36
+ ,10.96
+ ,11.36
+ ,10.15
+ ,9.35
+ ,9.59
+ ,9.59
+ ,9.67
+ ,9.19
+ ,9.02
+ ,8.94
+ ,8.38
+ ,8.3
+ ,8.14
+ ,8.3
+ ,8.54
+ ,9.02
+ ,9.27
+ ,9.02
+ ,9.02
+ ,8.38
+ ,8.46
+ ,7.9
+ ,7.17
+ ,7.25
+ ,7.33
+ ,7.41
+ ,7.98
+ ,7.65
+ ,7.41
+ ,7.57
+ ,7.41
+ ,7.49
+ ,7.49
+ ,8.14
+ ,8.38
+ ,8.22
+ ,8.46
+ ,7.98
+ ,8.06
+ ,8.06
+ ,8.54
+ ,9.75
+ ,12.17
+ ,15.23
+ ,15.79
+ ,15.39
+ ,14.34
+ ,13.78
+ ,13.21
+ ,12.65
+ ,11.84
+ ,11.84
+ ,11.6
+ ,11.04
+ ,10.64
+ ,10.39
+ ,10.15
+ ,9.67
+ ,9.67
+ ,9.91
+ ,9.91
+ ,9.91
+ ,9.71
+ ,9.51
+ ,9.32
+ ,9.12
+ ,9.22
+ ,9.22
+ ,8.92
+ ,8.82
+ ,8.82
+ ,8.82
+ ,8.72
+ ,8.34
+ ,8.14
+ ,8.14
+ ,8.04
+ ,8.04
+ ,8.04
+ ,8.14
+ ,8.24
+ ,8.34
+ ,8.53
+ ,8.63
+ ,8.53
+ ,8.72
+ ,9.11
+ ,8.92
+ ,8.82
+ ,9.21
+ ,9.21
+ ,9.4
+ ,9.6
+ ,9.69
+ ,9.74
+ ,10.64
+ ,12.82
+ ,15.06
+ ,17.3
+ ,20.04
+ ,17.9
+ ,16.77
+ ,17.07
+ ,17.1
+ ,17.53
+ ,17.7
+ ,17.37
+ ,17.13
+ ,17.13
+ ,16.7
+ ,15.23
+ ,13.66
+ ,12.96
+ ,13.39
+ ,13.73
+ ,13.86
+ ,14.36
+ ,14.09
+ ,13.89
+ ,14.03
+ ,14.73
+ ,16.3
+ ,17.3
+ ,17.6
+ ,18
+ ,19.54
+ ,22.34
+ ,24.08
+ ,23.85
+ ,24.08
+ ,25.98
+ ,26.55
+ ,26.75
+ ,26.88
+ ,26.78
+ ,27.18
+ ,28.15
+ ,28.92
+ ,29.16
+ ,29.62
+ ,29.92
+ ,30.26
+ ,30.62
+ ,31.03
+ ,31.56
+ ,32.46
+ ,33.4
+ ,34.8
+ ,36.67
+ ,38.84
+ ,40.51
+ ,41.85
+ ,44.45
+ ,49.33
+ ,53.84
+ ,56.94
+ ,60.61
+ ,65.22
+ ,72.57
+ ,82.38
+ ,90.93
+ ,96.5
+ ,99.6
+ ,103.9
+ ,107.6
+ ,109.6
+ ,113.6
+ ,118.3
+ ,124
+ ,130.7
+ ,136.2
+ ,140.3
+ ,144.5
+ ,148.2
+ ,152.4
+ ,156.9
+ ,160.5
+ ,163
+ ,166.6
+ ,172.2
+ ,177.1
+ ,179.9
+ ,184
+ ,188.9
+ ,195.3
+ ,201.6
+ ,207.34
+ ,215.3
+ ,214.54)
+ ,dim=c(1
+ ,219)
+ ,dimnames=list(c('CPI')
+ ,1:219))
> y <- array(NA,dim=c(1,219),dimnames=list(c('CPI'),1:219))
> 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
CPI t
1 9.10 1
2 9.27 2
3 9.59 3
4 10.64 4
5 12.17 5
6 12.81 6
7 12.33 7
8 11.92 8
9 11.92 9
10 12.17 10
11 12.33 11
12 10.39 12
13 10.96 13
14 11.44 14
15 11.36 15
16 11.84 16
17 11.20 17
18 12.17 18
19 11.92 19
20 11.92 20
21 12.73 21
22 12.89 22
23 15.47 23
24 17.00 24
25 14.91 25
26 13.62 26
27 12.89 27
28 12.33 28
29 12.33 29
30 11.36 30
31 10.96 31
32 11.36 32
33 10.15 33
34 9.35 34
35 9.59 35
36 9.59 36
37 9.67 37
38 9.19 38
39 9.02 39
40 8.94 40
41 8.38 41
42 8.30 42
43 8.14 43
44 8.30 44
45 8.54 45
46 9.02 46
47 9.27 47
48 9.02 48
49 9.02 49
50 8.38 50
51 8.46 51
52 7.90 52
53 7.17 53
54 7.25 54
55 7.33 55
56 7.41 56
57 7.98 57
58 7.65 58
59 7.41 59
60 7.57 60
61 7.41 61
62 7.49 62
63 7.49 63
64 8.14 64
65 8.38 65
66 8.22 66
67 8.46 67
68 7.98 68
69 8.06 69
70 8.06 70
71 8.54 71
72 9.75 72
73 12.17 73
74 15.23 74
75 15.79 75
76 15.39 76
77 14.34 77
78 13.78 78
79 13.21 79
80 12.65 80
81 11.84 81
82 11.84 82
83 11.60 83
84 11.04 84
85 10.64 85
86 10.39 86
87 10.15 87
88 9.67 88
89 9.67 89
90 9.91 90
91 9.91 91
92 9.91 92
93 9.71 93
94 9.51 94
95 9.32 95
96 9.12 96
97 9.22 97
98 9.22 98
99 8.92 99
100 8.82 100
101 8.82 101
102 8.82 102
103 8.72 103
104 8.34 104
105 8.14 105
106 8.14 106
107 8.04 107
108 8.04 108
109 8.04 109
110 8.14 110
111 8.24 111
112 8.34 112
113 8.53 113
114 8.63 114
115 8.53 115
116 8.72 116
117 9.11 117
118 8.92 118
119 8.82 119
120 9.21 120
121 9.21 121
122 9.40 122
123 9.60 123
124 9.69 124
125 9.74 125
126 10.64 126
127 12.82 127
128 15.06 128
129 17.30 129
130 20.04 130
131 17.90 131
132 16.77 132
133 17.07 133
134 17.10 134
135 17.53 135
136 17.70 136
137 17.37 137
138 17.13 138
139 17.13 139
140 16.70 140
141 15.23 141
142 13.66 142
143 12.96 143
144 13.39 144
145 13.73 145
146 13.86 146
147 14.36 147
148 14.09 148
149 13.89 149
150 14.03 150
151 14.73 151
152 16.30 152
153 17.30 153
154 17.60 154
155 18.00 155
156 19.54 156
157 22.34 157
158 24.08 158
159 23.85 159
160 24.08 160
161 25.98 161
162 26.55 162
163 26.75 163
164 26.88 164
165 26.78 165
166 27.18 166
167 28.15 167
168 28.92 168
169 29.16 169
170 29.62 170
171 29.92 171
172 30.26 172
173 30.62 173
174 31.03 174
175 31.56 175
176 32.46 176
177 33.40 177
178 34.80 178
179 36.67 179
180 38.84 180
181 40.51 181
182 41.85 182
183 44.45 183
184 49.33 184
185 53.84 185
186 56.94 186
187 60.61 187
188 65.22 188
189 72.57 189
190 82.38 190
191 90.93 191
192 96.50 192
193 99.60 193
194 103.90 194
195 107.60 195
196 109.60 196
197 113.60 197
198 118.30 198
199 124.00 199
200 130.70 200
201 136.20 201
202 140.30 202
203 144.50 203
204 148.20 204
205 152.40 205
206 156.90 206
207 160.50 207
208 163.00 208
209 166.60 209
210 172.20 210
211 177.10 211
212 179.90 212
213 184.00 213
214 188.90 214
215 195.30 215
216 201.60 216
217 207.34 217
218 215.30 218
219 214.54 219
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) t
-24.5547 0.5308
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-41.040 -29.864 -4.594 21.598 124.134
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -24.55466 4.92058 -4.99 1.24e-06 ***
t 0.53083 0.03878 13.69 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 36.28 on 217 degrees of freedom
Multiple R-squared: 0.4633, Adjusted R-squared: 0.4608
F-statistic: 187.3 on 1 and 217 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,] 4.526285e-06 9.052569e-06 9.999955e-01
[2,] 6.522501e-08 1.304500e-07 9.999999e-01
[3,] 2.744545e-09 5.489090e-09 1.000000e+00
[4,] 3.227008e-10 6.454016e-10 1.000000e+00
[5,] 2.179448e-11 4.358896e-11 1.000000e+00
[6,] 8.946022e-13 1.789204e-12 1.000000e+00
[7,] 3.172794e-14 6.345587e-14 1.000000e+00
[8,] 2.096061e-14 4.192123e-14 1.000000e+00
[9,] 1.499717e-15 2.999434e-15 1.000000e+00
[10,] 6.001017e-17 1.200203e-16 1.000000e+00
[11,] 2.377978e-18 4.755955e-18 1.000000e+00
[12,] 7.389323e-20 1.477865e-19 1.000000e+00
[13,] 3.108266e-21 6.216531e-21 1.000000e+00
[14,] 9.035708e-23 1.807142e-22 1.000000e+00
[15,] 2.635323e-24 5.270646e-24 1.000000e+00
[16,] 7.601723e-26 1.520345e-25 1.000000e+00
[17,] 2.283919e-27 4.567839e-27 1.000000e+00
[18,] 6.754486e-29 1.350897e-28 1.000000e+00
[19,] 5.976763e-29 1.195353e-28 1.000000e+00
[20,] 1.646561e-28 3.293123e-28 1.000000e+00
[21,] 7.795227e-30 1.559045e-29 1.000000e+00
[22,] 3.243290e-31 6.486580e-31 1.000000e+00
[23,] 2.150192e-32 4.300384e-32 1.000000e+00
[24,] 2.297956e-33 4.595912e-33 1.000000e+00
[25,] 2.151192e-34 4.302384e-34 1.000000e+00
[26,] 5.168052e-35 1.033610e-34 1.000000e+00
[27,] 1.381405e-35 2.762811e-35 1.000000e+00
[28,] 1.696183e-36 3.392367e-36 1.000000e+00
[29,] 6.107197e-37 1.221439e-36 1.000000e+00
[30,] 3.423837e-37 6.847675e-37 1.000000e+00
[31,] 8.287360e-38 1.657472e-37 1.000000e+00
[32,] 1.446192e-38 2.892384e-38 1.000000e+00
[33,] 1.879068e-39 3.758136e-39 1.000000e+00
[34,] 2.891889e-40 5.783778e-40 1.000000e+00
[35,] 4.088118e-41 8.176236e-41 1.000000e+00
[36,] 5.071604e-42 1.014321e-41 1.000000e+00
[37,] 7.778551e-43 1.555710e-42 1.000000e+00
[38,] 1.031219e-43 2.062439e-43 1.000000e+00
[39,] 1.276355e-44 2.552709e-44 1.000000e+00
[40,] 1.249202e-45 2.498405e-45 1.000000e+00
[41,] 9.958675e-47 1.991735e-46 1.000000e+00
[42,] 6.489106e-48 1.297821e-47 1.000000e+00
[43,] 3.955950e-49 7.911901e-49 1.000000e+00
[44,] 2.454521e-50 4.909043e-50 1.000000e+00
[45,] 1.493278e-51 2.986556e-51 1.000000e+00
[46,] 1.017530e-52 2.035061e-52 1.000000e+00
[47,] 6.531217e-54 1.306243e-53 1.000000e+00
[48,] 4.771462e-55 9.542923e-55 1.000000e+00
[49,] 4.528116e-56 9.056231e-56 1.000000e+00
[50,] 3.741467e-57 7.482933e-57 1.000000e+00
[51,] 2.775258e-58 5.550516e-58 1.000000e+00
[52,] 1.894370e-59 3.788740e-59 1.000000e+00
[53,] 1.124163e-60 2.248327e-60 1.000000e+00
[54,] 6.835346e-62 1.367069e-61 1.000000e+00
[55,] 4.240335e-63 8.480669e-63 1.000000e+00
[56,] 2.513991e-64 5.027981e-64 1.000000e+00
[57,] 1.496413e-65 2.992826e-65 1.000000e+00
[58,] 8.731013e-67 1.746203e-66 1.000000e+00
[59,] 5.060875e-68 1.012175e-67 1.000000e+00
[60,] 3.171233e-69 6.342465e-69 1.000000e+00
[61,] 2.167642e-70 4.335284e-70 1.000000e+00
[62,] 1.424685e-71 2.849371e-71 1.000000e+00
[63,] 1.038129e-72 2.076258e-72 1.000000e+00
[64,] 6.534932e-74 1.306986e-73 1.000000e+00
[65,] 4.265477e-75 8.530954e-75 1.000000e+00
[66,] 2.826514e-76 5.653029e-76 1.000000e+00
[67,] 2.333630e-77 4.667260e-77 1.000000e+00
[68,] 4.858635e-78 9.717270e-78 1.000000e+00
[69,] 2.415863e-77 4.831726e-77 1.000000e+00
[70,] 1.741521e-74 3.483041e-74 1.000000e+00
[71,] 3.575705e-72 7.151410e-72 1.000000e+00
[72,] 7.523914e-71 1.504783e-70 1.000000e+00
[73,] 1.863268e-70 3.726537e-70 1.000000e+00
[74,] 1.840527e-70 3.681054e-70 1.000000e+00
[75,] 9.331280e-71 1.866256e-70 1.000000e+00
[76,] 2.914991e-71 5.829983e-71 1.000000e+00
[77,] 5.669118e-72 1.133824e-71 1.000000e+00
[78,] 1.081107e-72 2.162215e-72 1.000000e+00
[79,] 1.847414e-73 3.694828e-73 1.000000e+00
[80,] 2.631940e-74 5.263879e-74 1.000000e+00
[81,] 3.444404e-75 6.888808e-75 1.000000e+00
[82,] 4.368913e-76 8.737826e-76 1.000000e+00
[83,] 5.446942e-77 1.089388e-76 1.000000e+00
[84,] 6.678742e-78 1.335748e-77 1.000000e+00
[85,] 8.301311e-79 1.660262e-78 1.000000e+00
[86,] 1.059725e-79 2.119451e-79 1.000000e+00
[87,] 1.374462e-80 2.748924e-80 1.000000e+00
[88,] 1.812378e-81 3.624755e-81 1.000000e+00
[89,] 2.401121e-82 4.802243e-82 1.000000e+00
[90,] 3.217818e-83 6.435636e-83 1.000000e+00
[91,] 4.387983e-84 8.775966e-84 1.000000e+00
[92,] 6.122659e-85 1.224532e-84 1.000000e+00
[93,] 8.634147e-86 1.726829e-85 1.000000e+00
[94,] 1.237677e-86 2.475355e-86 1.000000e+00
[95,] 1.830093e-87 3.660185e-87 1.000000e+00
[96,] 2.767168e-88 5.534335e-88 1.000000e+00
[97,] 4.243065e-89 8.486131e-89 1.000000e+00
[98,] 6.603894e-90 1.320779e-89 1.000000e+00
[99,] 1.051922e-90 2.103844e-90 1.000000e+00
[100,] 1.777630e-91 3.555260e-91 1.000000e+00
[101,] 3.135521e-92 6.271041e-92 1.000000e+00
[102,] 5.568607e-93 1.113721e-92 1.000000e+00
[103,] 1.014328e-93 2.028656e-93 1.000000e+00
[104,] 1.860591e-94 3.721183e-94 1.000000e+00
[105,] 3.440557e-95 6.881114e-95 1.000000e+00
[106,] 6.332985e-96 1.266597e-95 1.000000e+00
[107,] 1.167418e-96 2.334836e-96 1.000000e+00
[108,] 2.167381e-97 4.334761e-97 1.000000e+00
[109,] 4.067719e-98 8.135438e-98 1.000000e+00
[110,] 7.792197e-99 1.558439e-98 1.000000e+00
[111,] 1.520694e-99 3.041387e-99 1.000000e+00
[112,] 3.048247e-100 6.096493e-100 1.000000e+00
[113,] 6.525159e-101 1.305032e-100 1.000000e+00
[114,] 1.393434e-101 2.786868e-101 1.000000e+00
[115,] 3.010582e-102 6.021165e-102 1.000000e+00
[116,] 7.055142e-103 1.411028e-102 1.000000e+00
[117,] 1.692789e-103 3.385578e-103 1.000000e+00
[118,] 4.341711e-104 8.683422e-104 1.000000e+00
[119,] 1.204848e-104 2.409696e-104 1.000000e+00
[120,] 3.516555e-105 7.033109e-105 1.000000e+00
[121,] 1.065664e-105 2.131329e-105 1.000000e+00
[122,] 4.948347e-106 9.896694e-106 1.000000e+00
[123,] 1.379512e-105 2.759024e-105 1.000000e+00
[124,] 5.949995e-104 1.189999e-103 1.000000e+00
[125,] 5.846945e-101 1.169389e-100 1.000000e+00
[126,] 2.805633e-96 5.611266e-96 1.000000e+00
[127,] 7.672241e-94 1.534448e-93 1.000000e+00
[128,] 2.942235e-92 5.884470e-92 1.000000e+00
[129,] 1.204689e-90 2.409378e-90 1.000000e+00
[130,] 4.002371e-89 8.004741e-89 1.000000e+00
[131,] 1.702239e-87 3.404477e-87 1.000000e+00
[132,] 7.119505e-86 1.423901e-85 1.000000e+00
[133,] 1.884510e-84 3.769020e-84 1.000000e+00
[134,] 3.748353e-83 7.496705e-83 1.000000e+00
[135,] 7.206223e-82 1.441245e-81 1.000000e+00
[136,] 9.910051e-81 1.982010e-80 1.000000e+00
[137,] 5.520335e-80 1.104067e-79 1.000000e+00
[138,] 1.603367e-79 3.206734e-79 1.000000e+00
[139,] 3.954121e-79 7.908242e-79 1.000000e+00
[140,] 1.176754e-78 2.353508e-78 1.000000e+00
[141,] 4.164957e-78 8.329914e-78 1.000000e+00
[142,] 1.626809e-77 3.253619e-77 1.000000e+00
[143,] 8.160516e-77 1.632103e-76 1.000000e+00
[144,] 3.786348e-76 7.572697e-76 1.000000e+00
[145,] 1.659795e-75 3.319589e-75 1.000000e+00
[146,] 7.724851e-75 1.544970e-74 1.000000e+00
[147,] 4.833912e-74 9.667824e-74 1.000000e+00
[148,] 7.197375e-73 1.439475e-72 1.000000e+00
[149,] 2.087767e-71 4.175535e-71 1.000000e+00
[150,] 7.154635e-70 1.430927e-69 1.000000e+00
[151,] 3.081294e-68 6.162588e-68 1.000000e+00
[152,] 4.490755e-66 8.981510e-66 1.000000e+00
[153,] 1.044668e-62 2.089335e-62 1.000000e+00
[154,] 1.379962e-58 2.759924e-58 1.000000e+00
[155,] 8.621596e-55 1.724319e-54 1.000000e+00
[156,] 4.768924e-51 9.537848e-51 1.000000e+00
[157,] 1.607270e-46 3.214541e-46 1.000000e+00
[158,] 6.435573e-42 1.287115e-41 1.000000e+00
[159,] 1.996787e-37 3.993575e-37 1.000000e+00
[160,] 4.492780e-33 8.985560e-33 1.000000e+00
[161,] 5.682005e-29 1.136401e-28 1.000000e+00
[162,] 6.301328e-25 1.260266e-24 1.000000e+00
[163,] 9.424805e-21 1.884961e-20 1.000000e+00
[164,] 1.310155e-16 2.620311e-16 1.000000e+00
[165,] 8.409754e-13 1.681951e-12 1.000000e+00
[166,] 2.391109e-09 4.782219e-09 1.000000e+00
[167,] 2.042346e-06 4.084692e-06 9.999980e-01
[168,] 4.275800e-04 8.551599e-04 9.995724e-01
[169,] 1.914406e-02 3.828812e-02 9.808559e-01
[170,] 1.925284e-01 3.850568e-01 8.074716e-01
[171,] 5.867766e-01 8.264468e-01 4.132234e-01
[172,] 8.787676e-01 2.424649e-01 1.212324e-01
[173,] 9.717016e-01 5.659689e-02 2.829844e-02
[174,] 9.926858e-01 1.462840e-02 7.314201e-03
[175,] 9.975229e-01 4.954175e-03 2.477087e-03
[176,] 9.988476e-01 2.304723e-03 1.152361e-03
[177,] 9.991989e-01 1.602135e-03 8.010673e-04
[178,] 9.993896e-01 1.220830e-03 6.104151e-04
[179,] 9.996719e-01 6.562103e-04 3.281051e-04
[180,] 9.998676e-01 2.647642e-04 1.323821e-04
[181,] 9.999615e-01 7.697301e-05 3.848650e-05
[182,] 9.999949e-01 1.015271e-05 5.076356e-06
[183,] 9.999998e-01 3.539036e-07 1.769518e-07
[184,] 1.000000e+00 1.651023e-09 8.255114e-10
[185,] 1.000000e+00 8.646428e-12 4.323214e-12
[186,] 1.000000e+00 1.452300e-12 7.261500e-13
[187,] 1.000000e+00 4.442855e-13 2.221428e-13
[188,] 1.000000e+00 1.079958e-13 5.399788e-14
[189,] 1.000000e+00 6.310516e-14 3.155258e-14
[190,] 1.000000e+00 4.781128e-14 2.390564e-14
[191,] 1.000000e+00 5.583583e-14 2.791791e-14
[192,] 1.000000e+00 8.446709e-14 4.223355e-14
[193,] 1.000000e+00 1.196432e-13 5.982161e-14
[194,] 1.000000e+00 1.852314e-13 9.261569e-14
[195,] 1.000000e+00 4.367774e-13 2.183887e-13
[196,] 1.000000e+00 1.218810e-12 6.094050e-13
[197,] 1.000000e+00 2.607888e-12 1.303944e-12
[198,] 1.000000e+00 6.055454e-12 3.027727e-12
[199,] 1.000000e+00 1.397072e-11 6.985360e-12
[200,] 1.000000e+00 4.022549e-11 2.011274e-11
[201,] 1.000000e+00 1.115774e-10 5.578868e-11
[202,] 1.000000e+00 2.105220e-10 1.052610e-10
[203,] 1.000000e+00 4.330910e-10 2.165455e-10
[204,] 1.000000e+00 2.678166e-09 1.339083e-09
[205,] 1.000000e+00 2.503871e-08 1.251935e-08
[206,] 9.999999e-01 1.722363e-07 8.611813e-08
[207,] 9.999996e-01 8.660891e-07 4.330445e-07
[208,] 9.999948e-01 1.031058e-05 5.155288e-06
[209,] 9.999324e-01 1.351342e-04 6.756712e-05
[210,] 9.992767e-01 1.446696e-03 7.233481e-04
> postscript(file="/var/www/rcomp/tmp/1b3x81293576759.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/2wmhn1293576760.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/3wmhn1293576760.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/4wmhn1293576760.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/5wmhn1293576760.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 = 219
Frequency = 1
1 2 3 4 5 6
33.1238315 32.7630025 32.5521735 33.0713445 34.0705155 34.1796865
7 8 9 10 11 12
33.1688575 32.2280285 31.6971995 31.4163705 31.0455415 28.5747125
13 14 15 16 17 18
28.6138834 28.5630544 27.9522254 27.9013964 26.7305674 27.1697384
19 20 21 22 23 24
26.3889094 25.8580804 26.1372514 25.7664224 27.8155934 28.8147644
25 26 27 28 29 30
26.1939354 24.3731064 23.1122774 22.0214484 21.4906194 19.9897904
31 32 33 34 35 36
19.0589614 18.9281324 17.1873034 15.8564744 15.5656454 15.0348164
37 38 39 40 41 42
14.5839874 13.5731584 12.8723294 12.2615004 11.1706714 10.5598424
43 44 45 46 47 48
9.8690134 9.4981844 9.2073554 9.1565264 8.8756974 8.0948684
49 50 51 52 53 54
7.5640394 6.3932104 5.9423814 4.8515524 3.5907234 3.1398944
55 56 57 58 59 60
2.6890654 2.2382364 2.2774074 1.4165784 0.6457494 0.2749204
61 62 63 64 65 66
-0.4159086 -0.8667376 -1.3975666 -1.2783956 -1.5692246 -2.2600536
67 68 69 70 71 72
-2.5508826 -3.5617116 -4.0125406 -4.5433696 -4.5941986 -3.9150276
73 74 75 76 77 78
-2.0258566 0.5033144 0.5324854 -0.3983436 -1.9791726 -3.0700016
79 80 81 82 83 84
-4.1708306 -5.2616596 -6.6024886 -7.1333176 -7.9041466 -8.9949756
85 86 87 88 89 90
-9.9258046 -10.7066336 -11.4774626 -12.4882917 -13.0191207 -13.3099497
91 92 93 94 95 96
-13.8407787 -14.3716077 -15.1024367 -15.8332657 -16.5540947 -17.2849237
97 98 99 100 101 102
-17.7157527 -18.2465817 -19.0774107 -19.7082397 -20.2390687 -20.7698977
103 104 105 106 107 108
-21.4007267 -22.3115557 -23.0423847 -23.5732137 -24.2040427 -24.7348717
109 110 111 112 113 114
-25.2657007 -25.6965297 -26.1273587 -26.5581877 -26.8990167 -27.3298457
115 116 117 118 119 120
-27.9606747 -28.3015037 -28.4423327 -29.1631617 -29.7939907 -29.9348197
121 122 123 124 125 126
-30.4656487 -30.8064777 -31.1373067 -31.5781357 -32.0589647 -31.6897937
127 128 129 130 131 132
-30.0406227 -28.3314517 -26.6222807 -24.4131097 -27.0839387 -28.7447677
133 134 135 136 137 138
-28.9755967 -29.4764257 -29.5772547 -29.9380837 -30.7989127 -31.5697417
139 140 141 142 143 144
-32.1005707 -33.0613997 -35.0622287 -37.1630577 -38.3938867 -38.4947157
145 146 147 148 149 150
-38.6855447 -39.0863737 -39.1172027 -39.9180317 -40.6488607 -41.0396897
151 152 153 154 155 156
-40.8705187 -39.8313477 -39.3621767 -39.5930057 -39.7238347 -38.7146637
157 158 159 160 161 162
-36.4454927 -35.2363217 -35.9971507 -36.2979797 -34.9288087 -34.8896377
163 164 165 166 167 168
-35.2204668 -35.6212958 -36.2521248 -36.3829538 -35.9437828 -35.7046118
169 170 171 172 173 174
-35.9954408 -36.0662698 -36.2970988 -36.4879278 -36.6587568 -36.7795858
175 176 177 178 179 180
-36.7804148 -36.4112438 -36.0020728 -35.1329018 -33.7937308 -32.1545598
181 182 183 184 185 186
-31.0153888 -30.2062178 -28.1370468 -23.7878758 -19.8087048 -17.2395338
187 188 189 190 191 192
-14.1003628 -10.0211918 -3.2020208 6.0771502 14.0963212 19.1354922
193 194 195 196 197 198
21.7046632 25.4738342 28.6430052 30.1121762 33.5813472 37.7505182
199 200 201 202 203 204
42.9196892 49.0888602 54.0580312 57.6272022 61.2963732 64.4655442
205 206 207 208 209 210
68.1347152 72.1038862 75.1730572 77.1422282 80.2113992 85.2805702
211 212 213 214 215 216
89.6497412 91.9189122 95.4880832 99.8572542 105.7264252 111.4955962
217 218 219
116.7047672 124.1339382 122.8431092
> postscript(file="/var/www/rcomp/tmp/6pegr1293576760.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 = 219
Frequency = 1
lag(myerror, k = 1) myerror
0 33.1238315 NA
1 32.7630025 33.1238315
2 32.5521735 32.7630025
3 33.0713445 32.5521735
4 34.0705155 33.0713445
5 34.1796865 34.0705155
6 33.1688575 34.1796865
7 32.2280285 33.1688575
8 31.6971995 32.2280285
9 31.4163705 31.6971995
10 31.0455415 31.4163705
11 28.5747125 31.0455415
12 28.6138834 28.5747125
13 28.5630544 28.6138834
14 27.9522254 28.5630544
15 27.9013964 27.9522254
16 26.7305674 27.9013964
17 27.1697384 26.7305674
18 26.3889094 27.1697384
19 25.8580804 26.3889094
20 26.1372514 25.8580804
21 25.7664224 26.1372514
22 27.8155934 25.7664224
23 28.8147644 27.8155934
24 26.1939354 28.8147644
25 24.3731064 26.1939354
26 23.1122774 24.3731064
27 22.0214484 23.1122774
28 21.4906194 22.0214484
29 19.9897904 21.4906194
30 19.0589614 19.9897904
31 18.9281324 19.0589614
32 17.1873034 18.9281324
33 15.8564744 17.1873034
34 15.5656454 15.8564744
35 15.0348164 15.5656454
36 14.5839874 15.0348164
37 13.5731584 14.5839874
38 12.8723294 13.5731584
39 12.2615004 12.8723294
40 11.1706714 12.2615004
41 10.5598424 11.1706714
42 9.8690134 10.5598424
43 9.4981844 9.8690134
44 9.2073554 9.4981844
45 9.1565264 9.2073554
46 8.8756974 9.1565264
47 8.0948684 8.8756974
48 7.5640394 8.0948684
49 6.3932104 7.5640394
50 5.9423814 6.3932104
51 4.8515524 5.9423814
52 3.5907234 4.8515524
53 3.1398944 3.5907234
54 2.6890654 3.1398944
55 2.2382364 2.6890654
56 2.2774074 2.2382364
57 1.4165784 2.2774074
58 0.6457494 1.4165784
59 0.2749204 0.6457494
60 -0.4159086 0.2749204
61 -0.8667376 -0.4159086
62 -1.3975666 -0.8667376
63 -1.2783956 -1.3975666
64 -1.5692246 -1.2783956
65 -2.2600536 -1.5692246
66 -2.5508826 -2.2600536
67 -3.5617116 -2.5508826
68 -4.0125406 -3.5617116
69 -4.5433696 -4.0125406
70 -4.5941986 -4.5433696
71 -3.9150276 -4.5941986
72 -2.0258566 -3.9150276
73 0.5033144 -2.0258566
74 0.5324854 0.5033144
75 -0.3983436 0.5324854
76 -1.9791726 -0.3983436
77 -3.0700016 -1.9791726
78 -4.1708306 -3.0700016
79 -5.2616596 -4.1708306
80 -6.6024886 -5.2616596
81 -7.1333176 -6.6024886
82 -7.9041466 -7.1333176
83 -8.9949756 -7.9041466
84 -9.9258046 -8.9949756
85 -10.7066336 -9.9258046
86 -11.4774626 -10.7066336
87 -12.4882917 -11.4774626
88 -13.0191207 -12.4882917
89 -13.3099497 -13.0191207
90 -13.8407787 -13.3099497
91 -14.3716077 -13.8407787
92 -15.1024367 -14.3716077
93 -15.8332657 -15.1024367
94 -16.5540947 -15.8332657
95 -17.2849237 -16.5540947
96 -17.7157527 -17.2849237
97 -18.2465817 -17.7157527
98 -19.0774107 -18.2465817
99 -19.7082397 -19.0774107
100 -20.2390687 -19.7082397
101 -20.7698977 -20.2390687
102 -21.4007267 -20.7698977
103 -22.3115557 -21.4007267
104 -23.0423847 -22.3115557
105 -23.5732137 -23.0423847
106 -24.2040427 -23.5732137
107 -24.7348717 -24.2040427
108 -25.2657007 -24.7348717
109 -25.6965297 -25.2657007
110 -26.1273587 -25.6965297
111 -26.5581877 -26.1273587
112 -26.8990167 -26.5581877
113 -27.3298457 -26.8990167
114 -27.9606747 -27.3298457
115 -28.3015037 -27.9606747
116 -28.4423327 -28.3015037
117 -29.1631617 -28.4423327
118 -29.7939907 -29.1631617
119 -29.9348197 -29.7939907
120 -30.4656487 -29.9348197
121 -30.8064777 -30.4656487
122 -31.1373067 -30.8064777
123 -31.5781357 -31.1373067
124 -32.0589647 -31.5781357
125 -31.6897937 -32.0589647
126 -30.0406227 -31.6897937
127 -28.3314517 -30.0406227
128 -26.6222807 -28.3314517
129 -24.4131097 -26.6222807
130 -27.0839387 -24.4131097
131 -28.7447677 -27.0839387
132 -28.9755967 -28.7447677
133 -29.4764257 -28.9755967
134 -29.5772547 -29.4764257
135 -29.9380837 -29.5772547
136 -30.7989127 -29.9380837
137 -31.5697417 -30.7989127
138 -32.1005707 -31.5697417
139 -33.0613997 -32.1005707
140 -35.0622287 -33.0613997
141 -37.1630577 -35.0622287
142 -38.3938867 -37.1630577
143 -38.4947157 -38.3938867
144 -38.6855447 -38.4947157
145 -39.0863737 -38.6855447
146 -39.1172027 -39.0863737
147 -39.9180317 -39.1172027
148 -40.6488607 -39.9180317
149 -41.0396897 -40.6488607
150 -40.8705187 -41.0396897
151 -39.8313477 -40.8705187
152 -39.3621767 -39.8313477
153 -39.5930057 -39.3621767
154 -39.7238347 -39.5930057
155 -38.7146637 -39.7238347
156 -36.4454927 -38.7146637
157 -35.2363217 -36.4454927
158 -35.9971507 -35.2363217
159 -36.2979797 -35.9971507
160 -34.9288087 -36.2979797
161 -34.8896377 -34.9288087
162 -35.2204668 -34.8896377
163 -35.6212958 -35.2204668
164 -36.2521248 -35.6212958
165 -36.3829538 -36.2521248
166 -35.9437828 -36.3829538
167 -35.7046118 -35.9437828
168 -35.9954408 -35.7046118
169 -36.0662698 -35.9954408
170 -36.2970988 -36.0662698
171 -36.4879278 -36.2970988
172 -36.6587568 -36.4879278
173 -36.7795858 -36.6587568
174 -36.7804148 -36.7795858
175 -36.4112438 -36.7804148
176 -36.0020728 -36.4112438
177 -35.1329018 -36.0020728
178 -33.7937308 -35.1329018
179 -32.1545598 -33.7937308
180 -31.0153888 -32.1545598
181 -30.2062178 -31.0153888
182 -28.1370468 -30.2062178
183 -23.7878758 -28.1370468
184 -19.8087048 -23.7878758
185 -17.2395338 -19.8087048
186 -14.1003628 -17.2395338
187 -10.0211918 -14.1003628
188 -3.2020208 -10.0211918
189 6.0771502 -3.2020208
190 14.0963212 6.0771502
191 19.1354922 14.0963212
192 21.7046632 19.1354922
193 25.4738342 21.7046632
194 28.6430052 25.4738342
195 30.1121762 28.6430052
196 33.5813472 30.1121762
197 37.7505182 33.5813472
198 42.9196892 37.7505182
199 49.0888602 42.9196892
200 54.0580312 49.0888602
201 57.6272022 54.0580312
202 61.2963732 57.6272022
203 64.4655442 61.2963732
204 68.1347152 64.4655442
205 72.1038862 68.1347152
206 75.1730572 72.1038862
207 77.1422282 75.1730572
208 80.2113992 77.1422282
209 85.2805702 80.2113992
210 89.6497412 85.2805702
211 91.9189122 89.6497412
212 95.4880832 91.9189122
213 99.8572542 95.4880832
214 105.7264252 99.8572542
215 111.4955962 105.7264252
216 116.7047672 111.4955962
217 124.1339382 116.7047672
218 122.8431092 124.1339382
219 NA 122.8431092
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 32.7630025 33.1238315
[2,] 32.5521735 32.7630025
[3,] 33.0713445 32.5521735
[4,] 34.0705155 33.0713445
[5,] 34.1796865 34.0705155
[6,] 33.1688575 34.1796865
[7,] 32.2280285 33.1688575
[8,] 31.6971995 32.2280285
[9,] 31.4163705 31.6971995
[10,] 31.0455415 31.4163705
[11,] 28.5747125 31.0455415
[12,] 28.6138834 28.5747125
[13,] 28.5630544 28.6138834
[14,] 27.9522254 28.5630544
[15,] 27.9013964 27.9522254
[16,] 26.7305674 27.9013964
[17,] 27.1697384 26.7305674
[18,] 26.3889094 27.1697384
[19,] 25.8580804 26.3889094
[20,] 26.1372514 25.8580804
[21,] 25.7664224 26.1372514
[22,] 27.8155934 25.7664224
[23,] 28.8147644 27.8155934
[24,] 26.1939354 28.8147644
[25,] 24.3731064 26.1939354
[26,] 23.1122774 24.3731064
[27,] 22.0214484 23.1122774
[28,] 21.4906194 22.0214484
[29,] 19.9897904 21.4906194
[30,] 19.0589614 19.9897904
[31,] 18.9281324 19.0589614
[32,] 17.1873034 18.9281324
[33,] 15.8564744 17.1873034
[34,] 15.5656454 15.8564744
[35,] 15.0348164 15.5656454
[36,] 14.5839874 15.0348164
[37,] 13.5731584 14.5839874
[38,] 12.8723294 13.5731584
[39,] 12.2615004 12.8723294
[40,] 11.1706714 12.2615004
[41,] 10.5598424 11.1706714
[42,] 9.8690134 10.5598424
[43,] 9.4981844 9.8690134
[44,] 9.2073554 9.4981844
[45,] 9.1565264 9.2073554
[46,] 8.8756974 9.1565264
[47,] 8.0948684 8.8756974
[48,] 7.5640394 8.0948684
[49,] 6.3932104 7.5640394
[50,] 5.9423814 6.3932104
[51,] 4.8515524 5.9423814
[52,] 3.5907234 4.8515524
[53,] 3.1398944 3.5907234
[54,] 2.6890654 3.1398944
[55,] 2.2382364 2.6890654
[56,] 2.2774074 2.2382364
[57,] 1.4165784 2.2774074
[58,] 0.6457494 1.4165784
[59,] 0.2749204 0.6457494
[60,] -0.4159086 0.2749204
[61,] -0.8667376 -0.4159086
[62,] -1.3975666 -0.8667376
[63,] -1.2783956 -1.3975666
[64,] -1.5692246 -1.2783956
[65,] -2.2600536 -1.5692246
[66,] -2.5508826 -2.2600536
[67,] -3.5617116 -2.5508826
[68,] -4.0125406 -3.5617116
[69,] -4.5433696 -4.0125406
[70,] -4.5941986 -4.5433696
[71,] -3.9150276 -4.5941986
[72,] -2.0258566 -3.9150276
[73,] 0.5033144 -2.0258566
[74,] 0.5324854 0.5033144
[75,] -0.3983436 0.5324854
[76,] -1.9791726 -0.3983436
[77,] -3.0700016 -1.9791726
[78,] -4.1708306 -3.0700016
[79,] -5.2616596 -4.1708306
[80,] -6.6024886 -5.2616596
[81,] -7.1333176 -6.6024886
[82,] -7.9041466 -7.1333176
[83,] -8.9949756 -7.9041466
[84,] -9.9258046 -8.9949756
[85,] -10.7066336 -9.9258046
[86,] -11.4774626 -10.7066336
[87,] -12.4882917 -11.4774626
[88,] -13.0191207 -12.4882917
[89,] -13.3099497 -13.0191207
[90,] -13.8407787 -13.3099497
[91,] -14.3716077 -13.8407787
[92,] -15.1024367 -14.3716077
[93,] -15.8332657 -15.1024367
[94,] -16.5540947 -15.8332657
[95,] -17.2849237 -16.5540947
[96,] -17.7157527 -17.2849237
[97,] -18.2465817 -17.7157527
[98,] -19.0774107 -18.2465817
[99,] -19.7082397 -19.0774107
[100,] -20.2390687 -19.7082397
[101,] -20.7698977 -20.2390687
[102,] -21.4007267 -20.7698977
[103,] -22.3115557 -21.4007267
[104,] -23.0423847 -22.3115557
[105,] -23.5732137 -23.0423847
[106,] -24.2040427 -23.5732137
[107,] -24.7348717 -24.2040427
[108,] -25.2657007 -24.7348717
[109,] -25.6965297 -25.2657007
[110,] -26.1273587 -25.6965297
[111,] -26.5581877 -26.1273587
[112,] -26.8990167 -26.5581877
[113,] -27.3298457 -26.8990167
[114,] -27.9606747 -27.3298457
[115,] -28.3015037 -27.9606747
[116,] -28.4423327 -28.3015037
[117,] -29.1631617 -28.4423327
[118,] -29.7939907 -29.1631617
[119,] -29.9348197 -29.7939907
[120,] -30.4656487 -29.9348197
[121,] -30.8064777 -30.4656487
[122,] -31.1373067 -30.8064777
[123,] -31.5781357 -31.1373067
[124,] -32.0589647 -31.5781357
[125,] -31.6897937 -32.0589647
[126,] -30.0406227 -31.6897937
[127,] -28.3314517 -30.0406227
[128,] -26.6222807 -28.3314517
[129,] -24.4131097 -26.6222807
[130,] -27.0839387 -24.4131097
[131,] -28.7447677 -27.0839387
[132,] -28.9755967 -28.7447677
[133,] -29.4764257 -28.9755967
[134,] -29.5772547 -29.4764257
[135,] -29.9380837 -29.5772547
[136,] -30.7989127 -29.9380837
[137,] -31.5697417 -30.7989127
[138,] -32.1005707 -31.5697417
[139,] -33.0613997 -32.1005707
[140,] -35.0622287 -33.0613997
[141,] -37.1630577 -35.0622287
[142,] -38.3938867 -37.1630577
[143,] -38.4947157 -38.3938867
[144,] -38.6855447 -38.4947157
[145,] -39.0863737 -38.6855447
[146,] -39.1172027 -39.0863737
[147,] -39.9180317 -39.1172027
[148,] -40.6488607 -39.9180317
[149,] -41.0396897 -40.6488607
[150,] -40.8705187 -41.0396897
[151,] -39.8313477 -40.8705187
[152,] -39.3621767 -39.8313477
[153,] -39.5930057 -39.3621767
[154,] -39.7238347 -39.5930057
[155,] -38.7146637 -39.7238347
[156,] -36.4454927 -38.7146637
[157,] -35.2363217 -36.4454927
[158,] -35.9971507 -35.2363217
[159,] -36.2979797 -35.9971507
[160,] -34.9288087 -36.2979797
[161,] -34.8896377 -34.9288087
[162,] -35.2204668 -34.8896377
[163,] -35.6212958 -35.2204668
[164,] -36.2521248 -35.6212958
[165,] -36.3829538 -36.2521248
[166,] -35.9437828 -36.3829538
[167,] -35.7046118 -35.9437828
[168,] -35.9954408 -35.7046118
[169,] -36.0662698 -35.9954408
[170,] -36.2970988 -36.0662698
[171,] -36.4879278 -36.2970988
[172,] -36.6587568 -36.4879278
[173,] -36.7795858 -36.6587568
[174,] -36.7804148 -36.7795858
[175,] -36.4112438 -36.7804148
[176,] -36.0020728 -36.4112438
[177,] -35.1329018 -36.0020728
[178,] -33.7937308 -35.1329018
[179,] -32.1545598 -33.7937308
[180,] -31.0153888 -32.1545598
[181,] -30.2062178 -31.0153888
[182,] -28.1370468 -30.2062178
[183,] -23.7878758 -28.1370468
[184,] -19.8087048 -23.7878758
[185,] -17.2395338 -19.8087048
[186,] -14.1003628 -17.2395338
[187,] -10.0211918 -14.1003628
[188,] -3.2020208 -10.0211918
[189,] 6.0771502 -3.2020208
[190,] 14.0963212 6.0771502
[191,] 19.1354922 14.0963212
[192,] 21.7046632 19.1354922
[193,] 25.4738342 21.7046632
[194,] 28.6430052 25.4738342
[195,] 30.1121762 28.6430052
[196,] 33.5813472 30.1121762
[197,] 37.7505182 33.5813472
[198,] 42.9196892 37.7505182
[199,] 49.0888602 42.9196892
[200,] 54.0580312 49.0888602
[201,] 57.6272022 54.0580312
[202,] 61.2963732 57.6272022
[203,] 64.4655442 61.2963732
[204,] 68.1347152 64.4655442
[205,] 72.1038862 68.1347152
[206,] 75.1730572 72.1038862
[207,] 77.1422282 75.1730572
[208,] 80.2113992 77.1422282
[209,] 85.2805702 80.2113992
[210,] 89.6497412 85.2805702
[211,] 91.9189122 89.6497412
[212,] 95.4880832 91.9189122
[213,] 99.8572542 95.4880832
[214,] 105.7264252 99.8572542
[215,] 111.4955962 105.7264252
[216,] 116.7047672 111.4955962
[217,] 124.1339382 116.7047672
[218,] 122.8431092 124.1339382
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 32.7630025 33.1238315
2 32.5521735 32.7630025
3 33.0713445 32.5521735
4 34.0705155 33.0713445
5 34.1796865 34.0705155
6 33.1688575 34.1796865
7 32.2280285 33.1688575
8 31.6971995 32.2280285
9 31.4163705 31.6971995
10 31.0455415 31.4163705
11 28.5747125 31.0455415
12 28.6138834 28.5747125
13 28.5630544 28.6138834
14 27.9522254 28.5630544
15 27.9013964 27.9522254
16 26.7305674 27.9013964
17 27.1697384 26.7305674
18 26.3889094 27.1697384
19 25.8580804 26.3889094
20 26.1372514 25.8580804
21 25.7664224 26.1372514
22 27.8155934 25.7664224
23 28.8147644 27.8155934
24 26.1939354 28.8147644
25 24.3731064 26.1939354
26 23.1122774 24.3731064
27 22.0214484 23.1122774
28 21.4906194 22.0214484
29 19.9897904 21.4906194
30 19.0589614 19.9897904
31 18.9281324 19.0589614
32 17.1873034 18.9281324
33 15.8564744 17.1873034
34 15.5656454 15.8564744
35 15.0348164 15.5656454
36 14.5839874 15.0348164
37 13.5731584 14.5839874
38 12.8723294 13.5731584
39 12.2615004 12.8723294
40 11.1706714 12.2615004
41 10.5598424 11.1706714
42 9.8690134 10.5598424
43 9.4981844 9.8690134
44 9.2073554 9.4981844
45 9.1565264 9.2073554
46 8.8756974 9.1565264
47 8.0948684 8.8756974
48 7.5640394 8.0948684
49 6.3932104 7.5640394
50 5.9423814 6.3932104
51 4.8515524 5.9423814
52 3.5907234 4.8515524
53 3.1398944 3.5907234
54 2.6890654 3.1398944
55 2.2382364 2.6890654
56 2.2774074 2.2382364
57 1.4165784 2.2774074
58 0.6457494 1.4165784
59 0.2749204 0.6457494
60 -0.4159086 0.2749204
61 -0.8667376 -0.4159086
62 -1.3975666 -0.8667376
63 -1.2783956 -1.3975666
64 -1.5692246 -1.2783956
65 -2.2600536 -1.5692246
66 -2.5508826 -2.2600536
67 -3.5617116 -2.5508826
68 -4.0125406 -3.5617116
69 -4.5433696 -4.0125406
70 -4.5941986 -4.5433696
71 -3.9150276 -4.5941986
72 -2.0258566 -3.9150276
73 0.5033144 -2.0258566
74 0.5324854 0.5033144
75 -0.3983436 0.5324854
76 -1.9791726 -0.3983436
77 -3.0700016 -1.9791726
78 -4.1708306 -3.0700016
79 -5.2616596 -4.1708306
80 -6.6024886 -5.2616596
81 -7.1333176 -6.6024886
82 -7.9041466 -7.1333176
83 -8.9949756 -7.9041466
84 -9.9258046 -8.9949756
85 -10.7066336 -9.9258046
86 -11.4774626 -10.7066336
87 -12.4882917 -11.4774626
88 -13.0191207 -12.4882917
89 -13.3099497 -13.0191207
90 -13.8407787 -13.3099497
91 -14.3716077 -13.8407787
92 -15.1024367 -14.3716077
93 -15.8332657 -15.1024367
94 -16.5540947 -15.8332657
95 -17.2849237 -16.5540947
96 -17.7157527 -17.2849237
97 -18.2465817 -17.7157527
98 -19.0774107 -18.2465817
99 -19.7082397 -19.0774107
100 -20.2390687 -19.7082397
101 -20.7698977 -20.2390687
102 -21.4007267 -20.7698977
103 -22.3115557 -21.4007267
104 -23.0423847 -22.3115557
105 -23.5732137 -23.0423847
106 -24.2040427 -23.5732137
107 -24.7348717 -24.2040427
108 -25.2657007 -24.7348717
109 -25.6965297 -25.2657007
110 -26.1273587 -25.6965297
111 -26.5581877 -26.1273587
112 -26.8990167 -26.5581877
113 -27.3298457 -26.8990167
114 -27.9606747 -27.3298457
115 -28.3015037 -27.9606747
116 -28.4423327 -28.3015037
117 -29.1631617 -28.4423327
118 -29.7939907 -29.1631617
119 -29.9348197 -29.7939907
120 -30.4656487 -29.9348197
121 -30.8064777 -30.4656487
122 -31.1373067 -30.8064777
123 -31.5781357 -31.1373067
124 -32.0589647 -31.5781357
125 -31.6897937 -32.0589647
126 -30.0406227 -31.6897937
127 -28.3314517 -30.0406227
128 -26.6222807 -28.3314517
129 -24.4131097 -26.6222807
130 -27.0839387 -24.4131097
131 -28.7447677 -27.0839387
132 -28.9755967 -28.7447677
133 -29.4764257 -28.9755967
134 -29.5772547 -29.4764257
135 -29.9380837 -29.5772547
136 -30.7989127 -29.9380837
137 -31.5697417 -30.7989127
138 -32.1005707 -31.5697417
139 -33.0613997 -32.1005707
140 -35.0622287 -33.0613997
141 -37.1630577 -35.0622287
142 -38.3938867 -37.1630577
143 -38.4947157 -38.3938867
144 -38.6855447 -38.4947157
145 -39.0863737 -38.6855447
146 -39.1172027 -39.0863737
147 -39.9180317 -39.1172027
148 -40.6488607 -39.9180317
149 -41.0396897 -40.6488607
150 -40.8705187 -41.0396897
151 -39.8313477 -40.8705187
152 -39.3621767 -39.8313477
153 -39.5930057 -39.3621767
154 -39.7238347 -39.5930057
155 -38.7146637 -39.7238347
156 -36.4454927 -38.7146637
157 -35.2363217 -36.4454927
158 -35.9971507 -35.2363217
159 -36.2979797 -35.9971507
160 -34.9288087 -36.2979797
161 -34.8896377 -34.9288087
162 -35.2204668 -34.8896377
163 -35.6212958 -35.2204668
164 -36.2521248 -35.6212958
165 -36.3829538 -36.2521248
166 -35.9437828 -36.3829538
167 -35.7046118 -35.9437828
168 -35.9954408 -35.7046118
169 -36.0662698 -35.9954408
170 -36.2970988 -36.0662698
171 -36.4879278 -36.2970988
172 -36.6587568 -36.4879278
173 -36.7795858 -36.6587568
174 -36.7804148 -36.7795858
175 -36.4112438 -36.7804148
176 -36.0020728 -36.4112438
177 -35.1329018 -36.0020728
178 -33.7937308 -35.1329018
179 -32.1545598 -33.7937308
180 -31.0153888 -32.1545598
181 -30.2062178 -31.0153888
182 -28.1370468 -30.2062178
183 -23.7878758 -28.1370468
184 -19.8087048 -23.7878758
185 -17.2395338 -19.8087048
186 -14.1003628 -17.2395338
187 -10.0211918 -14.1003628
188 -3.2020208 -10.0211918
189 6.0771502 -3.2020208
190 14.0963212 6.0771502
191 19.1354922 14.0963212
192 21.7046632 19.1354922
193 25.4738342 21.7046632
194 28.6430052 25.4738342
195 30.1121762 28.6430052
196 33.5813472 30.1121762
197 37.7505182 33.5813472
198 42.9196892 37.7505182
199 49.0888602 42.9196892
200 54.0580312 49.0888602
201 57.6272022 54.0580312
202 61.2963732 57.6272022
203 64.4655442 61.2963732
204 68.1347152 64.4655442
205 72.1038862 68.1347152
206 75.1730572 72.1038862
207 77.1422282 75.1730572
208 80.2113992 77.1422282
209 85.2805702 80.2113992
210 89.6497412 85.2805702
211 91.9189122 89.6497412
212 95.4880832 91.9189122
213 99.8572542 95.4880832
214 105.7264252 99.8572542
215 111.4955962 105.7264252
216 116.7047672 111.4955962
217 124.1339382 116.7047672
218 122.8431092 124.1339382
> 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/7h5fb1293576760.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/8h5fb1293576760.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/9h5fb1293576760.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/10sefw1293576760.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/11vfvk1293576760.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/12hfuq1293576760.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/13dpah1293576760.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/14y7q51293576760.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/152qpt1293576760.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/1658ny1293576760.tab")
+ }
>
> try(system("convert tmp/1b3x81293576759.ps tmp/1b3x81293576759.png",intern=TRUE))
character(0)
> try(system("convert tmp/2wmhn1293576760.ps tmp/2wmhn1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wmhn1293576760.ps tmp/3wmhn1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/4wmhn1293576760.ps tmp/4wmhn1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wmhn1293576760.ps tmp/5wmhn1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/6pegr1293576760.ps tmp/6pegr1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/7h5fb1293576760.ps tmp/7h5fb1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/8h5fb1293576760.ps tmp/8h5fb1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/9h5fb1293576760.ps tmp/9h5fb1293576760.png",intern=TRUE))
character(0)
> try(system("convert tmp/10sefw1293576760.ps tmp/10sefw1293576760.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.080 1.820 6.891