R version 2.12.1 (2010-12-16)
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(11.73
+ ,11.75
+ ,11.39
+ ,11.54
+ ,9.62
+ ,9.82
+ ,9.94
+ ,9.9
+ ,9.8
+ ,9.86
+ ,10.5
+ ,10.33
+ ,10.16
+ ,9.91
+ ,9.96
+ ,10.03
+ ,9.55
+ ,9.51
+ ,9.8
+ ,10.08
+ ,10.2
+ ,10.23
+ ,10.2
+ ,10.07
+ ,10.01
+ ,10.05
+ ,9.92
+ ,10.03
+ ,10.18
+ ,10.1
+ ,10.16
+ ,10.15
+ ,10.13
+ ,10.09
+ ,10.18
+ ,10.06
+ ,9.65
+ ,9.74
+ ,9.53
+ ,9.5
+ ,9
+ ,9.15
+ ,9.32
+ ,9.62
+ ,9.59
+ ,9.37
+ ,9.35
+ ,9.32
+ ,9.49
+ ,9.52
+ ,9.59
+ ,9.35
+ ,9.2
+ ,9.57
+ ,9.78
+ ,9.79
+ ,9.57
+ ,9.53
+ ,9.65
+ ,9.36
+ ,9.4
+ ,9.32
+ ,9.31
+ ,9.19
+ ,9.39
+ ,9.28
+ ,9.28
+ ,9.31
+ ,9.28
+ ,9.31
+ ,9.35
+ ,9.19
+ ,9.07
+ ,8.96
+ ,8.69
+ ,8.58
+ ,8.56
+ ,8.47
+ ,8.46
+ ,8.75
+ ,8.95
+ ,9.33
+ ,9.51
+ ,9.561
+ ,9.94
+ ,9.9
+ ,9.275
+ ,9.56
+ ,9.779
+ ,9.746
+ ,9.991
+ ,9.98
+ ,10.195
+ ,10.31
+ ,10.25
+ ,9.871
+ ,10.06
+ ,9.894
+ ,9.59
+ ,9.64
+ ,9.89
+ ,9.53
+ ,9.388
+ ,9.16
+ ,9.418
+ ,9.57
+ ,9.857
+ ,9.877
+ ,9.76
+ ,9.76
+ ,9.695
+ ,9.475
+ ,9.262
+ ,9.097
+ ,8.55
+ ,8.16
+ ,7.532
+ ,7.325
+ ,6.749
+ ,7.13
+ ,6.995
+ ,7.346
+ ,7.73
+ ,7.837
+ ,7.514
+ ,7.58
+ ,6.83
+ ,6.617
+ ,6.715
+ ,6.63
+ ,6.891
+ ,7.002
+ ,7.09
+ ,7.36
+ ,7.477
+ ,7.826
+ ,7.79
+ ,7.578
+ ,7.204
+ ,7.198
+ ,7.685
+ ,7.795
+ ,7.46
+ ,7.274
+ ,7.33
+ ,7.655
+ ,7.767
+ ,7.84
+ ,7.424
+ ,7.54
+ ,7.351
+ ,6.735
+ ,6.777
+ ,6.679
+ ,7.34
+ ,6.978
+ ,6.92
+ ,6.628
+ ,6.385
+ ,5.984
+ ,6.268
+ ,6.596
+ ,6.395
+ ,6.715
+ ,6.804
+ ,6.929
+ ,6.846
+ ,6.992
+ ,6.774
+ ,6.75
+ ,6.485
+ ,6.27
+ ,6.47
+ ,6.78
+ ,6.71
+ ,6.141
+ ,6.72
+ ,6.68
+ ,6.371
+ ,6.097
+ ,6.27
+ ,6.447
+ ,6.37
+ ,6.446
+ ,6.54
+ ,6.374
+ ,6.33
+ ,6.63
+ ,6.498
+ ,6.485
+ ,6.36)
+ ,dim=c(1
+ ,191)
+ ,dimnames=list(c('koers-nyrstar')
+ ,1:191))
> y <- array(NA,dim=c(1,191),dimnames=list(c('koers-nyrstar'),1:191))
> 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 = 'Include Monthly Dummies'
> par1 = '1'
> 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,4), dimnames=list(1:n, paste('D', seq(1:4), sep ='')))
+ for (i in 1:4){
+ x2[seq(i,n,5),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
koers-nyrstar D1 D2 D3 D4 t
1 11.730 1 0 0 0 1
2 11.750 0 1 0 0 2
3 11.390 0 0 1 0 3
4 11.540 0 0 0 1 4
5 9.620 0 0 0 0 5
6 9.820 1 0 0 0 6
7 9.940 0 1 0 0 7
8 9.900 0 0 1 0 8
9 9.800 0 0 0 1 9
10 9.860 0 0 0 0 10
11 10.500 1 0 0 0 11
12 10.330 0 1 0 0 12
13 10.160 0 0 1 0 13
14 9.910 0 0 0 1 14
15 9.960 0 0 0 0 15
16 10.030 1 0 0 0 16
17 9.550 0 1 0 0 17
18 9.510 0 0 1 0 18
19 9.800 0 0 0 1 19
20 10.080 0 0 0 0 20
21 10.200 1 0 0 0 21
22 10.230 0 1 0 0 22
23 10.200 0 0 1 0 23
24 10.070 0 0 0 1 24
25 10.010 0 0 0 0 25
26 10.050 1 0 0 0 26
27 9.920 0 1 0 0 27
28 10.030 0 0 1 0 28
29 10.180 0 0 0 1 29
30 10.100 0 0 0 0 30
31 10.160 1 0 0 0 31
32 10.150 0 1 0 0 32
33 10.130 0 0 1 0 33
34 10.090 0 0 0 1 34
35 10.180 0 0 0 0 35
36 10.060 1 0 0 0 36
37 9.650 0 1 0 0 37
38 9.740 0 0 1 0 38
39 9.530 0 0 0 1 39
40 9.500 0 0 0 0 40
41 9.000 1 0 0 0 41
42 9.150 0 1 0 0 42
43 9.320 0 0 1 0 43
44 9.620 0 0 0 1 44
45 9.590 0 0 0 0 45
46 9.370 1 0 0 0 46
47 9.350 0 1 0 0 47
48 9.320 0 0 1 0 48
49 9.490 0 0 0 1 49
50 9.520 0 0 0 0 50
51 9.590 1 0 0 0 51
52 9.350 0 1 0 0 52
53 9.200 0 0 1 0 53
54 9.570 0 0 0 1 54
55 9.780 0 0 0 0 55
56 9.790 1 0 0 0 56
57 9.570 0 1 0 0 57
58 9.530 0 0 1 0 58
59 9.650 0 0 0 1 59
60 9.360 0 0 0 0 60
61 9.400 1 0 0 0 61
62 9.320 0 1 0 0 62
63 9.310 0 0 1 0 63
64 9.190 0 0 0 1 64
65 9.390 0 0 0 0 65
66 9.280 1 0 0 0 66
67 9.280 0 1 0 0 67
68 9.310 0 0 1 0 68
69 9.280 0 0 0 1 69
70 9.310 0 0 0 0 70
71 9.350 1 0 0 0 71
72 9.190 0 1 0 0 72
73 9.070 0 0 1 0 73
74 8.960 0 0 0 1 74
75 8.690 0 0 0 0 75
76 8.580 1 0 0 0 76
77 8.560 0 1 0 0 77
78 8.470 0 0 1 0 78
79 8.460 0 0 0 1 79
80 8.750 0 0 0 0 80
81 8.950 1 0 0 0 81
82 9.330 0 1 0 0 82
83 9.510 0 0 1 0 83
84 9.561 0 0 0 1 84
85 9.940 0 0 0 0 85
86 9.900 1 0 0 0 86
87 9.275 0 1 0 0 87
88 9.560 0 0 1 0 88
89 9.779 0 0 0 1 89
90 9.746 0 0 0 0 90
91 9.991 1 0 0 0 91
92 9.980 0 1 0 0 92
93 10.195 0 0 1 0 93
94 10.310 0 0 0 1 94
95 10.250 0 0 0 0 95
96 9.871 1 0 0 0 96
97 10.060 0 1 0 0 97
98 9.894 0 0 1 0 98
99 9.590 0 0 0 1 99
100 9.640 0 0 0 0 100
101 9.890 1 0 0 0 101
102 9.530 0 1 0 0 102
103 9.388 0 0 1 0 103
104 9.160 0 0 0 1 104
105 9.418 0 0 0 0 105
106 9.570 1 0 0 0 106
107 9.857 0 1 0 0 107
108 9.877 0 0 1 0 108
109 9.760 0 0 0 1 109
110 9.760 0 0 0 0 110
111 9.695 1 0 0 0 111
112 9.475 0 1 0 0 112
113 9.262 0 0 1 0 113
114 9.097 0 0 0 1 114
115 8.550 0 0 0 0 115
116 8.160 1 0 0 0 116
117 7.532 0 1 0 0 117
118 7.325 0 0 1 0 118
119 6.749 0 0 0 1 119
120 7.130 0 0 0 0 120
121 6.995 1 0 0 0 121
122 7.346 0 1 0 0 122
123 7.730 0 0 1 0 123
124 7.837 0 0 0 1 124
125 7.514 0 0 0 0 125
126 7.580 1 0 0 0 126
127 6.830 0 1 0 0 127
128 6.617 0 0 1 0 128
129 6.715 0 0 0 1 129
130 6.630 0 0 0 0 130
131 6.891 1 0 0 0 131
132 7.002 0 1 0 0 132
133 7.090 0 0 1 0 133
134 7.360 0 0 0 1 134
135 7.477 0 0 0 0 135
136 7.826 1 0 0 0 136
137 7.790 0 1 0 0 137
138 7.578 0 0 1 0 138
139 7.204 0 0 0 1 139
140 7.198 0 0 0 0 140
141 7.685 1 0 0 0 141
142 7.795 0 1 0 0 142
143 7.460 0 0 1 0 143
144 7.274 0 0 0 1 144
145 7.330 0 0 0 0 145
146 7.655 1 0 0 0 146
147 7.767 0 1 0 0 147
148 7.840 0 0 1 0 148
149 7.424 0 0 0 1 149
150 7.540 0 0 0 0 150
151 7.351 1 0 0 0 151
152 6.735 0 1 0 0 152
153 6.777 0 0 1 0 153
154 6.679 0 0 0 1 154
155 7.340 0 0 0 0 155
156 6.978 1 0 0 0 156
157 6.920 0 1 0 0 157
158 6.628 0 0 1 0 158
159 6.385 0 0 0 1 159
160 5.984 0 0 0 0 160
161 6.268 1 0 0 0 161
162 6.596 0 1 0 0 162
163 6.395 0 0 1 0 163
164 6.715 0 0 0 1 164
165 6.804 0 0 0 0 165
166 6.929 1 0 0 0 166
167 6.846 0 1 0 0 167
168 6.992 0 0 1 0 168
169 6.774 0 0 0 1 169
170 6.750 0 0 0 0 170
171 6.485 1 0 0 0 171
172 6.270 0 1 0 0 172
173 6.470 0 0 1 0 173
174 6.780 0 0 0 1 174
175 6.710 0 0 0 0 175
176 6.141 1 0 0 0 176
177 6.720 0 1 0 0 177
178 6.680 0 0 1 0 178
179 6.371 0 0 0 1 179
180 6.097 0 0 0 0 180
181 6.270 1 0 0 0 181
182 6.447 0 1 0 0 182
183 6.370 0 0 1 0 183
184 6.446 0 0 0 1 184
185 6.540 0 0 0 0 185
186 6.374 1 0 0 0 186
187 6.330 0 1 0 0 187
188 6.630 0 0 1 0 188
189 6.498 0 0 0 1 189
190 6.485 0 0 0 0 190
191 6.360 1 0 0 0 191
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) D1 D2 D3 D4 t
10.815405 0.058631 0.013945 0.014516 0.004956 -0.023334
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.29462 -0.38727 -0.09324 0.16934 1.68303
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 10.8154045 0.1371726 78.845 <2e-16 ***
D1 0.0586313 0.1513302 0.387 0.699
D2 0.0139454 0.1523265 0.092 0.927
D3 0.0145163 0.1523140 0.095 0.924
D4 0.0049555 0.1523065 0.033 0.974
t -0.0233340 0.0008714 -26.778 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6639 on 185 degrees of freedom
Multiple R-squared: 0.795, Adjusted R-squared: 0.7895
F-statistic: 143.5 on 5 and 185 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,] 9.800496e-03 1.960099e-02 9.901995e-01
[2,] 5.626127e-01 8.747746e-01 4.373873e-01
[3,] 7.518702e-01 4.962596e-01 2.481298e-01
[4,] 7.162723e-01 5.674553e-01 2.837277e-01
[5,] 6.591248e-01 6.817505e-01 3.408752e-01
[6,] 5.658551e-01 8.682899e-01 4.341449e-01
[7,] 6.294974e-01 7.410052e-01 3.705026e-01
[8,] 5.554981e-01 8.890037e-01 4.445019e-01
[9,] 4.781040e-01 9.562079e-01 5.218960e-01
[10,] 4.022980e-01 8.045960e-01 5.977020e-01
[11,] 3.426017e-01 6.852034e-01 6.573983e-01
[12,] 4.405882e-01 8.811765e-01 5.594118e-01
[13,] 4.149675e-01 8.299349e-01 5.850325e-01
[14,] 3.986777e-01 7.973553e-01 6.013223e-01
[15,] 3.876145e-01 7.752291e-01 6.123855e-01
[16,] 3.462354e-01 6.924708e-01 6.537646e-01
[17,] 3.438633e-01 6.877266e-01 6.561367e-01
[18,] 2.898860e-01 5.797720e-01 7.101140e-01
[19,] 2.393840e-01 4.787680e-01 7.606160e-01
[20,] 2.046001e-01 4.092002e-01 7.953999e-01
[21,] 1.811058e-01 3.622116e-01 8.188942e-01
[22,] 1.776700e-01 3.553399e-01 8.223300e-01
[23,] 1.449712e-01 2.899425e-01 8.550288e-01
[24,] 1.192136e-01 2.384272e-01 8.807864e-01
[25,] 9.859389e-02 1.971878e-01 9.014061e-01
[26,] 7.818476e-02 1.563695e-01 9.218152e-01
[27,] 7.389310e-02 1.477862e-01 9.261069e-01
[28,] 5.545849e-02 1.109170e-01 9.445415e-01
[29,] 4.307139e-02 8.614278e-02 9.569286e-01
[30,] 3.179524e-02 6.359047e-02 9.682048e-01
[31,] 2.475399e-02 4.950798e-02 9.752460e-01
[32,] 1.845513e-02 3.691025e-02 9.815449e-01
[33,] 2.545207e-02 5.090414e-02 9.745479e-01
[34,] 2.428198e-02 4.856395e-02 9.757180e-01
[35,] 1.964696e-02 3.929392e-02 9.803530e-01
[36,] 1.454232e-02 2.908464e-02 9.854577e-01
[37,] 1.132145e-02 2.264289e-02 9.886786e-01
[38,] 8.814769e-03 1.762954e-02 9.911852e-01
[39,] 6.677538e-03 1.335508e-02 9.933225e-01
[40,] 5.065953e-03 1.013191e-02 9.949340e-01
[41,] 3.663185e-03 7.326370e-03 9.963368e-01
[42,] 2.850589e-03 5.701178e-03 9.971494e-01
[43,] 2.083871e-03 4.167742e-03 9.979161e-01
[44,] 1.520119e-03 3.040237e-03 9.984799e-01
[45,] 1.163742e-03 2.327483e-03 9.988363e-01
[46,] 8.498973e-04 1.699795e-03 9.991501e-01
[47,] 8.507987e-04 1.701597e-03 9.991492e-01
[48,] 6.994643e-04 1.398929e-03 9.993005e-01
[49,] 5.226634e-04 1.045327e-03 9.994773e-01
[50,] 3.883859e-04 7.767718e-04 9.996116e-01
[51,] 2.865753e-04 5.731507e-04 9.997134e-01
[52,] 2.030611e-04 4.061222e-04 9.997969e-01
[53,] 1.383558e-04 2.767117e-04 9.998616e-01
[54,] 9.521513e-05 1.904303e-04 9.999048e-01
[55,] 6.592381e-05 1.318476e-04 9.999341e-01
[56,] 4.594086e-05 9.188172e-05 9.999541e-01
[57,] 3.292279e-05 6.584558e-05 9.999671e-01
[58,] 2.229738e-05 4.459476e-05 9.999777e-01
[59,] 1.509573e-05 3.019147e-05 9.999849e-01
[60,] 1.036583e-05 2.073166e-05 9.999896e-01
[61,] 6.732066e-06 1.346413e-05 9.999933e-01
[62,] 4.672061e-06 9.344123e-06 9.999953e-01
[63,] 3.051569e-06 6.103137e-06 9.999969e-01
[64,] 2.020864e-06 4.041728e-06 9.999980e-01
[65,] 1.398631e-06 2.797262e-06 9.999986e-01
[66,] 1.035952e-06 2.071903e-06 9.999990e-01
[67,] 1.098788e-06 2.197575e-06 9.999989e-01
[68,] 1.796172e-06 3.592343e-06 9.999982e-01
[69,] 2.517542e-06 5.035084e-06 9.999975e-01
[70,] 4.269055e-06 8.538110e-06 9.999957e-01
[71,] 7.460631e-06 1.492126e-05 9.999925e-01
[72,] 7.535208e-06 1.507042e-05 9.999925e-01
[73,] 6.678229e-06 1.335646e-05 9.999933e-01
[74,] 6.887741e-06 1.377548e-05 9.999931e-01
[75,] 9.632247e-06 1.926449e-05 9.999904e-01
[76,] 1.249250e-05 2.498499e-05 9.999875e-01
[77,] 4.494894e-05 8.989789e-05 9.999551e-01
[78,] 8.747170e-05 1.749434e-04 9.999125e-01
[79,] 7.171499e-05 1.434300e-04 9.999283e-01
[80,] 7.869475e-05 1.573895e-04 9.999213e-01
[81,] 1.116983e-04 2.233966e-04 9.998883e-01
[82,] 1.531674e-04 3.063347e-04 9.998468e-01
[83,] 2.648013e-04 5.296027e-04 9.997352e-01
[84,] 4.914313e-04 9.828627e-04 9.995086e-01
[85,] 1.337155e-03 2.674311e-03 9.986628e-01
[86,] 3.918137e-03 7.836274e-03 9.960819e-01
[87,] 9.279036e-03 1.855807e-02 9.907210e-01
[88,] 1.027514e-02 2.055028e-02 9.897249e-01
[89,] 1.610427e-02 3.220855e-02 9.838957e-01
[90,] 2.017854e-02 4.035708e-02 9.798215e-01
[91,] 1.934441e-02 3.868882e-02 9.806556e-01
[92,] 1.992616e-02 3.985232e-02 9.800738e-01
[93,] 2.580078e-02 5.160155e-02 9.741992e-01
[94,] 2.563640e-02 5.127280e-02 9.743636e-01
[95,] 2.380054e-02 4.760108e-02 9.761995e-01
[96,] 2.081496e-02 4.162992e-02 9.791850e-01
[97,] 2.162897e-02 4.325793e-02 9.783710e-01
[98,] 2.612748e-02 5.225495e-02 9.738725e-01
[99,] 5.132873e-02 1.026575e-01 9.486713e-01
[100,] 1.079806e-01 2.159613e-01 8.920194e-01
[101,] 2.087715e-01 4.175429e-01 7.912285e-01
[102,] 3.930393e-01 7.860786e-01 6.069607e-01
[103,] 6.294053e-01 7.411894e-01 3.705947e-01
[104,] 8.234204e-01 3.531592e-01 1.765796e-01
[105,] 9.328345e-01 1.343310e-01 6.716551e-02
[106,] 9.844558e-01 3.108845e-02 1.554422e-02
[107,] 9.933276e-01 1.334478e-02 6.672390e-03
[108,] 9.964125e-01 7.174913e-03 3.587457e-03
[109,] 9.982987e-01 3.402535e-03 1.701268e-03
[110,] 9.993351e-01 1.329802e-03 6.649008e-04
[111,] 9.999462e-01 1.075085e-04 5.375425e-05
[112,] 9.999809e-01 3.819963e-05 1.909981e-05
[113,] 9.999958e-01 8.395423e-06 4.197711e-06
[114,] 9.999969e-01 6.245461e-06 3.122730e-06
[115,] 9.999965e-01 7.006721e-06 3.503361e-06
[116,] 9.999965e-01 6.993086e-06 3.496543e-06
[117,] 9.999960e-01 8.039677e-06 4.019838e-06
[118,] 9.999953e-01 9.456106e-06 4.728053e-06
[119,] 9.999986e-01 2.896068e-06 1.448034e-06
[120,] 9.999998e-01 3.447258e-07 1.723629e-07
[121,] 1.000000e+00 7.379435e-08 3.689718e-08
[122,] 1.000000e+00 7.202808e-09 3.601404e-09
[123,] 1.000000e+00 2.027066e-09 1.013533e-09
[124,] 1.000000e+00 8.735343e-10 4.367672e-10
[125,] 1.000000e+00 5.770498e-10 2.885249e-10
[126,] 1.000000e+00 1.059359e-09 5.296794e-10
[127,] 1.000000e+00 2.222352e-09 1.111176e-09
[128,] 1.000000e+00 3.639141e-09 1.819570e-09
[129,] 1.000000e+00 6.360750e-09 3.180375e-09
[130,] 1.000000e+00 1.351836e-08 6.759181e-09
[131,] 1.000000e+00 2.387222e-08 1.193611e-08
[132,] 1.000000e+00 4.069757e-08 2.034878e-08
[133,] 1.000000e+00 6.265090e-08 3.132545e-08
[134,] 1.000000e+00 6.914610e-08 3.457305e-08
[135,] 9.999999e-01 1.407476e-07 7.037378e-08
[136,] 9.999999e-01 2.913137e-07 1.456568e-07
[137,] 9.999997e-01 5.999256e-07 2.999628e-07
[138,] 9.999997e-01 5.301628e-07 2.650814e-07
[139,] 9.999999e-01 2.299282e-07 1.149641e-07
[140,] 1.000000e+00 4.264867e-08 2.132433e-08
[141,] 1.000000e+00 3.714766e-08 1.857383e-08
[142,] 1.000000e+00 1.413418e-08 7.067091e-09
[143,] 1.000000e+00 5.040192e-09 2.520096e-09
[144,] 1.000000e+00 1.175602e-08 5.878010e-09
[145,] 1.000000e+00 2.833869e-08 1.416934e-08
[146,] 1.000000e+00 6.397645e-08 3.198822e-08
[147,] 1.000000e+00 1.553256e-08 7.766281e-09
[148,] 1.000000e+00 1.316402e-08 6.582008e-09
[149,] 1.000000e+00 2.137553e-08 1.068777e-08
[150,] 1.000000e+00 5.665520e-08 2.832760e-08
[151,] 1.000000e+00 8.350128e-08 4.175064e-08
[152,] 1.000000e+00 5.307239e-09 2.653619e-09
[153,] 1.000000e+00 5.262940e-09 2.631470e-09
[154,] 1.000000e+00 1.538733e-08 7.693666e-09
[155,] 1.000000e+00 8.089234e-09 4.044617e-09
[156,] 1.000000e+00 2.594399e-08 1.297199e-08
[157,] 1.000000e+00 9.060000e-08 4.530000e-08
[158,] 1.000000e+00 8.550170e-08 4.275085e-08
[159,] 9.999999e-01 1.711624e-07 8.558118e-08
[160,] 9.999999e-01 2.079097e-07 1.039549e-07
[161,] 9.999997e-01 6.035126e-07 3.017563e-07
[162,] 9.999993e-01 1.311456e-06 6.557280e-07
[163,] 9.999982e-01 3.588942e-06 1.794471e-06
[164,] 9.999964e-01 7.245130e-06 3.622565e-06
[165,] 9.999886e-01 2.272455e-05 1.136227e-05
[166,] 9.999826e-01 3.472997e-05 1.736498e-05
[167,] 9.999843e-01 3.134910e-05 1.567455e-05
[168,] 9.999484e-01 1.031590e-04 5.157949e-05
[169,] 9.999647e-01 7.061120e-05 3.530560e-05
[170,] 9.999597e-01 8.055237e-05 4.027618e-05
[171,] 9.997779e-01 4.442733e-04 2.221367e-04
[172,] 9.998609e-01 2.782576e-04 1.391288e-04
[173,] 9.989987e-01 2.002646e-03 1.001323e-03
[174,] 9.958044e-01 8.391262e-03 4.195631e-03
> postscript(file="/var/www/rcomp/tmp/136tb1322228256.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/2et9w1322228256.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/3nb8q1322228256.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/4jyna1322228256.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/5jcpm1322228256.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 = 191
Frequency = 1
1 2 3 4 5
0.8792981451 0.9673179645 0.6300811224 0.8129758592 -1.0787346671
6 7 8 9 10
-0.9140319867 -0.7260121673 -0.7432490094 -0.8103542725 -0.7220647989
11 12 13 14 15
-0.1173621185 -0.2193422991 -0.3665791412 -0.5836844043 -0.5053949307
16 17 18 19 20
-0.4706922503 -0.8826724309 -0.8999092730 -0.5770145361 -0.2687250625
21 22 23 24 25
-0.1840223821 -0.0860025627 -0.0932394048 -0.1903446679 -0.2220551942
26 27 28 29 30
-0.2173525139 -0.2793326945 -0.1465695366 0.0363252003 -0.0153853260
31 32 33 34 35
0.0093173544 0.0673371737 0.0701003316 0.0629950685 0.1812845422
36 37 38 39 40
0.0259872226 -0.3159929580 -0.2032298002 -0.3803350633 -0.3820455896
41 42 43 44 45
-0.9173429092 -0.6993230898 -0.5065599319 -0.1736651951 -0.1753757214
46 47 48 49 50
-0.4306730410 -0.3826532216 -0.3898900637 -0.1869953269 -0.1287058532
51 52 53 54 55
-0.0940031728 -0.2659833534 -0.3932201955 0.0096745413 0.2479640150
56 57 58 59 60
0.2226666954 0.0706865148 0.0534496727 0.2063444095 -0.0553661168
61 62 63 64 65
-0.0506634364 -0.0626436170 -0.0498804591 -0.1369857223 0.0913037514
66 67 68 69 70
-0.0539935682 0.0140262512 0.0667894091 0.0696841459 0.1279736196
71 72 73 74 75
0.1326763000 0.0406961194 -0.0565407227 -0.1336459859 -0.3753565122
76 77 78 79 80
-0.5206538318 -0.4726340124 -0.5398708545 -0.5169761177 -0.1986866440
81 82 83 84 85
-0.0339839636 0.4140358558 0.6167990137 0.7006937505 1.1079832242
86 87 88 89 90
1.0326859046 0.4757057240 0.7834688819 1.0353636187 1.0306530924
91 92 93 94 95
1.2403557728 1.2973755922 1.5351387501 1.6830334869 1.6513229606
96 97 98 99 100
1.2370256410 1.4940454604 1.3508086183 1.0797033552 1.1579928288
101 102 103 104 105
1.3726955092 1.0807153286 0.9614784865 0.7663732234 1.0526626970
106 107 108 109 110
1.1693653774 1.5243851968 1.5671483547 1.4830430916 1.5113325653
111 112 113 114 115
1.4110352456 1.2590550650 1.0688182229 0.9367129598 0.4180024335
116 117 118 119 120
-0.0072948862 -0.5672750668 -0.7515119089 -1.2946171720 -0.8853276983
121 122 123 124 125
-1.0556250179 -0.6366051986 -0.2298420407 -0.0899473038 -0.3846578301
126 127 128 129 130
-0.3539551497 -1.0359353303 -1.2261721725 -1.0952774356 -1.1519879619
131 132 133 134 135
-0.9262852815 -0.7472654621 -0.6365023042 -0.3336075674 -0.1883180937
136 137 138 139 140
0.1253845867 0.1574044061 -0.0318324360 -0.3729376992 -0.3506482255
141 142 143 144 145
0.1010544549 0.2790742743 -0.0331625678 -0.1862678310 -0.1019783573
146 147 148 149 150
0.1877243231 0.3677441425 0.4635073004 0.0804020372 0.2246915109
151 152 153 154 155
0.0003941913 -0.5475859893 -0.4828228314 -0.5479280946 0.1413613791
156 157 158 159 160
-0.2559359405 -0.2459161211 -0.5151529632 -0.7252582264 -1.0979687527
161 162 163 164 165
-0.8492660723 -0.4532462529 -0.6314830950 -0.2785883582 -0.1612988845
166 167 168 169 170
-0.0715962041 -0.0865763847 0.0821867732 -0.1029184900 -0.0986290163
171 172 173 174 175
-0.3989263359 -0.5459065165 -0.3231433586 0.0197513782 -0.0219591481
176 177 178 179 180
-0.6262564677 0.0207633517 0.0035265096 -0.2725787536 -0.5182892799
181 182 183 184 185
-0.3805865995 -0.1355667801 -0.1898036222 -0.0809088853 0.0413805883
186 187 188 189 190
-0.1599167313 -0.1358969119 0.1868662460 0.0877609829 0.1030504565
191
-0.0572468631
> postscript(file="/var/www/rcomp/tmp/6j1v11322228256.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 = 191
Frequency = 1
lag(myerror, k = 1) myerror
0 0.8792981451 NA
1 0.9673179645 0.8792981451
2 0.6300811224 0.9673179645
3 0.8129758592 0.6300811224
4 -1.0787346671 0.8129758592
5 -0.9140319867 -1.0787346671
6 -0.7260121673 -0.9140319867
7 -0.7432490094 -0.7260121673
8 -0.8103542725 -0.7432490094
9 -0.7220647989 -0.8103542725
10 -0.1173621185 -0.7220647989
11 -0.2193422991 -0.1173621185
12 -0.3665791412 -0.2193422991
13 -0.5836844043 -0.3665791412
14 -0.5053949307 -0.5836844043
15 -0.4706922503 -0.5053949307
16 -0.8826724309 -0.4706922503
17 -0.8999092730 -0.8826724309
18 -0.5770145361 -0.8999092730
19 -0.2687250625 -0.5770145361
20 -0.1840223821 -0.2687250625
21 -0.0860025627 -0.1840223821
22 -0.0932394048 -0.0860025627
23 -0.1903446679 -0.0932394048
24 -0.2220551942 -0.1903446679
25 -0.2173525139 -0.2220551942
26 -0.2793326945 -0.2173525139
27 -0.1465695366 -0.2793326945
28 0.0363252003 -0.1465695366
29 -0.0153853260 0.0363252003
30 0.0093173544 -0.0153853260
31 0.0673371737 0.0093173544
32 0.0701003316 0.0673371737
33 0.0629950685 0.0701003316
34 0.1812845422 0.0629950685
35 0.0259872226 0.1812845422
36 -0.3159929580 0.0259872226
37 -0.2032298002 -0.3159929580
38 -0.3803350633 -0.2032298002
39 -0.3820455896 -0.3803350633
40 -0.9173429092 -0.3820455896
41 -0.6993230898 -0.9173429092
42 -0.5065599319 -0.6993230898
43 -0.1736651951 -0.5065599319
44 -0.1753757214 -0.1736651951
45 -0.4306730410 -0.1753757214
46 -0.3826532216 -0.4306730410
47 -0.3898900637 -0.3826532216
48 -0.1869953269 -0.3898900637
49 -0.1287058532 -0.1869953269
50 -0.0940031728 -0.1287058532
51 -0.2659833534 -0.0940031728
52 -0.3932201955 -0.2659833534
53 0.0096745413 -0.3932201955
54 0.2479640150 0.0096745413
55 0.2226666954 0.2479640150
56 0.0706865148 0.2226666954
57 0.0534496727 0.0706865148
58 0.2063444095 0.0534496727
59 -0.0553661168 0.2063444095
60 -0.0506634364 -0.0553661168
61 -0.0626436170 -0.0506634364
62 -0.0498804591 -0.0626436170
63 -0.1369857223 -0.0498804591
64 0.0913037514 -0.1369857223
65 -0.0539935682 0.0913037514
66 0.0140262512 -0.0539935682
67 0.0667894091 0.0140262512
68 0.0696841459 0.0667894091
69 0.1279736196 0.0696841459
70 0.1326763000 0.1279736196
71 0.0406961194 0.1326763000
72 -0.0565407227 0.0406961194
73 -0.1336459859 -0.0565407227
74 -0.3753565122 -0.1336459859
75 -0.5206538318 -0.3753565122
76 -0.4726340124 -0.5206538318
77 -0.5398708545 -0.4726340124
78 -0.5169761177 -0.5398708545
79 -0.1986866440 -0.5169761177
80 -0.0339839636 -0.1986866440
81 0.4140358558 -0.0339839636
82 0.6167990137 0.4140358558
83 0.7006937505 0.6167990137
84 1.1079832242 0.7006937505
85 1.0326859046 1.1079832242
86 0.4757057240 1.0326859046
87 0.7834688819 0.4757057240
88 1.0353636187 0.7834688819
89 1.0306530924 1.0353636187
90 1.2403557728 1.0306530924
91 1.2973755922 1.2403557728
92 1.5351387501 1.2973755922
93 1.6830334869 1.5351387501
94 1.6513229606 1.6830334869
95 1.2370256410 1.6513229606
96 1.4940454604 1.2370256410
97 1.3508086183 1.4940454604
98 1.0797033552 1.3508086183
99 1.1579928288 1.0797033552
100 1.3726955092 1.1579928288
101 1.0807153286 1.3726955092
102 0.9614784865 1.0807153286
103 0.7663732234 0.9614784865
104 1.0526626970 0.7663732234
105 1.1693653774 1.0526626970
106 1.5243851968 1.1693653774
107 1.5671483547 1.5243851968
108 1.4830430916 1.5671483547
109 1.5113325653 1.4830430916
110 1.4110352456 1.5113325653
111 1.2590550650 1.4110352456
112 1.0688182229 1.2590550650
113 0.9367129598 1.0688182229
114 0.4180024335 0.9367129598
115 -0.0072948862 0.4180024335
116 -0.5672750668 -0.0072948862
117 -0.7515119089 -0.5672750668
118 -1.2946171720 -0.7515119089
119 -0.8853276983 -1.2946171720
120 -1.0556250179 -0.8853276983
121 -0.6366051986 -1.0556250179
122 -0.2298420407 -0.6366051986
123 -0.0899473038 -0.2298420407
124 -0.3846578301 -0.0899473038
125 -0.3539551497 -0.3846578301
126 -1.0359353303 -0.3539551497
127 -1.2261721725 -1.0359353303
128 -1.0952774356 -1.2261721725
129 -1.1519879619 -1.0952774356
130 -0.9262852815 -1.1519879619
131 -0.7472654621 -0.9262852815
132 -0.6365023042 -0.7472654621
133 -0.3336075674 -0.6365023042
134 -0.1883180937 -0.3336075674
135 0.1253845867 -0.1883180937
136 0.1574044061 0.1253845867
137 -0.0318324360 0.1574044061
138 -0.3729376992 -0.0318324360
139 -0.3506482255 -0.3729376992
140 0.1010544549 -0.3506482255
141 0.2790742743 0.1010544549
142 -0.0331625678 0.2790742743
143 -0.1862678310 -0.0331625678
144 -0.1019783573 -0.1862678310
145 0.1877243231 -0.1019783573
146 0.3677441425 0.1877243231
147 0.4635073004 0.3677441425
148 0.0804020372 0.4635073004
149 0.2246915109 0.0804020372
150 0.0003941913 0.2246915109
151 -0.5475859893 0.0003941913
152 -0.4828228314 -0.5475859893
153 -0.5479280946 -0.4828228314
154 0.1413613791 -0.5479280946
155 -0.2559359405 0.1413613791
156 -0.2459161211 -0.2559359405
157 -0.5151529632 -0.2459161211
158 -0.7252582264 -0.5151529632
159 -1.0979687527 -0.7252582264
160 -0.8492660723 -1.0979687527
161 -0.4532462529 -0.8492660723
162 -0.6314830950 -0.4532462529
163 -0.2785883582 -0.6314830950
164 -0.1612988845 -0.2785883582
165 -0.0715962041 -0.1612988845
166 -0.0865763847 -0.0715962041
167 0.0821867732 -0.0865763847
168 -0.1029184900 0.0821867732
169 -0.0986290163 -0.1029184900
170 -0.3989263359 -0.0986290163
171 -0.5459065165 -0.3989263359
172 -0.3231433586 -0.5459065165
173 0.0197513782 -0.3231433586
174 -0.0219591481 0.0197513782
175 -0.6262564677 -0.0219591481
176 0.0207633517 -0.6262564677
177 0.0035265096 0.0207633517
178 -0.2725787536 0.0035265096
179 -0.5182892799 -0.2725787536
180 -0.3805865995 -0.5182892799
181 -0.1355667801 -0.3805865995
182 -0.1898036222 -0.1355667801
183 -0.0809088853 -0.1898036222
184 0.0413805883 -0.0809088853
185 -0.1599167313 0.0413805883
186 -0.1358969119 -0.1599167313
187 0.1868662460 -0.1358969119
188 0.0877609829 0.1868662460
189 0.1030504565 0.0877609829
190 -0.0572468631 0.1030504565
191 NA -0.0572468631
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.9673179645 0.8792981451
[2,] 0.6300811224 0.9673179645
[3,] 0.8129758592 0.6300811224
[4,] -1.0787346671 0.8129758592
[5,] -0.9140319867 -1.0787346671
[6,] -0.7260121673 -0.9140319867
[7,] -0.7432490094 -0.7260121673
[8,] -0.8103542725 -0.7432490094
[9,] -0.7220647989 -0.8103542725
[10,] -0.1173621185 -0.7220647989
[11,] -0.2193422991 -0.1173621185
[12,] -0.3665791412 -0.2193422991
[13,] -0.5836844043 -0.3665791412
[14,] -0.5053949307 -0.5836844043
[15,] -0.4706922503 -0.5053949307
[16,] -0.8826724309 -0.4706922503
[17,] -0.8999092730 -0.8826724309
[18,] -0.5770145361 -0.8999092730
[19,] -0.2687250625 -0.5770145361
[20,] -0.1840223821 -0.2687250625
[21,] -0.0860025627 -0.1840223821
[22,] -0.0932394048 -0.0860025627
[23,] -0.1903446679 -0.0932394048
[24,] -0.2220551942 -0.1903446679
[25,] -0.2173525139 -0.2220551942
[26,] -0.2793326945 -0.2173525139
[27,] -0.1465695366 -0.2793326945
[28,] 0.0363252003 -0.1465695366
[29,] -0.0153853260 0.0363252003
[30,] 0.0093173544 -0.0153853260
[31,] 0.0673371737 0.0093173544
[32,] 0.0701003316 0.0673371737
[33,] 0.0629950685 0.0701003316
[34,] 0.1812845422 0.0629950685
[35,] 0.0259872226 0.1812845422
[36,] -0.3159929580 0.0259872226
[37,] -0.2032298002 -0.3159929580
[38,] -0.3803350633 -0.2032298002
[39,] -0.3820455896 -0.3803350633
[40,] -0.9173429092 -0.3820455896
[41,] -0.6993230898 -0.9173429092
[42,] -0.5065599319 -0.6993230898
[43,] -0.1736651951 -0.5065599319
[44,] -0.1753757214 -0.1736651951
[45,] -0.4306730410 -0.1753757214
[46,] -0.3826532216 -0.4306730410
[47,] -0.3898900637 -0.3826532216
[48,] -0.1869953269 -0.3898900637
[49,] -0.1287058532 -0.1869953269
[50,] -0.0940031728 -0.1287058532
[51,] -0.2659833534 -0.0940031728
[52,] -0.3932201955 -0.2659833534
[53,] 0.0096745413 -0.3932201955
[54,] 0.2479640150 0.0096745413
[55,] 0.2226666954 0.2479640150
[56,] 0.0706865148 0.2226666954
[57,] 0.0534496727 0.0706865148
[58,] 0.2063444095 0.0534496727
[59,] -0.0553661168 0.2063444095
[60,] -0.0506634364 -0.0553661168
[61,] -0.0626436170 -0.0506634364
[62,] -0.0498804591 -0.0626436170
[63,] -0.1369857223 -0.0498804591
[64,] 0.0913037514 -0.1369857223
[65,] -0.0539935682 0.0913037514
[66,] 0.0140262512 -0.0539935682
[67,] 0.0667894091 0.0140262512
[68,] 0.0696841459 0.0667894091
[69,] 0.1279736196 0.0696841459
[70,] 0.1326763000 0.1279736196
[71,] 0.0406961194 0.1326763000
[72,] -0.0565407227 0.0406961194
[73,] -0.1336459859 -0.0565407227
[74,] -0.3753565122 -0.1336459859
[75,] -0.5206538318 -0.3753565122
[76,] -0.4726340124 -0.5206538318
[77,] -0.5398708545 -0.4726340124
[78,] -0.5169761177 -0.5398708545
[79,] -0.1986866440 -0.5169761177
[80,] -0.0339839636 -0.1986866440
[81,] 0.4140358558 -0.0339839636
[82,] 0.6167990137 0.4140358558
[83,] 0.7006937505 0.6167990137
[84,] 1.1079832242 0.7006937505
[85,] 1.0326859046 1.1079832242
[86,] 0.4757057240 1.0326859046
[87,] 0.7834688819 0.4757057240
[88,] 1.0353636187 0.7834688819
[89,] 1.0306530924 1.0353636187
[90,] 1.2403557728 1.0306530924
[91,] 1.2973755922 1.2403557728
[92,] 1.5351387501 1.2973755922
[93,] 1.6830334869 1.5351387501
[94,] 1.6513229606 1.6830334869
[95,] 1.2370256410 1.6513229606
[96,] 1.4940454604 1.2370256410
[97,] 1.3508086183 1.4940454604
[98,] 1.0797033552 1.3508086183
[99,] 1.1579928288 1.0797033552
[100,] 1.3726955092 1.1579928288
[101,] 1.0807153286 1.3726955092
[102,] 0.9614784865 1.0807153286
[103,] 0.7663732234 0.9614784865
[104,] 1.0526626970 0.7663732234
[105,] 1.1693653774 1.0526626970
[106,] 1.5243851968 1.1693653774
[107,] 1.5671483547 1.5243851968
[108,] 1.4830430916 1.5671483547
[109,] 1.5113325653 1.4830430916
[110,] 1.4110352456 1.5113325653
[111,] 1.2590550650 1.4110352456
[112,] 1.0688182229 1.2590550650
[113,] 0.9367129598 1.0688182229
[114,] 0.4180024335 0.9367129598
[115,] -0.0072948862 0.4180024335
[116,] -0.5672750668 -0.0072948862
[117,] -0.7515119089 -0.5672750668
[118,] -1.2946171720 -0.7515119089
[119,] -0.8853276983 -1.2946171720
[120,] -1.0556250179 -0.8853276983
[121,] -0.6366051986 -1.0556250179
[122,] -0.2298420407 -0.6366051986
[123,] -0.0899473038 -0.2298420407
[124,] -0.3846578301 -0.0899473038
[125,] -0.3539551497 -0.3846578301
[126,] -1.0359353303 -0.3539551497
[127,] -1.2261721725 -1.0359353303
[128,] -1.0952774356 -1.2261721725
[129,] -1.1519879619 -1.0952774356
[130,] -0.9262852815 -1.1519879619
[131,] -0.7472654621 -0.9262852815
[132,] -0.6365023042 -0.7472654621
[133,] -0.3336075674 -0.6365023042
[134,] -0.1883180937 -0.3336075674
[135,] 0.1253845867 -0.1883180937
[136,] 0.1574044061 0.1253845867
[137,] -0.0318324360 0.1574044061
[138,] -0.3729376992 -0.0318324360
[139,] -0.3506482255 -0.3729376992
[140,] 0.1010544549 -0.3506482255
[141,] 0.2790742743 0.1010544549
[142,] -0.0331625678 0.2790742743
[143,] -0.1862678310 -0.0331625678
[144,] -0.1019783573 -0.1862678310
[145,] 0.1877243231 -0.1019783573
[146,] 0.3677441425 0.1877243231
[147,] 0.4635073004 0.3677441425
[148,] 0.0804020372 0.4635073004
[149,] 0.2246915109 0.0804020372
[150,] 0.0003941913 0.2246915109
[151,] -0.5475859893 0.0003941913
[152,] -0.4828228314 -0.5475859893
[153,] -0.5479280946 -0.4828228314
[154,] 0.1413613791 -0.5479280946
[155,] -0.2559359405 0.1413613791
[156,] -0.2459161211 -0.2559359405
[157,] -0.5151529632 -0.2459161211
[158,] -0.7252582264 -0.5151529632
[159,] -1.0979687527 -0.7252582264
[160,] -0.8492660723 -1.0979687527
[161,] -0.4532462529 -0.8492660723
[162,] -0.6314830950 -0.4532462529
[163,] -0.2785883582 -0.6314830950
[164,] -0.1612988845 -0.2785883582
[165,] -0.0715962041 -0.1612988845
[166,] -0.0865763847 -0.0715962041
[167,] 0.0821867732 -0.0865763847
[168,] -0.1029184900 0.0821867732
[169,] -0.0986290163 -0.1029184900
[170,] -0.3989263359 -0.0986290163
[171,] -0.5459065165 -0.3989263359
[172,] -0.3231433586 -0.5459065165
[173,] 0.0197513782 -0.3231433586
[174,] -0.0219591481 0.0197513782
[175,] -0.6262564677 -0.0219591481
[176,] 0.0207633517 -0.6262564677
[177,] 0.0035265096 0.0207633517
[178,] -0.2725787536 0.0035265096
[179,] -0.5182892799 -0.2725787536
[180,] -0.3805865995 -0.5182892799
[181,] -0.1355667801 -0.3805865995
[182,] -0.1898036222 -0.1355667801
[183,] -0.0809088853 -0.1898036222
[184,] 0.0413805883 -0.0809088853
[185,] -0.1599167313 0.0413805883
[186,] -0.1358969119 -0.1599167313
[187,] 0.1868662460 -0.1358969119
[188,] 0.0877609829 0.1868662460
[189,] 0.1030504565 0.0877609829
[190,] -0.0572468631 0.1030504565
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.9673179645 0.8792981451
2 0.6300811224 0.9673179645
3 0.8129758592 0.6300811224
4 -1.0787346671 0.8129758592
5 -0.9140319867 -1.0787346671
6 -0.7260121673 -0.9140319867
7 -0.7432490094 -0.7260121673
8 -0.8103542725 -0.7432490094
9 -0.7220647989 -0.8103542725
10 -0.1173621185 -0.7220647989
11 -0.2193422991 -0.1173621185
12 -0.3665791412 -0.2193422991
13 -0.5836844043 -0.3665791412
14 -0.5053949307 -0.5836844043
15 -0.4706922503 -0.5053949307
16 -0.8826724309 -0.4706922503
17 -0.8999092730 -0.8826724309
18 -0.5770145361 -0.8999092730
19 -0.2687250625 -0.5770145361
20 -0.1840223821 -0.2687250625
21 -0.0860025627 -0.1840223821
22 -0.0932394048 -0.0860025627
23 -0.1903446679 -0.0932394048
24 -0.2220551942 -0.1903446679
25 -0.2173525139 -0.2220551942
26 -0.2793326945 -0.2173525139
27 -0.1465695366 -0.2793326945
28 0.0363252003 -0.1465695366
29 -0.0153853260 0.0363252003
30 0.0093173544 -0.0153853260
31 0.0673371737 0.0093173544
32 0.0701003316 0.0673371737
33 0.0629950685 0.0701003316
34 0.1812845422 0.0629950685
35 0.0259872226 0.1812845422
36 -0.3159929580 0.0259872226
37 -0.2032298002 -0.3159929580
38 -0.3803350633 -0.2032298002
39 -0.3820455896 -0.3803350633
40 -0.9173429092 -0.3820455896
41 -0.6993230898 -0.9173429092
42 -0.5065599319 -0.6993230898
43 -0.1736651951 -0.5065599319
44 -0.1753757214 -0.1736651951
45 -0.4306730410 -0.1753757214
46 -0.3826532216 -0.4306730410
47 -0.3898900637 -0.3826532216
48 -0.1869953269 -0.3898900637
49 -0.1287058532 -0.1869953269
50 -0.0940031728 -0.1287058532
51 -0.2659833534 -0.0940031728
52 -0.3932201955 -0.2659833534
53 0.0096745413 -0.3932201955
54 0.2479640150 0.0096745413
55 0.2226666954 0.2479640150
56 0.0706865148 0.2226666954
57 0.0534496727 0.0706865148
58 0.2063444095 0.0534496727
59 -0.0553661168 0.2063444095
60 -0.0506634364 -0.0553661168
61 -0.0626436170 -0.0506634364
62 -0.0498804591 -0.0626436170
63 -0.1369857223 -0.0498804591
64 0.0913037514 -0.1369857223
65 -0.0539935682 0.0913037514
66 0.0140262512 -0.0539935682
67 0.0667894091 0.0140262512
68 0.0696841459 0.0667894091
69 0.1279736196 0.0696841459
70 0.1326763000 0.1279736196
71 0.0406961194 0.1326763000
72 -0.0565407227 0.0406961194
73 -0.1336459859 -0.0565407227
74 -0.3753565122 -0.1336459859
75 -0.5206538318 -0.3753565122
76 -0.4726340124 -0.5206538318
77 -0.5398708545 -0.4726340124
78 -0.5169761177 -0.5398708545
79 -0.1986866440 -0.5169761177
80 -0.0339839636 -0.1986866440
81 0.4140358558 -0.0339839636
82 0.6167990137 0.4140358558
83 0.7006937505 0.6167990137
84 1.1079832242 0.7006937505
85 1.0326859046 1.1079832242
86 0.4757057240 1.0326859046
87 0.7834688819 0.4757057240
88 1.0353636187 0.7834688819
89 1.0306530924 1.0353636187
90 1.2403557728 1.0306530924
91 1.2973755922 1.2403557728
92 1.5351387501 1.2973755922
93 1.6830334869 1.5351387501
94 1.6513229606 1.6830334869
95 1.2370256410 1.6513229606
96 1.4940454604 1.2370256410
97 1.3508086183 1.4940454604
98 1.0797033552 1.3508086183
99 1.1579928288 1.0797033552
100 1.3726955092 1.1579928288
101 1.0807153286 1.3726955092
102 0.9614784865 1.0807153286
103 0.7663732234 0.9614784865
104 1.0526626970 0.7663732234
105 1.1693653774 1.0526626970
106 1.5243851968 1.1693653774
107 1.5671483547 1.5243851968
108 1.4830430916 1.5671483547
109 1.5113325653 1.4830430916
110 1.4110352456 1.5113325653
111 1.2590550650 1.4110352456
112 1.0688182229 1.2590550650
113 0.9367129598 1.0688182229
114 0.4180024335 0.9367129598
115 -0.0072948862 0.4180024335
116 -0.5672750668 -0.0072948862
117 -0.7515119089 -0.5672750668
118 -1.2946171720 -0.7515119089
119 -0.8853276983 -1.2946171720
120 -1.0556250179 -0.8853276983
121 -0.6366051986 -1.0556250179
122 -0.2298420407 -0.6366051986
123 -0.0899473038 -0.2298420407
124 -0.3846578301 -0.0899473038
125 -0.3539551497 -0.3846578301
126 -1.0359353303 -0.3539551497
127 -1.2261721725 -1.0359353303
128 -1.0952774356 -1.2261721725
129 -1.1519879619 -1.0952774356
130 -0.9262852815 -1.1519879619
131 -0.7472654621 -0.9262852815
132 -0.6365023042 -0.7472654621
133 -0.3336075674 -0.6365023042
134 -0.1883180937 -0.3336075674
135 0.1253845867 -0.1883180937
136 0.1574044061 0.1253845867
137 -0.0318324360 0.1574044061
138 -0.3729376992 -0.0318324360
139 -0.3506482255 -0.3729376992
140 0.1010544549 -0.3506482255
141 0.2790742743 0.1010544549
142 -0.0331625678 0.2790742743
143 -0.1862678310 -0.0331625678
144 -0.1019783573 -0.1862678310
145 0.1877243231 -0.1019783573
146 0.3677441425 0.1877243231
147 0.4635073004 0.3677441425
148 0.0804020372 0.4635073004
149 0.2246915109 0.0804020372
150 0.0003941913 0.2246915109
151 -0.5475859893 0.0003941913
152 -0.4828228314 -0.5475859893
153 -0.5479280946 -0.4828228314
154 0.1413613791 -0.5479280946
155 -0.2559359405 0.1413613791
156 -0.2459161211 -0.2559359405
157 -0.5151529632 -0.2459161211
158 -0.7252582264 -0.5151529632
159 -1.0979687527 -0.7252582264
160 -0.8492660723 -1.0979687527
161 -0.4532462529 -0.8492660723
162 -0.6314830950 -0.4532462529
163 -0.2785883582 -0.6314830950
164 -0.1612988845 -0.2785883582
165 -0.0715962041 -0.1612988845
166 -0.0865763847 -0.0715962041
167 0.0821867732 -0.0865763847
168 -0.1029184900 0.0821867732
169 -0.0986290163 -0.1029184900
170 -0.3989263359 -0.0986290163
171 -0.5459065165 -0.3989263359
172 -0.3231433586 -0.5459065165
173 0.0197513782 -0.3231433586
174 -0.0219591481 0.0197513782
175 -0.6262564677 -0.0219591481
176 0.0207633517 -0.6262564677
177 0.0035265096 0.0207633517
178 -0.2725787536 0.0035265096
179 -0.5182892799 -0.2725787536
180 -0.3805865995 -0.5182892799
181 -0.1355667801 -0.3805865995
182 -0.1898036222 -0.1355667801
183 -0.0809088853 -0.1898036222
184 0.0413805883 -0.0809088853
185 -0.1599167313 0.0413805883
186 -0.1358969119 -0.1599167313
187 0.1868662460 -0.1358969119
188 0.0877609829 0.1868662460
189 0.1030504565 0.0877609829
190 -0.0572468631 0.1030504565
> 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/7qmuu1322228256.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/8d1vh1322228256.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/98psm1322228256.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/10i2j61322228256.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/11drww1322228256.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/12qk7a1322228257.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/13wwxg1322228257.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/14ytho1322228257.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/15fbjt1322228257.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/16deal1322228257.tab")
+ }
>
> try(system("convert tmp/136tb1322228256.ps tmp/136tb1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/2et9w1322228256.ps tmp/2et9w1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/3nb8q1322228256.ps tmp/3nb8q1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/4jyna1322228256.ps tmp/4jyna1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/5jcpm1322228256.ps tmp/5jcpm1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/6j1v11322228256.ps tmp/6j1v11322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qmuu1322228256.ps tmp/7qmuu1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/8d1vh1322228256.ps tmp/8d1vh1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/98psm1322228256.ps tmp/98psm1322228256.png",intern=TRUE))
character(0)
> try(system("convert tmp/10i2j61322228256.ps tmp/10i2j61322228256.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.632 0.692 7.473