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(13
+ ,12
+ ,53
+ ,14
+ ,16
+ ,11
+ ,83
+ ,18
+ ,19
+ ,14
+ ,66
+ ,11
+ ,15
+ ,12
+ ,67
+ ,12
+ ,14
+ ,21
+ ,76
+ ,16
+ ,13
+ ,12
+ ,78
+ ,18
+ ,19
+ ,22
+ ,53
+ ,14
+ ,15
+ ,11
+ ,80
+ ,14
+ ,14
+ ,10
+ ,74
+ ,15
+ ,15
+ ,13
+ ,76
+ ,15
+ ,16
+ ,10
+ ,79
+ ,17
+ ,16
+ ,8
+ ,54
+ ,19
+ ,16
+ ,15
+ ,67
+ ,10
+ ,16
+ ,14
+ ,54
+ ,16
+ ,17
+ ,10
+ ,87
+ ,18
+ ,15
+ ,14
+ ,58
+ ,14
+ ,15
+ ,14
+ ,75
+ ,14
+ ,20
+ ,11
+ ,88
+ ,17
+ ,18
+ ,10
+ ,64
+ ,14
+ ,16
+ ,13
+ ,57
+ ,16
+ ,16
+ ,9.5
+ ,66
+ ,18
+ ,16
+ ,14
+ ,68
+ ,11
+ ,19
+ ,12
+ ,54
+ ,14
+ ,16
+ ,14
+ ,56
+ ,12
+ ,17
+ ,11
+ ,86
+ ,17
+ ,17
+ ,9
+ ,80
+ ,9
+ ,16
+ ,11
+ ,76
+ ,16
+ ,15
+ ,15
+ ,69
+ ,14
+ ,16
+ ,14
+ ,78
+ ,15
+ ,14
+ ,13
+ ,67
+ ,11
+ ,15
+ ,9
+ ,80
+ ,16
+ ,12
+ ,15
+ ,54
+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+ ,12
+ ,20
+ ,69
+ ,11
+ ,14
+ ,15
+ ,68
+ ,13
+ ,10
+ ,23
+ ,44
+ ,14
+ ,12
+ ,20
+ ,56
+ ,10
+ ,12
+ ,16
+ ,53
+ ,12
+ ,11
+ ,14
+ ,70
+ ,15
+ ,10
+ ,17
+ ,78
+ ,13
+ ,12
+ ,11
+ ,71
+ ,13
+ ,16
+ ,13
+ ,72
+ ,13
+ ,12
+ ,17
+ ,68
+ ,12
+ ,14
+ ,15
+ ,67
+ ,12
+ ,16
+ ,21
+ ,75
+ ,9
+ ,14
+ ,18
+ ,62
+ ,9
+ ,13
+ ,15
+ ,67
+ ,15
+ ,4
+ ,8
+ ,83
+ ,10
+ ,15
+ ,12
+ ,64
+ ,14
+ ,11
+ ,12
+ ,68
+ ,15
+ ,11
+ ,22
+ ,62
+ ,7
+ ,14
+ ,12
+ ,72
+ ,14)
+ ,dim=c(4
+ ,264)
+ ,dimnames=list(c('Learning'
+ ,'Depression'
+ ,'Sport1'
+ ,'Happiness')
+ ,1:264))
> y <- array(NA,dim=c(4,264),dimnames=list(c('Learning','Depression','Sport1','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 = '4'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '4'
> #'GNU S' R Code compiled by R2WASP v. 1.2.327 ()
> #Author: root
> #To cite this work: Wessa P., (2013), Multiple Regression (v1.0.29) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_multipleregression.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #
> 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
Happiness Learning Depression Sport1
1 14 13 12.0 53
2 18 16 11.0 83
3 11 19 14.0 66
4 12 15 12.0 67
5 16 14 21.0 76
6 18 13 12.0 78
7 14 19 22.0 53
8 14 15 11.0 80
9 15 14 10.0 74
10 15 15 13.0 76
11 17 16 10.0 79
12 19 16 8.0 54
13 10 16 15.0 67
14 16 16 14.0 54
15 18 17 10.0 87
16 14 15 14.0 58
17 14 15 14.0 75
18 17 20 11.0 88
19 14 18 10.0 64
20 16 16 13.0 57
21 18 16 9.5 66
22 11 16 14.0 68
23 14 19 12.0 54
24 12 16 14.0 56
25 17 17 11.0 86
26 9 17 9.0 80
27 16 16 11.0 76
28 14 15 15.0 69
29 15 16 14.0 78
30 11 14 13.0 67
31 16 15 9.0 80
32 13 12 15.0 54
33 17 14 10.0 71
34 15 16 11.0 84
35 14 14 13.0 74
36 16 10 8.0 71
37 9 10 20.0 63
38 15 14 12.0 71
39 17 16 10.0 76
40 13 16 10.0 69
41 15 16 9.0 74
42 16 14 14.0 75
43 16 20 8.0 54
44 12 14 14.0 52
45 15 14 11.0 69
46 11 11 13.0 68
47 15 14 9.0 65
48 15 15 11.0 75
49 17 16 15.0 74
50 13 14 11.0 75
51 16 16 10.0 72
52 14 14 14.0 67
53 11 12 18.0 63
54 12 16 14.0 62
55 12 9 11.0 63
56 15 14 14.5 76
57 16 16 13.0 74
58 15 16 9.0 67
59 12 15 10.0 73
60 12 16 15.0 70
61 8 12 20.0 53
62 13 16 12.0 77
63 11 16 12.0 80
64 14 14 14.0 52
65 15 16 13.0 54
66 10 17 11.0 80
67 11 18 17.0 66
68 12 18 12.0 73
69 15 12 13.0 63
70 15 16 14.0 69
71 14 10 13.0 67
72 16 14 15.0 54
73 15 18 13.0 81
74 15 18 10.0 69
75 13 16 11.0 84
76 12 17 19.0 80
77 17 16 13.0 70
78 13 16 17.0 69
79 15 13 13.0 77
80 13 16 9.0 54
81 15 16 11.0 79
82 15 16 9.0 71
83 16 15 12.0 73
84 15 15 12.0 72
85 14 16 13.0 77
86 15 14 13.0 75
87 14 16 12.0 69
88 13 16 15.0 54
89 7 15 22.0 70
90 17 12 13.0 73
91 13 17 15.0 54
92 15 16 13.0 77
93 14 15 15.0 82
94 13 13 12.5 80
95 16 16 11.0 80
96 12 16 16.0 69
97 14 16 11.0 78
98 17 16 11.0 81
99 15 14 10.0 76
100 17 16 10.0 76
101 12 16 16.0 73
102 16 20 12.0 85
103 11 15 11.0 66
104 15 16 16.0 79
105 9 13 19.0 68
106 16 17 11.0 76
107 15 16 16.0 71
108 10 16 15.0 54
109 10 12 24.0 46
110 15 16 14.0 85
111 11 16 15.0 74
112 13 17 11.0 88
113 14 13 15.0 38
114 18 12 12.0 76
115 16 18 10.0 86
116 14 14 14.0 54
117 14 14 13.0 67
118 14 13 9.0 69
119 14 16 15.0 90
120 12 13 15.0 54
121 14 16 14.0 76
122 15 13 11.0 89
123 15 16 8.0 76
124 15 15 11.0 73
125 13 16 11.0 79
126 17 15 8.0 90
127 17 17 10.0 74
128 19 15 11.0 81
129 15 12 13.0 72
130 13 16 11.0 71
131 9 10 20.0 66
132 15 16 10.0 77
133 15 12 15.0 65
134 15 14 12.0 74
135 16 15 14.0 85
136 11 13 23.0 54
137 14 15 14.0 63
138 11 11 16.0 54
139 15 12 11.0 64
140 13 11 12.0 69
141 15 16 10.0 54
142 16 15 14.0 84
143 14 17 12.0 86
144 15 16 12.0 77
145 16 10 11.0 89
146 16 18 12.0 76
147 11 13 13.0 60
148 12 16 11.0 75
149 9 13 19.0 73
150 16 10 12.0 85
151 13 15 17.0 79
152 16 16 9.0 71
153 12 16 12.0 72
154 9 14 19.0 69
155 13 10 18.0 78
156 13 17 15.0 54
157 14 13 14.0 69
158 19 15 11.0 81
159 13 16 9.0 84
160 12 12 18.0 84
161 13 13 16.0 69
162 10 13 24.0 66
163 14 12 14.0 81
164 16 17 20.0 82
165 10 15 18.0 72
166 11 10 23.0 54
167 14 14 12.0 78
168 12 11 14.0 74
169 9 13 16.0 82
170 9 16 18.0 73
171 11 12 20.0 55
172 16 16 12.0 72
173 9 12 12.0 78
174 13 9 17.0 59
175 16 12 13.0 72
176 13 15 9.0 78
177 9 12 16.0 68
178 12 12 18.0 69
179 16 14 10.0 67
180 11 12 14.0 74
181 14 16 11.0 54
182 13 11 9.0 67
183 15 19 11.0 70
184 14 15 10.0 80
185 16 8 11.0 89
186 13 16 19.0 76
187 14 17 14.0 74
188 15 12 12.0 87
189 13 11 14.0 54
190 11 11 21.0 61
191 11 14 13.0 38
192 14 16 10.0 75
193 15 12 15.0 69
194 11 16 16.0 62
195 15 13 14.0 72
196 12 15 12.0 70
197 14 16 19.0 79
198 14 16 15.0 87
199 8 14 19.0 62
200 13 16 13.0 77
201 9 16 17.0 69
202 15 14 12.0 69
203 17 11 11.0 75
204 13 12 14.0 54
205 15 15 11.0 72
206 15 15 13.0 74
207 14 16 12.0 85
208 16 16 15.0 52
209 13 11 14.0 70
210 16 15 12.0 84
211 9 12 17.0 64
212 16 12 11.0 84
213 11 15 18.0 87
214 10 15 13.0 79
215 11 16 17.0 67
216 15 14 13.0 65
217 17 17 11.0 85
218 14 14 12.0 83
219 8 13 22.0 61
220 15 15 14.0 82
221 11 13 12.0 76
222 16 14 12.0 58
223 10 15 17.0 72
224 15 12 9.0 72
225 9 13 21.0 38
226 16 8 10.0 78
227 19 14 11.0 54
228 12 14 12.0 63
229 8 11 23.0 66
230 11 12 13.0 70
231 14 13 12.0 71
232 9 10 16.0 67
233 15 16 9.0 58
234 13 18 17.0 72
235 16 13 9.0 72
236 11 11 14.0 70
237 12 4 17.0 76
238 13 13 13.0 50
239 10 16 11.0 72
240 11 10 12.0 72
241 12 12 10.0 88
242 8 12 19.0 53
243 12 10 16.0 58
244 12 13 16.0 66
245 15 15 14.0 82
246 11 12 20.0 69
247 13 14 15.0 68
248 14 10 23.0 44
249 10 12 20.0 56
250 12 12 16.0 53
251 15 11 14.0 70
252 13 10 17.0 78
253 13 12 11.0 71
254 13 16 13.0 72
255 12 12 17.0 68
256 12 14 15.0 67
257 9 16 21.0 75
258 9 14 18.0 62
259 15 13 15.0 67
260 10 4 8.0 83
261 14 15 12.0 64
262 15 11 12.0 68
263 7 11 22.0 62
264 14 14 12.0 72
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Learning Depression Sport1
15.34465 0.11539 -0.37767 0.02358
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.7939 -1.3820 0.2076 1.2781 5.1787
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 15.34465 1.40580 10.915 <2e-16 ***
Learning 0.11539 0.05193 2.222 0.0271 *
Depression -0.37767 0.03853 -9.801 <2e-16 ***
Sport1 0.02358 0.01264 1.865 0.0633 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.007 on 260 degrees of freedom
Multiple R-squared: 0.3621, Adjusted R-squared: 0.3547
F-statistic: 49.19 on 3 and 260 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.8416234 0.316753214 0.158376607
[2,] 0.7978308 0.404338312 0.202169156
[3,] 0.6887833 0.622433336 0.311216668
[4,] 0.5739662 0.852067693 0.426033846
[5,] 0.5777920 0.844415926 0.422207963
[6,] 0.9229472 0.154105669 0.077052834
[7,] 0.9779368 0.044126395 0.022063198
[8,] 0.9735028 0.052994316 0.026497158
[9,] 0.9726116 0.054776761 0.027388381
[10,] 0.9586470 0.082706090 0.041353045
[11,] 0.9443684 0.111263103 0.055631551
[12,] 0.9273190 0.145362080 0.072681040
[13,] 0.9071605 0.185679075 0.092839537
[14,] 0.8950872 0.209825621 0.104912810
[15,] 0.9005456 0.198908822 0.099454411
[16,] 0.9431977 0.113604640 0.056802320
[17,] 0.9225622 0.154875681 0.077437840
[18,] 0.9181068 0.163786435 0.081893217
[19,] 0.8977692 0.204461567 0.102230784
[20,] 0.9952277 0.009544566 0.004772283
[21,] 0.9931836 0.013632742 0.006816371
[22,] 0.9902574 0.019485200 0.009742600
[23,] 0.9862831 0.027433807 0.013716904
[24,] 0.9923047 0.015390624 0.007695312
[25,] 0.9889809 0.022038296 0.011019148
[26,] 0.9850180 0.029964068 0.014982034
[27,] 0.9831663 0.033667461 0.016833731
[28,] 0.9773453 0.045309499 0.022654749
[29,] 0.9706247 0.058750669 0.029375335
[30,] 0.9612343 0.077531499 0.038765750
[31,] 0.9720727 0.055854550 0.027927275
[32,] 0.9635921 0.072815853 0.036407927
[33,] 0.9582046 0.083590709 0.041795354
[34,] 0.9591413 0.081717311 0.040858656
[35,] 0.9485799 0.102840183 0.051420092
[36,] 0.9459472 0.108105610 0.054052805
[37,] 0.9327397 0.134520582 0.067260291
[38,] 0.9218780 0.156243974 0.078121987
[39,] 0.9036693 0.192661492 0.096330746
[40,] 0.9174833 0.165033379 0.082516690
[41,] 0.8984205 0.203159083 0.101579541
[42,] 0.8767102 0.246579585 0.123289792
[43,] 0.9013853 0.197229317 0.098614658
[44,] 0.8975538 0.204892365 0.102446182
[45,] 0.8789831 0.242033882 0.121016941
[46,] 0.8561133 0.287773404 0.143886702
[47,] 0.8380432 0.323913554 0.161956777
[48,] 0.8294081 0.341183833 0.170591917
[49,] 0.8153760 0.369248060 0.184624030
[50,] 0.7957362 0.408527652 0.204263826
[51,] 0.7814411 0.437117848 0.218558924
[52,] 0.7491102 0.501779635 0.250889817
[53,] 0.7920587 0.415882598 0.207941299
[54,] 0.7852963 0.429407354 0.214703677
[55,] 0.8083508 0.383298346 0.191649173
[56,] 0.8041321 0.391735864 0.195867932
[57,] 0.8712395 0.257520956 0.128760478
[58,] 0.8564599 0.287080295 0.143540148
[59,] 0.8441434 0.311713201 0.155856600
[60,] 0.9405299 0.118940166 0.059470083
[61,] 0.9393841 0.121231717 0.060615859
[62,] 0.9470396 0.105920704 0.052960352
[63,] 0.9427398 0.114520486 0.057260243
[64,] 0.9357032 0.128593673 0.064296837
[65,] 0.9239143 0.152171330 0.076085665
[66,] 0.9423536 0.115292760 0.057646380
[67,] 0.9308451 0.138309826 0.069154913
[68,] 0.9169943 0.166011499 0.083005750
[69,] 0.9163652 0.167269543 0.083634771
[70,] 0.9014615 0.197076988 0.098538494
[71,] 0.9183119 0.163376177 0.081688089
[72,] 0.9035242 0.192951581 0.096475791
[73,] 0.8913153 0.217369413 0.108684706
[74,] 0.8893303 0.221339481 0.110669740
[75,] 0.8702517 0.259496531 0.129748265
[76,] 0.8496891 0.300621862 0.150310931
[77,] 0.8419425 0.316114936 0.158057468
[78,] 0.8207628 0.358474385 0.179237192
[79,] 0.7954085 0.409182942 0.204591471
[80,] 0.7748138 0.450372449 0.225186225
[81,] 0.7464252 0.507149506 0.253574753
[82,] 0.7158169 0.568366260 0.284183130
[83,] 0.7940585 0.411883022 0.205941511
[84,] 0.8326536 0.334692815 0.167346408
[85,] 0.8084281 0.383143869 0.191571934
[86,] 0.7866382 0.426723697 0.213361848
[87,] 0.7605740 0.478851935 0.239425968
[88,] 0.7418285 0.516342945 0.258171473
[89,] 0.7194696 0.561060779 0.280530389
[90,] 0.6942579 0.611484193 0.305742097
[91,] 0.6679372 0.664125520 0.332062760
[92,] 0.6676708 0.664658480 0.332329240
[93,] 0.6339859 0.732028214 0.366014107
[94,] 0.6263903 0.747219336 0.373609668
[95,] 0.6000427 0.799914545 0.399957273
[96,] 0.5723774 0.855245156 0.427622578
[97,] 0.6418841 0.716231819 0.358115909
[98,] 0.6365717 0.726856541 0.363428271
[99,] 0.6547690 0.690462021 0.345231010
[100,] 0.6303450 0.739310078 0.369655039
[101,] 0.6333061 0.733387883 0.366693942
[102,] 0.6622399 0.675520147 0.337760074
[103,] 0.6388449 0.722310270 0.361155135
[104,] 0.6133366 0.773326801 0.386663401
[105,] 0.6255179 0.748964179 0.374482089
[106,] 0.6343952 0.731209637 0.365604818
[107,] 0.6301444 0.739711241 0.369855621
[108,] 0.7143810 0.571238033 0.285619017
[109,] 0.6845061 0.630987827 0.315493914
[110,] 0.6605255 0.678949065 0.339474533
[111,] 0.6283840 0.743232063 0.371616031
[112,] 0.6056159 0.788768240 0.394384120
[113,] 0.5720148 0.855970459 0.427985229
[114,] 0.5399147 0.920170596 0.460085298
[115,] 0.5054306 0.989138852 0.494569426
[116,] 0.4707015 0.941402976 0.529298512
[117,] 0.4424916 0.884983229 0.557508385
[118,] 0.4088495 0.817699043 0.591150479
[119,] 0.4048062 0.809612380 0.595193810
[120,] 0.3763554 0.752710759 0.623644621
[121,] 0.3700395 0.740078901 0.629960549
[122,] 0.4830388 0.966077642 0.516961179
[123,] 0.4640830 0.928165980 0.535917010
[124,] 0.4526368 0.905273541 0.547363229
[125,] 0.4474072 0.894814428 0.552592786
[126,] 0.4131989 0.826397769 0.586801115
[127,] 0.4233963 0.846792673 0.576603663
[128,] 0.3949691 0.789938140 0.605030930
[129,] 0.4015393 0.803078562 0.598460719
[130,] 0.3846191 0.769238161 0.615380919
[131,] 0.3562242 0.712448436 0.643775782
[132,] 0.3324676 0.664935110 0.667532445
[133,] 0.3070554 0.614110760 0.692944620
[134,] 0.2826434 0.565286780 0.717356610
[135,] 0.2551385 0.510276939 0.744861530
[136,] 0.2623745 0.524749082 0.737625459
[137,] 0.2384604 0.476920814 0.761539593
[138,] 0.2148684 0.429736868 0.785131566
[139,] 0.2033071 0.406614162 0.796692919
[140,] 0.1934094 0.386818758 0.806590621
[141,] 0.2033589 0.406717862 0.796641069
[142,] 0.2237110 0.447421952 0.776289024
[143,] 0.2395564 0.479112883 0.760443559
[144,] 0.2391470 0.478294098 0.760852951
[145,] 0.2151164 0.430232858 0.784883571
[146,] 0.1931577 0.386315441 0.806842279
[147,] 0.1990098 0.398019586 0.800990207
[148,] 0.2114372 0.422874380 0.788562810
[149,] 0.1988805 0.397760999 0.801119501
[150,] 0.1749691 0.349938113 0.825030944
[151,] 0.1567398 0.313479580 0.843260210
[152,] 0.2484472 0.496894320 0.751552840
[153,] 0.2668451 0.533690153 0.733154923
[154,] 0.2406125 0.481224996 0.759387502
[155,] 0.2163056 0.432611257 0.783694372
[156,] 0.1938472 0.387694302 0.806152849
[157,] 0.1746435 0.349287019 0.825356491
[158,] 0.2958485 0.591697088 0.704151456
[159,] 0.2907866 0.581573231 0.709213385
[160,] 0.2868649 0.573729855 0.713135072
[161,] 0.2578978 0.515795666 0.742102167
[162,] 0.2379460 0.475891925 0.762054038
[163,] 0.3021324 0.604264891 0.697867554
[164,] 0.3369515 0.673902903 0.663048549
[165,] 0.3066514 0.613302813 0.693348594
[166,] 0.3011565 0.602312947 0.698843527
[167,] 0.4764834 0.952966768 0.523516616
[168,] 0.4644646 0.928929239 0.535535380
[169,] 0.4903750 0.980749964 0.509625018
[170,] 0.5053444 0.989311217 0.494655609
[171,] 0.5615761 0.876847895 0.438423947
[172,] 0.5287936 0.942412767 0.471206383
[173,] 0.5067967 0.986406600 0.493203300
[174,] 0.5084384 0.983123270 0.491561635
[175,] 0.4709651 0.941930116 0.529034942
[176,] 0.4635232 0.927046410 0.536476795
[177,] 0.4256358 0.851271643 0.574364179
[178,] 0.3981973 0.796394632 0.601802684
[179,] 0.3978634 0.795726884 0.602136558
[180,] 0.3843250 0.768650045 0.615674978
[181,] 0.3501163 0.700232555 0.649883722
[182,] 0.3259682 0.651936398 0.674031801
[183,] 0.2923455 0.584690995 0.707654502
[184,] 0.2715199 0.543039850 0.728480075
[185,] 0.2848084 0.569616830 0.715191585
[186,] 0.2617381 0.523476111 0.738261945
[187,] 0.2806644 0.561328780 0.719335610
[188,] 0.2666774 0.533354721 0.733322640
[189,] 0.2659763 0.531952697 0.734023651
[190,] 0.2703152 0.540630389 0.729684806
[191,] 0.3092808 0.618561640 0.690719180
[192,] 0.2922257 0.584451487 0.707774256
[193,] 0.3327512 0.665502396 0.667248802
[194,] 0.3014698 0.602939622 0.698530189
[195,] 0.3509912 0.701982483 0.649008758
[196,] 0.3209915 0.641982912 0.679008544
[197,] 0.3710621 0.742124232 0.628937884
[198,] 0.3317788 0.663557640 0.668221180
[199,] 0.2958036 0.591607253 0.704196374
[200,] 0.2765811 0.553162156 0.723418922
[201,] 0.2433425 0.486684945 0.756657528
[202,] 0.2816416 0.563283252 0.718358374
[203,] 0.2481906 0.496381217 0.751809392
[204,] 0.2554408 0.510881618 0.744559191
[205,] 0.2758202 0.551640460 0.724179770
[206,] 0.2874906 0.574981212 0.712509394
[207,] 0.2568485 0.513697099 0.743151450
[208,] 0.3238603 0.647720658 0.676139671
[209,] 0.2941591 0.588318190 0.705840905
[210,] 0.2763392 0.552678401 0.723660799
[211,] 0.3113932 0.622786384 0.688606808
[212,] 0.2785895 0.557178967 0.721410517
[213,] 0.2651161 0.530232124 0.734883938
[214,] 0.2899600 0.579920050 0.710039975
[215,] 0.3030672 0.606134423 0.696932788
[216,] 0.3030250 0.606050068 0.696974966
[217,] 0.2867788 0.573557682 0.713221159
[218,] 0.2487456 0.497491142 0.751254429
[219,] 0.2471818 0.494363514 0.752818243
[220,] 0.2834331 0.566866269 0.716566865
[221,] 0.5091961 0.981607880 0.490803940
[222,] 0.4842162 0.968432311 0.515783844
[223,] 0.4593514 0.918702789 0.540648606
[224,] 0.4475307 0.895061404 0.552469298
[225,] 0.4044276 0.808855131 0.595572434
[226,] 0.4469562 0.893912444 0.553043778
[227,] 0.3933411 0.786682146 0.606658927
[228,] 0.3514529 0.702905854 0.648547073
[229,] 0.3615238 0.723047690 0.638476155
[230,] 0.3291870 0.658373919 0.670813041
[231,] 0.2985169 0.597033755 0.701483122
[232,] 0.2481606 0.496321114 0.751839443
[233,] 0.4006914 0.801382703 0.599308649
[234,] 0.3862142 0.772428353 0.613785823
[235,] 0.3583617 0.716723404 0.641638298
[236,] 0.4946613 0.989322532 0.505338734
[237,] 0.4257850 0.851569971 0.574215014
[238,] 0.3589159 0.717831718 0.641084141
[239,] 0.4172881 0.834576121 0.582711940
[240,] 0.3545191 0.709038209 0.645480895
[241,] 0.2868801 0.573760275 0.713119862
[242,] 0.5104849 0.979030232 0.489515116
[243,] 0.4237780 0.847556083 0.576221958
[244,] 0.3378056 0.675611219 0.662194391
[245,] 0.4235907 0.847181415 0.576409292
[246,] 0.6456636 0.708672724 0.354336362
[247,] 0.5518990 0.896202082 0.448101041
[248,] 0.4737193 0.947438614 0.526280693
[249,] 0.4292451 0.858490254 0.570754873
[250,] 0.3083318 0.616663573 0.691668213
[251,] 0.1879003 0.375800518 0.812099741
> postscript(file="/var/wessaorg/rcomp/tmp/1evfx1384986499.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/2zssu1384986499.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/3gca01384986499.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/4yf6l1384986499.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/5i5se1384986499.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.43742571 3.00612326 -2.80615367 -2.12350535 5.17865806 3.84787549
7 8 9 10 11 12
3.52175468 -0.80773924 0.07147650 1.04192435 1.72278351 3.55699817
13 14 15 16 17 18
-3.10589348 2.82300485 2.41873597 0.84406828 0.44317414 1.42664733
19 20 21 22 23 24
-1.15426930 2.37459104 2.84051574 -2.50714327 -0.27850512 -1.22415917
25 26 27 28 29 30
1.81998576 -6.79385775 1.17119732 0.96233397 1.25703664 -2.63044610
31 32 33 34 35 36
0.43692520 0.66223851 2.14222252 -0.01745875 0.20447984 0.84845285
37 38 39 40 41 42
-1.43087772 0.89755808 1.79352954 -2.04139640 -0.53697422 2.55856561
43 44 45 46 47 48
0.09543228 -0.89904819 0.56705432 -2.30785370 -0.09395320 0.31017080
49 50 51 52 53 54
3.72903246 -1.57443773 0.88785757 0.74722168 -0.41699623 -1.36565122
55 56 57 58 59 60
-1.71449627 1.72381749 1.97369690 -0.37190016 -3.02033296 -1.17663951
61 62 63 64 65 66
-2.42584058 -1.47471691 -3.54546294 1.10095181 1.44533707 -5.03852219
67 68 69 70 71 72
-1.55775886 -2.61117182 1.69466488 1.46927472 0.83111978 3.43145557
73 74 75 76 77 78
0.57783989 -0.27217934 -2.01745875 -0.01717995 3.06802493 0.60227806
79 80 81 82 83 84
1.24912528 -2.06533405 0.10045129 -0.46622820 1.73500260 0.75858460
85 86 87 88 89 90
-0.09704913 1.18089783 -0.28606084 0.20067263 -3.41757358 3.45884479
91 92 93 94 95 96
0.08528116 0.90295087 0.65576786 -1.01045463 1.07686928 -0.77538972
97 98 99 100 101 102
-0.87596670 2.05328728 0.02431248 1.79352954 -0.86971776 0.87506114
103 104 105 106 107 108
-3.47759112 1.98879019 -2.27262996 1.05580585 2.17744626 -2.79932737
109 110 111 112 113 114
1.24990460 1.09196258 -2.27096754 -2.22717826 1.92415918 4.01043098
115 116 117 118 119 120
0.32692651 1.05378779 0.36955390 -1.07288977 0.35172032 -0.45315296
121 122 123 124 125 126
0.30420066 0.21080562 -0.96180602 0.35733482 -1.89954871 0.82343733
127 128 129 130 131 132
1.72530209 4.16867875 1.48242680 -1.71089264 -1.50162375 -0.23005247
133 134 135 136 137 138
2.40283642 0.82681206 2.20735405 1.56818928 0.72615824 -0.84470224
139 140 141 142 143 144
0.91574731 -0.70910349 0.31233373 2.23093606 -0.80234646 0.52528309
145 146 147 148 149 150
1.55698003 1.31808216 -2.34998057 -2.80522067 -2.39054000 2.02897585
151 152 153 154 155 156
0.48184944 0.53377180 -2.35680687 -2.41160344 1.46005659 0.08528116
157 158 159 160 161 162
0.81544913 4.16867875 -2.77279431 0.08778159 0.57078469 0.66287296
163 164 165 166 167 168
0.64785650 4.31332382 -1.97540872 1.91436369 -0.26751598 -1.07167797
169 170 171 172 173 174
-3.73578142 -3.11438220 0.52699540 1.64319313 -5.03673303 1.64583844
175 176 177 178 179 180
2.48242680 -2.51591079 -3.29024183 0.44151172 1.23655056 -2.18706944
181 182 183 184 185 186
-0.30999849 -1.79494281 -0.03348504 -1.18540702 1.78776298 1.19253956
187 188 189 190 191 192
0.23597321 0.75102889 0.39996220 0.87856260 -1.94656785 -1.18288845
193 194 195 196 197 198
2.30850838 -1.61031566 1.74470311 -2.19425138 2.12179353 0.42246634
199 200 201 202 203 204
-3.24652938 -1.09704913 -3.39772194 0.94472210 2.77173668 0.28457073
205 206 207 208 209 210
0.38091682 1.08908837 -0.66337298 3.24783665 0.02265007 1.47560050
211 212 213 214 215 216
-2.81824601 1.44410713 -1.32913884 -4.02882168 -1.35055792 1.41671792
217 218 219 220 221 222
1.84356777 -0.38542602 -1.97455256 1.27810008 -3.10496049 2.20412420
223 224 225 226 227 228
-2.35307650 -0.02824432 -0.80983414 1.66949729 4.92078445 -1.91378585
229 230 231 232 233 234
-1.48401188 -2.47040919 0.01294956 -3.03587688 -0.15966209 0.30074909
235 236 237 238 239 240
0.85636421 -1.97734993 0.82190165 -0.11416048 -4.73447465 -2.66445804
241 242 243 244 245 246
-3.02788868 -2.80350836 0.17636120 -0.35846928 1.27810008 0.19684728
247 248 249 250 251 252
0.10130745 5.15018378 -0.49658660 0.06348830 2.02265007 1.08238881
253 254 255 256 257 258
-1.24932675 -0.97913909 0.08742595 -0.87511054 -2.02854287 -2.62419716
259 260 261 262 263 264
2.24028093 -4.74218243 -0.05275933 1.31447852 -2.76735163 -0.12602392
> postscript(file="/var/wessaorg/rcomp/tmp/6nq1n1384986499.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.43742571 NA
1 3.00612326 0.43742571
2 -2.80615367 3.00612326
3 -2.12350535 -2.80615367
4 5.17865806 -2.12350535
5 3.84787549 5.17865806
6 3.52175468 3.84787549
7 -0.80773924 3.52175468
8 0.07147650 -0.80773924
9 1.04192435 0.07147650
10 1.72278351 1.04192435
11 3.55699817 1.72278351
12 -3.10589348 3.55699817
13 2.82300485 -3.10589348
14 2.41873597 2.82300485
15 0.84406828 2.41873597
16 0.44317414 0.84406828
17 1.42664733 0.44317414
18 -1.15426930 1.42664733
19 2.37459104 -1.15426930
20 2.84051574 2.37459104
21 -2.50714327 2.84051574
22 -0.27850512 -2.50714327
23 -1.22415917 -0.27850512
24 1.81998576 -1.22415917
25 -6.79385775 1.81998576
26 1.17119732 -6.79385775
27 0.96233397 1.17119732
28 1.25703664 0.96233397
29 -2.63044610 1.25703664
30 0.43692520 -2.63044610
31 0.66223851 0.43692520
32 2.14222252 0.66223851
33 -0.01745875 2.14222252
34 0.20447984 -0.01745875
35 0.84845285 0.20447984
36 -1.43087772 0.84845285
37 0.89755808 -1.43087772
38 1.79352954 0.89755808
39 -2.04139640 1.79352954
40 -0.53697422 -2.04139640
41 2.55856561 -0.53697422
42 0.09543228 2.55856561
43 -0.89904819 0.09543228
44 0.56705432 -0.89904819
45 -2.30785370 0.56705432
46 -0.09395320 -2.30785370
47 0.31017080 -0.09395320
48 3.72903246 0.31017080
49 -1.57443773 3.72903246
50 0.88785757 -1.57443773
51 0.74722168 0.88785757
52 -0.41699623 0.74722168
53 -1.36565122 -0.41699623
54 -1.71449627 -1.36565122
55 1.72381749 -1.71449627
56 1.97369690 1.72381749
57 -0.37190016 1.97369690
58 -3.02033296 -0.37190016
59 -1.17663951 -3.02033296
60 -2.42584058 -1.17663951
61 -1.47471691 -2.42584058
62 -3.54546294 -1.47471691
63 1.10095181 -3.54546294
64 1.44533707 1.10095181
65 -5.03852219 1.44533707
66 -1.55775886 -5.03852219
67 -2.61117182 -1.55775886
68 1.69466488 -2.61117182
69 1.46927472 1.69466488
70 0.83111978 1.46927472
71 3.43145557 0.83111978
72 0.57783989 3.43145557
73 -0.27217934 0.57783989
74 -2.01745875 -0.27217934
75 -0.01717995 -2.01745875
76 3.06802493 -0.01717995
77 0.60227806 3.06802493
78 1.24912528 0.60227806
79 -2.06533405 1.24912528
80 0.10045129 -2.06533405
81 -0.46622820 0.10045129
82 1.73500260 -0.46622820
83 0.75858460 1.73500260
84 -0.09704913 0.75858460
85 1.18089783 -0.09704913
86 -0.28606084 1.18089783
87 0.20067263 -0.28606084
88 -3.41757358 0.20067263
89 3.45884479 -3.41757358
90 0.08528116 3.45884479
91 0.90295087 0.08528116
92 0.65576786 0.90295087
93 -1.01045463 0.65576786
94 1.07686928 -1.01045463
95 -0.77538972 1.07686928
96 -0.87596670 -0.77538972
97 2.05328728 -0.87596670
98 0.02431248 2.05328728
99 1.79352954 0.02431248
100 -0.86971776 1.79352954
101 0.87506114 -0.86971776
102 -3.47759112 0.87506114
103 1.98879019 -3.47759112
104 -2.27262996 1.98879019
105 1.05580585 -2.27262996
106 2.17744626 1.05580585
107 -2.79932737 2.17744626
108 1.24990460 -2.79932737
109 1.09196258 1.24990460
110 -2.27096754 1.09196258
111 -2.22717826 -2.27096754
112 1.92415918 -2.22717826
113 4.01043098 1.92415918
114 0.32692651 4.01043098
115 1.05378779 0.32692651
116 0.36955390 1.05378779
117 -1.07288977 0.36955390
118 0.35172032 -1.07288977
119 -0.45315296 0.35172032
120 0.30420066 -0.45315296
121 0.21080562 0.30420066
122 -0.96180602 0.21080562
123 0.35733482 -0.96180602
124 -1.89954871 0.35733482
125 0.82343733 -1.89954871
126 1.72530209 0.82343733
127 4.16867875 1.72530209
128 1.48242680 4.16867875
129 -1.71089264 1.48242680
130 -1.50162375 -1.71089264
131 -0.23005247 -1.50162375
132 2.40283642 -0.23005247
133 0.82681206 2.40283642
134 2.20735405 0.82681206
135 1.56818928 2.20735405
136 0.72615824 1.56818928
137 -0.84470224 0.72615824
138 0.91574731 -0.84470224
139 -0.70910349 0.91574731
140 0.31233373 -0.70910349
141 2.23093606 0.31233373
142 -0.80234646 2.23093606
143 0.52528309 -0.80234646
144 1.55698003 0.52528309
145 1.31808216 1.55698003
146 -2.34998057 1.31808216
147 -2.80522067 -2.34998057
148 -2.39054000 -2.80522067
149 2.02897585 -2.39054000
150 0.48184944 2.02897585
151 0.53377180 0.48184944
152 -2.35680687 0.53377180
153 -2.41160344 -2.35680687
154 1.46005659 -2.41160344
155 0.08528116 1.46005659
156 0.81544913 0.08528116
157 4.16867875 0.81544913
158 -2.77279431 4.16867875
159 0.08778159 -2.77279431
160 0.57078469 0.08778159
161 0.66287296 0.57078469
162 0.64785650 0.66287296
163 4.31332382 0.64785650
164 -1.97540872 4.31332382
165 1.91436369 -1.97540872
166 -0.26751598 1.91436369
167 -1.07167797 -0.26751598
168 -3.73578142 -1.07167797
169 -3.11438220 -3.73578142
170 0.52699540 -3.11438220
171 1.64319313 0.52699540
172 -5.03673303 1.64319313
173 1.64583844 -5.03673303
174 2.48242680 1.64583844
175 -2.51591079 2.48242680
176 -3.29024183 -2.51591079
177 0.44151172 -3.29024183
178 1.23655056 0.44151172
179 -2.18706944 1.23655056
180 -0.30999849 -2.18706944
181 -1.79494281 -0.30999849
182 -0.03348504 -1.79494281
183 -1.18540702 -0.03348504
184 1.78776298 -1.18540702
185 1.19253956 1.78776298
186 0.23597321 1.19253956
187 0.75102889 0.23597321
188 0.39996220 0.75102889
189 0.87856260 0.39996220
190 -1.94656785 0.87856260
191 -1.18288845 -1.94656785
192 2.30850838 -1.18288845
193 -1.61031566 2.30850838
194 1.74470311 -1.61031566
195 -2.19425138 1.74470311
196 2.12179353 -2.19425138
197 0.42246634 2.12179353
198 -3.24652938 0.42246634
199 -1.09704913 -3.24652938
200 -3.39772194 -1.09704913
201 0.94472210 -3.39772194
202 2.77173668 0.94472210
203 0.28457073 2.77173668
204 0.38091682 0.28457073
205 1.08908837 0.38091682
206 -0.66337298 1.08908837
207 3.24783665 -0.66337298
208 0.02265007 3.24783665
209 1.47560050 0.02265007
210 -2.81824601 1.47560050
211 1.44410713 -2.81824601
212 -1.32913884 1.44410713
213 -4.02882168 -1.32913884
214 -1.35055792 -4.02882168
215 1.41671792 -1.35055792
216 1.84356777 1.41671792
217 -0.38542602 1.84356777
218 -1.97455256 -0.38542602
219 1.27810008 -1.97455256
220 -3.10496049 1.27810008
221 2.20412420 -3.10496049
222 -2.35307650 2.20412420
223 -0.02824432 -2.35307650
224 -0.80983414 -0.02824432
225 1.66949729 -0.80983414
226 4.92078445 1.66949729
227 -1.91378585 4.92078445
228 -1.48401188 -1.91378585
229 -2.47040919 -1.48401188
230 0.01294956 -2.47040919
231 -3.03587688 0.01294956
232 -0.15966209 -3.03587688
233 0.30074909 -0.15966209
234 0.85636421 0.30074909
235 -1.97734993 0.85636421
236 0.82190165 -1.97734993
237 -0.11416048 0.82190165
238 -4.73447465 -0.11416048
239 -2.66445804 -4.73447465
240 -3.02788868 -2.66445804
241 -2.80350836 -3.02788868
242 0.17636120 -2.80350836
243 -0.35846928 0.17636120
244 1.27810008 -0.35846928
245 0.19684728 1.27810008
246 0.10130745 0.19684728
247 5.15018378 0.10130745
248 -0.49658660 5.15018378
249 0.06348830 -0.49658660
250 2.02265007 0.06348830
251 1.08238881 2.02265007
252 -1.24932675 1.08238881
253 -0.97913909 -1.24932675
254 0.08742595 -0.97913909
255 -0.87511054 0.08742595
256 -2.02854287 -0.87511054
257 -2.62419716 -2.02854287
258 2.24028093 -2.62419716
259 -4.74218243 2.24028093
260 -0.05275933 -4.74218243
261 1.31447852 -0.05275933
262 -2.76735163 1.31447852
263 -0.12602392 -2.76735163
264 NA -0.12602392
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.00612326 0.43742571
[2,] -2.80615367 3.00612326
[3,] -2.12350535 -2.80615367
[4,] 5.17865806 -2.12350535
[5,] 3.84787549 5.17865806
[6,] 3.52175468 3.84787549
[7,] -0.80773924 3.52175468
[8,] 0.07147650 -0.80773924
[9,] 1.04192435 0.07147650
[10,] 1.72278351 1.04192435
[11,] 3.55699817 1.72278351
[12,] -3.10589348 3.55699817
[13,] 2.82300485 -3.10589348
[14,] 2.41873597 2.82300485
[15,] 0.84406828 2.41873597
[16,] 0.44317414 0.84406828
[17,] 1.42664733 0.44317414
[18,] -1.15426930 1.42664733
[19,] 2.37459104 -1.15426930
[20,] 2.84051574 2.37459104
[21,] -2.50714327 2.84051574
[22,] -0.27850512 -2.50714327
[23,] -1.22415917 -0.27850512
[24,] 1.81998576 -1.22415917
[25,] -6.79385775 1.81998576
[26,] 1.17119732 -6.79385775
[27,] 0.96233397 1.17119732
[28,] 1.25703664 0.96233397
[29,] -2.63044610 1.25703664
[30,] 0.43692520 -2.63044610
[31,] 0.66223851 0.43692520
[32,] 2.14222252 0.66223851
[33,] -0.01745875 2.14222252
[34,] 0.20447984 -0.01745875
[35,] 0.84845285 0.20447984
[36,] -1.43087772 0.84845285
[37,] 0.89755808 -1.43087772
[38,] 1.79352954 0.89755808
[39,] -2.04139640 1.79352954
[40,] -0.53697422 -2.04139640
[41,] 2.55856561 -0.53697422
[42,] 0.09543228 2.55856561
[43,] -0.89904819 0.09543228
[44,] 0.56705432 -0.89904819
[45,] -2.30785370 0.56705432
[46,] -0.09395320 -2.30785370
[47,] 0.31017080 -0.09395320
[48,] 3.72903246 0.31017080
[49,] -1.57443773 3.72903246
[50,] 0.88785757 -1.57443773
[51,] 0.74722168 0.88785757
[52,] -0.41699623 0.74722168
[53,] -1.36565122 -0.41699623
[54,] -1.71449627 -1.36565122
[55,] 1.72381749 -1.71449627
[56,] 1.97369690 1.72381749
[57,] -0.37190016 1.97369690
[58,] -3.02033296 -0.37190016
[59,] -1.17663951 -3.02033296
[60,] -2.42584058 -1.17663951
[61,] -1.47471691 -2.42584058
[62,] -3.54546294 -1.47471691
[63,] 1.10095181 -3.54546294
[64,] 1.44533707 1.10095181
[65,] -5.03852219 1.44533707
[66,] -1.55775886 -5.03852219
[67,] -2.61117182 -1.55775886
[68,] 1.69466488 -2.61117182
[69,] 1.46927472 1.69466488
[70,] 0.83111978 1.46927472
[71,] 3.43145557 0.83111978
[72,] 0.57783989 3.43145557
[73,] -0.27217934 0.57783989
[74,] -2.01745875 -0.27217934
[75,] -0.01717995 -2.01745875
[76,] 3.06802493 -0.01717995
[77,] 0.60227806 3.06802493
[78,] 1.24912528 0.60227806
[79,] -2.06533405 1.24912528
[80,] 0.10045129 -2.06533405
[81,] -0.46622820 0.10045129
[82,] 1.73500260 -0.46622820
[83,] 0.75858460 1.73500260
[84,] -0.09704913 0.75858460
[85,] 1.18089783 -0.09704913
[86,] -0.28606084 1.18089783
[87,] 0.20067263 -0.28606084
[88,] -3.41757358 0.20067263
[89,] 3.45884479 -3.41757358
[90,] 0.08528116 3.45884479
[91,] 0.90295087 0.08528116
[92,] 0.65576786 0.90295087
[93,] -1.01045463 0.65576786
[94,] 1.07686928 -1.01045463
[95,] -0.77538972 1.07686928
[96,] -0.87596670 -0.77538972
[97,] 2.05328728 -0.87596670
[98,] 0.02431248 2.05328728
[99,] 1.79352954 0.02431248
[100,] -0.86971776 1.79352954
[101,] 0.87506114 -0.86971776
[102,] -3.47759112 0.87506114
[103,] 1.98879019 -3.47759112
[104,] -2.27262996 1.98879019
[105,] 1.05580585 -2.27262996
[106,] 2.17744626 1.05580585
[107,] -2.79932737 2.17744626
[108,] 1.24990460 -2.79932737
[109,] 1.09196258 1.24990460
[110,] -2.27096754 1.09196258
[111,] -2.22717826 -2.27096754
[112,] 1.92415918 -2.22717826
[113,] 4.01043098 1.92415918
[114,] 0.32692651 4.01043098
[115,] 1.05378779 0.32692651
[116,] 0.36955390 1.05378779
[117,] -1.07288977 0.36955390
[118,] 0.35172032 -1.07288977
[119,] -0.45315296 0.35172032
[120,] 0.30420066 -0.45315296
[121,] 0.21080562 0.30420066
[122,] -0.96180602 0.21080562
[123,] 0.35733482 -0.96180602
[124,] -1.89954871 0.35733482
[125,] 0.82343733 -1.89954871
[126,] 1.72530209 0.82343733
[127,] 4.16867875 1.72530209
[128,] 1.48242680 4.16867875
[129,] -1.71089264 1.48242680
[130,] -1.50162375 -1.71089264
[131,] -0.23005247 -1.50162375
[132,] 2.40283642 -0.23005247
[133,] 0.82681206 2.40283642
[134,] 2.20735405 0.82681206
[135,] 1.56818928 2.20735405
[136,] 0.72615824 1.56818928
[137,] -0.84470224 0.72615824
[138,] 0.91574731 -0.84470224
[139,] -0.70910349 0.91574731
[140,] 0.31233373 -0.70910349
[141,] 2.23093606 0.31233373
[142,] -0.80234646 2.23093606
[143,] 0.52528309 -0.80234646
[144,] 1.55698003 0.52528309
[145,] 1.31808216 1.55698003
[146,] -2.34998057 1.31808216
[147,] -2.80522067 -2.34998057
[148,] -2.39054000 -2.80522067
[149,] 2.02897585 -2.39054000
[150,] 0.48184944 2.02897585
[151,] 0.53377180 0.48184944
[152,] -2.35680687 0.53377180
[153,] -2.41160344 -2.35680687
[154,] 1.46005659 -2.41160344
[155,] 0.08528116 1.46005659
[156,] 0.81544913 0.08528116
[157,] 4.16867875 0.81544913
[158,] -2.77279431 4.16867875
[159,] 0.08778159 -2.77279431
[160,] 0.57078469 0.08778159
[161,] 0.66287296 0.57078469
[162,] 0.64785650 0.66287296
[163,] 4.31332382 0.64785650
[164,] -1.97540872 4.31332382
[165,] 1.91436369 -1.97540872
[166,] -0.26751598 1.91436369
[167,] -1.07167797 -0.26751598
[168,] -3.73578142 -1.07167797
[169,] -3.11438220 -3.73578142
[170,] 0.52699540 -3.11438220
[171,] 1.64319313 0.52699540
[172,] -5.03673303 1.64319313
[173,] 1.64583844 -5.03673303
[174,] 2.48242680 1.64583844
[175,] -2.51591079 2.48242680
[176,] -3.29024183 -2.51591079
[177,] 0.44151172 -3.29024183
[178,] 1.23655056 0.44151172
[179,] -2.18706944 1.23655056
[180,] -0.30999849 -2.18706944
[181,] -1.79494281 -0.30999849
[182,] -0.03348504 -1.79494281
[183,] -1.18540702 -0.03348504
[184,] 1.78776298 -1.18540702
[185,] 1.19253956 1.78776298
[186,] 0.23597321 1.19253956
[187,] 0.75102889 0.23597321
[188,] 0.39996220 0.75102889
[189,] 0.87856260 0.39996220
[190,] -1.94656785 0.87856260
[191,] -1.18288845 -1.94656785
[192,] 2.30850838 -1.18288845
[193,] -1.61031566 2.30850838
[194,] 1.74470311 -1.61031566
[195,] -2.19425138 1.74470311
[196,] 2.12179353 -2.19425138
[197,] 0.42246634 2.12179353
[198,] -3.24652938 0.42246634
[199,] -1.09704913 -3.24652938
[200,] -3.39772194 -1.09704913
[201,] 0.94472210 -3.39772194
[202,] 2.77173668 0.94472210
[203,] 0.28457073 2.77173668
[204,] 0.38091682 0.28457073
[205,] 1.08908837 0.38091682
[206,] -0.66337298 1.08908837
[207,] 3.24783665 -0.66337298
[208,] 0.02265007 3.24783665
[209,] 1.47560050 0.02265007
[210,] -2.81824601 1.47560050
[211,] 1.44410713 -2.81824601
[212,] -1.32913884 1.44410713
[213,] -4.02882168 -1.32913884
[214,] -1.35055792 -4.02882168
[215,] 1.41671792 -1.35055792
[216,] 1.84356777 1.41671792
[217,] -0.38542602 1.84356777
[218,] -1.97455256 -0.38542602
[219,] 1.27810008 -1.97455256
[220,] -3.10496049 1.27810008
[221,] 2.20412420 -3.10496049
[222,] -2.35307650 2.20412420
[223,] -0.02824432 -2.35307650
[224,] -0.80983414 -0.02824432
[225,] 1.66949729 -0.80983414
[226,] 4.92078445 1.66949729
[227,] -1.91378585 4.92078445
[228,] -1.48401188 -1.91378585
[229,] -2.47040919 -1.48401188
[230,] 0.01294956 -2.47040919
[231,] -3.03587688 0.01294956
[232,] -0.15966209 -3.03587688
[233,] 0.30074909 -0.15966209
[234,] 0.85636421 0.30074909
[235,] -1.97734993 0.85636421
[236,] 0.82190165 -1.97734993
[237,] -0.11416048 0.82190165
[238,] -4.73447465 -0.11416048
[239,] -2.66445804 -4.73447465
[240,] -3.02788868 -2.66445804
[241,] -2.80350836 -3.02788868
[242,] 0.17636120 -2.80350836
[243,] -0.35846928 0.17636120
[244,] 1.27810008 -0.35846928
[245,] 0.19684728 1.27810008
[246,] 0.10130745 0.19684728
[247,] 5.15018378 0.10130745
[248,] -0.49658660 5.15018378
[249,] 0.06348830 -0.49658660
[250,] 2.02265007 0.06348830
[251,] 1.08238881 2.02265007
[252,] -1.24932675 1.08238881
[253,] -0.97913909 -1.24932675
[254,] 0.08742595 -0.97913909
[255,] -0.87511054 0.08742595
[256,] -2.02854287 -0.87511054
[257,] -2.62419716 -2.02854287
[258,] 2.24028093 -2.62419716
[259,] -4.74218243 2.24028093
[260,] -0.05275933 -4.74218243
[261,] 1.31447852 -0.05275933
[262,] -2.76735163 1.31447852
[263,] -0.12602392 -2.76735163
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.00612326 0.43742571
2 -2.80615367 3.00612326
3 -2.12350535 -2.80615367
4 5.17865806 -2.12350535
5 3.84787549 5.17865806
6 3.52175468 3.84787549
7 -0.80773924 3.52175468
8 0.07147650 -0.80773924
9 1.04192435 0.07147650
10 1.72278351 1.04192435
11 3.55699817 1.72278351
12 -3.10589348 3.55699817
13 2.82300485 -3.10589348
14 2.41873597 2.82300485
15 0.84406828 2.41873597
16 0.44317414 0.84406828
17 1.42664733 0.44317414
18 -1.15426930 1.42664733
19 2.37459104 -1.15426930
20 2.84051574 2.37459104
21 -2.50714327 2.84051574
22 -0.27850512 -2.50714327
23 -1.22415917 -0.27850512
24 1.81998576 -1.22415917
25 -6.79385775 1.81998576
26 1.17119732 -6.79385775
27 0.96233397 1.17119732
28 1.25703664 0.96233397
29 -2.63044610 1.25703664
30 0.43692520 -2.63044610
31 0.66223851 0.43692520
32 2.14222252 0.66223851
33 -0.01745875 2.14222252
34 0.20447984 -0.01745875
35 0.84845285 0.20447984
36 -1.43087772 0.84845285
37 0.89755808 -1.43087772
38 1.79352954 0.89755808
39 -2.04139640 1.79352954
40 -0.53697422 -2.04139640
41 2.55856561 -0.53697422
42 0.09543228 2.55856561
43 -0.89904819 0.09543228
44 0.56705432 -0.89904819
45 -2.30785370 0.56705432
46 -0.09395320 -2.30785370
47 0.31017080 -0.09395320
48 3.72903246 0.31017080
49 -1.57443773 3.72903246
50 0.88785757 -1.57443773
51 0.74722168 0.88785757
52 -0.41699623 0.74722168
53 -1.36565122 -0.41699623
54 -1.71449627 -1.36565122
55 1.72381749 -1.71449627
56 1.97369690 1.72381749
57 -0.37190016 1.97369690
58 -3.02033296 -0.37190016
59 -1.17663951 -3.02033296
60 -2.42584058 -1.17663951
61 -1.47471691 -2.42584058
62 -3.54546294 -1.47471691
63 1.10095181 -3.54546294
64 1.44533707 1.10095181
65 -5.03852219 1.44533707
66 -1.55775886 -5.03852219
67 -2.61117182 -1.55775886
68 1.69466488 -2.61117182
69 1.46927472 1.69466488
70 0.83111978 1.46927472
71 3.43145557 0.83111978
72 0.57783989 3.43145557
73 -0.27217934 0.57783989
74 -2.01745875 -0.27217934
75 -0.01717995 -2.01745875
76 3.06802493 -0.01717995
77 0.60227806 3.06802493
78 1.24912528 0.60227806
79 -2.06533405 1.24912528
80 0.10045129 -2.06533405
81 -0.46622820 0.10045129
82 1.73500260 -0.46622820
83 0.75858460 1.73500260
84 -0.09704913 0.75858460
85 1.18089783 -0.09704913
86 -0.28606084 1.18089783
87 0.20067263 -0.28606084
88 -3.41757358 0.20067263
89 3.45884479 -3.41757358
90 0.08528116 3.45884479
91 0.90295087 0.08528116
92 0.65576786 0.90295087
93 -1.01045463 0.65576786
94 1.07686928 -1.01045463
95 -0.77538972 1.07686928
96 -0.87596670 -0.77538972
97 2.05328728 -0.87596670
98 0.02431248 2.05328728
99 1.79352954 0.02431248
100 -0.86971776 1.79352954
101 0.87506114 -0.86971776
102 -3.47759112 0.87506114
103 1.98879019 -3.47759112
104 -2.27262996 1.98879019
105 1.05580585 -2.27262996
106 2.17744626 1.05580585
107 -2.79932737 2.17744626
108 1.24990460 -2.79932737
109 1.09196258 1.24990460
110 -2.27096754 1.09196258
111 -2.22717826 -2.27096754
112 1.92415918 -2.22717826
113 4.01043098 1.92415918
114 0.32692651 4.01043098
115 1.05378779 0.32692651
116 0.36955390 1.05378779
117 -1.07288977 0.36955390
118 0.35172032 -1.07288977
119 -0.45315296 0.35172032
120 0.30420066 -0.45315296
121 0.21080562 0.30420066
122 -0.96180602 0.21080562
123 0.35733482 -0.96180602
124 -1.89954871 0.35733482
125 0.82343733 -1.89954871
126 1.72530209 0.82343733
127 4.16867875 1.72530209
128 1.48242680 4.16867875
129 -1.71089264 1.48242680
130 -1.50162375 -1.71089264
131 -0.23005247 -1.50162375
132 2.40283642 -0.23005247
133 0.82681206 2.40283642
134 2.20735405 0.82681206
135 1.56818928 2.20735405
136 0.72615824 1.56818928
137 -0.84470224 0.72615824
138 0.91574731 -0.84470224
139 -0.70910349 0.91574731
140 0.31233373 -0.70910349
141 2.23093606 0.31233373
142 -0.80234646 2.23093606
143 0.52528309 -0.80234646
144 1.55698003 0.52528309
145 1.31808216 1.55698003
146 -2.34998057 1.31808216
147 -2.80522067 -2.34998057
148 -2.39054000 -2.80522067
149 2.02897585 -2.39054000
150 0.48184944 2.02897585
151 0.53377180 0.48184944
152 -2.35680687 0.53377180
153 -2.41160344 -2.35680687
154 1.46005659 -2.41160344
155 0.08528116 1.46005659
156 0.81544913 0.08528116
157 4.16867875 0.81544913
158 -2.77279431 4.16867875
159 0.08778159 -2.77279431
160 0.57078469 0.08778159
161 0.66287296 0.57078469
162 0.64785650 0.66287296
163 4.31332382 0.64785650
164 -1.97540872 4.31332382
165 1.91436369 -1.97540872
166 -0.26751598 1.91436369
167 -1.07167797 -0.26751598
168 -3.73578142 -1.07167797
169 -3.11438220 -3.73578142
170 0.52699540 -3.11438220
171 1.64319313 0.52699540
172 -5.03673303 1.64319313
173 1.64583844 -5.03673303
174 2.48242680 1.64583844
175 -2.51591079 2.48242680
176 -3.29024183 -2.51591079
177 0.44151172 -3.29024183
178 1.23655056 0.44151172
179 -2.18706944 1.23655056
180 -0.30999849 -2.18706944
181 -1.79494281 -0.30999849
182 -0.03348504 -1.79494281
183 -1.18540702 -0.03348504
184 1.78776298 -1.18540702
185 1.19253956 1.78776298
186 0.23597321 1.19253956
187 0.75102889 0.23597321
188 0.39996220 0.75102889
189 0.87856260 0.39996220
190 -1.94656785 0.87856260
191 -1.18288845 -1.94656785
192 2.30850838 -1.18288845
193 -1.61031566 2.30850838
194 1.74470311 -1.61031566
195 -2.19425138 1.74470311
196 2.12179353 -2.19425138
197 0.42246634 2.12179353
198 -3.24652938 0.42246634
199 -1.09704913 -3.24652938
200 -3.39772194 -1.09704913
201 0.94472210 -3.39772194
202 2.77173668 0.94472210
203 0.28457073 2.77173668
204 0.38091682 0.28457073
205 1.08908837 0.38091682
206 -0.66337298 1.08908837
207 3.24783665 -0.66337298
208 0.02265007 3.24783665
209 1.47560050 0.02265007
210 -2.81824601 1.47560050
211 1.44410713 -2.81824601
212 -1.32913884 1.44410713
213 -4.02882168 -1.32913884
214 -1.35055792 -4.02882168
215 1.41671792 -1.35055792
216 1.84356777 1.41671792
217 -0.38542602 1.84356777
218 -1.97455256 -0.38542602
219 1.27810008 -1.97455256
220 -3.10496049 1.27810008
221 2.20412420 -3.10496049
222 -2.35307650 2.20412420
223 -0.02824432 -2.35307650
224 -0.80983414 -0.02824432
225 1.66949729 -0.80983414
226 4.92078445 1.66949729
227 -1.91378585 4.92078445
228 -1.48401188 -1.91378585
229 -2.47040919 -1.48401188
230 0.01294956 -2.47040919
231 -3.03587688 0.01294956
232 -0.15966209 -3.03587688
233 0.30074909 -0.15966209
234 0.85636421 0.30074909
235 -1.97734993 0.85636421
236 0.82190165 -1.97734993
237 -0.11416048 0.82190165
238 -4.73447465 -0.11416048
239 -2.66445804 -4.73447465
240 -3.02788868 -2.66445804
241 -2.80350836 -3.02788868
242 0.17636120 -2.80350836
243 -0.35846928 0.17636120
244 1.27810008 -0.35846928
245 0.19684728 1.27810008
246 0.10130745 0.19684728
247 5.15018378 0.10130745
248 -0.49658660 5.15018378
249 0.06348830 -0.49658660
250 2.02265007 0.06348830
251 1.08238881 2.02265007
252 -1.24932675 1.08238881
253 -0.97913909 -1.24932675
254 0.08742595 -0.97913909
255 -0.87511054 0.08742595
256 -2.02854287 -0.87511054
257 -2.62419716 -2.02854287
258 2.24028093 -2.62419716
259 -4.74218243 2.24028093
260 -0.05275933 -4.74218243
261 1.31447852 -0.05275933
262 -2.76735163 1.31447852
263 -0.12602392 -2.76735163
> 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/71vu21384986499.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/80y8u1384986499.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/9otiu1384986499.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/10l3ik1384986499.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/11kggf1384986499.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/12jdx11384986499.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/13ate71384986499.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/14s57q1384986499.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/15nfgi1384986499.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/16b4r21384986499.tab")
+ }
>
> try(system("convert tmp/1evfx1384986499.ps tmp/1evfx1384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zssu1384986499.ps tmp/2zssu1384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/3gca01384986499.ps tmp/3gca01384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/4yf6l1384986499.ps tmp/4yf6l1384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/5i5se1384986499.ps tmp/5i5se1384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/6nq1n1384986499.ps tmp/6nq1n1384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/71vu21384986499.ps tmp/71vu21384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/80y8u1384986499.ps tmp/80y8u1384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/9otiu1384986499.ps tmp/9otiu1384986499.png",intern=TRUE))
character(0)
> try(system("convert tmp/10l3ik1384986499.ps tmp/10l3ik1384986499.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
9.872 1.590 11.452