R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(20.005
+ ,0
+ ,20.155
+ ,0
+ ,20.005
+ ,0
+ ,19.975
+ ,0
+ ,20.155
+ ,0
+ ,19.510
+ ,0
+ ,19.480
+ ,0
+ ,19.630
+ ,0
+ ,19.940
+ ,0
+ ,20.300
+ ,0
+ ,20.415
+ ,0
+ ,20.395
+ ,0
+ ,19.970
+ ,0
+ ,20.030
+ ,0
+ ,19.960
+ ,0
+ ,19.930
+ ,0
+ ,20.020
+ ,0
+ ,20.220
+ ,0
+ ,20.570
+ ,0
+ ,20.495
+ ,0
+ ,20.565
+ ,0
+ ,20.155
+ ,0
+ ,20.485
+ ,0
+ ,20.375
+ ,0
+ ,20.505
+ ,0
+ ,20.760
+ ,0
+ ,20.760
+ ,0
+ ,20.450
+ ,0
+ ,20.720
+ ,0
+ ,20.420
+ ,0
+ ,20.350
+ ,0
+ ,20.380
+ ,0
+ ,20.280
+ ,0
+ ,20.410
+ ,0
+ ,20.620
+ ,0
+ ,20.875
+ ,0
+ ,20.430
+ ,0
+ ,20.310
+ ,0
+ ,19.020
+ ,0
+ ,19.300
+ ,0
+ ,19.340
+ ,0
+ ,19.320
+ ,0
+ ,19.240
+ ,0
+ ,19.060
+ ,0
+ ,18.410
+ ,0
+ ,18.350
+ ,0
+ ,18.550
+ ,0
+ ,18.560
+ ,0
+ ,18.750
+ ,0
+ ,18.820
+ ,0
+ ,18.550
+ ,0
+ ,18.910
+ ,0
+ ,18.810
+ ,0
+ ,18.690
+ ,0
+ ,18.930
+ ,0
+ ,18.620
+ ,0
+ ,19.170
+ ,0
+ ,19.000
+ ,0
+ ,18.570
+ ,0
+ ,18.570
+ ,0
+ ,18.470
+ ,0
+ ,18.390
+ ,0
+ ,18.190
+ ,0
+ ,18.300
+ ,0
+ ,18.310
+ ,0
+ ,17.920
+ ,0
+ ,17.980
+ ,0
+ ,18.220
+ ,0
+ ,18.180
+ ,0
+ ,18.300
+ ,0
+ ,18.455
+ ,0
+ ,18.210
+ ,0
+ ,17.975
+ ,0
+ ,17.960
+ ,0
+ ,18.380
+ ,0
+ ,18.720
+ ,0
+ ,18.650
+ ,0
+ ,18.885
+ ,0
+ ,18.915
+ ,0
+ ,18.860
+ ,0
+ ,18.870
+ ,0
+ ,18.835
+ ,0
+ ,18.295
+ ,0
+ ,18.450
+ ,0
+ ,18.240
+ ,0
+ ,18.450
+ ,0
+ ,18.440
+ ,0
+ ,18.280
+ ,0
+ ,18.200
+ ,0
+ ,18.200
+ ,0
+ ,18.380
+ ,0
+ ,18.320
+ ,0
+ ,18.160
+ ,0
+ ,18.140
+ ,0
+ ,18.100
+ ,0
+ ,18.180
+ ,0
+ ,18.330
+ ,0
+ ,18.370
+ ,0
+ ,18.550
+ ,0
+ ,18.600
+ ,0
+ ,18.740
+ ,0
+ ,18.380
+ ,0
+ ,18.330
+ ,0
+ ,18.290
+ ,0
+ ,18.810
+ ,0
+ ,18.960
+ ,0
+ ,18.950
+ ,0
+ ,19.090
+ ,0
+ ,19.050
+ ,0
+ ,19.070
+ ,0
+ ,18.930
+ ,0
+ ,19.000
+ ,0
+ ,18.920
+ ,0
+ ,19.060
+ ,0
+ ,19.330
+ ,0
+ ,19.420
+ ,0
+ ,19.720
+ ,0
+ ,19.690
+ ,0
+ ,19.570
+ ,0
+ ,19.500
+ ,0
+ ,19.680
+ ,0
+ ,19.120
+ ,0
+ ,19.050
+ ,0
+ ,19.080
+ ,0
+ ,19.030
+ ,0
+ ,19.000
+ ,0
+ ,18.860
+ ,0
+ ,18.800
+ ,0
+ ,18.810
+ ,0
+ ,18.890
+ ,0
+ ,18.370
+ ,0
+ ,18.405
+ ,0
+ ,18.350
+ ,0
+ ,18.360
+ ,0
+ ,18.445
+ ,0
+ ,17.520
+ ,0
+ ,17.760
+ ,0
+ ,17.980
+ ,0
+ ,17.380
+ ,0
+ ,17.280
+ ,0
+ ,17.650
+ ,0
+ ,17.875
+ ,0
+ ,18.010
+ ,0
+ ,17.935
+ ,0
+ ,17.925
+ ,0
+ ,18.225
+ ,0
+ ,18.130
+ ,0
+ ,18.270
+ ,0
+ ,18.265
+ ,0
+ ,17.920
+ ,0
+ ,17.900
+ ,0
+ ,17.985
+ ,0
+ ,17.985
+ ,0
+ ,18.240
+ ,0
+ ,18.110
+ ,0
+ ,17.630
+ ,0
+ ,17.160
+ ,0
+ ,17.290
+ ,0
+ ,17.630
+ ,0
+ ,17.590
+ ,0
+ ,17.730
+ ,0
+ ,19.280
+ ,0
+ ,19.010
+ ,0
+ ,19.300
+ ,0
+ ,19.510
+ ,0
+ ,19.530
+ ,0
+ ,19.480
+ ,0
+ ,19.265
+ ,0
+ ,19.700
+ ,0
+ ,20.125
+ ,0
+ ,19.985
+ ,1
+ ,20.085
+ ,1
+ ,19.545
+ ,1
+ ,19.875
+ ,1
+ ,20.050
+ ,1
+ ,21.735
+ ,1
+ ,20.865
+ ,1
+ ,21.820
+ ,1
+ ,20.550
+ ,1
+ ,20.160
+ ,1
+ ,20.080
+ ,1
+ ,20.050
+ ,1
+ ,19.260
+ ,1
+ ,19.280
+ ,1
+ ,19.100
+ ,1
+ ,18.955
+ ,1
+ ,18.265
+ ,1
+ ,17.760
+ ,1
+ ,18.760
+ ,1
+ ,19.280
+ ,1
+ ,18.920
+ ,1
+ ,18.950
+ ,1
+ ,18.490
+ ,1
+ ,18.470
+ ,1
+ ,18.570
+ ,1
+ ,18.900
+ ,1
+ ,18.485
+ ,1
+ ,18.635
+ ,1
+ ,18.865
+ ,1
+ ,18.860
+ ,1
+ ,18.400
+ ,1
+ ,18.515
+ ,1
+ ,18.950
+ ,1
+ ,18.830
+ ,1
+ ,18.840
+ ,1
+ ,19.200
+ ,1
+ ,19.340
+ ,1)
+ ,dim=c(2
+ ,207)
+ ,dimnames=list(c('goudprijs'
+ ,'dummy')
+ ,1:207))
> y <- array(NA,dim=c(2,207),dimnames=list(c('goudprijs','dummy'),1:207))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> 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
goudprijs dummy
1 20.005 0
2 20.155 0
3 20.005 0
4 19.975 0
5 20.155 0
6 19.510 0
7 19.480 0
8 19.630 0
9 19.940 0
10 20.300 0
11 20.415 0
12 20.395 0
13 19.970 0
14 20.030 0
15 19.960 0
16 19.930 0
17 20.020 0
18 20.220 0
19 20.570 0
20 20.495 0
21 20.565 0
22 20.155 0
23 20.485 0
24 20.375 0
25 20.505 0
26 20.760 0
27 20.760 0
28 20.450 0
29 20.720 0
30 20.420 0
31 20.350 0
32 20.380 0
33 20.280 0
34 20.410 0
35 20.620 0
36 20.875 0
37 20.430 0
38 20.310 0
39 19.020 0
40 19.300 0
41 19.340 0
42 19.320 0
43 19.240 0
44 19.060 0
45 18.410 0
46 18.350 0
47 18.550 0
48 18.560 0
49 18.750 0
50 18.820 0
51 18.550 0
52 18.910 0
53 18.810 0
54 18.690 0
55 18.930 0
56 18.620 0
57 19.170 0
58 19.000 0
59 18.570 0
60 18.570 0
61 18.470 0
62 18.390 0
63 18.190 0
64 18.300 0
65 18.310 0
66 17.920 0
67 17.980 0
68 18.220 0
69 18.180 0
70 18.300 0
71 18.455 0
72 18.210 0
73 17.975 0
74 17.960 0
75 18.380 0
76 18.720 0
77 18.650 0
78 18.885 0
79 18.915 0
80 18.860 0
81 18.870 0
82 18.835 0
83 18.295 0
84 18.450 0
85 18.240 0
86 18.450 0
87 18.440 0
88 18.280 0
89 18.200 0
90 18.200 0
91 18.380 0
92 18.320 0
93 18.160 0
94 18.140 0
95 18.100 0
96 18.180 0
97 18.330 0
98 18.370 0
99 18.550 0
100 18.600 0
101 18.740 0
102 18.380 0
103 18.330 0
104 18.290 0
105 18.810 0
106 18.960 0
107 18.950 0
108 19.090 0
109 19.050 0
110 19.070 0
111 18.930 0
112 19.000 0
113 18.920 0
114 19.060 0
115 19.330 0
116 19.420 0
117 19.720 0
118 19.690 0
119 19.570 0
120 19.500 0
121 19.680 0
122 19.120 0
123 19.050 0
124 19.080 0
125 19.030 0
126 19.000 0
127 18.860 0
128 18.800 0
129 18.810 0
130 18.890 0
131 18.370 0
132 18.405 0
133 18.350 0
134 18.360 0
135 18.445 0
136 17.520 0
137 17.760 0
138 17.980 0
139 17.380 0
140 17.280 0
141 17.650 0
142 17.875 0
143 18.010 0
144 17.935 0
145 17.925 0
146 18.225 0
147 18.130 0
148 18.270 0
149 18.265 0
150 17.920 0
151 17.900 0
152 17.985 0
153 17.985 0
154 18.240 0
155 18.110 0
156 17.630 0
157 17.160 0
158 17.290 0
159 17.630 0
160 17.590 0
161 17.730 0
162 19.280 0
163 19.010 0
164 19.300 0
165 19.510 0
166 19.530 0
167 19.480 0
168 19.265 0
169 19.700 0
170 20.125 0
171 19.985 1
172 20.085 1
173 19.545 1
174 19.875 1
175 20.050 1
176 21.735 1
177 20.865 1
178 21.820 1
179 20.550 1
180 20.160 1
181 20.080 1
182 20.050 1
183 19.260 1
184 19.280 1
185 19.100 1
186 18.955 1
187 18.265 1
188 17.760 1
189 18.760 1
190 19.280 1
191 18.920 1
192 18.950 1
193 18.490 1
194 18.470 1
195 18.570 1
196 18.900 1
197 18.485 1
198 18.635 1
199 18.865 1
200 18.860 1
201 18.400 1
202 18.515 1
203 18.950 1
204 18.830 1
205 18.840 1
206 19.200 1
207 19.340 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dummy
18.9461 0.3695
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.7861 -0.6536 -0.1361 0.6039 2.5043
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 18.94615 0.06831 277.353 <2e-16 ***
dummy 0.36953 0.16157 2.287 0.0232 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.8907 on 205 degrees of freedom
Multiple R-squared: 0.02488, Adjusted R-squared: 0.02012
F-statistic: 5.231 on 1 and 205 DF, p-value: 0.02321
> 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,] 2.117671e-03 4.235341e-03 9.978823e-01
[2,] 1.454517e-02 2.909035e-02 9.854548e-01
[3,] 1.305899e-02 2.611797e-02 9.869410e-01
[4,] 5.586165e-03 1.117233e-02 9.944138e-01
[5,] 1.768270e-03 3.536540e-03 9.982317e-01
[6,] 1.367694e-03 2.735389e-03 9.986323e-01
[7,] 1.362033e-03 2.724067e-03 9.986380e-01
[8,] 1.033276e-03 2.066553e-03 9.989667e-01
[9,] 3.795346e-04 7.590692e-04 9.996205e-01
[10,] 1.358674e-04 2.717348e-04 9.998641e-01
[11,] 4.701493e-05 9.402987e-05 9.999530e-01
[12,] 1.603194e-05 3.206387e-05 9.999840e-01
[13,] 5.297004e-06 1.059401e-05 9.999947e-01
[14,] 2.384815e-06 4.769630e-06 9.999976e-01
[15,] 4.848833e-06 9.697665e-06 9.999952e-01
[16,] 5.185553e-06 1.037111e-05 9.999948e-01
[17,] 6.677744e-06 1.335549e-05 9.999933e-01
[18,] 2.795742e-06 5.591484e-06 9.999972e-01
[19,] 2.441694e-06 4.883387e-06 9.999976e-01
[20,] 1.485587e-06 2.971174e-06 9.999985e-01
[21,] 1.329325e-06 2.658651e-06 9.999987e-01
[22,] 3.313218e-06 6.626436e-06 9.999967e-01
[23,] 6.833482e-06 1.366696e-05 9.999932e-01
[24,] 4.940632e-06 9.881265e-06 9.999951e-01
[25,] 7.908631e-06 1.581726e-05 9.999921e-01
[26,] 5.596110e-06 1.119222e-05 9.999944e-01
[27,] 3.641623e-06 7.283247e-06 9.999964e-01
[28,] 2.524066e-06 5.048132e-06 9.999975e-01
[29,] 1.596521e-06 3.193042e-06 9.999984e-01
[30,] 1.227571e-06 2.455141e-06 9.999988e-01
[31,] 1.660497e-06 3.320994e-06 9.999983e-01
[32,] 6.173414e-06 1.234683e-05 9.999938e-01
[33,] 5.710857e-06 1.142171e-05 9.999943e-01
[34,] 4.752169e-06 9.504339e-06 9.999952e-01
[35,] 1.310180e-04 2.620359e-04 9.998690e-01
[36,] 4.282642e-04 8.565284e-04 9.995717e-01
[37,] 9.687557e-04 1.937511e-03 9.990312e-01
[38,] 1.940359e-03 3.880719e-03 9.980596e-01
[39,] 3.946454e-03 7.892907e-03 9.960535e-01
[40,] 9.591366e-03 1.918273e-02 9.904086e-01
[41,] 6.214101e-02 1.242820e-01 9.378590e-01
[42,] 1.953779e-01 3.907559e-01 8.046221e-01
[43,] 3.240356e-01 6.480713e-01 6.759644e-01
[44,] 4.500213e-01 9.000425e-01 5.499787e-01
[45,] 5.242759e-01 9.514483e-01 4.757241e-01
[46,] 5.766548e-01 8.466903e-01 4.233452e-01
[47,] 6.632537e-01 6.734925e-01 3.367463e-01
[48,] 6.863433e-01 6.273133e-01 3.136567e-01
[49,] 7.153823e-01 5.692353e-01 2.846177e-01
[50,] 7.515896e-01 4.968209e-01 2.484104e-01
[51,] 7.603969e-01 4.792062e-01 2.396031e-01
[52,] 7.928935e-01 4.142129e-01 2.071065e-01
[53,] 7.860072e-01 4.279856e-01 2.139928e-01
[54,] 7.851547e-01 4.296906e-01 2.148453e-01
[55,] 8.127932e-01 3.744136e-01 1.872068e-01
[56,] 8.348100e-01 3.303801e-01 1.651900e-01
[57,] 8.594980e-01 2.810040e-01 1.405020e-01
[58,] 8.840732e-01 2.318536e-01 1.159268e-01
[59,] 9.148730e-01 1.702539e-01 8.512696e-02
[60,] 9.314983e-01 1.370034e-01 6.850172e-02
[61,] 9.435523e-01 1.128953e-01 5.644767e-02
[62,] 9.654153e-01 6.916938e-02 3.458469e-02
[63,] 9.772871e-01 4.542584e-02 2.271292e-02
[64,] 9.813785e-01 3.724291e-02 1.862145e-02
[65,] 9.848945e-01 3.021109e-02 1.510554e-02
[66,] 9.863892e-01 2.722154e-02 1.361077e-02
[67,] 9.863593e-01 2.728145e-02 1.364073e-02
[68,] 9.880721e-01 2.385571e-02 1.192786e-02
[69,] 9.912118e-01 1.757637e-02 8.788187e-03
[70,] 9.934952e-01 1.300953e-02 6.504764e-03
[71,] 9.933308e-01 1.333837e-02 6.669186e-03
[72,] 9.921300e-01 1.573994e-02 7.869972e-03
[73,] 9.908816e-01 1.823675e-02 9.118376e-03
[74,] 9.889667e-01 2.206659e-02 1.103329e-02
[75,] 9.866746e-01 2.665075e-02 1.332538e-02
[76,] 9.840388e-01 3.192244e-02 1.596122e-02
[77,] 9.809375e-01 3.812498e-02 1.906249e-02
[78,] 9.773894e-01 4.522110e-02 2.261055e-02
[79,] 9.770083e-01 4.598347e-02 2.299173e-02
[80,] 9.749113e-01 5.017740e-02 2.508870e-02
[81,] 9.747985e-01 5.040303e-02 2.520151e-02
[82,] 9.722394e-01 5.552123e-02 2.776062e-02
[83,] 9.694386e-01 6.112281e-02 3.056141e-02
[84,] 9.681907e-01 6.361856e-02 3.180928e-02
[85,] 9.678493e-01 6.430142e-02 3.215071e-02
[86,] 9.672891e-01 6.542171e-02 3.271086e-02
[87,] 9.641058e-01 7.178842e-02 3.589421e-02
[88,] 9.613186e-01 7.736280e-02 3.868140e-02
[89,] 9.607539e-01 7.849220e-02 3.924610e-02
[90,] 9.603176e-01 7.936480e-02 3.968240e-02
[91,] 9.603923e-01 7.921534e-02 3.960767e-02
[92,] 9.588326e-01 8.233474e-02 4.116737e-02
[93,] 9.546614e-01 9.067715e-02 4.533857e-02
[94,] 9.494307e-01 1.011387e-01 5.056934e-02
[95,] 9.413013e-01 1.173975e-01 5.869874e-02
[96,] 9.315804e-01 1.368392e-01 6.841960e-02
[97,] 9.195219e-01 1.609561e-01 8.047806e-02
[98,] 9.106349e-01 1.787302e-01 8.936510e-02
[99,] 9.020379e-01 1.959242e-01 9.796208e-02
[100,] 8.937295e-01 2.125409e-01 1.062705e-01
[101,] 8.764354e-01 2.471292e-01 1.235646e-01
[102,] 8.576520e-01 2.846959e-01 1.423480e-01
[103,] 8.370086e-01 3.259827e-01 1.629914e-01
[104,] 8.164952e-01 3.670097e-01 1.835048e-01
[105,] 7.938707e-01 4.122585e-01 2.061293e-01
[106,] 7.702389e-01 4.595222e-01 2.297611e-01
[107,] 7.430864e-01 5.138273e-01 2.569136e-01
[108,] 7.154502e-01 5.690996e-01 2.845498e-01
[109,] 6.854290e-01 6.291420e-01 3.145710e-01
[110,] 6.569276e-01 6.861448e-01 3.430724e-01
[111,] 6.390900e-01 7.218200e-01 3.609100e-01
[112,] 6.274212e-01 7.451576e-01 3.725788e-01
[113,] 6.422938e-01 7.154123e-01 3.577062e-01
[114,] 6.565486e-01 6.869028e-01 3.434514e-01
[115,] 6.619899e-01 6.760202e-01 3.380101e-01
[116,] 6.635840e-01 6.728320e-01 3.364160e-01
[117,] 6.841208e-01 6.317584e-01 3.158792e-01
[118,] 6.651138e-01 6.697724e-01 3.348862e-01
[119,] 6.433706e-01 7.132587e-01 3.566294e-01
[120,] 6.232603e-01 7.534795e-01 3.767397e-01
[121,] 6.013938e-01 7.972124e-01 3.986062e-01
[122,] 5.787184e-01 8.425633e-01 4.212816e-01
[123,] 5.515655e-01 8.968691e-01 4.484345e-01
[124,] 5.231179e-01 9.537643e-01 4.768821e-01
[125,] 4.951482e-01 9.902964e-01 5.048518e-01
[126,] 4.700546e-01 9.401092e-01 5.299454e-01
[127,] 4.430812e-01 8.861623e-01 5.569188e-01
[128,] 4.151856e-01 8.303711e-01 5.848144e-01
[129,] 3.886543e-01 7.773085e-01 6.113457e-01
[130,] 3.620116e-01 7.240233e-01 6.379884e-01
[131,] 3.341709e-01 6.683417e-01 6.658291e-01
[132,] 3.644756e-01 7.289511e-01 6.355244e-01
[133,] 3.696273e-01 7.392546e-01 6.303727e-01
[134,] 3.571915e-01 7.143830e-01 6.428085e-01
[135,] 4.025696e-01 8.051392e-01 5.974304e-01
[136,] 4.630689e-01 9.261378e-01 5.369311e-01
[137,] 4.769303e-01 9.538607e-01 5.230697e-01
[138,] 4.693324e-01 9.386648e-01 5.306676e-01
[139,] 4.514741e-01 9.029483e-01 5.485259e-01
[140,] 4.388559e-01 8.777117e-01 5.611441e-01
[141,] 4.270258e-01 8.540516e-01 5.729742e-01
[142,] 3.971532e-01 7.943065e-01 6.028468e-01
[143,] 3.722428e-01 7.444857e-01 6.277572e-01
[144,] 3.414113e-01 6.828227e-01 6.585887e-01
[145,] 3.116036e-01 6.232071e-01 6.883964e-01
[146,] 3.013322e-01 6.026644e-01 6.986678e-01
[147,] 2.932882e-01 5.865764e-01 7.067118e-01
[148,] 2.802213e-01 5.604426e-01 7.197787e-01
[149,] 2.682537e-01 5.365074e-01 7.317463e-01
[150,] 2.435145e-01 4.870290e-01 7.564855e-01
[151,] 2.266029e-01 4.532058e-01 7.733971e-01
[152,] 2.485918e-01 4.971836e-01 7.514082e-01
[153,] 3.470066e-01 6.940132e-01 6.529934e-01
[154,] 4.531121e-01 9.062243e-01 5.468879e-01
[155,] 5.230936e-01 9.538128e-01 4.769064e-01
[156,] 6.219989e-01 7.560021e-01 3.780011e-01
[157,] 7.181389e-01 5.637222e-01 2.818611e-01
[158,] 6.783458e-01 6.433084e-01 3.216542e-01
[159,] 6.456253e-01 7.087494e-01 3.543747e-01
[160,] 6.037603e-01 7.924795e-01 3.962397e-01
[161,] 5.592207e-01 8.815585e-01 4.407793e-01
[162,] 5.137836e-01 9.724329e-01 4.862164e-01
[163,] 4.683361e-01 9.366721e-01 5.316639e-01
[164,] 4.330833e-01 8.661666e-01 5.669167e-01
[165,] 3.938933e-01 7.877867e-01 6.061067e-01
[166,] 3.598068e-01 7.196136e-01 6.401932e-01
[167,] 3.331261e-01 6.662523e-01 6.668739e-01
[168,] 3.153187e-01 6.306374e-01 6.846813e-01
[169,] 2.739431e-01 5.478861e-01 7.260569e-01
[170,] 2.462039e-01 4.924078e-01 7.537961e-01
[171,] 2.312372e-01 4.624744e-01 7.687628e-01
[172,] 5.636087e-01 8.727827e-01 4.363913e-01
[173,] 7.095529e-01 5.808942e-01 2.904471e-01
[174,] 9.845075e-01 3.098507e-02 1.549254e-02
[175,] 9.970802e-01 5.839678e-03 2.919839e-03
[176,] 9.991911e-01 1.617878e-03 8.089389e-04
[177,] 9.998487e-01 3.026616e-04 1.513308e-04
[178,] 9.999895e-01 2.106648e-05 1.053324e-05
[179,] 9.999877e-01 2.455221e-05 1.227610e-05
[180,] 9.999872e-01 2.553730e-05 1.276865e-05
[181,] 9.999799e-01 4.010567e-05 2.005283e-05
[182,] 9.999605e-01 7.901349e-05 3.950675e-05
[183,] 9.999580e-01 8.405660e-05 4.202830e-05
[184,] 9.999986e-01 2.711868e-06 1.355934e-06
[185,] 9.999959e-01 8.193739e-06 4.096870e-06
[186,] 9.999965e-01 7.086952e-06 3.543476e-06
[187,] 9.999898e-01 2.034788e-05 1.017394e-05
[188,] 9.999731e-01 5.379147e-05 2.689573e-05
[189,] 9.999448e-01 1.104455e-04 5.522275e-05
[190,] 9.998995e-01 2.009421e-04 1.004710e-04
[191,] 9.997643e-01 4.713209e-04 2.356604e-04
[192,] 9.992808e-01 1.438334e-03 7.191670e-04
[193,] 9.987417e-01 2.516643e-03 1.258321e-03
[194,] 9.968854e-01 6.229256e-03 3.114628e-03
[195,] 9.906195e-01 1.876100e-02 9.380499e-03
[196,] 9.736046e-01 5.279077e-02 2.639539e-02
[197,] 9.702083e-01 5.958331e-02 2.979166e-02
[198,] 9.679544e-01 6.409114e-02 3.204557e-02
> postscript(file="/var/www/html/rcomp/tmp/13fsz1227533800.ps",horizontal=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/html/rcomp/tmp/2ezbe1227533800.ps",horizontal=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/html/rcomp/tmp/3d3az1227533800.ps",horizontal=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/html/rcomp/tmp/41hzj1227533800.ps",horizontal=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/html/rcomp/tmp/5azj91227533800.ps",horizontal=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 = 207
Frequency = 1
1 2 3 4 5 6
1.058852941 1.208852941 1.058852941 1.028852941 1.208852941 0.563852941
7 8 9 10 11 12
0.533852941 0.683852941 0.993852941 1.353852941 1.468852941 1.448852941
13 14 15 16 17 18
1.023852941 1.083852941 1.013852941 0.983852941 1.073852941 1.273852941
19 20 21 22 23 24
1.623852941 1.548852941 1.618852941 1.208852941 1.538852941 1.428852941
25 26 27 28 29 30
1.558852941 1.813852941 1.813852941 1.503852941 1.773852941 1.473852941
31 32 33 34 35 36
1.403852941 1.433852941 1.333852941 1.463852941 1.673852941 1.928852941
37 38 39 40 41 42
1.483852941 1.363852941 0.073852941 0.353852941 0.393852941 0.373852941
43 44 45 46 47 48
0.293852941 0.113852941 -0.536147059 -0.596147059 -0.396147059 -0.386147059
49 50 51 52 53 54
-0.196147059 -0.126147059 -0.396147059 -0.036147059 -0.136147059 -0.256147059
55 56 57 58 59 60
-0.016147059 -0.326147059 0.223852941 0.053852941 -0.376147059 -0.376147059
61 62 63 64 65 66
-0.476147059 -0.556147059 -0.756147059 -0.646147059 -0.636147059 -1.026147059
67 68 69 70 71 72
-0.966147059 -0.726147059 -0.766147059 -0.646147059 -0.491147059 -0.736147059
73 74 75 76 77 78
-0.971147059 -0.986147059 -0.566147059 -0.226147059 -0.296147059 -0.061147059
79 80 81 82 83 84
-0.031147059 -0.086147059 -0.076147059 -0.111147059 -0.651147059 -0.496147059
85 86 87 88 89 90
-0.706147059 -0.496147059 -0.506147059 -0.666147059 -0.746147059 -0.746147059
91 92 93 94 95 96
-0.566147059 -0.626147059 -0.786147059 -0.806147059 -0.846147059 -0.766147059
97 98 99 100 101 102
-0.616147059 -0.576147059 -0.396147059 -0.346147059 -0.206147059 -0.566147059
103 104 105 106 107 108
-0.616147059 -0.656147059 -0.136147059 0.013852941 0.003852941 0.143852941
109 110 111 112 113 114
0.103852941 0.123852941 -0.016147059 0.053852941 -0.026147059 0.113852941
115 116 117 118 119 120
0.383852941 0.473852941 0.773852941 0.743852941 0.623852941 0.553852941
121 122 123 124 125 126
0.733852941 0.173852941 0.103852941 0.133852941 0.083852941 0.053852941
127 128 129 130 131 132
-0.086147059 -0.146147059 -0.136147059 -0.056147059 -0.576147059 -0.541147059
133 134 135 136 137 138
-0.596147059 -0.586147059 -0.501147059 -1.426147059 -1.186147059 -0.966147059
139 140 141 142 143 144
-1.566147059 -1.666147059 -1.296147059 -1.071147059 -0.936147059 -1.011147059
145 146 147 148 149 150
-1.021147059 -0.721147059 -0.816147059 -0.676147059 -0.681147059 -1.026147059
151 152 153 154 155 156
-1.046147059 -0.961147059 -0.961147059 -0.706147059 -0.836147059 -1.316147059
157 158 159 160 161 162
-1.786147059 -1.656147059 -1.316147059 -1.356147059 -1.216147059 0.333852941
163 164 165 166 167 168
0.063852941 0.353852941 0.563852941 0.583852941 0.533852941 0.318852941
169 170 171 172 173 174
0.753852941 1.178852941 0.669324324 0.769324324 0.229324324 0.559324324
175 176 177 178 179 180
0.734324324 2.419324324 1.549324324 2.504324324 1.234324324 0.844324324
181 182 183 184 185 186
0.764324324 0.734324324 -0.055675676 -0.035675676 -0.215675676 -0.360675676
187 188 189 190 191 192
-1.050675676 -1.555675676 -0.555675676 -0.035675676 -0.395675676 -0.365675676
193 194 195 196 197 198
-0.825675676 -0.845675676 -0.745675676 -0.415675676 -0.830675676 -0.680675676
199 200 201 202 203 204
-0.450675676 -0.455675676 -0.915675676 -0.800675676 -0.365675676 -0.485675676
205 206 207
-0.475675676 -0.115675676 0.024324324
> postscript(file="/var/www/html/rcomp/tmp/682p21227533800.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 207
Frequency = 1
lag(myerror, k = 1) myerror
0 1.058852941 NA
1 1.208852941 1.058852941
2 1.058852941 1.208852941
3 1.028852941 1.058852941
4 1.208852941 1.028852941
5 0.563852941 1.208852941
6 0.533852941 0.563852941
7 0.683852941 0.533852941
8 0.993852941 0.683852941
9 1.353852941 0.993852941
10 1.468852941 1.353852941
11 1.448852941 1.468852941
12 1.023852941 1.448852941
13 1.083852941 1.023852941
14 1.013852941 1.083852941
15 0.983852941 1.013852941
16 1.073852941 0.983852941
17 1.273852941 1.073852941
18 1.623852941 1.273852941
19 1.548852941 1.623852941
20 1.618852941 1.548852941
21 1.208852941 1.618852941
22 1.538852941 1.208852941
23 1.428852941 1.538852941
24 1.558852941 1.428852941
25 1.813852941 1.558852941
26 1.813852941 1.813852941
27 1.503852941 1.813852941
28 1.773852941 1.503852941
29 1.473852941 1.773852941
30 1.403852941 1.473852941
31 1.433852941 1.403852941
32 1.333852941 1.433852941
33 1.463852941 1.333852941
34 1.673852941 1.463852941
35 1.928852941 1.673852941
36 1.483852941 1.928852941
37 1.363852941 1.483852941
38 0.073852941 1.363852941
39 0.353852941 0.073852941
40 0.393852941 0.353852941
41 0.373852941 0.393852941
42 0.293852941 0.373852941
43 0.113852941 0.293852941
44 -0.536147059 0.113852941
45 -0.596147059 -0.536147059
46 -0.396147059 -0.596147059
47 -0.386147059 -0.396147059
48 -0.196147059 -0.386147059
49 -0.126147059 -0.196147059
50 -0.396147059 -0.126147059
51 -0.036147059 -0.396147059
52 -0.136147059 -0.036147059
53 -0.256147059 -0.136147059
54 -0.016147059 -0.256147059
55 -0.326147059 -0.016147059
56 0.223852941 -0.326147059
57 0.053852941 0.223852941
58 -0.376147059 0.053852941
59 -0.376147059 -0.376147059
60 -0.476147059 -0.376147059
61 -0.556147059 -0.476147059
62 -0.756147059 -0.556147059
63 -0.646147059 -0.756147059
64 -0.636147059 -0.646147059
65 -1.026147059 -0.636147059
66 -0.966147059 -1.026147059
67 -0.726147059 -0.966147059
68 -0.766147059 -0.726147059
69 -0.646147059 -0.766147059
70 -0.491147059 -0.646147059
71 -0.736147059 -0.491147059
72 -0.971147059 -0.736147059
73 -0.986147059 -0.971147059
74 -0.566147059 -0.986147059
75 -0.226147059 -0.566147059
76 -0.296147059 -0.226147059
77 -0.061147059 -0.296147059
78 -0.031147059 -0.061147059
79 -0.086147059 -0.031147059
80 -0.076147059 -0.086147059
81 -0.111147059 -0.076147059
82 -0.651147059 -0.111147059
83 -0.496147059 -0.651147059
84 -0.706147059 -0.496147059
85 -0.496147059 -0.706147059
86 -0.506147059 -0.496147059
87 -0.666147059 -0.506147059
88 -0.746147059 -0.666147059
89 -0.746147059 -0.746147059
90 -0.566147059 -0.746147059
91 -0.626147059 -0.566147059
92 -0.786147059 -0.626147059
93 -0.806147059 -0.786147059
94 -0.846147059 -0.806147059
95 -0.766147059 -0.846147059
96 -0.616147059 -0.766147059
97 -0.576147059 -0.616147059
98 -0.396147059 -0.576147059
99 -0.346147059 -0.396147059
100 -0.206147059 -0.346147059
101 -0.566147059 -0.206147059
102 -0.616147059 -0.566147059
103 -0.656147059 -0.616147059
104 -0.136147059 -0.656147059
105 0.013852941 -0.136147059
106 0.003852941 0.013852941
107 0.143852941 0.003852941
108 0.103852941 0.143852941
109 0.123852941 0.103852941
110 -0.016147059 0.123852941
111 0.053852941 -0.016147059
112 -0.026147059 0.053852941
113 0.113852941 -0.026147059
114 0.383852941 0.113852941
115 0.473852941 0.383852941
116 0.773852941 0.473852941
117 0.743852941 0.773852941
118 0.623852941 0.743852941
119 0.553852941 0.623852941
120 0.733852941 0.553852941
121 0.173852941 0.733852941
122 0.103852941 0.173852941
123 0.133852941 0.103852941
124 0.083852941 0.133852941
125 0.053852941 0.083852941
126 -0.086147059 0.053852941
127 -0.146147059 -0.086147059
128 -0.136147059 -0.146147059
129 -0.056147059 -0.136147059
130 -0.576147059 -0.056147059
131 -0.541147059 -0.576147059
132 -0.596147059 -0.541147059
133 -0.586147059 -0.596147059
134 -0.501147059 -0.586147059
135 -1.426147059 -0.501147059
136 -1.186147059 -1.426147059
137 -0.966147059 -1.186147059
138 -1.566147059 -0.966147059
139 -1.666147059 -1.566147059
140 -1.296147059 -1.666147059
141 -1.071147059 -1.296147059
142 -0.936147059 -1.071147059
143 -1.011147059 -0.936147059
144 -1.021147059 -1.011147059
145 -0.721147059 -1.021147059
146 -0.816147059 -0.721147059
147 -0.676147059 -0.816147059
148 -0.681147059 -0.676147059
149 -1.026147059 -0.681147059
150 -1.046147059 -1.026147059
151 -0.961147059 -1.046147059
152 -0.961147059 -0.961147059
153 -0.706147059 -0.961147059
154 -0.836147059 -0.706147059
155 -1.316147059 -0.836147059
156 -1.786147059 -1.316147059
157 -1.656147059 -1.786147059
158 -1.316147059 -1.656147059
159 -1.356147059 -1.316147059
160 -1.216147059 -1.356147059
161 0.333852941 -1.216147059
162 0.063852941 0.333852941
163 0.353852941 0.063852941
164 0.563852941 0.353852941
165 0.583852941 0.563852941
166 0.533852941 0.583852941
167 0.318852941 0.533852941
168 0.753852941 0.318852941
169 1.178852941 0.753852941
170 0.669324324 1.178852941
171 0.769324324 0.669324324
172 0.229324324 0.769324324
173 0.559324324 0.229324324
174 0.734324324 0.559324324
175 2.419324324 0.734324324
176 1.549324324 2.419324324
177 2.504324324 1.549324324
178 1.234324324 2.504324324
179 0.844324324 1.234324324
180 0.764324324 0.844324324
181 0.734324324 0.764324324
182 -0.055675676 0.734324324
183 -0.035675676 -0.055675676
184 -0.215675676 -0.035675676
185 -0.360675676 -0.215675676
186 -1.050675676 -0.360675676
187 -1.555675676 -1.050675676
188 -0.555675676 -1.555675676
189 -0.035675676 -0.555675676
190 -0.395675676 -0.035675676
191 -0.365675676 -0.395675676
192 -0.825675676 -0.365675676
193 -0.845675676 -0.825675676
194 -0.745675676 -0.845675676
195 -0.415675676 -0.745675676
196 -0.830675676 -0.415675676
197 -0.680675676 -0.830675676
198 -0.450675676 -0.680675676
199 -0.455675676 -0.450675676
200 -0.915675676 -0.455675676
201 -0.800675676 -0.915675676
202 -0.365675676 -0.800675676
203 -0.485675676 -0.365675676
204 -0.475675676 -0.485675676
205 -0.115675676 -0.475675676
206 0.024324324 -0.115675676
207 NA 0.024324324
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.208852941 1.058852941
[2,] 1.058852941 1.208852941
[3,] 1.028852941 1.058852941
[4,] 1.208852941 1.028852941
[5,] 0.563852941 1.208852941
[6,] 0.533852941 0.563852941
[7,] 0.683852941 0.533852941
[8,] 0.993852941 0.683852941
[9,] 1.353852941 0.993852941
[10,] 1.468852941 1.353852941
[11,] 1.448852941 1.468852941
[12,] 1.023852941 1.448852941
[13,] 1.083852941 1.023852941
[14,] 1.013852941 1.083852941
[15,] 0.983852941 1.013852941
[16,] 1.073852941 0.983852941
[17,] 1.273852941 1.073852941
[18,] 1.623852941 1.273852941
[19,] 1.548852941 1.623852941
[20,] 1.618852941 1.548852941
[21,] 1.208852941 1.618852941
[22,] 1.538852941 1.208852941
[23,] 1.428852941 1.538852941
[24,] 1.558852941 1.428852941
[25,] 1.813852941 1.558852941
[26,] 1.813852941 1.813852941
[27,] 1.503852941 1.813852941
[28,] 1.773852941 1.503852941
[29,] 1.473852941 1.773852941
[30,] 1.403852941 1.473852941
[31,] 1.433852941 1.403852941
[32,] 1.333852941 1.433852941
[33,] 1.463852941 1.333852941
[34,] 1.673852941 1.463852941
[35,] 1.928852941 1.673852941
[36,] 1.483852941 1.928852941
[37,] 1.363852941 1.483852941
[38,] 0.073852941 1.363852941
[39,] 0.353852941 0.073852941
[40,] 0.393852941 0.353852941
[41,] 0.373852941 0.393852941
[42,] 0.293852941 0.373852941
[43,] 0.113852941 0.293852941
[44,] -0.536147059 0.113852941
[45,] -0.596147059 -0.536147059
[46,] -0.396147059 -0.596147059
[47,] -0.386147059 -0.396147059
[48,] -0.196147059 -0.386147059
[49,] -0.126147059 -0.196147059
[50,] -0.396147059 -0.126147059
[51,] -0.036147059 -0.396147059
[52,] -0.136147059 -0.036147059
[53,] -0.256147059 -0.136147059
[54,] -0.016147059 -0.256147059
[55,] -0.326147059 -0.016147059
[56,] 0.223852941 -0.326147059
[57,] 0.053852941 0.223852941
[58,] -0.376147059 0.053852941
[59,] -0.376147059 -0.376147059
[60,] -0.476147059 -0.376147059
[61,] -0.556147059 -0.476147059
[62,] -0.756147059 -0.556147059
[63,] -0.646147059 -0.756147059
[64,] -0.636147059 -0.646147059
[65,] -1.026147059 -0.636147059
[66,] -0.966147059 -1.026147059
[67,] -0.726147059 -0.966147059
[68,] -0.766147059 -0.726147059
[69,] -0.646147059 -0.766147059
[70,] -0.491147059 -0.646147059
[71,] -0.736147059 -0.491147059
[72,] -0.971147059 -0.736147059
[73,] -0.986147059 -0.971147059
[74,] -0.566147059 -0.986147059
[75,] -0.226147059 -0.566147059
[76,] -0.296147059 -0.226147059
[77,] -0.061147059 -0.296147059
[78,] -0.031147059 -0.061147059
[79,] -0.086147059 -0.031147059
[80,] -0.076147059 -0.086147059
[81,] -0.111147059 -0.076147059
[82,] -0.651147059 -0.111147059
[83,] -0.496147059 -0.651147059
[84,] -0.706147059 -0.496147059
[85,] -0.496147059 -0.706147059
[86,] -0.506147059 -0.496147059
[87,] -0.666147059 -0.506147059
[88,] -0.746147059 -0.666147059
[89,] -0.746147059 -0.746147059
[90,] -0.566147059 -0.746147059
[91,] -0.626147059 -0.566147059
[92,] -0.786147059 -0.626147059
[93,] -0.806147059 -0.786147059
[94,] -0.846147059 -0.806147059
[95,] -0.766147059 -0.846147059
[96,] -0.616147059 -0.766147059
[97,] -0.576147059 -0.616147059
[98,] -0.396147059 -0.576147059
[99,] -0.346147059 -0.396147059
[100,] -0.206147059 -0.346147059
[101,] -0.566147059 -0.206147059
[102,] -0.616147059 -0.566147059
[103,] -0.656147059 -0.616147059
[104,] -0.136147059 -0.656147059
[105,] 0.013852941 -0.136147059
[106,] 0.003852941 0.013852941
[107,] 0.143852941 0.003852941
[108,] 0.103852941 0.143852941
[109,] 0.123852941 0.103852941
[110,] -0.016147059 0.123852941
[111,] 0.053852941 -0.016147059
[112,] -0.026147059 0.053852941
[113,] 0.113852941 -0.026147059
[114,] 0.383852941 0.113852941
[115,] 0.473852941 0.383852941
[116,] 0.773852941 0.473852941
[117,] 0.743852941 0.773852941
[118,] 0.623852941 0.743852941
[119,] 0.553852941 0.623852941
[120,] 0.733852941 0.553852941
[121,] 0.173852941 0.733852941
[122,] 0.103852941 0.173852941
[123,] 0.133852941 0.103852941
[124,] 0.083852941 0.133852941
[125,] 0.053852941 0.083852941
[126,] -0.086147059 0.053852941
[127,] -0.146147059 -0.086147059
[128,] -0.136147059 -0.146147059
[129,] -0.056147059 -0.136147059
[130,] -0.576147059 -0.056147059
[131,] -0.541147059 -0.576147059
[132,] -0.596147059 -0.541147059
[133,] -0.586147059 -0.596147059
[134,] -0.501147059 -0.586147059
[135,] -1.426147059 -0.501147059
[136,] -1.186147059 -1.426147059
[137,] -0.966147059 -1.186147059
[138,] -1.566147059 -0.966147059
[139,] -1.666147059 -1.566147059
[140,] -1.296147059 -1.666147059
[141,] -1.071147059 -1.296147059
[142,] -0.936147059 -1.071147059
[143,] -1.011147059 -0.936147059
[144,] -1.021147059 -1.011147059
[145,] -0.721147059 -1.021147059
[146,] -0.816147059 -0.721147059
[147,] -0.676147059 -0.816147059
[148,] -0.681147059 -0.676147059
[149,] -1.026147059 -0.681147059
[150,] -1.046147059 -1.026147059
[151,] -0.961147059 -1.046147059
[152,] -0.961147059 -0.961147059
[153,] -0.706147059 -0.961147059
[154,] -0.836147059 -0.706147059
[155,] -1.316147059 -0.836147059
[156,] -1.786147059 -1.316147059
[157,] -1.656147059 -1.786147059
[158,] -1.316147059 -1.656147059
[159,] -1.356147059 -1.316147059
[160,] -1.216147059 -1.356147059
[161,] 0.333852941 -1.216147059
[162,] 0.063852941 0.333852941
[163,] 0.353852941 0.063852941
[164,] 0.563852941 0.353852941
[165,] 0.583852941 0.563852941
[166,] 0.533852941 0.583852941
[167,] 0.318852941 0.533852941
[168,] 0.753852941 0.318852941
[169,] 1.178852941 0.753852941
[170,] 0.669324324 1.178852941
[171,] 0.769324324 0.669324324
[172,] 0.229324324 0.769324324
[173,] 0.559324324 0.229324324
[174,] 0.734324324 0.559324324
[175,] 2.419324324 0.734324324
[176,] 1.549324324 2.419324324
[177,] 2.504324324 1.549324324
[178,] 1.234324324 2.504324324
[179,] 0.844324324 1.234324324
[180,] 0.764324324 0.844324324
[181,] 0.734324324 0.764324324
[182,] -0.055675676 0.734324324
[183,] -0.035675676 -0.055675676
[184,] -0.215675676 -0.035675676
[185,] -0.360675676 -0.215675676
[186,] -1.050675676 -0.360675676
[187,] -1.555675676 -1.050675676
[188,] -0.555675676 -1.555675676
[189,] -0.035675676 -0.555675676
[190,] -0.395675676 -0.035675676
[191,] -0.365675676 -0.395675676
[192,] -0.825675676 -0.365675676
[193,] -0.845675676 -0.825675676
[194,] -0.745675676 -0.845675676
[195,] -0.415675676 -0.745675676
[196,] -0.830675676 -0.415675676
[197,] -0.680675676 -0.830675676
[198,] -0.450675676 -0.680675676
[199,] -0.455675676 -0.450675676
[200,] -0.915675676 -0.455675676
[201,] -0.800675676 -0.915675676
[202,] -0.365675676 -0.800675676
[203,] -0.485675676 -0.365675676
[204,] -0.475675676 -0.485675676
[205,] -0.115675676 -0.475675676
[206,] 0.024324324 -0.115675676
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.208852941 1.058852941
2 1.058852941 1.208852941
3 1.028852941 1.058852941
4 1.208852941 1.028852941
5 0.563852941 1.208852941
6 0.533852941 0.563852941
7 0.683852941 0.533852941
8 0.993852941 0.683852941
9 1.353852941 0.993852941
10 1.468852941 1.353852941
11 1.448852941 1.468852941
12 1.023852941 1.448852941
13 1.083852941 1.023852941
14 1.013852941 1.083852941
15 0.983852941 1.013852941
16 1.073852941 0.983852941
17 1.273852941 1.073852941
18 1.623852941 1.273852941
19 1.548852941 1.623852941
20 1.618852941 1.548852941
21 1.208852941 1.618852941
22 1.538852941 1.208852941
23 1.428852941 1.538852941
24 1.558852941 1.428852941
25 1.813852941 1.558852941
26 1.813852941 1.813852941
27 1.503852941 1.813852941
28 1.773852941 1.503852941
29 1.473852941 1.773852941
30 1.403852941 1.473852941
31 1.433852941 1.403852941
32 1.333852941 1.433852941
33 1.463852941 1.333852941
34 1.673852941 1.463852941
35 1.928852941 1.673852941
36 1.483852941 1.928852941
37 1.363852941 1.483852941
38 0.073852941 1.363852941
39 0.353852941 0.073852941
40 0.393852941 0.353852941
41 0.373852941 0.393852941
42 0.293852941 0.373852941
43 0.113852941 0.293852941
44 -0.536147059 0.113852941
45 -0.596147059 -0.536147059
46 -0.396147059 -0.596147059
47 -0.386147059 -0.396147059
48 -0.196147059 -0.386147059
49 -0.126147059 -0.196147059
50 -0.396147059 -0.126147059
51 -0.036147059 -0.396147059
52 -0.136147059 -0.036147059
53 -0.256147059 -0.136147059
54 -0.016147059 -0.256147059
55 -0.326147059 -0.016147059
56 0.223852941 -0.326147059
57 0.053852941 0.223852941
58 -0.376147059 0.053852941
59 -0.376147059 -0.376147059
60 -0.476147059 -0.376147059
61 -0.556147059 -0.476147059
62 -0.756147059 -0.556147059
63 -0.646147059 -0.756147059
64 -0.636147059 -0.646147059
65 -1.026147059 -0.636147059
66 -0.966147059 -1.026147059
67 -0.726147059 -0.966147059
68 -0.766147059 -0.726147059
69 -0.646147059 -0.766147059
70 -0.491147059 -0.646147059
71 -0.736147059 -0.491147059
72 -0.971147059 -0.736147059
73 -0.986147059 -0.971147059
74 -0.566147059 -0.986147059
75 -0.226147059 -0.566147059
76 -0.296147059 -0.226147059
77 -0.061147059 -0.296147059
78 -0.031147059 -0.061147059
79 -0.086147059 -0.031147059
80 -0.076147059 -0.086147059
81 -0.111147059 -0.076147059
82 -0.651147059 -0.111147059
83 -0.496147059 -0.651147059
84 -0.706147059 -0.496147059
85 -0.496147059 -0.706147059
86 -0.506147059 -0.496147059
87 -0.666147059 -0.506147059
88 -0.746147059 -0.666147059
89 -0.746147059 -0.746147059
90 -0.566147059 -0.746147059
91 -0.626147059 -0.566147059
92 -0.786147059 -0.626147059
93 -0.806147059 -0.786147059
94 -0.846147059 -0.806147059
95 -0.766147059 -0.846147059
96 -0.616147059 -0.766147059
97 -0.576147059 -0.616147059
98 -0.396147059 -0.576147059
99 -0.346147059 -0.396147059
100 -0.206147059 -0.346147059
101 -0.566147059 -0.206147059
102 -0.616147059 -0.566147059
103 -0.656147059 -0.616147059
104 -0.136147059 -0.656147059
105 0.013852941 -0.136147059
106 0.003852941 0.013852941
107 0.143852941 0.003852941
108 0.103852941 0.143852941
109 0.123852941 0.103852941
110 -0.016147059 0.123852941
111 0.053852941 -0.016147059
112 -0.026147059 0.053852941
113 0.113852941 -0.026147059
114 0.383852941 0.113852941
115 0.473852941 0.383852941
116 0.773852941 0.473852941
117 0.743852941 0.773852941
118 0.623852941 0.743852941
119 0.553852941 0.623852941
120 0.733852941 0.553852941
121 0.173852941 0.733852941
122 0.103852941 0.173852941
123 0.133852941 0.103852941
124 0.083852941 0.133852941
125 0.053852941 0.083852941
126 -0.086147059 0.053852941
127 -0.146147059 -0.086147059
128 -0.136147059 -0.146147059
129 -0.056147059 -0.136147059
130 -0.576147059 -0.056147059
131 -0.541147059 -0.576147059
132 -0.596147059 -0.541147059
133 -0.586147059 -0.596147059
134 -0.501147059 -0.586147059
135 -1.426147059 -0.501147059
136 -1.186147059 -1.426147059
137 -0.966147059 -1.186147059
138 -1.566147059 -0.966147059
139 -1.666147059 -1.566147059
140 -1.296147059 -1.666147059
141 -1.071147059 -1.296147059
142 -0.936147059 -1.071147059
143 -1.011147059 -0.936147059
144 -1.021147059 -1.011147059
145 -0.721147059 -1.021147059
146 -0.816147059 -0.721147059
147 -0.676147059 -0.816147059
148 -0.681147059 -0.676147059
149 -1.026147059 -0.681147059
150 -1.046147059 -1.026147059
151 -0.961147059 -1.046147059
152 -0.961147059 -0.961147059
153 -0.706147059 -0.961147059
154 -0.836147059 -0.706147059
155 -1.316147059 -0.836147059
156 -1.786147059 -1.316147059
157 -1.656147059 -1.786147059
158 -1.316147059 -1.656147059
159 -1.356147059 -1.316147059
160 -1.216147059 -1.356147059
161 0.333852941 -1.216147059
162 0.063852941 0.333852941
163 0.353852941 0.063852941
164 0.563852941 0.353852941
165 0.583852941 0.563852941
166 0.533852941 0.583852941
167 0.318852941 0.533852941
168 0.753852941 0.318852941
169 1.178852941 0.753852941
170 0.669324324 1.178852941
171 0.769324324 0.669324324
172 0.229324324 0.769324324
173 0.559324324 0.229324324
174 0.734324324 0.559324324
175 2.419324324 0.734324324
176 1.549324324 2.419324324
177 2.504324324 1.549324324
178 1.234324324 2.504324324
179 0.844324324 1.234324324
180 0.764324324 0.844324324
181 0.734324324 0.764324324
182 -0.055675676 0.734324324
183 -0.035675676 -0.055675676
184 -0.215675676 -0.035675676
185 -0.360675676 -0.215675676
186 -1.050675676 -0.360675676
187 -1.555675676 -1.050675676
188 -0.555675676 -1.555675676
189 -0.035675676 -0.555675676
190 -0.395675676 -0.035675676
191 -0.365675676 -0.395675676
192 -0.825675676 -0.365675676
193 -0.845675676 -0.825675676
194 -0.745675676 -0.845675676
195 -0.415675676 -0.745675676
196 -0.830675676 -0.415675676
197 -0.680675676 -0.830675676
198 -0.450675676 -0.680675676
199 -0.455675676 -0.450675676
200 -0.915675676 -0.455675676
201 -0.800675676 -0.915675676
202 -0.365675676 -0.800675676
203 -0.485675676 -0.365675676
204 -0.475675676 -0.485675676
205 -0.115675676 -0.475675676
206 0.024324324 -0.115675676
> 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/html/rcomp/tmp/7hsj51227533800.ps",horizontal=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/html/rcomp/tmp/85z2m1227533800.ps",horizontal=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/html/rcomp/tmp/9mkg71227533800.ps",horizontal=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/html/rcomp/tmp/10gjbt1227533800.ps",horizontal=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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/html/rcomp/tmp/11qud81227533800.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/html/rcomp/tmp/12ik891227533800.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/html/rcomp/tmp/13w7hz1227533800.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/html/rcomp/tmp/14gfmn1227533801.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/html/rcomp/tmp/158go81227533801.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/html/rcomp/tmp/16hkwh1227533801.tab")
+ }
>
> system("convert tmp/13fsz1227533800.ps tmp/13fsz1227533800.png")
> system("convert tmp/2ezbe1227533800.ps tmp/2ezbe1227533800.png")
> system("convert tmp/3d3az1227533800.ps tmp/3d3az1227533800.png")
> system("convert tmp/41hzj1227533800.ps tmp/41hzj1227533800.png")
> system("convert tmp/5azj91227533800.ps tmp/5azj91227533800.png")
> system("convert tmp/682p21227533800.ps tmp/682p21227533800.png")
> system("convert tmp/7hsj51227533800.ps tmp/7hsj51227533800.png")
> system("convert tmp/85z2m1227533800.ps tmp/85z2m1227533800.png")
> system("convert tmp/9mkg71227533800.ps tmp/9mkg71227533800.png")
> system("convert tmp/10gjbt1227533800.ps tmp/10gjbt1227533800.png")
>
>
> proc.time()
user system elapsed
4.839 1.720 5.341