R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i686-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(12
+ ,14
+ ,11
+ ,18
+ ,14
+ ,11
+ ,12
+ ,12
+ ,21
+ ,16
+ ,12
+ ,18
+ ,22
+ ,14
+ ,11
+ ,14
+ ,10
+ ,15
+ ,13
+ ,15
+ ,10
+ ,17
+ ,8
+ ,19
+ ,15
+ ,10
+ ,14
+ ,16
+ ,10
+ ,18
+ ,14
+ ,14
+ ,14
+ ,14
+ ,11
+ ,17
+ ,10
+ ,14
+ ,13
+ ,16
+ ,9.5
+ ,18
+ ,14
+ ,11
+ ,12
+ ,14
+ ,14
+ ,12
+ ,11
+ ,17
+ ,9
+ ,9
+ ,11
+ ,16
+ ,15
+ ,14
+ ,14
+ ,15
+ ,13
+ ,11
+ ,9
+ ,16
+ ,15
+ ,13
+ ,10
+ ,17
+ ,11
+ ,15
+ ,13
+ ,14
+ ,8
+ ,16
+ ,20
+ ,9
+ ,12
+ ,15
+ ,10
+ ,17
+ ,10
+ ,13
+ ,9
+ ,15
+ ,14
+ ,16
+ ,8
+ ,16
+ ,14
+ ,12
+ ,11
+ ,15
+ ,13
+ ,11
+ ,9
+ ,15
+ ,11
+ ,15
+ ,15
+ ,17
+ ,11
+ ,13
+ ,10
+ ,16
+ ,14
+ ,14
+ ,18
+ ,11
+ ,14
+ ,12
+ ,11
+ ,12
+ ,14.5
+ ,15
+ ,13
+ ,16
+ ,9
+ ,15
+ ,10
+ ,12
+ ,15
+ ,12
+ ,20
+ ,8
+ ,12
+ ,13
+ ,12
+ ,11
+ ,14
+ ,14
+ ,13
+ ,15
+ ,11
+ ,10
+ ,17
+ ,11
+ ,12
+ ,12
+ ,13
+ ,15
+ ,14
+ ,15
+ ,13
+ ,14
+ ,15
+ ,16
+ ,13
+ ,15
+ ,10
+ ,15
+ ,11
+ ,13
+ ,19
+ ,12
+ ,13
+ ,17
+ ,17
+ ,13
+ ,13
+ ,15
+ ,9
+ ,13
+ ,11
+ ,15
+ ,9
+ ,15
+ ,12
+ ,16
+ ,12
+ ,15
+ ,13
+ ,14
+ ,13
+ ,15
+ ,12
+ ,14
+ ,15
+ ,13
+ ,22
+ ,7
+ ,13
+ ,17
+ ,15
+ ,13
+ ,13
+ ,15
+ ,15
+ ,14
+ ,12.5
+ ,13
+ ,11
+ ,16
+ ,16
+ ,12
+ ,11
+ ,14
+ ,11
+ ,17
+ ,10
+ ,15
+ ,10
+ ,17
+ ,16
+ ,12
+ ,12
+ ,16
+ ,11
+ ,11
+ ,16
+ ,15
+ ,19
+ ,9
+ ,11
+ ,16
+ ,16
+ ,15
+ ,15
+ ,10
+ ,24
+ ,10
+ ,14
+ ,15
+ ,15
+ ,11
+ ,11
+ ,13
+ ,15
+ ,14
+ ,12
+ ,18
+ ,10
+ ,16
+ ,14
+ ,14
+ ,13
+ ,14
+ ,9
+ ,14
+ ,15
+ ,14
+ ,15
+ ,12
+ ,14
+ ,14
+ ,11
+ ,15
+ ,8
+ ,15
+ ,11
+ ,15
+ ,11
+ ,13
+ ,8
+ ,17
+ ,10
+ ,17
+ ,11
+ ,19
+ ,13
+ ,15
+ ,11
+ ,13
+ ,20
+ ,9
+ ,10
+ ,15
+ ,15
+ ,15
+ ,12
+ ,15
+ ,14
+ ,16
+ ,23
+ ,11
+ ,14
+ ,14
+ ,16
+ ,11
+ ,11
+ ,15
+ ,12
+ ,13
+ ,10
+ ,15
+ ,14
+ ,16
+ ,12
+ ,14
+ ,12
+ ,15
+ ,11
+ ,16
+ ,12
+ ,16
+ ,13
+ ,11
+ ,11
+ ,12
+ ,19
+ ,9
+ ,12
+ ,16
+ ,17
+ ,13
+ ,9
+ ,16
+ ,12
+ ,12
+ ,19
+ ,9
+ ,18
+ ,13
+ ,15
+ ,13
+ ,14
+ ,14
+ ,11
+ ,19
+ ,9
+ ,13
+ ,18
+ ,12
+ ,16
+ ,13
+ ,24
+ ,10
+ ,14
+ ,14
+ ,20
+ ,16
+ ,18
+ ,10
+ ,23
+ ,11
+ ,12
+ ,14
+ ,14
+ ,12
+ ,16
+ ,9
+ ,18
+ ,9
+ ,20
+ ,11
+ ,12
+ ,16
+ ,12
+ ,9
+ ,17
+ ,13
+ ,13
+ ,16
+ ,9
+ ,13
+ ,16
+ ,9
+ ,18
+ ,12
+ ,10
+ ,16
+ ,14
+ ,11
+ ,11
+ ,14
+ ,9
+ ,13
+ ,11
+ ,15
+ ,10
+ ,14
+ ,11
+ ,16
+ ,19
+ ,13
+ ,14
+ ,14
+ ,12
+ ,15
+ ,14
+ ,13
+ ,21
+ ,11
+ ,13
+ ,11
+ ,10
+ ,14
+ ,15
+ ,15
+ ,16
+ ,11
+ ,14
+ ,15
+ ,12
+ ,12
+ ,19
+ ,14
+ ,15
+ ,14
+ ,19
+ ,8
+ ,13
+ ,13
+ ,17
+ ,9
+ ,12
+ ,15
+ ,11
+ ,17
+ ,14
+ ,13
+ ,11
+ ,15
+ ,13
+ ,15
+ ,12
+ ,14
+ ,15
+ ,16
+ ,14
+ ,13
+ ,12
+ ,16
+ ,17
+ ,9
+ ,11
+ ,16
+ ,18
+ ,11
+ ,13
+ ,10
+ ,17
+ ,11
+ ,13
+ ,15
+ ,11
+ ,17
+ ,12
+ ,14
+ ,22
+ ,8
+ ,14
+ ,15
+ ,12
+ ,11
+ ,12
+ ,16
+ ,17
+ ,10
+ ,9
+ ,15
+ ,21
+ ,9
+ ,10
+ ,16
+ ,11
+ ,19
+ ,12
+ ,12
+ ,23
+ ,8
+ ,13
+ ,11
+ ,12
+ ,14
+ ,16
+ ,9
+ ,9
+ ,15
+ ,17
+ ,13
+ ,9
+ ,16
+ ,14
+ ,11
+ ,17
+ ,12
+ ,13
+ ,13
+ ,11
+ ,10
+ ,12
+ ,11
+ ,10
+ ,12
+ ,19
+ ,8
+ ,16
+ ,12
+ ,16
+ ,12
+ ,14
+ ,15
+ ,20
+ ,11
+ ,15
+ ,13
+ ,23
+ ,14
+ ,20
+ ,10
+ ,16
+ ,12
+ ,14
+ ,15
+ ,17
+ ,13
+ ,11
+ ,13
+ ,13
+ ,13
+ ,17
+ ,12
+ ,15
+ ,12
+ ,21
+ ,9
+ ,18
+ ,9
+ ,15
+ ,15
+ ,8
+ ,10
+ ,12
+ ,14
+ ,12
+ ,15
+ ,22
+ ,7
+ ,12
+ ,14)
+ ,dim=c(2
+ ,264)
+ ,dimnames=list(c('Depression'
+ ,'Happiness')
+ ,1:264))
> y <- array(NA,dim=c(2,264),dimnames=list(c('Depression','Happiness'),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 = '1'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Depression Happiness
1 12.0 14
2 11.0 18
3 14.0 11
4 12.0 12
5 21.0 16
6 12.0 18
7 22.0 14
8 11.0 14
9 10.0 15
10 13.0 15
11 10.0 17
12 8.0 19
13 15.0 10
14 14.0 16
15 10.0 18
16 14.0 14
17 14.0 14
18 11.0 17
19 10.0 14
20 13.0 16
21 9.5 18
22 14.0 11
23 12.0 14
24 14.0 12
25 11.0 17
26 9.0 9
27 11.0 16
28 15.0 14
29 14.0 15
30 13.0 11
31 9.0 16
32 15.0 13
33 10.0 17
34 11.0 15
35 13.0 14
36 8.0 16
37 20.0 9
38 12.0 15
39 10.0 17
40 10.0 13
41 9.0 15
42 14.0 16
43 8.0 16
44 14.0 12
45 11.0 15
46 13.0 11
47 9.0 15
48 11.0 15
49 15.0 17
50 11.0 13
51 10.0 16
52 14.0 14
53 18.0 11
54 14.0 12
55 11.0 12
56 14.5 15
57 13.0 16
58 9.0 15
59 10.0 12
60 15.0 12
61 20.0 8
62 12.0 13
63 12.0 11
64 14.0 14
65 13.0 15
66 11.0 10
67 17.0 11
68 12.0 12
69 13.0 15
70 14.0 15
71 13.0 14
72 15.0 16
73 13.0 15
74 10.0 15
75 11.0 13
76 19.0 12
77 13.0 17
78 17.0 13
79 13.0 15
80 9.0 13
81 11.0 15
82 9.0 15
83 12.0 16
84 12.0 15
85 13.0 14
86 13.0 15
87 12.0 14
88 15.0 13
89 22.0 7
90 13.0 17
91 15.0 13
92 13.0 15
93 15.0 14
94 12.5 13
95 11.0 16
96 16.0 12
97 11.0 14
98 11.0 17
99 10.0 15
100 10.0 17
101 16.0 12
102 12.0 16
103 11.0 11
104 16.0 15
105 19.0 9
106 11.0 16
107 16.0 15
108 15.0 10
109 24.0 10
110 14.0 15
111 15.0 11
112 11.0 13
113 15.0 14
114 12.0 18
115 10.0 16
116 14.0 14
117 13.0 14
118 9.0 14
119 15.0 14
120 15.0 12
121 14.0 14
122 11.0 15
123 8.0 15
124 11.0 15
125 11.0 13
126 8.0 17
127 10.0 17
128 11.0 19
129 13.0 15
130 11.0 13
131 20.0 9
132 10.0 15
133 15.0 15
134 12.0 15
135 14.0 16
136 23.0 11
137 14.0 14
138 16.0 11
139 11.0 15
140 12.0 13
141 10.0 15
142 14.0 16
143 12.0 14
144 12.0 15
145 11.0 16
146 12.0 16
147 13.0 11
148 11.0 12
149 19.0 9
150 12.0 16
151 17.0 13
152 9.0 16
153 12.0 12
154 19.0 9
155 18.0 13
156 15.0 13
157 14.0 14
158 11.0 19
159 9.0 13
160 18.0 12
161 16.0 13
162 24.0 10
163 14.0 14
164 20.0 16
165 18.0 10
166 23.0 11
167 12.0 14
168 14.0 12
169 16.0 9
170 18.0 9
171 20.0 11
172 12.0 16
173 12.0 9
174 17.0 13
175 13.0 16
176 9.0 13
177 16.0 9
178 18.0 12
179 10.0 16
180 14.0 11
181 11.0 14
182 9.0 13
183 11.0 15
184 10.0 14
185 11.0 16
186 19.0 13
187 14.0 14
188 12.0 15
189 14.0 13
190 21.0 11
191 13.0 11
192 10.0 14
193 15.0 15
194 16.0 11
195 14.0 15
196 12.0 12
197 19.0 14
198 15.0 14
199 19.0 8
200 13.0 13
201 17.0 9
202 12.0 15
203 11.0 17
204 14.0 13
205 11.0 15
206 13.0 15
207 12.0 14
208 15.0 16
209 14.0 13
210 12.0 16
211 17.0 9
212 11.0 16
213 18.0 11
214 13.0 10
215 17.0 11
216 13.0 15
217 11.0 17
218 12.0 14
219 22.0 8
220 14.0 15
221 12.0 11
222 12.0 16
223 17.0 10
224 9.0 15
225 21.0 9
226 10.0 16
227 11.0 19
228 12.0 12
229 23.0 8
230 13.0 11
231 12.0 14
232 16.0 9
233 9.0 15
234 17.0 13
235 9.0 16
236 14.0 11
237 17.0 12
238 13.0 13
239 11.0 10
240 12.0 11
241 10.0 12
242 19.0 8
243 16.0 12
244 16.0 12
245 14.0 15
246 20.0 11
247 15.0 13
248 23.0 14
249 20.0 10
250 16.0 12
251 14.0 15
252 17.0 13
253 11.0 13
254 13.0 13
255 17.0 12
256 15.0 12
257 21.0 9
258 18.0 9
259 15.0 15
260 8.0 10
261 12.0 14
262 12.0 15
263 22.0 7
264 12.0 14
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Happiness
24.5485 -0.8094
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.454 -1.609 -0.002 1.593 9.784
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 24.5485 0.9577 25.63 <2e-16 ***
Happiness -0.8095 0.0697 -11.61 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.824 on 262 degrees of freedom
Multiple R-squared: 0.3398, Adjusted R-squared: 0.3373
F-statistic: 134.9 on 1 and 262 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.95932478 0.081350442 0.040675221
[2,] 0.93456450 0.130870993 0.065435497
[3,] 0.99485243 0.010295142 0.005147571
[4,] 0.99467701 0.010645987 0.005322994
[5,] 0.99540674 0.009186526 0.004593263
[6,] 0.99152588 0.016948236 0.008474118
[7,] 0.99034708 0.019305836 0.009652918
[8,] 0.99057540 0.018849206 0.009424603
[9,] 0.98448742 0.031025155 0.015512577
[10,] 0.97728842 0.045423153 0.022711577
[11,] 0.96828067 0.063438666 0.031719333
[12,] 0.95310774 0.093784511 0.046892255
[13,] 0.93309332 0.133813355 0.066906678
[14,] 0.90997969 0.180040610 0.090020305
[15,] 0.91629197 0.167416058 0.083708029
[16,] 0.88929527 0.221409456 0.110704728
[17,] 0.86637739 0.267245220 0.133622610
[18,] 0.83289180 0.334216404 0.167108202
[19,] 0.79784472 0.404310557 0.202155279
[20,] 0.75152603 0.496947945 0.248473972
[21,] 0.70285464 0.594290720 0.297145360
[22,] 0.85594737 0.288105260 0.144052630
[23,] 0.82527853 0.349442934 0.174721467
[24,] 0.80774994 0.384500127 0.192250063
[25,] 0.77760569 0.444788619 0.222394310
[26,] 0.74159257 0.516814855 0.258407427
[27,] 0.74761263 0.504774730 0.252387365
[28,] 0.71991048 0.560179034 0.280089517
[29,] 0.68857146 0.622857082 0.311428541
[30,] 0.65148340 0.697033202 0.348516601
[31,] 0.60169050 0.796619002 0.398309501
[32,] 0.64463049 0.710739016 0.355369508
[33,] 0.72147954 0.557040913 0.278520457
[34,] 0.67804458 0.643910846 0.321955423
[35,] 0.64030934 0.719381310 0.359690655
[36,] 0.65995635 0.680087302 0.340043651
[37,] 0.67177510 0.656449795 0.328224898
[38,] 0.65678404 0.686431913 0.343215957
[39,] 0.68362338 0.632753242 0.316376621
[40,] 0.64137527 0.717249465 0.358624732
[41,] 0.60397813 0.792043737 0.396021868
[42,] 0.57200771 0.855984572 0.427992286
[43,] 0.58181720 0.836365597 0.418182798
[44,] 0.54310522 0.913789567 0.456894783
[45,] 0.58817455 0.823650903 0.411825452
[46,] 0.57227107 0.855457854 0.427728927
[47,] 0.54156535 0.916869306 0.458434653
[48,] 0.50757348 0.984853045 0.492426522
[49,] 0.53790999 0.924180017 0.462090009
[50,] 0.49540894 0.990817879 0.504591060
[51,] 0.50017405 0.999651892 0.499825946
[52,] 0.48683277 0.973665537 0.513167231
[53,] 0.45407788 0.908155760 0.545922120
[54,] 0.46674010 0.933480207 0.533259896
[55,] 0.50659868 0.986802639 0.493401319
[56,] 0.47401770 0.948035399 0.525982300
[57,] 0.51081721 0.978365588 0.489182794
[58,] 0.48052845 0.961056897 0.519471552
[59,] 0.47819912 0.956398230 0.521800885
[60,] 0.44550688 0.891013763 0.554493118
[61,] 0.40867923 0.817358460 0.591320770
[62,] 0.46360260 0.927205205 0.536397397
[63,] 0.45768797 0.915375930 0.542312035
[64,] 0.44023704 0.880474089 0.559762955
[65,] 0.40425259 0.808505176 0.595747412
[66,] 0.38210750 0.764214999 0.617892501
[67,] 0.34506736 0.690134714 0.654932643
[68,] 0.36315122 0.726302435 0.636848782
[69,] 0.32915116 0.658302325 0.670848837
[70,] 0.31715394 0.634307887 0.682846056
[71,] 0.31016262 0.620325245 0.689837378
[72,] 0.39239007 0.784780144 0.607609928
[73,] 0.37387364 0.747747283 0.626126358
[74,] 0.39611366 0.792227319 0.603886340
[75,] 0.36153533 0.723070654 0.638464673
[76,] 0.42398860 0.847977205 0.576011398
[77,] 0.39463819 0.789276379 0.605361811
[78,] 0.40901745 0.818034895 0.590982552
[79,] 0.37296152 0.745923034 0.627038483
[80,] 0.33787705 0.675754105 0.662122948
[81,] 0.30435775 0.608715503 0.695642248
[82,] 0.27429991 0.548599829 0.725700085
[83,] 0.24716312 0.494326243 0.752836879
[84,] 0.22743464 0.454869277 0.772565361
[85,] 0.28477565 0.569551290 0.715224355
[86,] 0.27085281 0.541705616 0.729147192
[87,] 0.24835509 0.496710188 0.751644906
[88,] 0.22154484 0.443089685 0.778455157
[89,] 0.20883520 0.417670409 0.791164795
[90,] 0.18808966 0.376179325 0.811910337
[91,] 0.16533093 0.330661869 0.834669065
[92,] 0.15161246 0.303224919 0.848387541
[93,] 0.14170233 0.283404666 0.858297667
[94,] 0.12209485 0.244189707 0.877905146
[95,] 0.11664033 0.233280656 0.883359672
[96,] 0.10145553 0.202911060 0.898544470
[97,] 0.09178892 0.183577832 0.908211084
[98,] 0.07786992 0.155739833 0.922130084
[99,] 0.09577569 0.191551372 0.904224314
[100,] 0.10869753 0.217395051 0.891302475
[101,] 0.10773097 0.215461932 0.892269034
[102,] 0.09261040 0.185220805 0.907389598
[103,] 0.10461174 0.209223474 0.895388263
[104,] 0.09179540 0.183590805 0.908204598
[105,] 0.25239163 0.504783265 0.747608368
[106,] 0.23393099 0.467861984 0.766069008
[107,] 0.20855106 0.417102119 0.791448941
[108,] 0.20975339 0.419506770 0.790246615
[109,] 0.19616437 0.392328738 0.803835631
[110,] 0.18297304 0.365946088 0.817026956
[111,] 0.16771509 0.335430174 0.832284913
[112,] 0.14848173 0.296963469 0.851518265
[113,] 0.12891265 0.257825308 0.871087346
[114,] 0.15201853 0.304037056 0.847981472
[115,] 0.14103600 0.282071996 0.858964002
[116,] 0.12288138 0.245762756 0.877118622
[117,] 0.10744456 0.214889119 0.892555441
[118,] 0.09553432 0.191068641 0.904465679
[119,] 0.11912459 0.238249180 0.880875410
[120,] 0.10630962 0.212619235 0.893690383
[121,] 0.10744023 0.214880461 0.892559769
[122,] 0.10837424 0.216748484 0.891625758
[123,] 0.09426498 0.188529961 0.905735020
[124,] 0.08492841 0.169856812 0.915071594
[125,] 0.07268643 0.145372869 0.927313565
[126,] 0.07362371 0.147247421 0.926376289
[127,] 0.07732965 0.154659297 0.922670351
[128,] 0.07393289 0.147865782 0.926067109
[129,] 0.07240487 0.144809744 0.927595128
[130,] 0.06128447 0.122568946 0.938715527
[131,] 0.05832648 0.116652955 0.941673523
[132,] 0.15254386 0.305087717 0.847456142
[133,] 0.13442161 0.268843223 0.865578389
[134,] 0.11714259 0.234285171 0.882857415
[135,] 0.10467983 0.209359663 0.895320169
[136,] 0.09686091 0.193721811 0.903139095
[137,] 0.09296237 0.185924737 0.907037632
[138,] 0.08860207 0.177204132 0.911397934
[139,] 0.07764808 0.155296165 0.922351917
[140,] 0.06592286 0.131845728 0.934077136
[141,] 0.05589985 0.111799696 0.944100152
[142,] 0.04678423 0.093568458 0.953215771
[143,] 0.04532450 0.090649008 0.954675496
[144,] 0.05240983 0.104819651 0.947590174
[145,] 0.04791452 0.095829049 0.952085475
[146,] 0.03985763 0.079715258 0.960142371
[147,] 0.04088285 0.081765702 0.959117149
[148,] 0.04005125 0.080102498 0.959948751
[149,] 0.04003146 0.080062919 0.959968541
[150,] 0.03613676 0.072273516 0.963863242
[151,] 0.04342449 0.086848985 0.956575507
[152,] 0.03673187 0.073463740 0.963268130
[153,] 0.03059985 0.061199697 0.969400151
[154,] 0.02683872 0.053677440 0.973161280
[155,] 0.04108915 0.082178295 0.958910852
[156,] 0.04305764 0.086115282 0.956942359
[157,] 0.03893950 0.077878995 0.961060502
[158,] 0.11005192 0.220103831 0.889948084
[159,] 0.09509925 0.190198506 0.904900747
[160,] 0.26438244 0.528764888 0.735617556
[161,] 0.24375711 0.487514229 0.756242886
[162,] 0.42621083 0.852421667 0.573789167
[163,] 0.39729419 0.794588384 0.602705808
[164,] 0.36569486 0.731389730 0.634305135
[165,] 0.33909383 0.678187654 0.660906173
[166,] 0.30822749 0.616454977 0.691772511
[167,] 0.35107292 0.702145844 0.648927078
[168,] 0.31825821 0.636516415 0.681741792
[169,] 0.40454544 0.809090879 0.595454560
[170,] 0.40728276 0.814565526 0.592717237
[171,] 0.38113812 0.762276240 0.618861880
[172,] 0.45884244 0.917684881 0.541157559
[173,] 0.43156349 0.863126972 0.568436514
[174,] 0.43853866 0.877077326 0.561461337
[175,] 0.41241105 0.824822096 0.587588952
[176,] 0.38980296 0.779605918 0.610197041
[177,] 0.37600942 0.752018835 0.623990583
[178,] 0.45818224 0.916364485 0.541817757
[179,] 0.43050288 0.861005764 0.569497118
[180,] 0.44439786 0.888795714 0.555602143
[181,] 0.40899486 0.817989725 0.591005138
[182,] 0.48148710 0.962974205 0.518512898
[183,] 0.44531764 0.890635284 0.554682358
[184,] 0.40835000 0.816699992 0.591650004
[185,] 0.37120315 0.742406304 0.628796848
[186,] 0.46088234 0.921764684 0.539117658
[187,] 0.45921358 0.918427170 0.540786415
[188,] 0.47406660 0.948133201 0.525933400
[189,] 0.46480363 0.929607262 0.535196369
[190,] 0.42575951 0.851519022 0.574240489
[191,] 0.39784227 0.795684544 0.602157728
[192,] 0.40163537 0.803270745 0.598364627
[193,] 0.52286859 0.954262818 0.477131409
[194,] 0.49766422 0.995328437 0.502335781
[195,] 0.45945021 0.918900428 0.540549786
[196,] 0.42488342 0.849766831 0.575116585
[197,] 0.38650159 0.773003177 0.613498411
[198,] 0.34822996 0.696459924 0.651770038
[199,] 0.31102542 0.622050836 0.688974582
[200,] 0.27517677 0.550353544 0.724823228
[201,] 0.24919583 0.498391666 0.750804167
[202,] 0.21818901 0.436378027 0.781810986
[203,] 0.19390471 0.387809421 0.806095290
[204,] 0.20650427 0.413008544 0.793495728
[205,] 0.17730957 0.354619145 0.822690427
[206,] 0.15160557 0.303211145 0.848394428
[207,] 0.12879843 0.257596859 0.871201570
[208,] 0.10782366 0.215647319 0.892176340
[209,] 0.09886758 0.197735157 0.901132422
[210,] 0.11118944 0.222378872 0.888810564
[211,] 0.09426810 0.188536200 0.905731900
[212,] 0.07774470 0.155489397 0.922255301
[213,] 0.06316984 0.126339684 0.936830158
[214,] 0.05219396 0.104387914 0.947806043
[215,] 0.05706219 0.114124381 0.942937810
[216,] 0.04863666 0.097273325 0.951363337
[217,] 0.05643332 0.112866645 0.943566677
[218,] 0.04481332 0.089626640 0.955186680
[219,] 0.03487519 0.069750389 0.965124805
[220,] 0.03690829 0.073816576 0.963091712
[221,] 0.03978317 0.079566335 0.960216833
[222,] 0.03300012 0.066000231 0.966999884
[223,] 0.02796071 0.055921428 0.972039286
[224,] 0.02757901 0.055158013 0.972420994
[225,] 0.04033164 0.080663281 0.959668360
[226,] 0.03823148 0.076462953 0.961768523
[227,] 0.03055544 0.061110885 0.969444558
[228,] 0.02419534 0.048390687 0.975804657
[229,] 0.02793056 0.055861112 0.972069444
[230,] 0.02570286 0.051405728 0.974297136
[231,] 0.02639031 0.052780619 0.973609690
[232,] 0.02155024 0.043100474 0.978449763
[233,] 0.01718797 0.034375940 0.982812030
[234,] 0.01311920 0.026238391 0.986880804
[235,] 0.02980237 0.059604744 0.970197628
[236,] 0.03993820 0.079876397 0.960061801
[237,] 0.08342743 0.166854864 0.916572568
[238,] 0.06244258 0.124885153 0.937557424
[239,] 0.04559087 0.091181730 0.954409135
[240,] 0.03241490 0.064829792 0.967585104
[241,] 0.02266860 0.045337194 0.977331403
[242,] 0.02418771 0.048375422 0.975812289
[243,] 0.01605902 0.032118036 0.983940982
[244,] 0.22405121 0.448102426 0.775948787
[245,] 0.22412108 0.448242160 0.775878920
[246,] 0.17424677 0.348493537 0.825753232
[247,] 0.14199572 0.283991430 0.858004285
[248,] 0.14555161 0.291103214 0.854448393
[249,] 0.13296936 0.265938730 0.867030635
[250,] 0.09193270 0.183865407 0.908067296
[251,] 0.07127271 0.142545425 0.928727288
[252,] 0.04231240 0.084624799 0.957687601
[253,] 0.04982466 0.099649329 0.950175336
[254,] 0.02978586 0.059571721 0.970214140
[255,] 0.03078383 0.061567656 0.969216172
> postscript(file="/var/wessaorg/rcomp/tmp/126te1384709326.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/2azxm1384709326.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/37zh81384709326.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/4pgb31384709326.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/55iud1384709326.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
-1.21621693 1.02157313 -1.64455948 -2.83511197 9.40267810 2.02157313
7 8 9 10 11 12
8.78378307 -2.21621693 -2.40676942 0.59323058 -0.78787438 -1.16897935
13 14 15 16 17 18
-1.45400700 2.40267810 0.02157313 0.78378307 0.78378307 0.21212562
19 20 21 22 23 24
-3.21621693 1.40267810 -0.47842687 -1.64455948 -1.21621693 -0.83511197
25 26 27 28 29 30
0.21212562 -8.26345452 -0.59732190 1.78378307 1.59323058 -2.64455948
31 32 33 34 35 36
-2.59732190 0.97433555 -0.78787438 -1.40676942 -0.21621693 -3.59732190
37 38 39 40 41 42
2.73654548 -0.40676942 -0.78787438 -4.02566445 -3.40676942 2.40267810
43 44 45 46 47 48
-3.59732190 -0.83511197 -1.40676942 -2.64455948 -3.40676942 -1.40676942
49 50 51 52 53 54
4.21212562 -3.02566445 -1.59732190 0.78378307 2.35544052 -0.83511197
55 56 57 58 59 60
-3.83511197 2.09323058 1.40267810 -3.40676942 -4.83511197 0.16488803
61 62 63 64 65 66
1.92709797 -2.02566445 -3.64455948 0.78378307 0.59323058 -5.45400700
67 68 69 70 71 72
1.35544052 -2.83511197 0.59323058 1.59323058 -0.21621693 3.40267810
73 74 75 76 77 78
0.59323058 -2.40676942 -3.02566445 4.16488803 2.21212562 2.97433555
79 80 81 82 83 84
0.59323058 -5.02566445 -1.40676942 -3.40676942 0.40267810 -0.40676942
85 86 87 88 89 90
-0.21621693 0.59323058 -1.21621693 0.97433555 3.11765045 2.21212562
91 92 93 94 95 96
0.97433555 0.59323058 1.78378307 -1.52566445 -0.59732190 1.16488803
97 98 99 100 101 102
-2.21621693 0.21212562 -2.40676942 -0.78787438 1.16488803 0.40267810
103 104 105 106 107 108
-4.64455948 3.59323058 1.73654548 -0.59732190 3.59323058 -1.45400700
109 110 111 112 113 114
7.54599300 1.59323058 -0.64455948 -3.02566445 1.78378307 2.02157313
115 116 117 118 119 120
-1.59732190 0.78378307 -0.21621693 -4.21621693 1.78378307 0.16488803
121 122 123 124 125 126
0.78378307 -1.40676942 -4.40676942 -1.40676942 -3.02566445 -2.78787438
127 128 129 130 131 132
-0.78787438 1.83102065 0.59323058 -3.02566445 2.73654548 -2.40676942
133 134 135 136 137 138
2.59323058 -0.40676942 2.40267810 7.35544052 0.78378307 0.35544052
139 140 141 142 143 144
-1.40676942 -2.02566445 -2.40676942 2.40267810 -1.21621693 -0.40676942
145 146 147 148 149 150
-0.59732190 0.40267810 -2.64455948 -3.83511197 1.73654548 0.40267810
151 152 153 154 155 156
2.97433555 -2.59732190 -2.83511197 1.73654548 3.97433555 0.97433555
157 158 159 160 161 162
0.78378307 1.83102065 -5.02566445 3.16488803 1.97433555 7.54599300
163 164 165 166 167 168
0.78378307 8.40267810 1.54599300 7.35544052 -1.21621693 -0.83511197
169 170 171 172 173 174
-1.26345452 0.73654548 4.35544052 0.40267810 -5.26345452 2.97433555
175 176 177 178 179 180
1.40267810 -5.02566445 -1.26345452 3.16488803 -1.59732190 -1.64455948
181 182 183 184 185 186
-2.21621693 -5.02566445 -1.40676942 -3.21621693 -0.59732190 4.97433555
187 188 189 190 191 192
0.78378307 -0.40676942 -0.02566445 5.35544052 -2.64455948 -3.21621693
193 194 195 196 197 198
2.59323058 0.35544052 1.59323058 -2.83511197 5.78378307 1.78378307
199 200 201 202 203 204
0.92709797 -1.02566445 -0.26345452 -0.40676942 0.21212562 -0.02566445
205 206 207 208 209 210
-1.40676942 0.59323058 -1.21621693 3.40267810 -0.02566445 0.40267810
211 212 213 214 215 216
-0.26345452 -0.59732190 2.35544052 -3.45400700 1.35544052 0.59323058
217 218 219 220 221 222
0.21212562 -1.21621693 3.92709797 1.59323058 -3.64455948 0.40267810
223 224 225 226 227 228
0.54599300 -3.40676942 3.73654548 -1.59732190 1.83102065 -2.83511197
229 230 231 232 233 234
4.92709797 -2.64455948 -1.21621693 -1.26345452 -3.40676942 2.97433555
235 236 237 238 239 240
-2.59732190 -1.64455948 2.16488803 -1.02566445 -5.45400700 -3.64455948
241 242 243 244 245 246
-4.83511197 0.92709797 1.16488803 1.16488803 1.59323058 4.35544052
247 248 249 250 251 252
0.97433555 9.78378307 3.54599300 1.16488803 1.59323058 2.97433555
253 254 255 256 257 258
-3.02566445 -1.02566445 2.16488803 0.16488803 3.73654548 0.73654548
259 260 261 262 263 264
2.59323058 -8.45400700 -1.21621693 -0.40676942 3.11765045 -1.21621693
> postscript(file="/var/wessaorg/rcomp/tmp/6i6x71384709326.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 -1.21621693 NA
1 1.02157313 -1.21621693
2 -1.64455948 1.02157313
3 -2.83511197 -1.64455948
4 9.40267810 -2.83511197
5 2.02157313 9.40267810
6 8.78378307 2.02157313
7 -2.21621693 8.78378307
8 -2.40676942 -2.21621693
9 0.59323058 -2.40676942
10 -0.78787438 0.59323058
11 -1.16897935 -0.78787438
12 -1.45400700 -1.16897935
13 2.40267810 -1.45400700
14 0.02157313 2.40267810
15 0.78378307 0.02157313
16 0.78378307 0.78378307
17 0.21212562 0.78378307
18 -3.21621693 0.21212562
19 1.40267810 -3.21621693
20 -0.47842687 1.40267810
21 -1.64455948 -0.47842687
22 -1.21621693 -1.64455948
23 -0.83511197 -1.21621693
24 0.21212562 -0.83511197
25 -8.26345452 0.21212562
26 -0.59732190 -8.26345452
27 1.78378307 -0.59732190
28 1.59323058 1.78378307
29 -2.64455948 1.59323058
30 -2.59732190 -2.64455948
31 0.97433555 -2.59732190
32 -0.78787438 0.97433555
33 -1.40676942 -0.78787438
34 -0.21621693 -1.40676942
35 -3.59732190 -0.21621693
36 2.73654548 -3.59732190
37 -0.40676942 2.73654548
38 -0.78787438 -0.40676942
39 -4.02566445 -0.78787438
40 -3.40676942 -4.02566445
41 2.40267810 -3.40676942
42 -3.59732190 2.40267810
43 -0.83511197 -3.59732190
44 -1.40676942 -0.83511197
45 -2.64455948 -1.40676942
46 -3.40676942 -2.64455948
47 -1.40676942 -3.40676942
48 4.21212562 -1.40676942
49 -3.02566445 4.21212562
50 -1.59732190 -3.02566445
51 0.78378307 -1.59732190
52 2.35544052 0.78378307
53 -0.83511197 2.35544052
54 -3.83511197 -0.83511197
55 2.09323058 -3.83511197
56 1.40267810 2.09323058
57 -3.40676942 1.40267810
58 -4.83511197 -3.40676942
59 0.16488803 -4.83511197
60 1.92709797 0.16488803
61 -2.02566445 1.92709797
62 -3.64455948 -2.02566445
63 0.78378307 -3.64455948
64 0.59323058 0.78378307
65 -5.45400700 0.59323058
66 1.35544052 -5.45400700
67 -2.83511197 1.35544052
68 0.59323058 -2.83511197
69 1.59323058 0.59323058
70 -0.21621693 1.59323058
71 3.40267810 -0.21621693
72 0.59323058 3.40267810
73 -2.40676942 0.59323058
74 -3.02566445 -2.40676942
75 4.16488803 -3.02566445
76 2.21212562 4.16488803
77 2.97433555 2.21212562
78 0.59323058 2.97433555
79 -5.02566445 0.59323058
80 -1.40676942 -5.02566445
81 -3.40676942 -1.40676942
82 0.40267810 -3.40676942
83 -0.40676942 0.40267810
84 -0.21621693 -0.40676942
85 0.59323058 -0.21621693
86 -1.21621693 0.59323058
87 0.97433555 -1.21621693
88 3.11765045 0.97433555
89 2.21212562 3.11765045
90 0.97433555 2.21212562
91 0.59323058 0.97433555
92 1.78378307 0.59323058
93 -1.52566445 1.78378307
94 -0.59732190 -1.52566445
95 1.16488803 -0.59732190
96 -2.21621693 1.16488803
97 0.21212562 -2.21621693
98 -2.40676942 0.21212562
99 -0.78787438 -2.40676942
100 1.16488803 -0.78787438
101 0.40267810 1.16488803
102 -4.64455948 0.40267810
103 3.59323058 -4.64455948
104 1.73654548 3.59323058
105 -0.59732190 1.73654548
106 3.59323058 -0.59732190
107 -1.45400700 3.59323058
108 7.54599300 -1.45400700
109 1.59323058 7.54599300
110 -0.64455948 1.59323058
111 -3.02566445 -0.64455948
112 1.78378307 -3.02566445
113 2.02157313 1.78378307
114 -1.59732190 2.02157313
115 0.78378307 -1.59732190
116 -0.21621693 0.78378307
117 -4.21621693 -0.21621693
118 1.78378307 -4.21621693
119 0.16488803 1.78378307
120 0.78378307 0.16488803
121 -1.40676942 0.78378307
122 -4.40676942 -1.40676942
123 -1.40676942 -4.40676942
124 -3.02566445 -1.40676942
125 -2.78787438 -3.02566445
126 -0.78787438 -2.78787438
127 1.83102065 -0.78787438
128 0.59323058 1.83102065
129 -3.02566445 0.59323058
130 2.73654548 -3.02566445
131 -2.40676942 2.73654548
132 2.59323058 -2.40676942
133 -0.40676942 2.59323058
134 2.40267810 -0.40676942
135 7.35544052 2.40267810
136 0.78378307 7.35544052
137 0.35544052 0.78378307
138 -1.40676942 0.35544052
139 -2.02566445 -1.40676942
140 -2.40676942 -2.02566445
141 2.40267810 -2.40676942
142 -1.21621693 2.40267810
143 -0.40676942 -1.21621693
144 -0.59732190 -0.40676942
145 0.40267810 -0.59732190
146 -2.64455948 0.40267810
147 -3.83511197 -2.64455948
148 1.73654548 -3.83511197
149 0.40267810 1.73654548
150 2.97433555 0.40267810
151 -2.59732190 2.97433555
152 -2.83511197 -2.59732190
153 1.73654548 -2.83511197
154 3.97433555 1.73654548
155 0.97433555 3.97433555
156 0.78378307 0.97433555
157 1.83102065 0.78378307
158 -5.02566445 1.83102065
159 3.16488803 -5.02566445
160 1.97433555 3.16488803
161 7.54599300 1.97433555
162 0.78378307 7.54599300
163 8.40267810 0.78378307
164 1.54599300 8.40267810
165 7.35544052 1.54599300
166 -1.21621693 7.35544052
167 -0.83511197 -1.21621693
168 -1.26345452 -0.83511197
169 0.73654548 -1.26345452
170 4.35544052 0.73654548
171 0.40267810 4.35544052
172 -5.26345452 0.40267810
173 2.97433555 -5.26345452
174 1.40267810 2.97433555
175 -5.02566445 1.40267810
176 -1.26345452 -5.02566445
177 3.16488803 -1.26345452
178 -1.59732190 3.16488803
179 -1.64455948 -1.59732190
180 -2.21621693 -1.64455948
181 -5.02566445 -2.21621693
182 -1.40676942 -5.02566445
183 -3.21621693 -1.40676942
184 -0.59732190 -3.21621693
185 4.97433555 -0.59732190
186 0.78378307 4.97433555
187 -0.40676942 0.78378307
188 -0.02566445 -0.40676942
189 5.35544052 -0.02566445
190 -2.64455948 5.35544052
191 -3.21621693 -2.64455948
192 2.59323058 -3.21621693
193 0.35544052 2.59323058
194 1.59323058 0.35544052
195 -2.83511197 1.59323058
196 5.78378307 -2.83511197
197 1.78378307 5.78378307
198 0.92709797 1.78378307
199 -1.02566445 0.92709797
200 -0.26345452 -1.02566445
201 -0.40676942 -0.26345452
202 0.21212562 -0.40676942
203 -0.02566445 0.21212562
204 -1.40676942 -0.02566445
205 0.59323058 -1.40676942
206 -1.21621693 0.59323058
207 3.40267810 -1.21621693
208 -0.02566445 3.40267810
209 0.40267810 -0.02566445
210 -0.26345452 0.40267810
211 -0.59732190 -0.26345452
212 2.35544052 -0.59732190
213 -3.45400700 2.35544052
214 1.35544052 -3.45400700
215 0.59323058 1.35544052
216 0.21212562 0.59323058
217 -1.21621693 0.21212562
218 3.92709797 -1.21621693
219 1.59323058 3.92709797
220 -3.64455948 1.59323058
221 0.40267810 -3.64455948
222 0.54599300 0.40267810
223 -3.40676942 0.54599300
224 3.73654548 -3.40676942
225 -1.59732190 3.73654548
226 1.83102065 -1.59732190
227 -2.83511197 1.83102065
228 4.92709797 -2.83511197
229 -2.64455948 4.92709797
230 -1.21621693 -2.64455948
231 -1.26345452 -1.21621693
232 -3.40676942 -1.26345452
233 2.97433555 -3.40676942
234 -2.59732190 2.97433555
235 -1.64455948 -2.59732190
236 2.16488803 -1.64455948
237 -1.02566445 2.16488803
238 -5.45400700 -1.02566445
239 -3.64455948 -5.45400700
240 -4.83511197 -3.64455948
241 0.92709797 -4.83511197
242 1.16488803 0.92709797
243 1.16488803 1.16488803
244 1.59323058 1.16488803
245 4.35544052 1.59323058
246 0.97433555 4.35544052
247 9.78378307 0.97433555
248 3.54599300 9.78378307
249 1.16488803 3.54599300
250 1.59323058 1.16488803
251 2.97433555 1.59323058
252 -3.02566445 2.97433555
253 -1.02566445 -3.02566445
254 2.16488803 -1.02566445
255 0.16488803 2.16488803
256 3.73654548 0.16488803
257 0.73654548 3.73654548
258 2.59323058 0.73654548
259 -8.45400700 2.59323058
260 -1.21621693 -8.45400700
261 -0.40676942 -1.21621693
262 3.11765045 -0.40676942
263 -1.21621693 3.11765045
264 NA -1.21621693
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.02157313 -1.21621693
[2,] -1.64455948 1.02157313
[3,] -2.83511197 -1.64455948
[4,] 9.40267810 -2.83511197
[5,] 2.02157313 9.40267810
[6,] 8.78378307 2.02157313
[7,] -2.21621693 8.78378307
[8,] -2.40676942 -2.21621693
[9,] 0.59323058 -2.40676942
[10,] -0.78787438 0.59323058
[11,] -1.16897935 -0.78787438
[12,] -1.45400700 -1.16897935
[13,] 2.40267810 -1.45400700
[14,] 0.02157313 2.40267810
[15,] 0.78378307 0.02157313
[16,] 0.78378307 0.78378307
[17,] 0.21212562 0.78378307
[18,] -3.21621693 0.21212562
[19,] 1.40267810 -3.21621693
[20,] -0.47842687 1.40267810
[21,] -1.64455948 -0.47842687
[22,] -1.21621693 -1.64455948
[23,] -0.83511197 -1.21621693
[24,] 0.21212562 -0.83511197
[25,] -8.26345452 0.21212562
[26,] -0.59732190 -8.26345452
[27,] 1.78378307 -0.59732190
[28,] 1.59323058 1.78378307
[29,] -2.64455948 1.59323058
[30,] -2.59732190 -2.64455948
[31,] 0.97433555 -2.59732190
[32,] -0.78787438 0.97433555
[33,] -1.40676942 -0.78787438
[34,] -0.21621693 -1.40676942
[35,] -3.59732190 -0.21621693
[36,] 2.73654548 -3.59732190
[37,] -0.40676942 2.73654548
[38,] -0.78787438 -0.40676942
[39,] -4.02566445 -0.78787438
[40,] -3.40676942 -4.02566445
[41,] 2.40267810 -3.40676942
[42,] -3.59732190 2.40267810
[43,] -0.83511197 -3.59732190
[44,] -1.40676942 -0.83511197
[45,] -2.64455948 -1.40676942
[46,] -3.40676942 -2.64455948
[47,] -1.40676942 -3.40676942
[48,] 4.21212562 -1.40676942
[49,] -3.02566445 4.21212562
[50,] -1.59732190 -3.02566445
[51,] 0.78378307 -1.59732190
[52,] 2.35544052 0.78378307
[53,] -0.83511197 2.35544052
[54,] -3.83511197 -0.83511197
[55,] 2.09323058 -3.83511197
[56,] 1.40267810 2.09323058
[57,] -3.40676942 1.40267810
[58,] -4.83511197 -3.40676942
[59,] 0.16488803 -4.83511197
[60,] 1.92709797 0.16488803
[61,] -2.02566445 1.92709797
[62,] -3.64455948 -2.02566445
[63,] 0.78378307 -3.64455948
[64,] 0.59323058 0.78378307
[65,] -5.45400700 0.59323058
[66,] 1.35544052 -5.45400700
[67,] -2.83511197 1.35544052
[68,] 0.59323058 -2.83511197
[69,] 1.59323058 0.59323058
[70,] -0.21621693 1.59323058
[71,] 3.40267810 -0.21621693
[72,] 0.59323058 3.40267810
[73,] -2.40676942 0.59323058
[74,] -3.02566445 -2.40676942
[75,] 4.16488803 -3.02566445
[76,] 2.21212562 4.16488803
[77,] 2.97433555 2.21212562
[78,] 0.59323058 2.97433555
[79,] -5.02566445 0.59323058
[80,] -1.40676942 -5.02566445
[81,] -3.40676942 -1.40676942
[82,] 0.40267810 -3.40676942
[83,] -0.40676942 0.40267810
[84,] -0.21621693 -0.40676942
[85,] 0.59323058 -0.21621693
[86,] -1.21621693 0.59323058
[87,] 0.97433555 -1.21621693
[88,] 3.11765045 0.97433555
[89,] 2.21212562 3.11765045
[90,] 0.97433555 2.21212562
[91,] 0.59323058 0.97433555
[92,] 1.78378307 0.59323058
[93,] -1.52566445 1.78378307
[94,] -0.59732190 -1.52566445
[95,] 1.16488803 -0.59732190
[96,] -2.21621693 1.16488803
[97,] 0.21212562 -2.21621693
[98,] -2.40676942 0.21212562
[99,] -0.78787438 -2.40676942
[100,] 1.16488803 -0.78787438
[101,] 0.40267810 1.16488803
[102,] -4.64455948 0.40267810
[103,] 3.59323058 -4.64455948
[104,] 1.73654548 3.59323058
[105,] -0.59732190 1.73654548
[106,] 3.59323058 -0.59732190
[107,] -1.45400700 3.59323058
[108,] 7.54599300 -1.45400700
[109,] 1.59323058 7.54599300
[110,] -0.64455948 1.59323058
[111,] -3.02566445 -0.64455948
[112,] 1.78378307 -3.02566445
[113,] 2.02157313 1.78378307
[114,] -1.59732190 2.02157313
[115,] 0.78378307 -1.59732190
[116,] -0.21621693 0.78378307
[117,] -4.21621693 -0.21621693
[118,] 1.78378307 -4.21621693
[119,] 0.16488803 1.78378307
[120,] 0.78378307 0.16488803
[121,] -1.40676942 0.78378307
[122,] -4.40676942 -1.40676942
[123,] -1.40676942 -4.40676942
[124,] -3.02566445 -1.40676942
[125,] -2.78787438 -3.02566445
[126,] -0.78787438 -2.78787438
[127,] 1.83102065 -0.78787438
[128,] 0.59323058 1.83102065
[129,] -3.02566445 0.59323058
[130,] 2.73654548 -3.02566445
[131,] -2.40676942 2.73654548
[132,] 2.59323058 -2.40676942
[133,] -0.40676942 2.59323058
[134,] 2.40267810 -0.40676942
[135,] 7.35544052 2.40267810
[136,] 0.78378307 7.35544052
[137,] 0.35544052 0.78378307
[138,] -1.40676942 0.35544052
[139,] -2.02566445 -1.40676942
[140,] -2.40676942 -2.02566445
[141,] 2.40267810 -2.40676942
[142,] -1.21621693 2.40267810
[143,] -0.40676942 -1.21621693
[144,] -0.59732190 -0.40676942
[145,] 0.40267810 -0.59732190
[146,] -2.64455948 0.40267810
[147,] -3.83511197 -2.64455948
[148,] 1.73654548 -3.83511197
[149,] 0.40267810 1.73654548
[150,] 2.97433555 0.40267810
[151,] -2.59732190 2.97433555
[152,] -2.83511197 -2.59732190
[153,] 1.73654548 -2.83511197
[154,] 3.97433555 1.73654548
[155,] 0.97433555 3.97433555
[156,] 0.78378307 0.97433555
[157,] 1.83102065 0.78378307
[158,] -5.02566445 1.83102065
[159,] 3.16488803 -5.02566445
[160,] 1.97433555 3.16488803
[161,] 7.54599300 1.97433555
[162,] 0.78378307 7.54599300
[163,] 8.40267810 0.78378307
[164,] 1.54599300 8.40267810
[165,] 7.35544052 1.54599300
[166,] -1.21621693 7.35544052
[167,] -0.83511197 -1.21621693
[168,] -1.26345452 -0.83511197
[169,] 0.73654548 -1.26345452
[170,] 4.35544052 0.73654548
[171,] 0.40267810 4.35544052
[172,] -5.26345452 0.40267810
[173,] 2.97433555 -5.26345452
[174,] 1.40267810 2.97433555
[175,] -5.02566445 1.40267810
[176,] -1.26345452 -5.02566445
[177,] 3.16488803 -1.26345452
[178,] -1.59732190 3.16488803
[179,] -1.64455948 -1.59732190
[180,] -2.21621693 -1.64455948
[181,] -5.02566445 -2.21621693
[182,] -1.40676942 -5.02566445
[183,] -3.21621693 -1.40676942
[184,] -0.59732190 -3.21621693
[185,] 4.97433555 -0.59732190
[186,] 0.78378307 4.97433555
[187,] -0.40676942 0.78378307
[188,] -0.02566445 -0.40676942
[189,] 5.35544052 -0.02566445
[190,] -2.64455948 5.35544052
[191,] -3.21621693 -2.64455948
[192,] 2.59323058 -3.21621693
[193,] 0.35544052 2.59323058
[194,] 1.59323058 0.35544052
[195,] -2.83511197 1.59323058
[196,] 5.78378307 -2.83511197
[197,] 1.78378307 5.78378307
[198,] 0.92709797 1.78378307
[199,] -1.02566445 0.92709797
[200,] -0.26345452 -1.02566445
[201,] -0.40676942 -0.26345452
[202,] 0.21212562 -0.40676942
[203,] -0.02566445 0.21212562
[204,] -1.40676942 -0.02566445
[205,] 0.59323058 -1.40676942
[206,] -1.21621693 0.59323058
[207,] 3.40267810 -1.21621693
[208,] -0.02566445 3.40267810
[209,] 0.40267810 -0.02566445
[210,] -0.26345452 0.40267810
[211,] -0.59732190 -0.26345452
[212,] 2.35544052 -0.59732190
[213,] -3.45400700 2.35544052
[214,] 1.35544052 -3.45400700
[215,] 0.59323058 1.35544052
[216,] 0.21212562 0.59323058
[217,] -1.21621693 0.21212562
[218,] 3.92709797 -1.21621693
[219,] 1.59323058 3.92709797
[220,] -3.64455948 1.59323058
[221,] 0.40267810 -3.64455948
[222,] 0.54599300 0.40267810
[223,] -3.40676942 0.54599300
[224,] 3.73654548 -3.40676942
[225,] -1.59732190 3.73654548
[226,] 1.83102065 -1.59732190
[227,] -2.83511197 1.83102065
[228,] 4.92709797 -2.83511197
[229,] -2.64455948 4.92709797
[230,] -1.21621693 -2.64455948
[231,] -1.26345452 -1.21621693
[232,] -3.40676942 -1.26345452
[233,] 2.97433555 -3.40676942
[234,] -2.59732190 2.97433555
[235,] -1.64455948 -2.59732190
[236,] 2.16488803 -1.64455948
[237,] -1.02566445 2.16488803
[238,] -5.45400700 -1.02566445
[239,] -3.64455948 -5.45400700
[240,] -4.83511197 -3.64455948
[241,] 0.92709797 -4.83511197
[242,] 1.16488803 0.92709797
[243,] 1.16488803 1.16488803
[244,] 1.59323058 1.16488803
[245,] 4.35544052 1.59323058
[246,] 0.97433555 4.35544052
[247,] 9.78378307 0.97433555
[248,] 3.54599300 9.78378307
[249,] 1.16488803 3.54599300
[250,] 1.59323058 1.16488803
[251,] 2.97433555 1.59323058
[252,] -3.02566445 2.97433555
[253,] -1.02566445 -3.02566445
[254,] 2.16488803 -1.02566445
[255,] 0.16488803 2.16488803
[256,] 3.73654548 0.16488803
[257,] 0.73654548 3.73654548
[258,] 2.59323058 0.73654548
[259,] -8.45400700 2.59323058
[260,] -1.21621693 -8.45400700
[261,] -0.40676942 -1.21621693
[262,] 3.11765045 -0.40676942
[263,] -1.21621693 3.11765045
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.02157313 -1.21621693
2 -1.64455948 1.02157313
3 -2.83511197 -1.64455948
4 9.40267810 -2.83511197
5 2.02157313 9.40267810
6 8.78378307 2.02157313
7 -2.21621693 8.78378307
8 -2.40676942 -2.21621693
9 0.59323058 -2.40676942
10 -0.78787438 0.59323058
11 -1.16897935 -0.78787438
12 -1.45400700 -1.16897935
13 2.40267810 -1.45400700
14 0.02157313 2.40267810
15 0.78378307 0.02157313
16 0.78378307 0.78378307
17 0.21212562 0.78378307
18 -3.21621693 0.21212562
19 1.40267810 -3.21621693
20 -0.47842687 1.40267810
21 -1.64455948 -0.47842687
22 -1.21621693 -1.64455948
23 -0.83511197 -1.21621693
24 0.21212562 -0.83511197
25 -8.26345452 0.21212562
26 -0.59732190 -8.26345452
27 1.78378307 -0.59732190
28 1.59323058 1.78378307
29 -2.64455948 1.59323058
30 -2.59732190 -2.64455948
31 0.97433555 -2.59732190
32 -0.78787438 0.97433555
33 -1.40676942 -0.78787438
34 -0.21621693 -1.40676942
35 -3.59732190 -0.21621693
36 2.73654548 -3.59732190
37 -0.40676942 2.73654548
38 -0.78787438 -0.40676942
39 -4.02566445 -0.78787438
40 -3.40676942 -4.02566445
41 2.40267810 -3.40676942
42 -3.59732190 2.40267810
43 -0.83511197 -3.59732190
44 -1.40676942 -0.83511197
45 -2.64455948 -1.40676942
46 -3.40676942 -2.64455948
47 -1.40676942 -3.40676942
48 4.21212562 -1.40676942
49 -3.02566445 4.21212562
50 -1.59732190 -3.02566445
51 0.78378307 -1.59732190
52 2.35544052 0.78378307
53 -0.83511197 2.35544052
54 -3.83511197 -0.83511197
55 2.09323058 -3.83511197
56 1.40267810 2.09323058
57 -3.40676942 1.40267810
58 -4.83511197 -3.40676942
59 0.16488803 -4.83511197
60 1.92709797 0.16488803
61 -2.02566445 1.92709797
62 -3.64455948 -2.02566445
63 0.78378307 -3.64455948
64 0.59323058 0.78378307
65 -5.45400700 0.59323058
66 1.35544052 -5.45400700
67 -2.83511197 1.35544052
68 0.59323058 -2.83511197
69 1.59323058 0.59323058
70 -0.21621693 1.59323058
71 3.40267810 -0.21621693
72 0.59323058 3.40267810
73 -2.40676942 0.59323058
74 -3.02566445 -2.40676942
75 4.16488803 -3.02566445
76 2.21212562 4.16488803
77 2.97433555 2.21212562
78 0.59323058 2.97433555
79 -5.02566445 0.59323058
80 -1.40676942 -5.02566445
81 -3.40676942 -1.40676942
82 0.40267810 -3.40676942
83 -0.40676942 0.40267810
84 -0.21621693 -0.40676942
85 0.59323058 -0.21621693
86 -1.21621693 0.59323058
87 0.97433555 -1.21621693
88 3.11765045 0.97433555
89 2.21212562 3.11765045
90 0.97433555 2.21212562
91 0.59323058 0.97433555
92 1.78378307 0.59323058
93 -1.52566445 1.78378307
94 -0.59732190 -1.52566445
95 1.16488803 -0.59732190
96 -2.21621693 1.16488803
97 0.21212562 -2.21621693
98 -2.40676942 0.21212562
99 -0.78787438 -2.40676942
100 1.16488803 -0.78787438
101 0.40267810 1.16488803
102 -4.64455948 0.40267810
103 3.59323058 -4.64455948
104 1.73654548 3.59323058
105 -0.59732190 1.73654548
106 3.59323058 -0.59732190
107 -1.45400700 3.59323058
108 7.54599300 -1.45400700
109 1.59323058 7.54599300
110 -0.64455948 1.59323058
111 -3.02566445 -0.64455948
112 1.78378307 -3.02566445
113 2.02157313 1.78378307
114 -1.59732190 2.02157313
115 0.78378307 -1.59732190
116 -0.21621693 0.78378307
117 -4.21621693 -0.21621693
118 1.78378307 -4.21621693
119 0.16488803 1.78378307
120 0.78378307 0.16488803
121 -1.40676942 0.78378307
122 -4.40676942 -1.40676942
123 -1.40676942 -4.40676942
124 -3.02566445 -1.40676942
125 -2.78787438 -3.02566445
126 -0.78787438 -2.78787438
127 1.83102065 -0.78787438
128 0.59323058 1.83102065
129 -3.02566445 0.59323058
130 2.73654548 -3.02566445
131 -2.40676942 2.73654548
132 2.59323058 -2.40676942
133 -0.40676942 2.59323058
134 2.40267810 -0.40676942
135 7.35544052 2.40267810
136 0.78378307 7.35544052
137 0.35544052 0.78378307
138 -1.40676942 0.35544052
139 -2.02566445 -1.40676942
140 -2.40676942 -2.02566445
141 2.40267810 -2.40676942
142 -1.21621693 2.40267810
143 -0.40676942 -1.21621693
144 -0.59732190 -0.40676942
145 0.40267810 -0.59732190
146 -2.64455948 0.40267810
147 -3.83511197 -2.64455948
148 1.73654548 -3.83511197
149 0.40267810 1.73654548
150 2.97433555 0.40267810
151 -2.59732190 2.97433555
152 -2.83511197 -2.59732190
153 1.73654548 -2.83511197
154 3.97433555 1.73654548
155 0.97433555 3.97433555
156 0.78378307 0.97433555
157 1.83102065 0.78378307
158 -5.02566445 1.83102065
159 3.16488803 -5.02566445
160 1.97433555 3.16488803
161 7.54599300 1.97433555
162 0.78378307 7.54599300
163 8.40267810 0.78378307
164 1.54599300 8.40267810
165 7.35544052 1.54599300
166 -1.21621693 7.35544052
167 -0.83511197 -1.21621693
168 -1.26345452 -0.83511197
169 0.73654548 -1.26345452
170 4.35544052 0.73654548
171 0.40267810 4.35544052
172 -5.26345452 0.40267810
173 2.97433555 -5.26345452
174 1.40267810 2.97433555
175 -5.02566445 1.40267810
176 -1.26345452 -5.02566445
177 3.16488803 -1.26345452
178 -1.59732190 3.16488803
179 -1.64455948 -1.59732190
180 -2.21621693 -1.64455948
181 -5.02566445 -2.21621693
182 -1.40676942 -5.02566445
183 -3.21621693 -1.40676942
184 -0.59732190 -3.21621693
185 4.97433555 -0.59732190
186 0.78378307 4.97433555
187 -0.40676942 0.78378307
188 -0.02566445 -0.40676942
189 5.35544052 -0.02566445
190 -2.64455948 5.35544052
191 -3.21621693 -2.64455948
192 2.59323058 -3.21621693
193 0.35544052 2.59323058
194 1.59323058 0.35544052
195 -2.83511197 1.59323058
196 5.78378307 -2.83511197
197 1.78378307 5.78378307
198 0.92709797 1.78378307
199 -1.02566445 0.92709797
200 -0.26345452 -1.02566445
201 -0.40676942 -0.26345452
202 0.21212562 -0.40676942
203 -0.02566445 0.21212562
204 -1.40676942 -0.02566445
205 0.59323058 -1.40676942
206 -1.21621693 0.59323058
207 3.40267810 -1.21621693
208 -0.02566445 3.40267810
209 0.40267810 -0.02566445
210 -0.26345452 0.40267810
211 -0.59732190 -0.26345452
212 2.35544052 -0.59732190
213 -3.45400700 2.35544052
214 1.35544052 -3.45400700
215 0.59323058 1.35544052
216 0.21212562 0.59323058
217 -1.21621693 0.21212562
218 3.92709797 -1.21621693
219 1.59323058 3.92709797
220 -3.64455948 1.59323058
221 0.40267810 -3.64455948
222 0.54599300 0.40267810
223 -3.40676942 0.54599300
224 3.73654548 -3.40676942
225 -1.59732190 3.73654548
226 1.83102065 -1.59732190
227 -2.83511197 1.83102065
228 4.92709797 -2.83511197
229 -2.64455948 4.92709797
230 -1.21621693 -2.64455948
231 -1.26345452 -1.21621693
232 -3.40676942 -1.26345452
233 2.97433555 -3.40676942
234 -2.59732190 2.97433555
235 -1.64455948 -2.59732190
236 2.16488803 -1.64455948
237 -1.02566445 2.16488803
238 -5.45400700 -1.02566445
239 -3.64455948 -5.45400700
240 -4.83511197 -3.64455948
241 0.92709797 -4.83511197
242 1.16488803 0.92709797
243 1.16488803 1.16488803
244 1.59323058 1.16488803
245 4.35544052 1.59323058
246 0.97433555 4.35544052
247 9.78378307 0.97433555
248 3.54599300 9.78378307
249 1.16488803 3.54599300
250 1.59323058 1.16488803
251 2.97433555 1.59323058
252 -3.02566445 2.97433555
253 -1.02566445 -3.02566445
254 2.16488803 -1.02566445
255 0.16488803 2.16488803
256 3.73654548 0.16488803
257 0.73654548 3.73654548
258 2.59323058 0.73654548
259 -8.45400700 2.59323058
260 -1.21621693 -8.45400700
261 -0.40676942 -1.21621693
262 3.11765045 -0.40676942
263 -1.21621693 3.11765045
> 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/7yccs1384709326.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/8bcud1384709326.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/9rivn1384709326.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/10ehiq1384709326.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, signif(mysum$coefficients[i,1],6), 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/11hoj31384709326.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,signif(mysum$coefficients[i,1],6))
+ a<-table.element(a, signif(mysum$coefficients[i,2],6))
+ a<-table.element(a, signif(mysum$coefficients[i,3],4))
+ a<-table.element(a, signif(mysum$coefficients[i,4],6))
+ a<-table.element(a, signif(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12xn8s1384709326.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, signif(sqrt(mysum$r.squared),6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, signif(mysum$r.squared,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, signif(mysum$adj.r.squared,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[1],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[2],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[3],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6))
> 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, signif(mysum$sigma,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, signif(sum(myerror*myerror),6))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13b8yg1384709326.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,signif(x[i],6))
+ a<-table.element(a,signif(x[i]-mysum$resid[i],6))
+ a<-table.element(a,signif(mysum$resid[i],6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14tj1t1384709326.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,signif(gqarr[mypoint-kp3+1,1],6))
+ a<-table.element(a,signif(gqarr[mypoint-kp3+1,2],6))
+ a<-table.element(a,signif(gqarr[mypoint-kp3+1,3],6))
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/15u3yv1384709326.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,signif(numsignificant1,6))
+ a<-table.element(a,signif(numsignificant1/numgqtests,6))
+ 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,signif(numsignificant5,6))
+ a<-table.element(a,signif(numsignificant5/numgqtests,6))
+ 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,signif(numsignificant10,6))
+ a<-table.element(a,signif(numsignificant10/numgqtests,6))
+ 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/166raw1384709326.tab")
+ }
>
> try(system("convert tmp/126te1384709326.ps tmp/126te1384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/2azxm1384709326.ps tmp/2azxm1384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/37zh81384709326.ps tmp/37zh81384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/4pgb31384709326.ps tmp/4pgb31384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/55iud1384709326.ps tmp/55iud1384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/6i6x71384709326.ps tmp/6i6x71384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/7yccs1384709326.ps tmp/7yccs1384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/8bcud1384709326.ps tmp/8bcud1384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/9rivn1384709326.ps tmp/9rivn1384709326.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ehiq1384709326.ps tmp/10ehiq1384709326.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
9.956 1.472 11.420