R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(26.663
+ ,23.598
+ ,26.931
+ ,24.740
+ ,25.806
+ ,24.364
+ ,24.477
+ ,23.901
+ ,23.175
+ ,23.227
+ ,21.672
+ ,21.870
+ ,21.439
+ ,21.089
+ ,23.709
+ ,21.669
+ ,21.752
+ ,20.761
+ ,23.479
+ ,23.824
+ ,23.105
+ ,23.110
+ ,21.759
+ ,22.073
+ ,21.937
+ ,20.035
+ ,23.590
+ ,21.672
+ ,22.222
+ ,22.123
+ ,23.950
+ ,23.504
+ ,22.238
+ ,23.142
+ ,21.059
+ ,21.573
+ ,21.548
+ ,20.000
+ ,22.424
+ ,20.615
+ ,21.761
+ ,22.874
+ ,24.104
+ ,23.748
+ ,23.262
+ ,22.907
+ ,21.519
+ ,22.025
+ ,22.604
+ ,20.894
+ ,24.677
+ ,23.673
+ ,25.320
+ ,23.583
+ ,24.671
+ ,24.454
+ ,24.122
+ ,24.252
+ ,22.084
+ ,22.991
+ ,23.287
+ ,23.049
+ ,25.076
+ ,24.037
+ ,24.430
+ ,24.667
+ ,26.451
+ ,25.618
+ ,25.014
+ ,25.110
+ ,22.964
+ ,23.981
+ ,23.798
+ ,22.270
+ ,24.775
+ ,22.646
+ ,23.988
+ ,24.737
+ ,26.276
+ ,25.816
+ ,25.210
+ ,25.199
+ ,23.162
+ ,24.707
+ ,24.364
+ ,22.644
+ ,25.565
+ ,24.062
+ ,25.431
+ ,24.635
+ ,27.009
+ ,26.606
+ ,26.268
+ ,26.462
+ ,25.246
+ ,25.180
+ ,24.657
+ ,23.304
+ ,26.982
+ ,26.199
+ ,27.210
+ ,26.122
+ ,26.706
+ ,26.878
+ ,26.152
+ ,26.379
+ ,24.712
+ ,25.688
+ ,24.990
+ ,24.239
+ ,26.721
+ ,23.475
+ ,24.767
+ ,26.219
+ ,28.361
+ ,28.599
+ ,27.914
+ ,27.784
+ ,25.693
+ ,26.881
+ ,26.217
+ ,24.218
+ ,27.914
+ ,26.975
+ ,28.527
+ ,27.139
+ ,28.982
+ ,28.169
+ ,28.056
+ ,29.136
+ ,26.291
+ ,26.987
+ ,26.589
+ ,24.848
+ ,27.543
+ ,26.896
+ ,28.878
+ ,27.390
+ ,28.065
+ ,28.141
+ ,29.048
+ ,28.484
+ ,26.634
+ ,27.735
+ ,27.132
+ ,24.924
+ ,28.963
+ ,26.589
+ ,27.931
+ ,28.009
+ ,29.229
+ ,28.759
+ ,28.405
+ ,27.945
+ ,25.912
+ ,26.619
+ ,26.076
+ ,25.286
+ ,27.660
+ ,25.951
+ ,26.398
+ ,25.565
+ ,28.865
+ ,30.000
+ ,29.261
+ ,29.012
+ ,26.992
+ ,27.897)
+ ,dim=c(1
+ ,168)
+ ,dimnames=list(c('')
+ ,1:168))
> y <- array(NA,dim=c(1,168),dimnames=list(c(''),1:168))
> 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'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 26.663 1 0 0 0 0 0 0 0 0 0 0 1
2 23.598 0 1 0 0 0 0 0 0 0 0 0 2
3 26.931 0 0 1 0 0 0 0 0 0 0 0 3
4 24.740 0 0 0 1 0 0 0 0 0 0 0 4
5 25.806 0 0 0 0 1 0 0 0 0 0 0 5
6 24.364 0 0 0 0 0 1 0 0 0 0 0 6
7 24.477 0 0 0 0 0 0 1 0 0 0 0 7
8 23.901 0 0 0 0 0 0 0 1 0 0 0 8
9 23.175 0 0 0 0 0 0 0 0 1 0 0 9
10 23.227 0 0 0 0 0 0 0 0 0 1 0 10
11 21.672 0 0 0 0 0 0 0 0 0 0 1 11
12 21.870 0 0 0 0 0 0 0 0 0 0 0 12
13 21.439 1 0 0 0 0 0 0 0 0 0 0 13
14 21.089 0 1 0 0 0 0 0 0 0 0 0 14
15 23.709 0 0 1 0 0 0 0 0 0 0 0 15
16 21.669 0 0 0 1 0 0 0 0 0 0 0 16
17 21.752 0 0 0 0 1 0 0 0 0 0 0 17
18 20.761 0 0 0 0 0 1 0 0 0 0 0 18
19 23.479 0 0 0 0 0 0 1 0 0 0 0 19
20 23.824 0 0 0 0 0 0 0 1 0 0 0 20
21 23.105 0 0 0 0 0 0 0 0 1 0 0 21
22 23.110 0 0 0 0 0 0 0 0 0 1 0 22
23 21.759 0 0 0 0 0 0 0 0 0 0 1 23
24 22.073 0 0 0 0 0 0 0 0 0 0 0 24
25 21.937 1 0 0 0 0 0 0 0 0 0 0 25
26 20.035 0 1 0 0 0 0 0 0 0 0 0 26
27 23.590 0 0 1 0 0 0 0 0 0 0 0 27
28 21.672 0 0 0 1 0 0 0 0 0 0 0 28
29 22.222 0 0 0 0 1 0 0 0 0 0 0 29
30 22.123 0 0 0 0 0 1 0 0 0 0 0 30
31 23.950 0 0 0 0 0 0 1 0 0 0 0 31
32 23.504 0 0 0 0 0 0 0 1 0 0 0 32
33 22.238 0 0 0 0 0 0 0 0 1 0 0 33
34 23.142 0 0 0 0 0 0 0 0 0 1 0 34
35 21.059 0 0 0 0 0 0 0 0 0 0 1 35
36 21.573 0 0 0 0 0 0 0 0 0 0 0 36
37 21.548 1 0 0 0 0 0 0 0 0 0 0 37
38 20.000 0 1 0 0 0 0 0 0 0 0 0 38
39 22.424 0 0 1 0 0 0 0 0 0 0 0 39
40 20.615 0 0 0 1 0 0 0 0 0 0 0 40
41 21.761 0 0 0 0 1 0 0 0 0 0 0 41
42 22.874 0 0 0 0 0 1 0 0 0 0 0 42
43 24.104 0 0 0 0 0 0 1 0 0 0 0 43
44 23.748 0 0 0 0 0 0 0 1 0 0 0 44
45 23.262 0 0 0 0 0 0 0 0 1 0 0 45
46 22.907 0 0 0 0 0 0 0 0 0 1 0 46
47 21.519 0 0 0 0 0 0 0 0 0 0 1 47
48 22.025 0 0 0 0 0 0 0 0 0 0 0 48
49 22.604 1 0 0 0 0 0 0 0 0 0 0 49
50 20.894 0 1 0 0 0 0 0 0 0 0 0 50
51 24.677 0 0 1 0 0 0 0 0 0 0 0 51
52 23.673 0 0 0 1 0 0 0 0 0 0 0 52
53 25.320 0 0 0 0 1 0 0 0 0 0 0 53
54 23.583 0 0 0 0 0 1 0 0 0 0 0 54
55 24.671 0 0 0 0 0 0 1 0 0 0 0 55
56 24.454 0 0 0 0 0 0 0 1 0 0 0 56
57 24.122 0 0 0 0 0 0 0 0 1 0 0 57
58 24.252 0 0 0 0 0 0 0 0 0 1 0 58
59 22.084 0 0 0 0 0 0 0 0 0 0 1 59
60 22.991 0 0 0 0 0 0 0 0 0 0 0 60
61 23.287 1 0 0 0 0 0 0 0 0 0 0 61
62 23.049 0 1 0 0 0 0 0 0 0 0 0 62
63 25.076 0 0 1 0 0 0 0 0 0 0 0 63
64 24.037 0 0 0 1 0 0 0 0 0 0 0 64
65 24.430 0 0 0 0 1 0 0 0 0 0 0 65
66 24.667 0 0 0 0 0 1 0 0 0 0 0 66
67 26.451 0 0 0 0 0 0 1 0 0 0 0 67
68 25.618 0 0 0 0 0 0 0 1 0 0 0 68
69 25.014 0 0 0 0 0 0 0 0 1 0 0 69
70 25.110 0 0 0 0 0 0 0 0 0 1 0 70
71 22.964 0 0 0 0 0 0 0 0 0 0 1 71
72 23.981 0 0 0 0 0 0 0 0 0 0 0 72
73 23.798 1 0 0 0 0 0 0 0 0 0 0 73
74 22.270 0 1 0 0 0 0 0 0 0 0 0 74
75 24.775 0 0 1 0 0 0 0 0 0 0 0 75
76 22.646 0 0 0 1 0 0 0 0 0 0 0 76
77 23.988 0 0 0 0 1 0 0 0 0 0 0 77
78 24.737 0 0 0 0 0 1 0 0 0 0 0 78
79 26.276 0 0 0 0 0 0 1 0 0 0 0 79
80 25.816 0 0 0 0 0 0 0 1 0 0 0 80
81 25.210 0 0 0 0 0 0 0 0 1 0 0 81
82 25.199 0 0 0 0 0 0 0 0 0 1 0 82
83 23.162 0 0 0 0 0 0 0 0 0 0 1 83
84 24.707 0 0 0 0 0 0 0 0 0 0 0 84
85 24.364 1 0 0 0 0 0 0 0 0 0 0 85
86 22.644 0 1 0 0 0 0 0 0 0 0 0 86
87 25.565 0 0 1 0 0 0 0 0 0 0 0 87
88 24.062 0 0 0 1 0 0 0 0 0 0 0 88
89 25.431 0 0 0 0 1 0 0 0 0 0 0 89
90 24.635 0 0 0 0 0 1 0 0 0 0 0 90
91 27.009 0 0 0 0 0 0 1 0 0 0 0 91
92 26.606 0 0 0 0 0 0 0 1 0 0 0 92
93 26.268 0 0 0 0 0 0 0 0 1 0 0 93
94 26.462 0 0 0 0 0 0 0 0 0 1 0 94
95 25.246 0 0 0 0 0 0 0 0 0 0 1 95
96 25.180 0 0 0 0 0 0 0 0 0 0 0 96
97 24.657 1 0 0 0 0 0 0 0 0 0 0 97
98 23.304 0 1 0 0 0 0 0 0 0 0 0 98
99 26.982 0 0 1 0 0 0 0 0 0 0 0 99
100 26.199 0 0 0 1 0 0 0 0 0 0 0 100
101 27.210 0 0 0 0 1 0 0 0 0 0 0 101
102 26.122 0 0 0 0 0 1 0 0 0 0 0 102
103 26.706 0 0 0 0 0 0 1 0 0 0 0 103
104 26.878 0 0 0 0 0 0 0 1 0 0 0 104
105 26.152 0 0 0 0 0 0 0 0 1 0 0 105
106 26.379 0 0 0 0 0 0 0 0 0 1 0 106
107 24.712 0 0 0 0 0 0 0 0 0 0 1 107
108 25.688 0 0 0 0 0 0 0 0 0 0 0 108
109 24.990 1 0 0 0 0 0 0 0 0 0 0 109
110 24.239 0 1 0 0 0 0 0 0 0 0 0 110
111 26.721 0 0 1 0 0 0 0 0 0 0 0 111
112 23.475 0 0 0 1 0 0 0 0 0 0 0 112
113 24.767 0 0 0 0 1 0 0 0 0 0 0 113
114 26.219 0 0 0 0 0 1 0 0 0 0 0 114
115 28.361 0 0 0 0 0 0 1 0 0 0 0 115
116 28.599 0 0 0 0 0 0 0 1 0 0 0 116
117 27.914 0 0 0 0 0 0 0 0 1 0 0 117
118 27.784 0 0 0 0 0 0 0 0 0 1 0 118
119 25.693 0 0 0 0 0 0 0 0 0 0 1 119
120 26.881 0 0 0 0 0 0 0 0 0 0 0 120
121 26.217 1 0 0 0 0 0 0 0 0 0 0 121
122 24.218 0 1 0 0 0 0 0 0 0 0 0 122
123 27.914 0 0 1 0 0 0 0 0 0 0 0 123
124 26.975 0 0 0 1 0 0 0 0 0 0 0 124
125 28.527 0 0 0 0 1 0 0 0 0 0 0 125
126 27.139 0 0 0 0 0 1 0 0 0 0 0 126
127 28.982 0 0 0 0 0 0 1 0 0 0 0 127
128 28.169 0 0 0 0 0 0 0 1 0 0 0 128
129 28.056 0 0 0 0 0 0 0 0 1 0 0 129
130 29.136 0 0 0 0 0 0 0 0 0 1 0 130
131 26.291 0 0 0 0 0 0 0 0 0 0 1 131
132 26.987 0 0 0 0 0 0 0 0 0 0 0 132
133 26.589 1 0 0 0 0 0 0 0 0 0 0 133
134 24.848 0 1 0 0 0 0 0 0 0 0 0 134
135 27.543 0 0 1 0 0 0 0 0 0 0 0 135
136 26.896 0 0 0 1 0 0 0 0 0 0 0 136
137 28.878 0 0 0 0 1 0 0 0 0 0 0 137
138 27.390 0 0 0 0 0 1 0 0 0 0 0 138
139 28.065 0 0 0 0 0 0 1 0 0 0 0 139
140 28.141 0 0 0 0 0 0 0 1 0 0 0 140
141 29.048 0 0 0 0 0 0 0 0 1 0 0 141
142 28.484 0 0 0 0 0 0 0 0 0 1 0 142
143 26.634 0 0 0 0 0 0 0 0 0 0 1 143
144 27.735 0 0 0 0 0 0 0 0 0 0 0 144
145 27.132 1 0 0 0 0 0 0 0 0 0 0 145
146 24.924 0 1 0 0 0 0 0 0 0 0 0 146
147 28.963 0 0 1 0 0 0 0 0 0 0 0 147
148 26.589 0 0 0 1 0 0 0 0 0 0 0 148
149 27.931 0 0 0 0 1 0 0 0 0 0 0 149
150 28.009 0 0 0 0 0 1 0 0 0 0 0 150
151 29.229 0 0 0 0 0 0 1 0 0 0 0 151
152 28.759 0 0 0 0 0 0 0 1 0 0 0 152
153 28.405 0 0 0 0 0 0 0 0 1 0 0 153
154 27.945 0 0 0 0 0 0 0 0 0 1 0 154
155 25.912 0 0 0 0 0 0 0 0 0 0 1 155
156 26.619 0 0 0 0 0 0 0 0 0 0 0 156
157 26.076 1 0 0 0 0 0 0 0 0 0 0 157
158 25.286 0 1 0 0 0 0 0 0 0 0 0 158
159 27.660 0 0 1 0 0 0 0 0 0 0 0 159
160 25.951 0 0 0 1 0 0 0 0 0 0 0 160
161 26.398 0 0 0 0 1 0 0 0 0 0 0 161
162 25.565 0 0 0 0 0 1 0 0 0 0 0 162
163 28.865 0 0 0 0 0 0 1 0 0 0 0 163
164 30.000 0 0 0 0 0 0 0 1 0 0 0 164
165 29.261 0 0 0 0 0 0 0 0 1 0 0 165
166 29.012 0 0 0 0 0 0 0 0 0 1 0 166
167 26.992 0 0 0 0 0 0 0 0 0 0 1 167
168 27.897 0 0 0 0 0 0 0 0 0 0 0 168
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
21.41018 0.05521 -1.47473 1.49782 -0.20556 0.84485
M6 M7 M8 M9 M10 M11
0.36276 1.92853 1.70536 1.18370 1.21247 -0.71369
t
0.03688
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.1819 -0.5458 -0.1180 0.4999 5.1607
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 21.410184 0.332313 64.428 < 2e-16 ***
M1 0.055213 0.414470 0.133 0.894197
M2 -1.474735 0.414393 -3.559 0.000495 ***
M3 1.497817 0.414323 3.615 0.000405 ***
M4 -0.205559 0.414260 -0.496 0.620451
M5 0.844850 0.414205 2.040 0.043079 *
M6 0.362759 0.414157 0.876 0.382441
M7 1.928525 0.414117 4.657 6.85e-06 ***
M8 1.705363 0.414084 4.118 6.19e-05 ***
M9 1.183701 0.414058 2.859 0.004838 **
M10 1.212467 0.414039 2.928 0.003921 **
M11 -0.713695 0.414028 -1.724 0.086741 .
t 0.036877 0.001747 21.108 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.095 on 155 degrees of freedom
Multiple R-squared: 0.7929, Adjusted R-squared: 0.7768
F-statistic: 49.44 on 12 and 155 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.7085463 5.829075e-01 2.914537e-01
[2,] 0.5854576 8.290848e-01 4.145424e-01
[3,] 0.4470942 8.941883e-01 5.529058e-01
[4,] 0.8268745 3.462511e-01 1.731255e-01
[5,] 0.9767463 4.650731e-02 2.325365e-02
[6,] 0.9941367 1.172656e-02 5.863280e-03
[7,] 0.9974793 5.041336e-03 2.520668e-03
[8,] 0.9989061 2.187801e-03 1.093900e-03
[9,] 0.9994088 1.182477e-03 5.912384e-04
[10,] 0.9990433 1.913453e-03 9.567263e-04
[11,] 0.9983065 3.386980e-03 1.693490e-03
[12,] 0.9976868 4.626323e-03 2.313161e-03
[13,] 0.9969117 6.176525e-03 3.088262e-03
[14,] 0.9957428 8.514345e-03 4.257172e-03
[15,] 0.9970498 5.900428e-03 2.950214e-03
[16,] 0.9983223 3.355494e-03 1.677747e-03
[17,] 0.9984610 3.078052e-03 1.539026e-03
[18,] 0.9982521 3.495757e-03 1.747878e-03
[19,] 0.9985570 2.885955e-03 1.442978e-03
[20,] 0.9981270 3.746017e-03 1.873009e-03
[21,] 0.9979389 4.122170e-03 2.061085e-03
[22,] 0.9968840 6.231901e-03 3.115950e-03
[23,] 0.9956153 8.769441e-03 4.384721e-03
[24,] 0.9949410 1.011799e-02 5.058993e-03
[25,] 0.9947508 1.049833e-02 5.249166e-03
[26,] 0.9952188 9.562335e-03 4.781167e-03
[27,] 0.9980604 3.879170e-03 1.939585e-03
[28,] 0.9987573 2.485378e-03 1.242689e-03
[29,] 0.9990625 1.874989e-03 9.374946e-04
[30,] 0.9994785 1.043014e-03 5.215072e-04
[31,] 0.9995872 8.255302e-04 4.127651e-04
[32,] 0.9996217 7.565981e-04 3.782990e-04
[33,] 0.9997297 5.406807e-04 2.703403e-04
[34,] 0.9996923 6.153772e-04 3.076886e-04
[35,] 0.9996587 6.825413e-04 3.412706e-04
[36,] 0.9997447 5.105173e-04 2.552586e-04
[37,] 0.9999289 1.421966e-04 7.109831e-05
[38,] 0.9999945 1.093909e-05 5.469545e-06
[39,] 0.9999954 9.114430e-06 4.557215e-06
[40,] 0.9999954 9.266215e-06 4.633107e-06
[41,] 0.9999954 9.239304e-06 4.619652e-06
[42,] 0.9999964 7.211807e-06 3.605904e-06
[43,] 0.9999968 6.377794e-06 3.188897e-06
[44,] 0.9999964 7.159575e-06 3.579787e-06
[45,] 0.9999969 6.296019e-06 3.148009e-06
[46,] 0.9999952 9.671986e-06 4.835993e-06
[47,] 0.9999979 4.258359e-06 2.129180e-06
[48,] 0.9999969 6.225244e-06 3.112622e-06
[49,] 0.9999974 5.292369e-06 2.646184e-06
[50,] 0.9999963 7.427242e-06 3.713621e-06
[51,] 0.9999969 6.175607e-06 3.087803e-06
[52,] 0.9999980 4.085695e-06 2.042847e-06
[53,] 0.9999976 4.828720e-06 2.414360e-06
[54,] 0.9999973 5.341803e-06 2.670901e-06
[55,] 0.9999968 6.413057e-06 3.206529e-06
[56,] 0.9999956 8.789977e-06 4.394988e-06
[57,] 0.9999948 1.040571e-05 5.202857e-06
[58,] 0.9999912 1.760898e-05 8.804491e-06
[59,] 0.9999852 2.958285e-05 1.479143e-05
[60,] 0.9999792 4.166504e-05 2.083252e-05
[61,] 0.9999808 3.843157e-05 1.921579e-05
[62,] 0.9999813 3.743926e-05 1.871963e-05
[63,] 0.9999739 5.214269e-05 2.607135e-05
[64,] 0.9999646 7.082652e-05 3.541326e-05
[65,] 0.9999556 8.887863e-05 4.443931e-05
[66,] 0.9999540 9.192190e-05 4.596095e-05
[67,] 0.9999523 9.531847e-05 4.765924e-05
[68,] 0.9999525 9.500698e-05 4.750349e-05
[69,] 0.9999460 1.079824e-04 5.399122e-05
[70,] 0.9999152 1.696963e-04 8.484813e-05
[71,] 0.9998731 2.537820e-04 1.268910e-04
[72,] 0.9998297 3.405068e-04 1.702534e-04
[73,] 0.9997678 4.643947e-04 2.321973e-04
[74,] 0.9996973 6.053984e-04 3.026992e-04
[75,] 0.9996256 7.487117e-04 3.743558e-04
[76,] 0.9995108 9.784562e-04 4.892281e-04
[77,] 0.9994114 1.177104e-03 5.885519e-04
[78,] 0.9993655 1.269051e-03 6.345254e-04
[79,] 0.9992747 1.450545e-03 7.252723e-04
[80,] 0.9992846 1.430709e-03 7.153544e-04
[81,] 0.9991489 1.702246e-03 8.511229e-04
[82,] 0.9988170 2.366035e-03 1.183017e-03
[83,] 0.9983180 3.363977e-03 1.681989e-03
[84,] 0.9977017 4.596553e-03 2.298276e-03
[85,] 0.9982120 3.576056e-03 1.788028e-03
[86,] 0.9983814 3.237245e-03 1.618622e-03
[87,] 0.9978354 4.329259e-03 2.164629e-03
[88,] 0.9974824 5.035156e-03 2.517578e-03
[89,] 0.9970286 5.942799e-03 2.971399e-03
[90,] 0.9975704 4.859161e-03 2.429580e-03
[91,] 0.9977110 4.578069e-03 2.289035e-03
[92,] 0.9972284 5.543232e-03 2.771616e-03
[93,] 0.9967700 6.460025e-03 3.230013e-03
[94,] 0.9962220 7.555979e-03 3.777990e-03
[95,] 0.9945036 1.099277e-02 5.496385e-03
[96,] 0.9930781 1.384374e-02 6.921870e-03
[97,] 0.9990310 1.937989e-03 9.689945e-04
[98,] 0.9999663 6.740284e-05 3.370142e-05
[99,] 0.9999513 9.733216e-05 4.866608e-05
[100,] 0.9999256 1.487928e-04 7.439640e-05
[101,] 0.9998969 2.061677e-04 1.030838e-04
[102,] 0.9998788 2.423177e-04 1.211588e-04
[103,] 0.9998592 2.815357e-04 1.407679e-04
[104,] 0.9998183 3.633753e-04 1.816876e-04
[105,] 0.9997454 5.091440e-04 2.545720e-04
[106,] 0.9995865 8.270000e-04 4.135000e-04
[107,] 0.9994773 1.045387e-03 5.226933e-04
[108,] 0.9991327 1.734534e-03 8.672668e-04
[109,] 0.9988016 2.396897e-03 1.198448e-03
[110,] 0.9987444 2.511214e-03 1.255607e-03
[111,] 0.9979682 4.063566e-03 2.031783e-03
[112,] 0.9969213 6.157469e-03 3.078734e-03
[113,] 0.9960383 7.923309e-03 3.961655e-03
[114,] 0.9954684 9.063257e-03 4.531629e-03
[115,] 0.9945311 1.093786e-02 5.468931e-03
[116,] 0.9915452 1.690953e-02 8.454767e-03
[117,] 0.9879585 2.408305e-02 1.204153e-02
[118,] 0.9810775 3.784509e-02 1.892255e-02
[119,] 0.9718787 5.624251e-02 2.812126e-02
[120,] 0.9662728 6.745446e-02 3.372723e-02
[121,] 0.9525302 9.493966e-02 4.746983e-02
[122,] 0.9683190 6.336205e-02 3.168102e-02
[123,] 0.9565675 8.686510e-02 4.343255e-02
[124,] 0.9497157 1.005685e-01 5.028427e-02
[125,] 0.9558022 8.839563e-02 4.419781e-02
[126,] 0.9337538 1.324923e-01 6.624615e-02
[127,] 0.9012332 1.975337e-01 9.876683e-02
[128,] 0.8555534 2.888931e-01 1.444466e-01
[129,] 0.7999689 4.000622e-01 2.000311e-01
[130,] 0.7580888 4.838223e-01 2.419112e-01
[131,] 0.6794199 6.411602e-01 3.205801e-01
[132,] 0.6513420 6.973160e-01 3.486580e-01
[133,] 0.5670726 8.658548e-01 4.329274e-01
[134,] 0.6066127 7.867745e-01 3.933873e-01
[135,] 0.9783644 4.327112e-02 2.163556e-02
[136,] 0.9997376 5.247871e-04 2.623936e-04
[137,] 0.9981483 3.703392e-03 1.851696e-03
> postscript(file="/var/wessaorg/rcomp/tmp/1xkgi1322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/22t2d1322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/3klu31322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/49lfh1322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/5fu8i1322918521.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 = 168
Frequency = 1
1 2 3 4 5 6
5.160726190 3.588797619 3.912369048 3.387869048 3.366583333 2.369797619
7 8 9 10 11 12
0.880154762 0.490440476 0.249226190 0.235583333 0.569869048 0.017297619
13 14 15 16 17 18
-0.505792125 0.637279304 0.247850733 -0.125649267 -1.129934982 -1.675720696
19 20 21 22 23 24
-0.560363553 -0.029077839 -0.263292125 -0.323934982 0.214350733 -0.222220696
25 26 27 28 29 30
-0.450310440 -0.859239011 -0.313667582 -0.565167582 -1.102453297 -0.756239011
31 32 33 34 35 36
-0.531881868 -0.791596154 -1.572810440 -0.734453297 -0.928167582 -1.164739011
37 38 39 40 41 42
-1.281828755 -1.336757326 -1.922185897 -2.064685897 -2.005971612 -0.447757326
43 44 45 46 47 48
-0.820400183 -0.990114469 -0.991328755 -1.411971612 -0.910685897 -1.155257326
49 50 51 52 53 54
-0.668347070 -0.885275641 -0.111704212 0.550795788 1.110510073 -0.181275641
55 56 57 58 59 60
-0.695918498 -0.726632784 -0.573847070 -0.509489927 -0.788204212 -0.631775641
61 62 63 64 65 66
-0.427865385 0.827206044 -0.155222527 0.472277473 -0.222008242 0.460206044
67 68 69 70 71 72
0.641563187 -0.005151099 -0.124365385 -0.094008242 -0.350722527 -0.084293956
73 74 75 76 77 78
-0.359383700 -0.394312271 -0.898740842 -1.361240842 -1.106526557 0.087687729
79 80 81 82 83 84
0.024044872 -0.249669414 -0.370883700 -0.447526557 -0.595240842 0.199187729
85 86 87 88 89 90
-0.235902015 -0.462830586 -0.551259158 -0.387759158 -0.106044872 -0.456830586
91 92 93 94 95 96
0.314526557 0.097812271 0.244597985 0.372955128 1.046240842 0.229669414
97 98 99 100 101 102
-0.385420330 -0.245348901 0.423222527 1.306722527 1.230436813 0.587651099
103 104 105 106 107 108
-0.430991758 -0.072706044 -0.313920330 -0.152563187 0.069722527 0.295151099
109 110 111 112 113 114
-0.494938645 0.247132784 -0.280295788 -1.859795788 -1.655081502 0.242132784
115 116 117 118 119 120
0.781489927 1.205775641 1.005561355 0.809918498 0.608204212 1.045632784
121 122 123 124 125 126
0.289543040 -0.216385531 0.470185897 1.197685897 1.662400183 0.719614469
127 128 129 130 131 132
0.959971612 0.333257326 0.705043040 1.719400183 0.763685897 0.709114469
133 134 135 136 137 138
0.219024725 -0.028903846 -0.343332418 0.676167582 1.570881868 0.528096154
139 140 141 142 143 144
-0.399546703 -0.137260989 1.254524725 0.624881868 0.664167582 1.014596154
145 146 147 148 149 150
0.319506410 -0.395422161 0.634149267 -0.073350733 0.181363553 0.704577839
151 152 153 154 155 156
0.321934982 0.038220696 0.169006410 -0.356636447 -0.500350733 -0.543922161
157 158 159 160 161 162
-1.179011905 -0.475940476 -1.111369048 -1.153869048 -1.794154762 -2.181940476
163 164 165 166 167 168
-0.484583333 0.836702381 0.582488095 0.267845238 0.137130952 0.291559524
> postscript(file="/var/wessaorg/rcomp/tmp/6qcfb1322918521.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 = 168
Frequency = 1
lag(myerror, k = 1) myerror
0 5.160726190 NA
1 3.588797619 5.160726190
2 3.912369048 3.588797619
3 3.387869048 3.912369048
4 3.366583333 3.387869048
5 2.369797619 3.366583333
6 0.880154762 2.369797619
7 0.490440476 0.880154762
8 0.249226190 0.490440476
9 0.235583333 0.249226190
10 0.569869048 0.235583333
11 0.017297619 0.569869048
12 -0.505792125 0.017297619
13 0.637279304 -0.505792125
14 0.247850733 0.637279304
15 -0.125649267 0.247850733
16 -1.129934982 -0.125649267
17 -1.675720696 -1.129934982
18 -0.560363553 -1.675720696
19 -0.029077839 -0.560363553
20 -0.263292125 -0.029077839
21 -0.323934982 -0.263292125
22 0.214350733 -0.323934982
23 -0.222220696 0.214350733
24 -0.450310440 -0.222220696
25 -0.859239011 -0.450310440
26 -0.313667582 -0.859239011
27 -0.565167582 -0.313667582
28 -1.102453297 -0.565167582
29 -0.756239011 -1.102453297
30 -0.531881868 -0.756239011
31 -0.791596154 -0.531881868
32 -1.572810440 -0.791596154
33 -0.734453297 -1.572810440
34 -0.928167582 -0.734453297
35 -1.164739011 -0.928167582
36 -1.281828755 -1.164739011
37 -1.336757326 -1.281828755
38 -1.922185897 -1.336757326
39 -2.064685897 -1.922185897
40 -2.005971612 -2.064685897
41 -0.447757326 -2.005971612
42 -0.820400183 -0.447757326
43 -0.990114469 -0.820400183
44 -0.991328755 -0.990114469
45 -1.411971612 -0.991328755
46 -0.910685897 -1.411971612
47 -1.155257326 -0.910685897
48 -0.668347070 -1.155257326
49 -0.885275641 -0.668347070
50 -0.111704212 -0.885275641
51 0.550795788 -0.111704212
52 1.110510073 0.550795788
53 -0.181275641 1.110510073
54 -0.695918498 -0.181275641
55 -0.726632784 -0.695918498
56 -0.573847070 -0.726632784
57 -0.509489927 -0.573847070
58 -0.788204212 -0.509489927
59 -0.631775641 -0.788204212
60 -0.427865385 -0.631775641
61 0.827206044 -0.427865385
62 -0.155222527 0.827206044
63 0.472277473 -0.155222527
64 -0.222008242 0.472277473
65 0.460206044 -0.222008242
66 0.641563187 0.460206044
67 -0.005151099 0.641563187
68 -0.124365385 -0.005151099
69 -0.094008242 -0.124365385
70 -0.350722527 -0.094008242
71 -0.084293956 -0.350722527
72 -0.359383700 -0.084293956
73 -0.394312271 -0.359383700
74 -0.898740842 -0.394312271
75 -1.361240842 -0.898740842
76 -1.106526557 -1.361240842
77 0.087687729 -1.106526557
78 0.024044872 0.087687729
79 -0.249669414 0.024044872
80 -0.370883700 -0.249669414
81 -0.447526557 -0.370883700
82 -0.595240842 -0.447526557
83 0.199187729 -0.595240842
84 -0.235902015 0.199187729
85 -0.462830586 -0.235902015
86 -0.551259158 -0.462830586
87 -0.387759158 -0.551259158
88 -0.106044872 -0.387759158
89 -0.456830586 -0.106044872
90 0.314526557 -0.456830586
91 0.097812271 0.314526557
92 0.244597985 0.097812271
93 0.372955128 0.244597985
94 1.046240842 0.372955128
95 0.229669414 1.046240842
96 -0.385420330 0.229669414
97 -0.245348901 -0.385420330
98 0.423222527 -0.245348901
99 1.306722527 0.423222527
100 1.230436813 1.306722527
101 0.587651099 1.230436813
102 -0.430991758 0.587651099
103 -0.072706044 -0.430991758
104 -0.313920330 -0.072706044
105 -0.152563187 -0.313920330
106 0.069722527 -0.152563187
107 0.295151099 0.069722527
108 -0.494938645 0.295151099
109 0.247132784 -0.494938645
110 -0.280295788 0.247132784
111 -1.859795788 -0.280295788
112 -1.655081502 -1.859795788
113 0.242132784 -1.655081502
114 0.781489927 0.242132784
115 1.205775641 0.781489927
116 1.005561355 1.205775641
117 0.809918498 1.005561355
118 0.608204212 0.809918498
119 1.045632784 0.608204212
120 0.289543040 1.045632784
121 -0.216385531 0.289543040
122 0.470185897 -0.216385531
123 1.197685897 0.470185897
124 1.662400183 1.197685897
125 0.719614469 1.662400183
126 0.959971612 0.719614469
127 0.333257326 0.959971612
128 0.705043040 0.333257326
129 1.719400183 0.705043040
130 0.763685897 1.719400183
131 0.709114469 0.763685897
132 0.219024725 0.709114469
133 -0.028903846 0.219024725
134 -0.343332418 -0.028903846
135 0.676167582 -0.343332418
136 1.570881868 0.676167582
137 0.528096154 1.570881868
138 -0.399546703 0.528096154
139 -0.137260989 -0.399546703
140 1.254524725 -0.137260989
141 0.624881868 1.254524725
142 0.664167582 0.624881868
143 1.014596154 0.664167582
144 0.319506410 1.014596154
145 -0.395422161 0.319506410
146 0.634149267 -0.395422161
147 -0.073350733 0.634149267
148 0.181363553 -0.073350733
149 0.704577839 0.181363553
150 0.321934982 0.704577839
151 0.038220696 0.321934982
152 0.169006410 0.038220696
153 -0.356636447 0.169006410
154 -0.500350733 -0.356636447
155 -0.543922161 -0.500350733
156 -1.179011905 -0.543922161
157 -0.475940476 -1.179011905
158 -1.111369048 -0.475940476
159 -1.153869048 -1.111369048
160 -1.794154762 -1.153869048
161 -2.181940476 -1.794154762
162 -0.484583333 -2.181940476
163 0.836702381 -0.484583333
164 0.582488095 0.836702381
165 0.267845238 0.582488095
166 0.137130952 0.267845238
167 0.291559524 0.137130952
168 NA 0.291559524
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.588797619 5.160726190
[2,] 3.912369048 3.588797619
[3,] 3.387869048 3.912369048
[4,] 3.366583333 3.387869048
[5,] 2.369797619 3.366583333
[6,] 0.880154762 2.369797619
[7,] 0.490440476 0.880154762
[8,] 0.249226190 0.490440476
[9,] 0.235583333 0.249226190
[10,] 0.569869048 0.235583333
[11,] 0.017297619 0.569869048
[12,] -0.505792125 0.017297619
[13,] 0.637279304 -0.505792125
[14,] 0.247850733 0.637279304
[15,] -0.125649267 0.247850733
[16,] -1.129934982 -0.125649267
[17,] -1.675720696 -1.129934982
[18,] -0.560363553 -1.675720696
[19,] -0.029077839 -0.560363553
[20,] -0.263292125 -0.029077839
[21,] -0.323934982 -0.263292125
[22,] 0.214350733 -0.323934982
[23,] -0.222220696 0.214350733
[24,] -0.450310440 -0.222220696
[25,] -0.859239011 -0.450310440
[26,] -0.313667582 -0.859239011
[27,] -0.565167582 -0.313667582
[28,] -1.102453297 -0.565167582
[29,] -0.756239011 -1.102453297
[30,] -0.531881868 -0.756239011
[31,] -0.791596154 -0.531881868
[32,] -1.572810440 -0.791596154
[33,] -0.734453297 -1.572810440
[34,] -0.928167582 -0.734453297
[35,] -1.164739011 -0.928167582
[36,] -1.281828755 -1.164739011
[37,] -1.336757326 -1.281828755
[38,] -1.922185897 -1.336757326
[39,] -2.064685897 -1.922185897
[40,] -2.005971612 -2.064685897
[41,] -0.447757326 -2.005971612
[42,] -0.820400183 -0.447757326
[43,] -0.990114469 -0.820400183
[44,] -0.991328755 -0.990114469
[45,] -1.411971612 -0.991328755
[46,] -0.910685897 -1.411971612
[47,] -1.155257326 -0.910685897
[48,] -0.668347070 -1.155257326
[49,] -0.885275641 -0.668347070
[50,] -0.111704212 -0.885275641
[51,] 0.550795788 -0.111704212
[52,] 1.110510073 0.550795788
[53,] -0.181275641 1.110510073
[54,] -0.695918498 -0.181275641
[55,] -0.726632784 -0.695918498
[56,] -0.573847070 -0.726632784
[57,] -0.509489927 -0.573847070
[58,] -0.788204212 -0.509489927
[59,] -0.631775641 -0.788204212
[60,] -0.427865385 -0.631775641
[61,] 0.827206044 -0.427865385
[62,] -0.155222527 0.827206044
[63,] 0.472277473 -0.155222527
[64,] -0.222008242 0.472277473
[65,] 0.460206044 -0.222008242
[66,] 0.641563187 0.460206044
[67,] -0.005151099 0.641563187
[68,] -0.124365385 -0.005151099
[69,] -0.094008242 -0.124365385
[70,] -0.350722527 -0.094008242
[71,] -0.084293956 -0.350722527
[72,] -0.359383700 -0.084293956
[73,] -0.394312271 -0.359383700
[74,] -0.898740842 -0.394312271
[75,] -1.361240842 -0.898740842
[76,] -1.106526557 -1.361240842
[77,] 0.087687729 -1.106526557
[78,] 0.024044872 0.087687729
[79,] -0.249669414 0.024044872
[80,] -0.370883700 -0.249669414
[81,] -0.447526557 -0.370883700
[82,] -0.595240842 -0.447526557
[83,] 0.199187729 -0.595240842
[84,] -0.235902015 0.199187729
[85,] -0.462830586 -0.235902015
[86,] -0.551259158 -0.462830586
[87,] -0.387759158 -0.551259158
[88,] -0.106044872 -0.387759158
[89,] -0.456830586 -0.106044872
[90,] 0.314526557 -0.456830586
[91,] 0.097812271 0.314526557
[92,] 0.244597985 0.097812271
[93,] 0.372955128 0.244597985
[94,] 1.046240842 0.372955128
[95,] 0.229669414 1.046240842
[96,] -0.385420330 0.229669414
[97,] -0.245348901 -0.385420330
[98,] 0.423222527 -0.245348901
[99,] 1.306722527 0.423222527
[100,] 1.230436813 1.306722527
[101,] 0.587651099 1.230436813
[102,] -0.430991758 0.587651099
[103,] -0.072706044 -0.430991758
[104,] -0.313920330 -0.072706044
[105,] -0.152563187 -0.313920330
[106,] 0.069722527 -0.152563187
[107,] 0.295151099 0.069722527
[108,] -0.494938645 0.295151099
[109,] 0.247132784 -0.494938645
[110,] -0.280295788 0.247132784
[111,] -1.859795788 -0.280295788
[112,] -1.655081502 -1.859795788
[113,] 0.242132784 -1.655081502
[114,] 0.781489927 0.242132784
[115,] 1.205775641 0.781489927
[116,] 1.005561355 1.205775641
[117,] 0.809918498 1.005561355
[118,] 0.608204212 0.809918498
[119,] 1.045632784 0.608204212
[120,] 0.289543040 1.045632784
[121,] -0.216385531 0.289543040
[122,] 0.470185897 -0.216385531
[123,] 1.197685897 0.470185897
[124,] 1.662400183 1.197685897
[125,] 0.719614469 1.662400183
[126,] 0.959971612 0.719614469
[127,] 0.333257326 0.959971612
[128,] 0.705043040 0.333257326
[129,] 1.719400183 0.705043040
[130,] 0.763685897 1.719400183
[131,] 0.709114469 0.763685897
[132,] 0.219024725 0.709114469
[133,] -0.028903846 0.219024725
[134,] -0.343332418 -0.028903846
[135,] 0.676167582 -0.343332418
[136,] 1.570881868 0.676167582
[137,] 0.528096154 1.570881868
[138,] -0.399546703 0.528096154
[139,] -0.137260989 -0.399546703
[140,] 1.254524725 -0.137260989
[141,] 0.624881868 1.254524725
[142,] 0.664167582 0.624881868
[143,] 1.014596154 0.664167582
[144,] 0.319506410 1.014596154
[145,] -0.395422161 0.319506410
[146,] 0.634149267 -0.395422161
[147,] -0.073350733 0.634149267
[148,] 0.181363553 -0.073350733
[149,] 0.704577839 0.181363553
[150,] 0.321934982 0.704577839
[151,] 0.038220696 0.321934982
[152,] 0.169006410 0.038220696
[153,] -0.356636447 0.169006410
[154,] -0.500350733 -0.356636447
[155,] -0.543922161 -0.500350733
[156,] -1.179011905 -0.543922161
[157,] -0.475940476 -1.179011905
[158,] -1.111369048 -0.475940476
[159,] -1.153869048 -1.111369048
[160,] -1.794154762 -1.153869048
[161,] -2.181940476 -1.794154762
[162,] -0.484583333 -2.181940476
[163,] 0.836702381 -0.484583333
[164,] 0.582488095 0.836702381
[165,] 0.267845238 0.582488095
[166,] 0.137130952 0.267845238
[167,] 0.291559524 0.137130952
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.588797619 5.160726190
2 3.912369048 3.588797619
3 3.387869048 3.912369048
4 3.366583333 3.387869048
5 2.369797619 3.366583333
6 0.880154762 2.369797619
7 0.490440476 0.880154762
8 0.249226190 0.490440476
9 0.235583333 0.249226190
10 0.569869048 0.235583333
11 0.017297619 0.569869048
12 -0.505792125 0.017297619
13 0.637279304 -0.505792125
14 0.247850733 0.637279304
15 -0.125649267 0.247850733
16 -1.129934982 -0.125649267
17 -1.675720696 -1.129934982
18 -0.560363553 -1.675720696
19 -0.029077839 -0.560363553
20 -0.263292125 -0.029077839
21 -0.323934982 -0.263292125
22 0.214350733 -0.323934982
23 -0.222220696 0.214350733
24 -0.450310440 -0.222220696
25 -0.859239011 -0.450310440
26 -0.313667582 -0.859239011
27 -0.565167582 -0.313667582
28 -1.102453297 -0.565167582
29 -0.756239011 -1.102453297
30 -0.531881868 -0.756239011
31 -0.791596154 -0.531881868
32 -1.572810440 -0.791596154
33 -0.734453297 -1.572810440
34 -0.928167582 -0.734453297
35 -1.164739011 -0.928167582
36 -1.281828755 -1.164739011
37 -1.336757326 -1.281828755
38 -1.922185897 -1.336757326
39 -2.064685897 -1.922185897
40 -2.005971612 -2.064685897
41 -0.447757326 -2.005971612
42 -0.820400183 -0.447757326
43 -0.990114469 -0.820400183
44 -0.991328755 -0.990114469
45 -1.411971612 -0.991328755
46 -0.910685897 -1.411971612
47 -1.155257326 -0.910685897
48 -0.668347070 -1.155257326
49 -0.885275641 -0.668347070
50 -0.111704212 -0.885275641
51 0.550795788 -0.111704212
52 1.110510073 0.550795788
53 -0.181275641 1.110510073
54 -0.695918498 -0.181275641
55 -0.726632784 -0.695918498
56 -0.573847070 -0.726632784
57 -0.509489927 -0.573847070
58 -0.788204212 -0.509489927
59 -0.631775641 -0.788204212
60 -0.427865385 -0.631775641
61 0.827206044 -0.427865385
62 -0.155222527 0.827206044
63 0.472277473 -0.155222527
64 -0.222008242 0.472277473
65 0.460206044 -0.222008242
66 0.641563187 0.460206044
67 -0.005151099 0.641563187
68 -0.124365385 -0.005151099
69 -0.094008242 -0.124365385
70 -0.350722527 -0.094008242
71 -0.084293956 -0.350722527
72 -0.359383700 -0.084293956
73 -0.394312271 -0.359383700
74 -0.898740842 -0.394312271
75 -1.361240842 -0.898740842
76 -1.106526557 -1.361240842
77 0.087687729 -1.106526557
78 0.024044872 0.087687729
79 -0.249669414 0.024044872
80 -0.370883700 -0.249669414
81 -0.447526557 -0.370883700
82 -0.595240842 -0.447526557
83 0.199187729 -0.595240842
84 -0.235902015 0.199187729
85 -0.462830586 -0.235902015
86 -0.551259158 -0.462830586
87 -0.387759158 -0.551259158
88 -0.106044872 -0.387759158
89 -0.456830586 -0.106044872
90 0.314526557 -0.456830586
91 0.097812271 0.314526557
92 0.244597985 0.097812271
93 0.372955128 0.244597985
94 1.046240842 0.372955128
95 0.229669414 1.046240842
96 -0.385420330 0.229669414
97 -0.245348901 -0.385420330
98 0.423222527 -0.245348901
99 1.306722527 0.423222527
100 1.230436813 1.306722527
101 0.587651099 1.230436813
102 -0.430991758 0.587651099
103 -0.072706044 -0.430991758
104 -0.313920330 -0.072706044
105 -0.152563187 -0.313920330
106 0.069722527 -0.152563187
107 0.295151099 0.069722527
108 -0.494938645 0.295151099
109 0.247132784 -0.494938645
110 -0.280295788 0.247132784
111 -1.859795788 -0.280295788
112 -1.655081502 -1.859795788
113 0.242132784 -1.655081502
114 0.781489927 0.242132784
115 1.205775641 0.781489927
116 1.005561355 1.205775641
117 0.809918498 1.005561355
118 0.608204212 0.809918498
119 1.045632784 0.608204212
120 0.289543040 1.045632784
121 -0.216385531 0.289543040
122 0.470185897 -0.216385531
123 1.197685897 0.470185897
124 1.662400183 1.197685897
125 0.719614469 1.662400183
126 0.959971612 0.719614469
127 0.333257326 0.959971612
128 0.705043040 0.333257326
129 1.719400183 0.705043040
130 0.763685897 1.719400183
131 0.709114469 0.763685897
132 0.219024725 0.709114469
133 -0.028903846 0.219024725
134 -0.343332418 -0.028903846
135 0.676167582 -0.343332418
136 1.570881868 0.676167582
137 0.528096154 1.570881868
138 -0.399546703 0.528096154
139 -0.137260989 -0.399546703
140 1.254524725 -0.137260989
141 0.624881868 1.254524725
142 0.664167582 0.624881868
143 1.014596154 0.664167582
144 0.319506410 1.014596154
145 -0.395422161 0.319506410
146 0.634149267 -0.395422161
147 -0.073350733 0.634149267
148 0.181363553 -0.073350733
149 0.704577839 0.181363553
150 0.321934982 0.704577839
151 0.038220696 0.321934982
152 0.169006410 0.038220696
153 -0.356636447 0.169006410
154 -0.500350733 -0.356636447
155 -0.543922161 -0.500350733
156 -1.179011905 -0.543922161
157 -0.475940476 -1.179011905
158 -1.111369048 -0.475940476
159 -1.153869048 -1.111369048
160 -1.794154762 -1.153869048
161 -2.181940476 -1.794154762
162 -0.484583333 -2.181940476
163 0.836702381 -0.484583333
164 0.582488095 0.836702381
165 0.267845238 0.582488095
166 0.137130952 0.267845238
167 0.291559524 0.137130952
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/7de6s1322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/8mowk1322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/98d2b1322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/wessaorg/rcomp/tmp/1064or1322918521.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/11pivz1322918521.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/124ahj1322918521.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/135p1v1322918521.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/142h6g1322918521.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/15vd8h1322918521.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/16151a1322918521.tab")
+ }
>
> try(system("convert tmp/1xkgi1322918521.ps tmp/1xkgi1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/22t2d1322918521.ps tmp/22t2d1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/3klu31322918521.ps tmp/3klu31322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/49lfh1322918521.ps tmp/49lfh1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/5fu8i1322918521.ps tmp/5fu8i1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/6qcfb1322918521.ps tmp/6qcfb1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/7de6s1322918521.ps tmp/7de6s1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/8mowk1322918521.ps tmp/8mowk1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/98d2b1322918521.ps tmp/98d2b1322918521.png",intern=TRUE))
character(0)
> try(system("convert tmp/1064or1322918521.ps tmp/1064or1322918521.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.749 0.493 5.412