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(9
+ ,41
+ ,38
+ ,14
+ ,12
+ ,9
+ ,39
+ ,32
+ ,18
+ ,11
+ ,9
+ ,30
+ ,35
+ ,11
+ ,14
+ ,9
+ ,31
+ ,33
+ ,12
+ ,12
+ ,9
+ ,34
+ ,37
+ ,16
+ ,21
+ ,9
+ ,35
+ ,29
+ ,18
+ ,12
+ ,9
+ ,39
+ ,31
+ ,14
+ ,22
+ ,9
+ ,34
+ ,36
+ ,14
+ ,11
+ ,9
+ ,36
+ ,35
+ ,15
+ ,10
+ ,9
+ ,37
+ ,38
+ ,15
+ ,13
+ ,9
+ ,38
+ ,31
+ ,17
+ ,10
+ ,9
+ ,36
+ ,34
+ ,19
+ ,8
+ ,9
+ ,38
+ ,35
+ ,10
+ ,15
+ ,9
+ ,39
+ ,38
+ ,16
+ ,14
+ ,9
+ ,33
+ ,37
+ ,18
+ ,10
+ ,9
+ ,32
+ ,33
+ ,14
+ ,14
+ ,9
+ ,36
+ ,32
+ ,14
+ ,14
+ ,9
+ ,38
+ ,38
+ ,17
+ ,11
+ ,9
+ ,39
+ ,38
+ ,14
+ ,10
+ ,9
+ ,32
+ ,32
+ ,16
+ ,13
+ ,9
+ ,32
+ ,33
+ ,18
+ ,9.5
+ ,9
+ ,31
+ ,31
+ ,11
+ ,14
+ ,9
+ ,39
+ ,38
+ ,14
+ ,12
+ ,9
+ ,37
+ ,39
+ ,12
+ ,14
+ ,9
+ ,39
+ ,32
+ ,17
+ ,11
+ ,9
+ ,41
+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=c(5
+ ,264)
+ ,dimnames=list(c('tijd'
+ ,'connected'
+ ,'separated'
+ ,'happiness'
+ ,'depression')
+ ,1:264))
> y <- array(NA,dim=c(5,264),dimnames=list(c('tijd','connected','separated','happiness','depression'),1:264))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> #'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
depression tijd connected separated happiness
1 12.0 9 41 38 14
2 11.0 9 39 32 18
3 14.0 9 30 35 11
4 12.0 9 31 33 12
5 21.0 9 34 37 16
6 12.0 9 35 29 18
7 22.0 9 39 31 14
8 11.0 9 34 36 14
9 10.0 9 36 35 15
10 13.0 9 37 38 15
11 10.0 9 38 31 17
12 8.0 9 36 34 19
13 15.0 9 38 35 10
14 14.0 9 39 38 16
15 10.0 9 33 37 18
16 14.0 9 32 33 14
17 14.0 9 36 32 14
18 11.0 9 38 38 17
19 10.0 9 39 38 14
20 13.0 9 32 32 16
21 9.5 9 32 33 18
22 14.0 9 31 31 11
23 12.0 9 39 38 14
24 14.0 9 37 39 12
25 11.0 9 39 32 17
26 9.0 9 41 32 9
27 11.0 9 36 35 16
28 15.0 9 33 37 14
29 14.0 9 33 33 15
30 13.0 9 34 33 11
31 9.0 9 31 31 16
32 15.0 9 27 32 13
33 10.0 9 37 31 17
34 11.0 9 34 37 15
35 13.0 9 34 30 14
36 8.0 9 32 33 16
37 20.0 9 29 31 9
38 12.0 9 36 33 15
39 10.0 9 29 31 17
40 10.0 9 35 33 13
41 9.0 9 37 32 15
42 14.0 9 34 33 16
43 8.0 9 38 32 16
44 14.0 9 35 33 12
45 11.0 9 38 28 15
46 13.0 9 37 35 11
47 9.0 9 38 39 15
48 11.0 9 33 34 15
49 15.0 9 36 38 17
50 11.0 9 38 32 13
51 10.0 9 32 38 16
52 14.0 9 32 30 14
53 18.0 9 32 33 11
54 14.0 9 34 38 12
55 11.0 9 32 32 12
56 14.5 9 37 35 15
57 13.0 9 39 34 16
58 9.0 9 29 34 15
59 10.0 9 37 36 12
60 15.0 9 35 34 12
61 20.0 9 30 28 8
62 12.0 9 38 34 13
63 12.0 9 34 35 11
64 14.0 9 31 35 14
65 13.0 9 34 31 15
66 11.0 10 35 37 10
67 17.0 10 36 35 11
68 12.0 10 30 27 12
69 13.0 10 39 40 15
70 14.0 10 35 37 15
71 13.0 10 38 36 14
72 15.0 10 31 38 16
73 13.0 10 34 39 15
74 10.0 10 38 41 15
75 11.0 10 34 27 13
76 19.0 10 39 30 12
77 13.0 10 37 37 17
78 17.0 10 34 31 13
79 13.0 10 28 31 15
80 9.0 10 37 27 13
81 11.0 10 33 36 15
82 9.0 10 35 37 15
83 12.0 10 37 33 16
84 12.0 10 32 34 15
85 13.0 10 33 31 14
86 13.0 10 38 39 15
87 12.0 10 33 34 14
88 15.0 10 29 32 13
89 22.0 10 33 33 7
90 13.0 10 31 36 17
91 15.0 10 36 32 13
92 13.0 10 35 41 15
93 15.0 10 32 28 14
94 12.5 10 29 30 13
95 11.0 10 39 36 16
96 16.0 10 37 35 12
97 11.0 10 35 31 14
98 11.0 10 37 34 17
99 10.0 10 32 36 15
100 10.0 10 38 36 17
101 16.0 10 37 35 12
102 12.0 10 36 37 16
103 11.0 10 32 28 11
104 16.0 10 33 39 15
105 19.0 10 40 32 9
106 11.0 10 38 35 16
107 16.0 10 41 39 15
108 15.0 10 36 35 10
109 24.0 10 43 42 10
110 14.0 10 30 34 15
111 15.0 10 31 33 11
112 11.0 10 32 41 13
113 15.0 10 32 33 14
114 12.0 10 37 34 18
115 10.0 10 37 32 16
116 14.0 10 33 40 14
117 13.0 10 34 40 14
118 9.0 10 33 35 14
119 15.0 10 38 36 14
120 15.0 10 33 37 12
121 14.0 10 31 27 14
122 11.0 10 38 39 15
123 8.0 10 37 38 15
124 11.0 10 36 31 15
125 11.0 10 31 33 13
126 8.0 10 39 32 17
127 10.0 10 44 39 17
128 11.0 10 33 36 19
129 13.0 10 35 33 15
130 11.0 10 32 33 13
131 20.0 10 28 32 9
132 10.0 10 40 37 15
133 15.0 10 27 30 15
134 12.0 10 37 38 15
135 14.0 10 32 29 16
136 23.0 10 28 22 11
137 14.0 10 34 35 14
138 16.0 10 30 35 11
139 11.0 10 35 34 15
140 12.0 10 31 35 13
141 10.0 10 32 34 15
142 14.0 10 30 37 16
143 12.0 10 30 35 14
144 12.0 10 31 23 15
145 11.0 10 40 31 16
146 12.0 10 32 27 16
147 13.0 10 36 36 11
148 11.0 10 32 31 12
149 19.0 10 35 32 9
150 12.0 10 38 39 16
151 17.0 10 42 37 13
152 9.0 10 34 38 16
153 12.0 10 35 39 12
154 19.0 9 38 34 9
155 18.0 10 33 31 13
156 15.0 10 36 32 13
157 14.0 10 32 37 14
158 11.0 10 33 36 19
159 9.0 10 34 32 13
160 18.0 10 32 38 12
161 16.0 10 34 36 13
162 24.0 11 27 26 10
163 14.0 11 31 26 14
164 20.0 11 38 33 16
165 18.0 11 34 39 10
166 23.0 11 24 30 11
167 12.0 11 30 33 14
168 14.0 11 26 25 12
169 16.0 11 34 38 9
170 18.0 11 27 37 9
171 20.0 11 37 31 11
172 12.0 11 36 37 16
173 12.0 11 41 35 9
174 17.0 11 29 25 13
175 13.0 11 36 28 16
176 9.0 11 32 35 13
177 16.0 11 37 33 9
178 18.0 11 30 30 12
179 10.0 11 31 31 16
180 14.0 11 38 37 11
181 11.0 11 36 36 14
182 9.0 11 35 30 13
183 11.0 11 31 36 15
184 10.0 11 38 32 14
185 11.0 11 22 28 16
186 19.0 11 32 36 13
187 14.0 11 36 34 14
188 12.0 11 39 31 15
189 14.0 11 28 28 13
190 21.0 11 32 36 11
191 13.0 11 32 36 11
192 10.0 11 38 40 14
193 15.0 11 32 33 15
194 16.0 11 35 37 11
195 14.0 11 32 32 15
196 12.0 11 37 38 12
197 19.0 11 34 31 14
198 15.0 11 33 37 14
199 19.0 11 33 33 8
200 13.0 11 26 32 13
201 17.0 11 30 30 9
202 12.0 11 24 30 15
203 11.0 11 34 31 17
204 14.0 11 34 32 13
205 11.0 11 33 34 15
206 13.0 11 34 36 15
207 12.0 11 35 37 14
208 15.0 11 35 36 16
209 14.0 11 36 33 13
210 12.0 11 34 33 16
211 17.0 11 34 33 9
212 11.0 11 41 44 16
213 18.0 11 32 39 11
214 13.0 11 30 32 10
215 17.0 11 35 35 11
216 13.0 11 28 25 15
217 11.0 11 33 35 17
218 12.0 11 39 34 14
219 22.0 11 36 35 8
220 14.0 11 36 39 15
221 12.0 11 35 33 11
222 12.0 11 38 36 16
223 17.0 11 33 32 10
224 9.0 11 31 32 15
225 21.0 11 34 36 9
226 10.0 11 32 36 16
227 11.0 11 31 32 19
228 12.0 11 33 34 12
229 23.0 11 34 33 8
230 13.0 11 34 35 11
231 12.0 11 34 30 14
232 16.0 11 33 38 9
233 9.0 11 32 34 15
234 17.0 11 41 33 13
235 9.0 11 34 32 16
236 14.0 11 36 31 11
237 17.0 11 37 30 12
238 13.0 11 36 27 13
239 11.0 11 29 31 10
240 12.0 11 37 30 11
241 10.0 11 27 32 12
242 19.0 11 35 35 8
243 16.0 11 28 28 12
244 16.0 11 35 33 12
245 14.0 11 37 31 15
246 20.0 11 29 35 11
247 15.0 11 32 35 13
248 23.0 11 36 32 14
249 20.0 11 19 21 10
250 16.0 11 21 20 12
251 14.0 11 31 34 15
252 17.0 11 33 32 13
253 11.0 11 36 34 13
254 13.0 11 33 32 13
255 17.0 11 37 33 12
256 15.0 11 34 33 12
257 21.0 11 35 37 9
258 18.0 11 31 32 9
259 15.0 11 37 34 15
260 8.0 11 35 30 10
261 12.0 11 27 30 14
262 12.0 11 34 38 15
263 22.0 11 40 36 7
264 12.0 11 29 32 14
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) tijd connected separated happiness
21.688419 0.385687 -0.037340 -0.009147 -0.770373
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.6459 -1.7889 -0.1081 1.6533 9.7744
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 21.688419 3.463790 6.261 1.58e-09 ***
tijd 0.385687 0.230651 1.672 0.0957 .
connected -0.037340 0.052198 -0.715 0.4750
separated -0.009147 0.052768 -0.173 0.8625
happiness -0.770373 0.072131 -10.680 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.818 on 259 degrees of freedom
Multiple R-squared: 0.3505, Adjusted R-squared: 0.3404
F-statistic: 34.94 on 4 and 259 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.999607205 0.0007855903 0.0003927952
[2,] 0.999558026 0.0008839478 0.0004419739
[3,] 0.998887087 0.0022258268 0.0011129134
[4,] 0.998664495 0.0026710109 0.0013355054
[5,] 0.998183998 0.0036320033 0.0018160017
[6,] 0.996767777 0.0064644457 0.0032322228
[7,] 0.994603318 0.0107933635 0.0053966817
[8,] 0.990598071 0.0188038589 0.0094019294
[9,] 0.984833381 0.0303332382 0.0151666191
[10,] 0.975873752 0.0482524964 0.0241262482
[11,] 0.964123747 0.0717525057 0.0358762528
[12,] 0.965260267 0.0694794654 0.0347397327
[13,] 0.950322201 0.0993555973 0.0496777987
[14,] 0.934423368 0.1311532638 0.0655766319
[15,] 0.913010906 0.1739781880 0.0869890940
[16,] 0.887256433 0.2254871333 0.1127435666
[17,] 0.852733281 0.2945334376 0.1472667188
[18,] 0.821485018 0.3570299632 0.1785149816
[19,] 0.928124658 0.1437506840 0.0718753420
[20,] 0.907958216 0.1840835670 0.0920417835
[21,] 0.893094126 0.2138117476 0.1069058738
[22,] 0.869745629 0.2605087412 0.1302543706
[23,] 0.841357355 0.3172852908 0.1586426454
[24,] 0.849189730 0.3016205407 0.1508102703
[25,] 0.821443626 0.3571127473 0.1785563737
[26,] 0.790667067 0.4186658660 0.2093329330
[27,] 0.762030990 0.4759380197 0.2379690098
[28,] 0.718358584 0.5632828317 0.2816414158
[29,] 0.758326716 0.4833465680 0.2416732840
[30,] 0.809489768 0.3810204635 0.1905102317
[31,] 0.772210746 0.4555785083 0.2277892542
[32,] 0.745782773 0.5084344548 0.2542172274
[33,] 0.755804425 0.4883911504 0.2441955752
[34,] 0.754670767 0.4906584658 0.2453292329
[35,] 0.740959893 0.5180802150 0.2590401075
[36,] 0.747414693 0.5051706143 0.2525853072
[37,] 0.707735041 0.5845299184 0.2922649592
[38,] 0.665528616 0.6689427683 0.3344713841
[39,] 0.628576237 0.7428475251 0.3714237626
[40,] 0.632170481 0.7356590388 0.3678295194
[41,] 0.596212727 0.8075745464 0.4037872732
[42,] 0.636188429 0.7276231427 0.3638115713
[43,] 0.606994909 0.7860101827 0.3930050913
[44,] 0.589926099 0.8201478021 0.4100739011
[45,] 0.553483219 0.8930335626 0.4465167813
[46,] 0.573328275 0.8533434510 0.4266717255
[47,] 0.528652263 0.9426954738 0.4713477369
[48,] 0.536270914 0.9274581729 0.4637290864
[49,] 0.529269956 0.9414600887 0.4707300443
[50,] 0.504727121 0.9905457582 0.4952728791
[51,] 0.534117574 0.9317648513 0.4658824257
[52,] 0.563058748 0.8738825030 0.4369412515
[53,] 0.530377309 0.9392453823 0.4696226912
[54,] 0.557153551 0.8856928989 0.4428464494
[55,] 0.520916539 0.9581669223 0.4790834612
[56,] 0.515408198 0.9691836040 0.4845918020
[57,] 0.477556723 0.9551134451 0.5224432774
[58,] 0.438673782 0.8773475638 0.5613262181
[59,] 0.437004500 0.8740090002 0.5629954999
[60,] 0.484397525 0.9687950495 0.5156024752
[61,] 0.467063408 0.9341268159 0.5329365920
[62,] 0.440975233 0.8819504662 0.5590247669
[63,] 0.418481067 0.8369621342 0.5815189329
[64,] 0.380043726 0.7600874512 0.6199562744
[65,] 0.377130470 0.7542609400 0.6228695300
[66,] 0.339864267 0.6797285339 0.6601357331
[67,] 0.329006189 0.6580123778 0.6709938111
[68,] 0.322229932 0.6444598630 0.6777700685
[69,] 0.417499191 0.8349983814 0.5825008093
[70,] 0.393575018 0.7871500355 0.6064249823
[71,] 0.396253913 0.7925078262 0.6037460869
[72,] 0.360868169 0.7217363381 0.6391318310
[73,] 0.434120809 0.8682416172 0.5658791914
[74,] 0.411422848 0.8228456955 0.5885771523
[75,] 0.432507302 0.8650146034 0.5674926983
[76,] 0.395300681 0.7906013629 0.6046993186
[77,] 0.360347215 0.7206944303 0.6396527849
[78,] 0.325194812 0.6503896245 0.6748051878
[79,] 0.293999599 0.5879991982 0.7060004009
[80,] 0.267237469 0.5344749370 0.7327625315
[81,] 0.240460056 0.4809201116 0.7595399442
[82,] 0.290077413 0.5801548266 0.7099225867
[83,] 0.268469379 0.5369387573 0.7315306213
[84,] 0.244103424 0.4882068487 0.7558965756
[85,] 0.216332475 0.4326649490 0.7836675255
[86,] 0.197516262 0.3950325248 0.8024837376
[87,] 0.183069586 0.3661391716 0.8169304142
[88,] 0.160391987 0.3207839736 0.8396080132
[89,] 0.145809009 0.2916180186 0.8541909907
[90,] 0.138318633 0.2766372667 0.8616813666
[91,] 0.118912324 0.2378246489 0.8810876756
[92,] 0.118287423 0.2365748470 0.8817125765
[93,] 0.102868984 0.2057379673 0.8971310164
[94,] 0.092617582 0.1852351646 0.9073824177
[95,] 0.078333181 0.1566663630 0.9216668185
[96,] 0.101078304 0.2021566075 0.8989216962
[97,] 0.108948705 0.2178974104 0.8910512948
[98,] 0.110170234 0.2203404678 0.8898297661
[99,] 0.094810654 0.1896213087 0.9051893456
[100,] 0.107062442 0.2141248836 0.8929375582
[101,] 0.093818070 0.1876361394 0.9061819303
[102,] 0.247489143 0.4949782856 0.7525108572
[103,] 0.226061297 0.4521225932 0.7739387034
[104,] 0.201051081 0.4021021622 0.7989489189
[105,] 0.211375076 0.4227501526 0.7886249237
[106,] 0.195213969 0.3904279389 0.8047860305
[107,] 0.180977402 0.3619548036 0.8190225982
[108,] 0.166717277 0.3334345546 0.8332827227
[109,] 0.146822177 0.2936443533 0.8531778233
[110,] 0.128201545 0.2564030908 0.8717984546
[111,] 0.155453260 0.3109065201 0.8445467400
[112,] 0.143250580 0.2865011607 0.8567494196
[113,] 0.124021247 0.2480424949 0.8759787526
[114,] 0.108559693 0.2171193852 0.8914403074
[115,] 0.097839190 0.1956783810 0.9021608095
[116,] 0.124455653 0.2489113056 0.8755443472
[117,] 0.111455109 0.2229102185 0.8885448908
[118,] 0.114716375 0.2294327509 0.8852836245
[119,] 0.115801007 0.2316020132 0.8841989934
[120,] 0.101187904 0.2023758087 0.8988120957
[121,] 0.090630023 0.1812600465 0.9093699768
[122,] 0.077439300 0.1548785990 0.9225607005
[123,] 0.080012562 0.1600251242 0.9199874379
[124,] 0.081088307 0.1621766140 0.9189116930
[125,] 0.077164504 0.1543290085 0.9228354957
[126,] 0.072815366 0.1456307312 0.9271846344
[127,] 0.061552062 0.1231041241 0.9384479379
[128,] 0.057312959 0.1146259182 0.9426870409
[129,] 0.134478359 0.2689567183 0.8655216408
[130,] 0.117347231 0.2346944623 0.8826527689
[131,] 0.100890652 0.2017813031 0.8991093485
[132,] 0.089846022 0.1796920436 0.9101539782
[133,] 0.083970448 0.1679408956 0.9160295522
[134,] 0.082109898 0.1642197961 0.9178901019
[135,] 0.076168638 0.1523372753 0.9238313623
[136,] 0.067193151 0.1343863025 0.9328068488
[137,] 0.057338539 0.1146770790 0.9426614605
[138,] 0.048259444 0.0965188874 0.9517405563
[139,] 0.039975561 0.0799511224 0.9600244388
[140,] 0.038762429 0.0775248588 0.9612375706
[141,] 0.048428771 0.0968575425 0.9515712287
[142,] 0.043396296 0.0867925918 0.9566037041
[143,] 0.035840915 0.0716818305 0.9641590848
[144,] 0.037137453 0.0742749059 0.9628625470
[145,] 0.037354163 0.0747083262 0.9626458369
[146,] 0.038720509 0.0774410180 0.9612794910
[147,] 0.035115028 0.0702300564 0.9648849718
[148,] 0.038928137 0.0778562734 0.9610718633
[149,] 0.032457100 0.0649142004 0.9675428998
[150,] 0.026649888 0.0532997752 0.9733501124
[151,] 0.022972324 0.0459446482 0.9770276759
[152,] 0.041744096 0.0834881918 0.9582559041
[153,] 0.039091193 0.0781823862 0.9609088069
[154,] 0.033566437 0.0671328747 0.9664335627
[155,] 0.078580558 0.1571611156 0.9214194422
[156,] 0.066307125 0.1326142495 0.9336928752
[157,] 0.188166341 0.3763326828 0.8118336586
[158,] 0.167965173 0.3359303464 0.8320348268
[159,] 0.277744240 0.5554884795 0.7222557603
[160,] 0.263911279 0.5278225573 0.7360887213
[161,] 0.247251507 0.4945030133 0.7527484934
[162,] 0.228721045 0.4574420904 0.7712789548
[163,] 0.202329670 0.4046593397 0.7976703302
[164,] 0.227433754 0.4548675075 0.7725662462
[165,] 0.201892737 0.4037854734 0.7981072633
[166,] 0.279512440 0.5590248808 0.7204875596
[167,] 0.271400933 0.5428018665 0.7285990667
[168,] 0.247386284 0.4947725683 0.7526137158
[169,] 0.335804684 0.6716093685 0.6641953157
[170,] 0.312085465 0.6241709309 0.6879145345
[171,] 0.309874963 0.6197499261 0.6901250370
[172,] 0.295002672 0.5900053439 0.7049973281
[173,] 0.277647284 0.5552945682 0.7223527159
[174,] 0.270958710 0.5419174192 0.7290412904
[175,] 0.353673988 0.7073479759 0.6463260121
[176,] 0.332386345 0.6647726891 0.6676136555
[177,] 0.349648330 0.6992966600 0.6503516700
[178,] 0.321545653 0.6430913054 0.6784543473
[179,] 0.382340503 0.7646810054 0.6176594973
[180,] 0.346478072 0.6929561437 0.6535219282
[181,] 0.313578302 0.6271566046 0.6864216977
[182,] 0.280648440 0.5612968799 0.7193515601
[183,] 0.359886761 0.7197735222 0.6401132389
[184,] 0.358793982 0.7175879642 0.6412060179
[185,] 0.377185993 0.7543719868 0.6228140066
[186,] 0.364725754 0.7294515089 0.6352742456
[187,] 0.327449206 0.6548984114 0.6725507943
[188,] 0.299839888 0.5996797764 0.7001601118
[189,] 0.308990160 0.6179803193 0.6910098404
[190,] 0.414566529 0.8291330589 0.5854334705
[191,] 0.386253054 0.7725061076 0.6137469462
[192,] 0.348499869 0.6969997382 0.6515001309
[193,] 0.317931183 0.6358623651 0.6820688175
[194,] 0.282799830 0.5655996608 0.7172001696
[195,] 0.251816417 0.5036328341 0.7481835829
[196,] 0.220106690 0.4402133808 0.7798933096
[197,] 0.190220648 0.3804412961 0.8097793519
[198,] 0.170509932 0.3410198639 0.8294900680
[199,] 0.145205387 0.2904107743 0.8547946129
[200,] 0.127851079 0.2557021586 0.8721489207
[201,] 0.133167971 0.2663359429 0.8668320286
[202,] 0.111287252 0.2225745036 0.8887127482
[203,] 0.092417487 0.1848349741 0.9075825130
[204,] 0.076440876 0.1528817526 0.9235591237
[205,] 0.063218628 0.1264372560 0.9367813720
[206,] 0.056243655 0.1124873105 0.9437563448
[207,] 0.063852116 0.1277042311 0.9361478845
[208,] 0.052143721 0.1042874429 0.9478562785
[209,] 0.042251439 0.0845028781 0.9577485610
[210,] 0.033227807 0.0664556142 0.9667721929
[211,] 0.027312883 0.0546257655 0.9726871172
[212,] 0.029063573 0.0581271467 0.9709364266
[213,] 0.023678063 0.0473561258 0.9763219371
[214,] 0.028940682 0.0578813650 0.9710593175
[215,] 0.021951440 0.0439028806 0.9780485597
[216,] 0.016374746 0.0327494922 0.9836252539
[217,] 0.017598351 0.0351967025 0.9824016488
[218,] 0.018935516 0.0378710319 0.9810644841
[219,] 0.015187199 0.0303743988 0.9848128006
[220,] 0.012498058 0.0249961155 0.9875019423
[221,] 0.012269900 0.0245397997 0.9877301002
[222,] 0.018089149 0.0361782972 0.9819108514
[223,] 0.017095832 0.0341916633 0.9829041683
[224,] 0.013284754 0.0265695078 0.9867152461
[225,] 0.010156957 0.0203139140 0.9898430430
[226,] 0.012156314 0.0243126274 0.9878436863
[227,] 0.010669222 0.0213384449 0.9893307776
[228,] 0.010990268 0.0219805352 0.9890097324
[229,] 0.008607089 0.0172141786 0.9913929107
[230,] 0.006601508 0.0132030155 0.9933984922
[231,] 0.004646036 0.0092920720 0.9953539640
[232,] 0.011664628 0.0233292555 0.9883353722
[233,] 0.016097704 0.0321954081 0.9839022959
[234,] 0.036791001 0.0735820011 0.9632089994
[235,] 0.025642367 0.0512847339 0.9743576330
[236,] 0.017236291 0.0344725830 0.9827637085
[237,] 0.011241157 0.0224823149 0.9887588425
[238,] 0.007358562 0.0147171236 0.9926414382
[239,] 0.007016591 0.0140331812 0.9929834094
[240,] 0.004163437 0.0083268747 0.9958365627
[241,] 0.132575959 0.2651519171 0.8674240414
[242,] 0.122430742 0.2448614848 0.8775692576
[243,] 0.206531197 0.4130623943 0.7934688029
[244,] 0.150906095 0.3018121897 0.8490939051
[245,] 0.199256927 0.3985138546 0.8007430727
[246,] 0.199278032 0.3985560648 0.8007219676
[247,] 0.127219055 0.2544381108 0.8727809446
[248,] 0.112893022 0.2257860433 0.8871069784
[249,] 0.061132035 0.1222640693 0.9388679653
> postscript(file="/var/www/rcomp/tmp/11ylx1321638444.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/24nfj1321638444.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/38oay1321638444.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/4fd6y1321638444.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/5cra11321638444.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 = 264
Frequency = 1
1 2 3 4 5 6
-0.49586084 1.45607262 -1.24516010 -2.45574032 9.77436025 2.27927282
7 8 9 10 11 12
9.36543198 -1.77553346 -1.93962704 1.12515317 -0.36078749 -0.86727995
13 14 15 16 17 18
-0.71681463 2.97020636 0.27776732 1.12234647 1.26255916 0.70323996
19 20 21 22 23 24
-2.57054057 1.65394663 -0.29615966 -1.24440735 -0.57054057 -0.17682045
25 26 27 28 29 30
0.68569915 -7.40260884 -0.16925357 2.19627346 1.93005981 -2.11409419
31 32 33 34 35 36
-2.39254002 1.15612690 -0.39812736 -0.99601321 0.16958587 -3.33690659
37 38 39 40 41 42
3.14016599 0.04207940 -0.69684629 -3.53600739 -2.92972751 2.73777314
43 44 45 46 47 48
-3.12201418 -0.30638086 -0.92897476 -1.98378103 -2.82836019 -1.06079341
49 50 51 52 53 54
4.62856023 -2.43313457 -1.29117270 1.09490614 2.81122608 -0.29798683
55 56 57 58 59 60
-3.42754724 2.59771283 1.93361925 -3.21015288 -4.20426079 0.70276592
61 62 63 64 65 66
2.37969205 -1.41484102 -3.09580063 1.10330017 0.94910611 -5.19622765
67 68 69 70 71 72
1.59319212 -2.93364784 0.83243948 1.65563968 -0.01186097 3.28580046
73 74 75 76 77 78
0.63659337 -2.19575361 -3.01391491 4.42985129 2.27106634 3.02267221
79 80 81 82 83 84
0.33937994 -4.90189531 -1.42818683 -3.34436032 0.46410576 -0.48382026
85 86 87 88 89 90
-0.24429420 0.78595283 -1.21685386 0.84511965 3.38138510 2.03788036
91 92 93 94 95 96
1.10649872 0.69222679 1.69092560 -1.67317390 -0.43377417 1.40090545
97 98 99 100 101 102
-2.16961446 0.24362600 -2.46552670 -0.70074057 1.40090545 0.46335301
103 104 105 106 107 108
-4.62019479 3.59925350 2.17436432 -0.48026082 3.89797243 -1.17718134
109 110 111 112 113 114
8.14822517 1.44150001 -0.61180077 -2.96053974 1.73665950 2.01399947
115 116 117 118 119 120
-1.54504102 0.83802682 -0.12463332 -4.20770708 1.98813903 0.26983955
121 122 123 124 125 126
0.64443896 -1.21404717 -4.26053381 -1.36190113 -3.07105383 -2.69998782
127 128 129 130 131 132
-0.44926104 1.65330703 0.61905256 -3.03371397 2.72628593 -2.15766099
133 134 135 136 137 138
2.29289329 -0.26053381 2.24081931 7.17556507 0.82963279 0.36915293
139 140 141 142 143 144
-1.37180066 -2.05276028 -2.48382026 2.23931381 -1.31972668 -0.62177469
145 146 147 148 149 150
-0.44216820 0.22252575 -2.39766110 -3.82238099 1.98766499 0.55632630
151 152 153 154 155 156
3.37627181 -2.60217994 -2.63718716 2.50366512 3.98533234 1.10649872
157 158 159 160 161 162
0.77324661 1.65330703 -4.96818102 3.24164646 2.06840610 7.01875187
163 164 165 166 167 168
0.24960520 8.11575865 1.39903906 6.71369286 -1.72370721 -1.48698784
169 170 171 172 173 174
-1.38048118 0.34899298 4.20825790 0.07766603 -5.14654245 2.39540522
175 176 177 178 179 180
0.99534502 -5.40110739 -1.31419548 2.70810552 -2.16391397 -1.69952156
181 182 183 184 185 186
-2.47222768 -5.33482169 -1.88855354 -3.43413506 -1.52741311 4.60803939
187 188 189 190 191 192
0.50947876 -0.63556851 -0.61449431 5.06729246 -2.93270754 -3.36096083
193 194 195 196 197 198
2.12134599 0.18845884 1.11219921 -2.95734119 5.40735869 1.42489950
199 200 201 202 203 204
0.76607159 -1.65258692 -0.60301488 -1.20481328 -0.28152091 -0.35386799
205 206 207 208 209 210
-1.83216737 0.22346605 -1.50042077 3.03117939 -0.27004148 -0.03360082
211 212 213 214 215 216
-0.42621508 -0.67160718 2.09473280 -3.81434785 1.17016528 -0.10118771
217 218 219 220 221 222
-0.28227366 -1.37850164 3.89638475 1.32558612 -3.84812828 0.14319898
223 224 225 226 227 228
0.29767174 -3.92514066 3.60122526 -2.08084021 1.15635320 -3.14328777
229 230 231 232 233 234
4.80341146 -2.86717459 -1.60178809 -1.41782105 -3.86950724 2.91665785
235 236 237 238 239 240
-3.04274760 -1.82908197 1.96948458 -1.32492216 -5.86083450 -3.80088888
241 242 243 244 245 246
-5.38562052 0.85904488 0.61513223 0.92224519 1.28975176 3.94612608
247 248 249 250 251 252
0.59889261 9.49118520 2.67429905 0.28057893 1.09315290 2.60879214
253 254 255 256 257 258
-3.26089470 -1.39120786 1.99692492 -0.11509468 3.64771191 0.45261855
259 260 261 262 263 264
2.31719209 -8.64594208 -1.86316715 -0.75824039 3.28451753 -1.77019386
> postscript(file="/var/www/rcomp/tmp/66qgx1321638444.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 = 264
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.49586084 NA
1 1.45607262 -0.49586084
2 -1.24516010 1.45607262
3 -2.45574032 -1.24516010
4 9.77436025 -2.45574032
5 2.27927282 9.77436025
6 9.36543198 2.27927282
7 -1.77553346 9.36543198
8 -1.93962704 -1.77553346
9 1.12515317 -1.93962704
10 -0.36078749 1.12515317
11 -0.86727995 -0.36078749
12 -0.71681463 -0.86727995
13 2.97020636 -0.71681463
14 0.27776732 2.97020636
15 1.12234647 0.27776732
16 1.26255916 1.12234647
17 0.70323996 1.26255916
18 -2.57054057 0.70323996
19 1.65394663 -2.57054057
20 -0.29615966 1.65394663
21 -1.24440735 -0.29615966
22 -0.57054057 -1.24440735
23 -0.17682045 -0.57054057
24 0.68569915 -0.17682045
25 -7.40260884 0.68569915
26 -0.16925357 -7.40260884
27 2.19627346 -0.16925357
28 1.93005981 2.19627346
29 -2.11409419 1.93005981
30 -2.39254002 -2.11409419
31 1.15612690 -2.39254002
32 -0.39812736 1.15612690
33 -0.99601321 -0.39812736
34 0.16958587 -0.99601321
35 -3.33690659 0.16958587
36 3.14016599 -3.33690659
37 0.04207940 3.14016599
38 -0.69684629 0.04207940
39 -3.53600739 -0.69684629
40 -2.92972751 -3.53600739
41 2.73777314 -2.92972751
42 -3.12201418 2.73777314
43 -0.30638086 -3.12201418
44 -0.92897476 -0.30638086
45 -1.98378103 -0.92897476
46 -2.82836019 -1.98378103
47 -1.06079341 -2.82836019
48 4.62856023 -1.06079341
49 -2.43313457 4.62856023
50 -1.29117270 -2.43313457
51 1.09490614 -1.29117270
52 2.81122608 1.09490614
53 -0.29798683 2.81122608
54 -3.42754724 -0.29798683
55 2.59771283 -3.42754724
56 1.93361925 2.59771283
57 -3.21015288 1.93361925
58 -4.20426079 -3.21015288
59 0.70276592 -4.20426079
60 2.37969205 0.70276592
61 -1.41484102 2.37969205
62 -3.09580063 -1.41484102
63 1.10330017 -3.09580063
64 0.94910611 1.10330017
65 -5.19622765 0.94910611
66 1.59319212 -5.19622765
67 -2.93364784 1.59319212
68 0.83243948 -2.93364784
69 1.65563968 0.83243948
70 -0.01186097 1.65563968
71 3.28580046 -0.01186097
72 0.63659337 3.28580046
73 -2.19575361 0.63659337
74 -3.01391491 -2.19575361
75 4.42985129 -3.01391491
76 2.27106634 4.42985129
77 3.02267221 2.27106634
78 0.33937994 3.02267221
79 -4.90189531 0.33937994
80 -1.42818683 -4.90189531
81 -3.34436032 -1.42818683
82 0.46410576 -3.34436032
83 -0.48382026 0.46410576
84 -0.24429420 -0.48382026
85 0.78595283 -0.24429420
86 -1.21685386 0.78595283
87 0.84511965 -1.21685386
88 3.38138510 0.84511965
89 2.03788036 3.38138510
90 1.10649872 2.03788036
91 0.69222679 1.10649872
92 1.69092560 0.69222679
93 -1.67317390 1.69092560
94 -0.43377417 -1.67317390
95 1.40090545 -0.43377417
96 -2.16961446 1.40090545
97 0.24362600 -2.16961446
98 -2.46552670 0.24362600
99 -0.70074057 -2.46552670
100 1.40090545 -0.70074057
101 0.46335301 1.40090545
102 -4.62019479 0.46335301
103 3.59925350 -4.62019479
104 2.17436432 3.59925350
105 -0.48026082 2.17436432
106 3.89797243 -0.48026082
107 -1.17718134 3.89797243
108 8.14822517 -1.17718134
109 1.44150001 8.14822517
110 -0.61180077 1.44150001
111 -2.96053974 -0.61180077
112 1.73665950 -2.96053974
113 2.01399947 1.73665950
114 -1.54504102 2.01399947
115 0.83802682 -1.54504102
116 -0.12463332 0.83802682
117 -4.20770708 -0.12463332
118 1.98813903 -4.20770708
119 0.26983955 1.98813903
120 0.64443896 0.26983955
121 -1.21404717 0.64443896
122 -4.26053381 -1.21404717
123 -1.36190113 -4.26053381
124 -3.07105383 -1.36190113
125 -2.69998782 -3.07105383
126 -0.44926104 -2.69998782
127 1.65330703 -0.44926104
128 0.61905256 1.65330703
129 -3.03371397 0.61905256
130 2.72628593 -3.03371397
131 -2.15766099 2.72628593
132 2.29289329 -2.15766099
133 -0.26053381 2.29289329
134 2.24081931 -0.26053381
135 7.17556507 2.24081931
136 0.82963279 7.17556507
137 0.36915293 0.82963279
138 -1.37180066 0.36915293
139 -2.05276028 -1.37180066
140 -2.48382026 -2.05276028
141 2.23931381 -2.48382026
142 -1.31972668 2.23931381
143 -0.62177469 -1.31972668
144 -0.44216820 -0.62177469
145 0.22252575 -0.44216820
146 -2.39766110 0.22252575
147 -3.82238099 -2.39766110
148 1.98766499 -3.82238099
149 0.55632630 1.98766499
150 3.37627181 0.55632630
151 -2.60217994 3.37627181
152 -2.63718716 -2.60217994
153 2.50366512 -2.63718716
154 3.98533234 2.50366512
155 1.10649872 3.98533234
156 0.77324661 1.10649872
157 1.65330703 0.77324661
158 -4.96818102 1.65330703
159 3.24164646 -4.96818102
160 2.06840610 3.24164646
161 7.01875187 2.06840610
162 0.24960520 7.01875187
163 8.11575865 0.24960520
164 1.39903906 8.11575865
165 6.71369286 1.39903906
166 -1.72370721 6.71369286
167 -1.48698784 -1.72370721
168 -1.38048118 -1.48698784
169 0.34899298 -1.38048118
170 4.20825790 0.34899298
171 0.07766603 4.20825790
172 -5.14654245 0.07766603
173 2.39540522 -5.14654245
174 0.99534502 2.39540522
175 -5.40110739 0.99534502
176 -1.31419548 -5.40110739
177 2.70810552 -1.31419548
178 -2.16391397 2.70810552
179 -1.69952156 -2.16391397
180 -2.47222768 -1.69952156
181 -5.33482169 -2.47222768
182 -1.88855354 -5.33482169
183 -3.43413506 -1.88855354
184 -1.52741311 -3.43413506
185 4.60803939 -1.52741311
186 0.50947876 4.60803939
187 -0.63556851 0.50947876
188 -0.61449431 -0.63556851
189 5.06729246 -0.61449431
190 -2.93270754 5.06729246
191 -3.36096083 -2.93270754
192 2.12134599 -3.36096083
193 0.18845884 2.12134599
194 1.11219921 0.18845884
195 -2.95734119 1.11219921
196 5.40735869 -2.95734119
197 1.42489950 5.40735869
198 0.76607159 1.42489950
199 -1.65258692 0.76607159
200 -0.60301488 -1.65258692
201 -1.20481328 -0.60301488
202 -0.28152091 -1.20481328
203 -0.35386799 -0.28152091
204 -1.83216737 -0.35386799
205 0.22346605 -1.83216737
206 -1.50042077 0.22346605
207 3.03117939 -1.50042077
208 -0.27004148 3.03117939
209 -0.03360082 -0.27004148
210 -0.42621508 -0.03360082
211 -0.67160718 -0.42621508
212 2.09473280 -0.67160718
213 -3.81434785 2.09473280
214 1.17016528 -3.81434785
215 -0.10118771 1.17016528
216 -0.28227366 -0.10118771
217 -1.37850164 -0.28227366
218 3.89638475 -1.37850164
219 1.32558612 3.89638475
220 -3.84812828 1.32558612
221 0.14319898 -3.84812828
222 0.29767174 0.14319898
223 -3.92514066 0.29767174
224 3.60122526 -3.92514066
225 -2.08084021 3.60122526
226 1.15635320 -2.08084021
227 -3.14328777 1.15635320
228 4.80341146 -3.14328777
229 -2.86717459 4.80341146
230 -1.60178809 -2.86717459
231 -1.41782105 -1.60178809
232 -3.86950724 -1.41782105
233 2.91665785 -3.86950724
234 -3.04274760 2.91665785
235 -1.82908197 -3.04274760
236 1.96948458 -1.82908197
237 -1.32492216 1.96948458
238 -5.86083450 -1.32492216
239 -3.80088888 -5.86083450
240 -5.38562052 -3.80088888
241 0.85904488 -5.38562052
242 0.61513223 0.85904488
243 0.92224519 0.61513223
244 1.28975176 0.92224519
245 3.94612608 1.28975176
246 0.59889261 3.94612608
247 9.49118520 0.59889261
248 2.67429905 9.49118520
249 0.28057893 2.67429905
250 1.09315290 0.28057893
251 2.60879214 1.09315290
252 -3.26089470 2.60879214
253 -1.39120786 -3.26089470
254 1.99692492 -1.39120786
255 -0.11509468 1.99692492
256 3.64771191 -0.11509468
257 0.45261855 3.64771191
258 2.31719209 0.45261855
259 -8.64594208 2.31719209
260 -1.86316715 -8.64594208
261 -0.75824039 -1.86316715
262 3.28451753 -0.75824039
263 -1.77019386 3.28451753
264 NA -1.77019386
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.45607262 -0.49586084
[2,] -1.24516010 1.45607262
[3,] -2.45574032 -1.24516010
[4,] 9.77436025 -2.45574032
[5,] 2.27927282 9.77436025
[6,] 9.36543198 2.27927282
[7,] -1.77553346 9.36543198
[8,] -1.93962704 -1.77553346
[9,] 1.12515317 -1.93962704
[10,] -0.36078749 1.12515317
[11,] -0.86727995 -0.36078749
[12,] -0.71681463 -0.86727995
[13,] 2.97020636 -0.71681463
[14,] 0.27776732 2.97020636
[15,] 1.12234647 0.27776732
[16,] 1.26255916 1.12234647
[17,] 0.70323996 1.26255916
[18,] -2.57054057 0.70323996
[19,] 1.65394663 -2.57054057
[20,] -0.29615966 1.65394663
[21,] -1.24440735 -0.29615966
[22,] -0.57054057 -1.24440735
[23,] -0.17682045 -0.57054057
[24,] 0.68569915 -0.17682045
[25,] -7.40260884 0.68569915
[26,] -0.16925357 -7.40260884
[27,] 2.19627346 -0.16925357
[28,] 1.93005981 2.19627346
[29,] -2.11409419 1.93005981
[30,] -2.39254002 -2.11409419
[31,] 1.15612690 -2.39254002
[32,] -0.39812736 1.15612690
[33,] -0.99601321 -0.39812736
[34,] 0.16958587 -0.99601321
[35,] -3.33690659 0.16958587
[36,] 3.14016599 -3.33690659
[37,] 0.04207940 3.14016599
[38,] -0.69684629 0.04207940
[39,] -3.53600739 -0.69684629
[40,] -2.92972751 -3.53600739
[41,] 2.73777314 -2.92972751
[42,] -3.12201418 2.73777314
[43,] -0.30638086 -3.12201418
[44,] -0.92897476 -0.30638086
[45,] -1.98378103 -0.92897476
[46,] -2.82836019 -1.98378103
[47,] -1.06079341 -2.82836019
[48,] 4.62856023 -1.06079341
[49,] -2.43313457 4.62856023
[50,] -1.29117270 -2.43313457
[51,] 1.09490614 -1.29117270
[52,] 2.81122608 1.09490614
[53,] -0.29798683 2.81122608
[54,] -3.42754724 -0.29798683
[55,] 2.59771283 -3.42754724
[56,] 1.93361925 2.59771283
[57,] -3.21015288 1.93361925
[58,] -4.20426079 -3.21015288
[59,] 0.70276592 -4.20426079
[60,] 2.37969205 0.70276592
[61,] -1.41484102 2.37969205
[62,] -3.09580063 -1.41484102
[63,] 1.10330017 -3.09580063
[64,] 0.94910611 1.10330017
[65,] -5.19622765 0.94910611
[66,] 1.59319212 -5.19622765
[67,] -2.93364784 1.59319212
[68,] 0.83243948 -2.93364784
[69,] 1.65563968 0.83243948
[70,] -0.01186097 1.65563968
[71,] 3.28580046 -0.01186097
[72,] 0.63659337 3.28580046
[73,] -2.19575361 0.63659337
[74,] -3.01391491 -2.19575361
[75,] 4.42985129 -3.01391491
[76,] 2.27106634 4.42985129
[77,] 3.02267221 2.27106634
[78,] 0.33937994 3.02267221
[79,] -4.90189531 0.33937994
[80,] -1.42818683 -4.90189531
[81,] -3.34436032 -1.42818683
[82,] 0.46410576 -3.34436032
[83,] -0.48382026 0.46410576
[84,] -0.24429420 -0.48382026
[85,] 0.78595283 -0.24429420
[86,] -1.21685386 0.78595283
[87,] 0.84511965 -1.21685386
[88,] 3.38138510 0.84511965
[89,] 2.03788036 3.38138510
[90,] 1.10649872 2.03788036
[91,] 0.69222679 1.10649872
[92,] 1.69092560 0.69222679
[93,] -1.67317390 1.69092560
[94,] -0.43377417 -1.67317390
[95,] 1.40090545 -0.43377417
[96,] -2.16961446 1.40090545
[97,] 0.24362600 -2.16961446
[98,] -2.46552670 0.24362600
[99,] -0.70074057 -2.46552670
[100,] 1.40090545 -0.70074057
[101,] 0.46335301 1.40090545
[102,] -4.62019479 0.46335301
[103,] 3.59925350 -4.62019479
[104,] 2.17436432 3.59925350
[105,] -0.48026082 2.17436432
[106,] 3.89797243 -0.48026082
[107,] -1.17718134 3.89797243
[108,] 8.14822517 -1.17718134
[109,] 1.44150001 8.14822517
[110,] -0.61180077 1.44150001
[111,] -2.96053974 -0.61180077
[112,] 1.73665950 -2.96053974
[113,] 2.01399947 1.73665950
[114,] -1.54504102 2.01399947
[115,] 0.83802682 -1.54504102
[116,] -0.12463332 0.83802682
[117,] -4.20770708 -0.12463332
[118,] 1.98813903 -4.20770708
[119,] 0.26983955 1.98813903
[120,] 0.64443896 0.26983955
[121,] -1.21404717 0.64443896
[122,] -4.26053381 -1.21404717
[123,] -1.36190113 -4.26053381
[124,] -3.07105383 -1.36190113
[125,] -2.69998782 -3.07105383
[126,] -0.44926104 -2.69998782
[127,] 1.65330703 -0.44926104
[128,] 0.61905256 1.65330703
[129,] -3.03371397 0.61905256
[130,] 2.72628593 -3.03371397
[131,] -2.15766099 2.72628593
[132,] 2.29289329 -2.15766099
[133,] -0.26053381 2.29289329
[134,] 2.24081931 -0.26053381
[135,] 7.17556507 2.24081931
[136,] 0.82963279 7.17556507
[137,] 0.36915293 0.82963279
[138,] -1.37180066 0.36915293
[139,] -2.05276028 -1.37180066
[140,] -2.48382026 -2.05276028
[141,] 2.23931381 -2.48382026
[142,] -1.31972668 2.23931381
[143,] -0.62177469 -1.31972668
[144,] -0.44216820 -0.62177469
[145,] 0.22252575 -0.44216820
[146,] -2.39766110 0.22252575
[147,] -3.82238099 -2.39766110
[148,] 1.98766499 -3.82238099
[149,] 0.55632630 1.98766499
[150,] 3.37627181 0.55632630
[151,] -2.60217994 3.37627181
[152,] -2.63718716 -2.60217994
[153,] 2.50366512 -2.63718716
[154,] 3.98533234 2.50366512
[155,] 1.10649872 3.98533234
[156,] 0.77324661 1.10649872
[157,] 1.65330703 0.77324661
[158,] -4.96818102 1.65330703
[159,] 3.24164646 -4.96818102
[160,] 2.06840610 3.24164646
[161,] 7.01875187 2.06840610
[162,] 0.24960520 7.01875187
[163,] 8.11575865 0.24960520
[164,] 1.39903906 8.11575865
[165,] 6.71369286 1.39903906
[166,] -1.72370721 6.71369286
[167,] -1.48698784 -1.72370721
[168,] -1.38048118 -1.48698784
[169,] 0.34899298 -1.38048118
[170,] 4.20825790 0.34899298
[171,] 0.07766603 4.20825790
[172,] -5.14654245 0.07766603
[173,] 2.39540522 -5.14654245
[174,] 0.99534502 2.39540522
[175,] -5.40110739 0.99534502
[176,] -1.31419548 -5.40110739
[177,] 2.70810552 -1.31419548
[178,] -2.16391397 2.70810552
[179,] -1.69952156 -2.16391397
[180,] -2.47222768 -1.69952156
[181,] -5.33482169 -2.47222768
[182,] -1.88855354 -5.33482169
[183,] -3.43413506 -1.88855354
[184,] -1.52741311 -3.43413506
[185,] 4.60803939 -1.52741311
[186,] 0.50947876 4.60803939
[187,] -0.63556851 0.50947876
[188,] -0.61449431 -0.63556851
[189,] 5.06729246 -0.61449431
[190,] -2.93270754 5.06729246
[191,] -3.36096083 -2.93270754
[192,] 2.12134599 -3.36096083
[193,] 0.18845884 2.12134599
[194,] 1.11219921 0.18845884
[195,] -2.95734119 1.11219921
[196,] 5.40735869 -2.95734119
[197,] 1.42489950 5.40735869
[198,] 0.76607159 1.42489950
[199,] -1.65258692 0.76607159
[200,] -0.60301488 -1.65258692
[201,] -1.20481328 -0.60301488
[202,] -0.28152091 -1.20481328
[203,] -0.35386799 -0.28152091
[204,] -1.83216737 -0.35386799
[205,] 0.22346605 -1.83216737
[206,] -1.50042077 0.22346605
[207,] 3.03117939 -1.50042077
[208,] -0.27004148 3.03117939
[209,] -0.03360082 -0.27004148
[210,] -0.42621508 -0.03360082
[211,] -0.67160718 -0.42621508
[212,] 2.09473280 -0.67160718
[213,] -3.81434785 2.09473280
[214,] 1.17016528 -3.81434785
[215,] -0.10118771 1.17016528
[216,] -0.28227366 -0.10118771
[217,] -1.37850164 -0.28227366
[218,] 3.89638475 -1.37850164
[219,] 1.32558612 3.89638475
[220,] -3.84812828 1.32558612
[221,] 0.14319898 -3.84812828
[222,] 0.29767174 0.14319898
[223,] -3.92514066 0.29767174
[224,] 3.60122526 -3.92514066
[225,] -2.08084021 3.60122526
[226,] 1.15635320 -2.08084021
[227,] -3.14328777 1.15635320
[228,] 4.80341146 -3.14328777
[229,] -2.86717459 4.80341146
[230,] -1.60178809 -2.86717459
[231,] -1.41782105 -1.60178809
[232,] -3.86950724 -1.41782105
[233,] 2.91665785 -3.86950724
[234,] -3.04274760 2.91665785
[235,] -1.82908197 -3.04274760
[236,] 1.96948458 -1.82908197
[237,] -1.32492216 1.96948458
[238,] -5.86083450 -1.32492216
[239,] -3.80088888 -5.86083450
[240,] -5.38562052 -3.80088888
[241,] 0.85904488 -5.38562052
[242,] 0.61513223 0.85904488
[243,] 0.92224519 0.61513223
[244,] 1.28975176 0.92224519
[245,] 3.94612608 1.28975176
[246,] 0.59889261 3.94612608
[247,] 9.49118520 0.59889261
[248,] 2.67429905 9.49118520
[249,] 0.28057893 2.67429905
[250,] 1.09315290 0.28057893
[251,] 2.60879214 1.09315290
[252,] -3.26089470 2.60879214
[253,] -1.39120786 -3.26089470
[254,] 1.99692492 -1.39120786
[255,] -0.11509468 1.99692492
[256,] 3.64771191 -0.11509468
[257,] 0.45261855 3.64771191
[258,] 2.31719209 0.45261855
[259,] -8.64594208 2.31719209
[260,] -1.86316715 -8.64594208
[261,] -0.75824039 -1.86316715
[262,] 3.28451753 -0.75824039
[263,] -1.77019386 3.28451753
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.45607262 -0.49586084
2 -1.24516010 1.45607262
3 -2.45574032 -1.24516010
4 9.77436025 -2.45574032
5 2.27927282 9.77436025
6 9.36543198 2.27927282
7 -1.77553346 9.36543198
8 -1.93962704 -1.77553346
9 1.12515317 -1.93962704
10 -0.36078749 1.12515317
11 -0.86727995 -0.36078749
12 -0.71681463 -0.86727995
13 2.97020636 -0.71681463
14 0.27776732 2.97020636
15 1.12234647 0.27776732
16 1.26255916 1.12234647
17 0.70323996 1.26255916
18 -2.57054057 0.70323996
19 1.65394663 -2.57054057
20 -0.29615966 1.65394663
21 -1.24440735 -0.29615966
22 -0.57054057 -1.24440735
23 -0.17682045 -0.57054057
24 0.68569915 -0.17682045
25 -7.40260884 0.68569915
26 -0.16925357 -7.40260884
27 2.19627346 -0.16925357
28 1.93005981 2.19627346
29 -2.11409419 1.93005981
30 -2.39254002 -2.11409419
31 1.15612690 -2.39254002
32 -0.39812736 1.15612690
33 -0.99601321 -0.39812736
34 0.16958587 -0.99601321
35 -3.33690659 0.16958587
36 3.14016599 -3.33690659
37 0.04207940 3.14016599
38 -0.69684629 0.04207940
39 -3.53600739 -0.69684629
40 -2.92972751 -3.53600739
41 2.73777314 -2.92972751
42 -3.12201418 2.73777314
43 -0.30638086 -3.12201418
44 -0.92897476 -0.30638086
45 -1.98378103 -0.92897476
46 -2.82836019 -1.98378103
47 -1.06079341 -2.82836019
48 4.62856023 -1.06079341
49 -2.43313457 4.62856023
50 -1.29117270 -2.43313457
51 1.09490614 -1.29117270
52 2.81122608 1.09490614
53 -0.29798683 2.81122608
54 -3.42754724 -0.29798683
55 2.59771283 -3.42754724
56 1.93361925 2.59771283
57 -3.21015288 1.93361925
58 -4.20426079 -3.21015288
59 0.70276592 -4.20426079
60 2.37969205 0.70276592
61 -1.41484102 2.37969205
62 -3.09580063 -1.41484102
63 1.10330017 -3.09580063
64 0.94910611 1.10330017
65 -5.19622765 0.94910611
66 1.59319212 -5.19622765
67 -2.93364784 1.59319212
68 0.83243948 -2.93364784
69 1.65563968 0.83243948
70 -0.01186097 1.65563968
71 3.28580046 -0.01186097
72 0.63659337 3.28580046
73 -2.19575361 0.63659337
74 -3.01391491 -2.19575361
75 4.42985129 -3.01391491
76 2.27106634 4.42985129
77 3.02267221 2.27106634
78 0.33937994 3.02267221
79 -4.90189531 0.33937994
80 -1.42818683 -4.90189531
81 -3.34436032 -1.42818683
82 0.46410576 -3.34436032
83 -0.48382026 0.46410576
84 -0.24429420 -0.48382026
85 0.78595283 -0.24429420
86 -1.21685386 0.78595283
87 0.84511965 -1.21685386
88 3.38138510 0.84511965
89 2.03788036 3.38138510
90 1.10649872 2.03788036
91 0.69222679 1.10649872
92 1.69092560 0.69222679
93 -1.67317390 1.69092560
94 -0.43377417 -1.67317390
95 1.40090545 -0.43377417
96 -2.16961446 1.40090545
97 0.24362600 -2.16961446
98 -2.46552670 0.24362600
99 -0.70074057 -2.46552670
100 1.40090545 -0.70074057
101 0.46335301 1.40090545
102 -4.62019479 0.46335301
103 3.59925350 -4.62019479
104 2.17436432 3.59925350
105 -0.48026082 2.17436432
106 3.89797243 -0.48026082
107 -1.17718134 3.89797243
108 8.14822517 -1.17718134
109 1.44150001 8.14822517
110 -0.61180077 1.44150001
111 -2.96053974 -0.61180077
112 1.73665950 -2.96053974
113 2.01399947 1.73665950
114 -1.54504102 2.01399947
115 0.83802682 -1.54504102
116 -0.12463332 0.83802682
117 -4.20770708 -0.12463332
118 1.98813903 -4.20770708
119 0.26983955 1.98813903
120 0.64443896 0.26983955
121 -1.21404717 0.64443896
122 -4.26053381 -1.21404717
123 -1.36190113 -4.26053381
124 -3.07105383 -1.36190113
125 -2.69998782 -3.07105383
126 -0.44926104 -2.69998782
127 1.65330703 -0.44926104
128 0.61905256 1.65330703
129 -3.03371397 0.61905256
130 2.72628593 -3.03371397
131 -2.15766099 2.72628593
132 2.29289329 -2.15766099
133 -0.26053381 2.29289329
134 2.24081931 -0.26053381
135 7.17556507 2.24081931
136 0.82963279 7.17556507
137 0.36915293 0.82963279
138 -1.37180066 0.36915293
139 -2.05276028 -1.37180066
140 -2.48382026 -2.05276028
141 2.23931381 -2.48382026
142 -1.31972668 2.23931381
143 -0.62177469 -1.31972668
144 -0.44216820 -0.62177469
145 0.22252575 -0.44216820
146 -2.39766110 0.22252575
147 -3.82238099 -2.39766110
148 1.98766499 -3.82238099
149 0.55632630 1.98766499
150 3.37627181 0.55632630
151 -2.60217994 3.37627181
152 -2.63718716 -2.60217994
153 2.50366512 -2.63718716
154 3.98533234 2.50366512
155 1.10649872 3.98533234
156 0.77324661 1.10649872
157 1.65330703 0.77324661
158 -4.96818102 1.65330703
159 3.24164646 -4.96818102
160 2.06840610 3.24164646
161 7.01875187 2.06840610
162 0.24960520 7.01875187
163 8.11575865 0.24960520
164 1.39903906 8.11575865
165 6.71369286 1.39903906
166 -1.72370721 6.71369286
167 -1.48698784 -1.72370721
168 -1.38048118 -1.48698784
169 0.34899298 -1.38048118
170 4.20825790 0.34899298
171 0.07766603 4.20825790
172 -5.14654245 0.07766603
173 2.39540522 -5.14654245
174 0.99534502 2.39540522
175 -5.40110739 0.99534502
176 -1.31419548 -5.40110739
177 2.70810552 -1.31419548
178 -2.16391397 2.70810552
179 -1.69952156 -2.16391397
180 -2.47222768 -1.69952156
181 -5.33482169 -2.47222768
182 -1.88855354 -5.33482169
183 -3.43413506 -1.88855354
184 -1.52741311 -3.43413506
185 4.60803939 -1.52741311
186 0.50947876 4.60803939
187 -0.63556851 0.50947876
188 -0.61449431 -0.63556851
189 5.06729246 -0.61449431
190 -2.93270754 5.06729246
191 -3.36096083 -2.93270754
192 2.12134599 -3.36096083
193 0.18845884 2.12134599
194 1.11219921 0.18845884
195 -2.95734119 1.11219921
196 5.40735869 -2.95734119
197 1.42489950 5.40735869
198 0.76607159 1.42489950
199 -1.65258692 0.76607159
200 -0.60301488 -1.65258692
201 -1.20481328 -0.60301488
202 -0.28152091 -1.20481328
203 -0.35386799 -0.28152091
204 -1.83216737 -0.35386799
205 0.22346605 -1.83216737
206 -1.50042077 0.22346605
207 3.03117939 -1.50042077
208 -0.27004148 3.03117939
209 -0.03360082 -0.27004148
210 -0.42621508 -0.03360082
211 -0.67160718 -0.42621508
212 2.09473280 -0.67160718
213 -3.81434785 2.09473280
214 1.17016528 -3.81434785
215 -0.10118771 1.17016528
216 -0.28227366 -0.10118771
217 -1.37850164 -0.28227366
218 3.89638475 -1.37850164
219 1.32558612 3.89638475
220 -3.84812828 1.32558612
221 0.14319898 -3.84812828
222 0.29767174 0.14319898
223 -3.92514066 0.29767174
224 3.60122526 -3.92514066
225 -2.08084021 3.60122526
226 1.15635320 -2.08084021
227 -3.14328777 1.15635320
228 4.80341146 -3.14328777
229 -2.86717459 4.80341146
230 -1.60178809 -2.86717459
231 -1.41782105 -1.60178809
232 -3.86950724 -1.41782105
233 2.91665785 -3.86950724
234 -3.04274760 2.91665785
235 -1.82908197 -3.04274760
236 1.96948458 -1.82908197
237 -1.32492216 1.96948458
238 -5.86083450 -1.32492216
239 -3.80088888 -5.86083450
240 -5.38562052 -3.80088888
241 0.85904488 -5.38562052
242 0.61513223 0.85904488
243 0.92224519 0.61513223
244 1.28975176 0.92224519
245 3.94612608 1.28975176
246 0.59889261 3.94612608
247 9.49118520 0.59889261
248 2.67429905 9.49118520
249 0.28057893 2.67429905
250 1.09315290 0.28057893
251 2.60879214 1.09315290
252 -3.26089470 2.60879214
253 -1.39120786 -3.26089470
254 1.99692492 -1.39120786
255 -0.11509468 1.99692492
256 3.64771191 -0.11509468
257 0.45261855 3.64771191
258 2.31719209 0.45261855
259 -8.64594208 2.31719209
260 -1.86316715 -8.64594208
261 -0.75824039 -1.86316715
262 3.28451753 -0.75824039
263 -1.77019386 3.28451753
> 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/72i4u1321638444.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/8l79m1321638444.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/95uja1321638444.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/10iztq1321638444.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/11n3o21321638444.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/12gv1t1321638444.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/13ncut1321638444.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/143ar61321638444.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/15tw0e1321638444.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/1639191321638445.tab")
+ }
>
> try(system("convert tmp/11ylx1321638444.ps tmp/11ylx1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/24nfj1321638444.ps tmp/24nfj1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/38oay1321638444.ps tmp/38oay1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/4fd6y1321638444.ps tmp/4fd6y1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cra11321638444.ps tmp/5cra11321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/66qgx1321638444.ps tmp/66qgx1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/72i4u1321638444.ps tmp/72i4u1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/8l79m1321638444.ps tmp/8l79m1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/95uja1321638444.ps tmp/95uja1321638444.png",intern=TRUE))
character(0)
> try(system("convert tmp/10iztq1321638444.ps tmp/10iztq1321638444.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
9.628 0.696 10.357