R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(1
+ ,9
+ ,5
+ ,-1
+ ,6
+ ,24
+ ,2
+ ,11
+ ,5
+ ,-4
+ ,6
+ ,29
+ ,3
+ ,13
+ ,9
+ ,-6
+ ,8
+ ,29
+ ,4
+ ,12
+ ,10
+ ,-9
+ ,4
+ ,25
+ ,5
+ ,13
+ ,14
+ ,-13
+ ,8
+ ,16
+ ,6
+ ,15
+ ,19
+ ,-13
+ ,10
+ ,18
+ ,7
+ ,13
+ ,18
+ ,-10
+ ,9
+ ,13
+ ,8
+ ,16
+ ,16
+ ,-12
+ ,12
+ ,22
+ ,9
+ ,10
+ ,8
+ ,-9
+ ,9
+ ,15
+ ,10
+ ,14
+ ,10
+ ,-15
+ ,11
+ ,20
+ ,11
+ ,14
+ ,12
+ ,-14
+ ,11
+ ,19
+ ,12
+ ,15
+ ,13
+ ,-18
+ ,11
+ ,18
+ ,1
+ ,13
+ ,15
+ ,-13
+ ,11
+ ,13
+ ,2
+ ,8
+ ,3
+ ,-2
+ ,11
+ ,17
+ ,3
+ ,7
+ ,2
+ ,-1
+ ,9
+ ,17
+ ,4
+ ,3
+ ,-2
+ ,5
+ ,8
+ ,13
+ ,5
+ ,3
+ ,1
+ ,8
+ ,6
+ ,14
+ ,6
+ ,4
+ ,1
+ ,6
+ ,7
+ ,13
+ ,7
+ ,4
+ ,-1
+ ,7
+ ,8
+ ,17
+ ,8
+ ,0
+ ,-6
+ ,15
+ ,6
+ ,17
+ ,9
+ ,-4
+ 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ertrouwen'
+ ,'economischesituatie'
+ ,'werkloosheid'
+ ,'financielesituatie'
+ ,'spaarvermogen')
+ ,1:154))
> y <- array(NA,dim=c(6,154),dimnames=list(c('maand','consumentenvertrouwen','economischesituatie','werkloosheid','financielesituatie','spaarvermogen'),1:154))
> 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 = '2'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) 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
consumentenvertrouwen maand economischesituatie werkloosheid
1 9 1 5 -1
2 11 2 5 -4
3 13 3 9 -6
4 12 4 10 -9
5 13 5 14 -13
6 15 6 19 -13
7 13 7 18 -10
8 16 8 16 -12
9 10 9 8 -9
10 14 10 10 -15
11 14 11 12 -14
12 15 12 13 -18
13 13 1 15 -13
14 8 2 3 -2
15 7 3 2 -1
16 3 4 -2 5
17 3 5 1 8
18 4 6 1 6
19 4 7 -1 7
20 0 8 -6 15
21 -4 9 -13 23
22 -14 10 -25 43
23 -18 11 -26 60
24 -8 12 -9 36
25 -1 1 1 28
26 1 2 3 23
27 2 3 6 23
28 0 4 2 22
29 1 5 5 22
30 0 6 5 24
31 -1 7 0 32
32 -3 8 -5 27
33 -3 9 -4 27
34 -3 10 -2 27
35 -4 11 -1 29
36 -8 12 -8 38
37 -9 1 -16 40
38 -13 2 -19 45
39 -18 3 -28 50
40 -11 4 -11 43
41 -9 5 -4 44
42 -10 6 -9 44
43 -13 7 -12 49
44 -11 8 -10 42
45 -5 9 -2 36
46 -15 10 -13 57
47 -6 11 0 42
48 -6 12 0 39
49 -3 1 4 33
50 -1 2 7 32
51 -3 3 5 34
52 -4 4 2 37
53 -6 5 -2 38
54 0 6 6 28
55 -4 7 -3 31
56 -2 8 1 28
57 -2 9 0 30
58 -6 10 -7 39
59 -7 11 -6 38
60 -6 12 -4 39
61 -6 1 -4 38
62 -3 2 -2 37
63 -2 3 2 32
64 -5 4 -5 32
65 -11 5 -15 44
66 -11 6 -16 43
67 -11 7 -18 42
68 -10 8 -13 38
69 -14 9 -23 37
70 -8 10 -10 35
71 -9 11 -10 37
72 -5 12 -6 33
73 -1 1 -3 24
74 -2 2 -4 24
75 -5 3 -7 31
76 -4 4 -7 25
77 -6 5 -7 28
78 -2 6 -3 24
79 -2 7 0 25
80 -2 8 -5 16
81 -2 9 -3 17
82 2 10 3 11
83 1 11 2 12
84 -8 12 -7 39
85 -1 1 -1 19
86 1 2 0 14
87 -1 3 -3 15
88 2 4 4 7
89 2 5 2 12
90 1 6 3 12
91 -1 7 0 14
92 -2 8 -10 9
93 -2 9 -10 8
94 -1 10 -9 4
95 -8 11 -22 7
96 -4 12 -16 3
97 -6 1 -18 5
98 -3 2 -14 0
99 -3 3 -12 -2
100 -7 4 -17 6
101 -9 5 -23 11
102 -11 6 -28 9
103 -13 7 -31 17
104 -11 8 -21 21
105 -9 9 -19 21
106 -17 10 -22 41
107 -22 11 -22 57
108 -25 12 -25 65
109 -20 1 -16 68
110 -24 2 -22 73
111 -24 3 -21 71
112 -22 4 -10 71
113 -19 5 -7 70
114 -18 6 -5 69
115 -17 7 -4 65
116 -11 8 7 57
117 -11 9 6 57
118 -12 10 3 57
119 -10 11 10 55
120 -15 12 0 65
121 -15 1 -2 65
122 -15 2 -1 64
123 -13 3 2 60
124 -8 4 8 43
125 -13 5 -6 47
126 -9 6 -4 40
127 -7 7 4 31
128 -4 8 7 27
129 -4 9 3 24
130 -2 10 3 23
131 0 11 8 17
132 -2 12 3 16
133 -3 1 -3 15
134 1 2 4 8
135 -2 3 -5 5
136 -1 4 -1 6
137 1 5 5 5
138 -3 6 0 12
139 -4 7 -6 8
140 -9 8 -13 17
141 -9 9 -15 22
142 -7 10 -8 24
143 -14 11 -20 36
144 -12 12 -10 31
145 -16 1 -22 34
146 -20 2 -25 47
147 -12 3 -10 33
148 -12 4 -8 35
149 -10 5 -9 31
150 -10 6 -5 35
151 -13 7 -7 39
152 -16 8 -11 46
153 -14 9 -11 40
154 -17 10 -16 50
financielesituatie spaarvermogen
1 6 24
2 6 29
3 8 29
4 4 25
5 8 16
6 10 18
7 9 13
8 12 22
9 9 15
10 11 20
11 11 19
12 11 18
13 11 13
14 11 17
15 9 17
16 8 13
17 6 14
18 7 13
19 8 17
20 6 17
21 5 15
22 2 9
23 3 10
24 3 9
25 7 14
26 8 18
27 7 18
28 7 12
29 6 16
30 6 12
31 7 19
32 5 13
33 5 12
34 5 13
35 4 11
36 4 10
37 4 16
38 1 12
39 -1 6
40 3 8
41 4 6
42 3 8
43 2 8
44 1 9
45 4 13
46 3 8
47 5 11
48 6 8
49 6 10
50 6 15
51 6 12
52 6 13
53 5 12
54 6 15
55 5 13
56 6 13
57 5 16
58 7 14
59 4 12
60 5 15
61 6 14
62 6 19
63 5 16
64 3 16
65 2 11
66 3 13
67 3 12
68 2 11
69 0 6
70 4 9
71 4 6
72 5 15
73 6 17
74 6 13
75 5 12
76 5 13
77 3 10
78 5 14
79 5 13
80 5 10
81 3 11
82 6 12
83 6 7
84 4 11
85 6 9
86 5 13
87 4 12
88 5 5
89 5 13
90 4 11
91 3 8
92 2 8
93 3 8
94 2 8
95 -1 0
96 0 3
97 -2 0
98 1 -1
99 -2 -1
100 -2 -4
101 -2 1
102 -6 -1
103 -4 0
104 -2 -1
105 0 6
106 -5 0
107 -4 -3
108 -5 -3
109 -1 4
110 -2 1
111 -4 0
112 -1 -4
113 1 -2
114 1 3
115 -2 2
116 1 5
117 1 6
118 3 6
119 3 3
120 1 4
121 1 7
122 0 5
123 2 6
124 2 1
125 -1 3
126 1 6
127 0 0
128 1 3
129 1 4
130 3 7
131 2 6
132 0 6
133 0 6
134 3 6
135 -2 2
136 0 2
137 1 2
138 -1 3
139 -2 -1
140 -1 -4
141 -1 4
142 1 5
143 -2 3
144 -5 -1
145 -5 -4
146 -6 0
147 -4 -1
148 -3 -1
149 -3 3
150 -1 2
151 -2 -4
152 -3 -3
153 -3 -1
154 -3 3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) maand economischesituatie
0.06846 -0.01232 0.24956
werkloosheid financielesituatie spaarvermogen
-0.25062 0.27826 0.23856
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.67455 -0.22551 0.02388 0.24241 0.58335
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.068458 0.083377 0.821 0.4129
maand -0.012325 0.007427 -1.659 0.0991 .
economischesituatie 0.249562 0.003555 70.195 <2e-16 ***
werkloosheid -0.250622 0.001360 -184.284 <2e-16 ***
financielesituatie 0.278264 0.014926 18.643 <2e-16 ***
spaarvermogen 0.238555 0.007088 33.658 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3113 on 148 degrees of freedom
Multiple R-squared: 0.9987, Adjusted R-squared: 0.9987
F-statistic: 2.306e+04 on 5 and 148 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.55130593 0.89738815 0.44869407
[2,] 0.38921458 0.77842915 0.61078542
[3,] 0.25341059 0.50682118 0.74658941
[4,] 0.15316061 0.30632122 0.84683939
[5,] 0.09472012 0.18944024 0.90527988
[6,] 0.05449976 0.10899951 0.94550024
[7,] 0.02935853 0.05871706 0.97064147
[8,] 0.02027525 0.04055049 0.97972475
[9,] 0.01052959 0.02105918 0.98947041
[10,] 0.03956951 0.07913902 0.96043049
[11,] 0.02639262 0.05278523 0.97360738
[12,] 0.02664491 0.05328983 0.97335509
[13,] 0.05016757 0.10033515 0.94983243
[14,] 0.10109637 0.20219274 0.89890363
[15,] 0.07823246 0.15646491 0.92176754
[16,] 0.06820084 0.13640169 0.93179916
[17,] 0.05057203 0.10114406 0.94942797
[18,] 0.30081652 0.60163303 0.69918348
[19,] 0.27353361 0.54706723 0.72646639
[20,] 0.22670190 0.45340380 0.77329810
[21,] 0.29967154 0.59934307 0.70032846
[22,] 0.24807921 0.49615842 0.75192079
[23,] 0.27237952 0.54475904 0.72762048
[24,] 0.31100911 0.62201822 0.68899089
[25,] 0.32693734 0.65387468 0.67306266
[26,] 0.43278392 0.86556785 0.56721608
[27,] 0.53190675 0.93618650 0.46809325
[28,] 0.49736681 0.99473362 0.50263319
[29,] 0.44252800 0.88505599 0.55747200
[30,] 0.40395138 0.80790277 0.59604862
[31,] 0.42349095 0.84698190 0.57650905
[32,] 0.43027231 0.86054462 0.56972769
[33,] 0.44175375 0.88350749 0.55824625
[34,] 0.47623071 0.95246141 0.52376929
[35,] 0.51005097 0.97989807 0.48994903
[36,] 0.62975041 0.74049918 0.37024959
[37,] 0.60668126 0.78663748 0.39331874
[38,] 0.62359448 0.75281104 0.37640552
[39,] 0.66443526 0.67112949 0.33556474
[40,] 0.63632389 0.72735222 0.36367611
[41,] 0.59204619 0.81590762 0.40795381
[42,] 0.55534370 0.88931260 0.44465630
[43,] 0.58096731 0.83806539 0.41903269
[44,] 0.53642906 0.92714188 0.46357094
[45,] 0.53499796 0.93000408 0.46500204
[46,] 0.50881443 0.98237115 0.49118557
[47,] 0.46230834 0.92461668 0.53769166
[48,] 0.41849480 0.83698961 0.58150520
[49,] 0.41691275 0.83382550 0.58308725
[50,] 0.41023755 0.82047509 0.58976245
[51,] 0.38292828 0.76585656 0.61707172
[52,] 0.38900189 0.77800378 0.61099811
[53,] 0.47574560 0.95149120 0.52425440
[54,] 0.58876480 0.82247039 0.41123520
[55,] 0.58555700 0.82888601 0.41444300
[56,] 0.62654263 0.74691475 0.37345737
[57,] 0.76235033 0.47529934 0.23764967
[58,] 0.73628760 0.52742480 0.26371240
[59,] 0.77766090 0.44467819 0.22233910
[60,] 0.79888880 0.40222241 0.20111120
[61,] 0.79849885 0.40300230 0.20150115
[62,] 0.77442095 0.45115810 0.22557905
[63,] 0.78987493 0.42025013 0.21012507
[64,] 0.78460893 0.43078215 0.21539107
[65,] 0.75305893 0.49388213 0.24694107
[66,] 0.75597940 0.48804120 0.24402060
[67,] 0.77361672 0.45276655 0.22638328
[68,] 0.79452319 0.41095361 0.20547681
[69,] 0.81420086 0.37159829 0.18579914
[70,] 0.79578022 0.40843956 0.20421978
[71,] 0.77453238 0.45093524 0.22546762
[72,] 0.79267685 0.41464629 0.20732315
[73,] 0.79397980 0.41204040 0.20602020
[74,] 0.81571137 0.36857726 0.18428863
[75,] 0.82055377 0.35889247 0.17944623
[76,] 0.80624395 0.38751210 0.19375605
[77,] 0.79309238 0.41381523 0.20690762
[78,] 0.75984491 0.48031018 0.24015509
[79,] 0.78540427 0.42919146 0.21459573
[80,] 0.77122594 0.45754812 0.22877406
[81,] 0.73689870 0.52620260 0.26310130
[82,] 0.77135579 0.45728842 0.22864421
[83,] 0.74535502 0.50928997 0.25464498
[84,] 0.79041350 0.41917301 0.20958650
[85,] 0.75536269 0.48927462 0.24463731
[86,] 0.71724288 0.56551425 0.28275712
[87,] 0.71899515 0.56200969 0.28100485
[88,] 0.70375663 0.59248674 0.29624337
[89,] 0.71438766 0.57122469 0.28561234
[90,] 0.75403221 0.49193557 0.24596779
[91,] 0.73336174 0.53327652 0.26663826
[92,] 0.70966681 0.58066639 0.29033319
[93,] 0.67878216 0.64243568 0.32121784
[94,] 0.63934688 0.72130624 0.36065312
[95,] 0.60603787 0.78792427 0.39396213
[96,] 0.63970175 0.72059650 0.36029825
[97,] 0.62961189 0.74077622 0.37038811
[98,] 0.61477806 0.77044388 0.38522194
[99,] 0.60917439 0.78165121 0.39082561
[100,] 0.58687216 0.82625568 0.41312784
[101,] 0.61376126 0.77247747 0.38623874
[102,] 0.59771114 0.80457772 0.40228886
[103,] 0.58518088 0.82963823 0.41481912
[104,] 0.64120308 0.71759385 0.35879692
[105,] 0.81431913 0.37136174 0.18568087
[106,] 0.80962723 0.38074554 0.19037277
[107,] 0.85020212 0.29959576 0.14979788
[108,] 0.82177433 0.35645135 0.17822567
[109,] 0.79936761 0.40126479 0.20063239
[110,] 0.87533434 0.24933131 0.12466566
[111,] 0.85013149 0.29973701 0.14986851
[112,] 0.85323390 0.29353220 0.14676610
[113,] 0.81859566 0.36280868 0.18140434
[114,] 0.80374063 0.39251875 0.19625937
[115,] 0.80885165 0.38229670 0.19114835
[116,] 0.76234582 0.47530836 0.23765418
[117,] 0.71438567 0.57122866 0.28561433
[118,] 0.77353724 0.45292552 0.22646276
[119,] 0.76174465 0.47651070 0.23825535
[120,] 0.70546250 0.58907500 0.29453750
[121,] 0.64279248 0.71441505 0.35720752
[122,] 0.90408229 0.19183543 0.09591771
[123,] 0.95882004 0.08235993 0.04117996
[124,] 0.93838745 0.12322510 0.06161255
[125,] 0.91127667 0.17744665 0.08872333
[126,] 0.89223163 0.21553673 0.10776837
[127,] 0.91852266 0.16295467 0.08147734
[128,] 0.90371132 0.19257737 0.09628868
[129,] 0.91134914 0.17730171 0.08865086
[130,] 0.95545626 0.08908748 0.04454374
[131,] 0.94654699 0.10690602 0.05345301
[132,] 0.94382883 0.11234234 0.05617117
[133,] 0.94152601 0.11694797 0.05847399
[134,] 0.97992909 0.04014182 0.02007091
[135,] 0.96827345 0.06345309 0.03172655
[136,] 0.96138654 0.07722693 0.03861346
[137,] 0.90771992 0.18456015 0.09228008
> postscript(file="/var/wessaorg/rcomp/tmp/1w0xs1353436295.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/25fgd1353436295.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/388781353436295.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/4u0oq1353436295.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/52gtp1353436295.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 = 154
Frequency = 1
1 2 3 4 5 6
0.050526276 0.118208345 0.074511409 0.152682204 0.198209891 -0.070915247
7 8 9 10 11 12
0.413878481 0.442296110 -0.292335263 -0.032172346 -0.029794958 -0.030966621
13 14 15 16 17 18
-0.219777385 -0.410078360 -0.341041437 -0.594248587 -0.260772080 0.210599664
19 20 21 22 23 24
-0.259812619 -0.438169729 0.081444770 0.367087220 0.372734833 0.366117720
25 26 27 28 29 30
0.424110963 -0.548284985 -0.006383875 0.184899542 -0.227420036 0.240370095
31 32 33 34 35 36
0.557335801 0.552219789 0.553537336 -0.171817923 -0.152436938 0.100981031
37 38 39 40 41 42
0.031821089 -0.165043505 0.334313358 -0.240444765 0.474411824 0.535702288
43 44 45 46 47 48
-0.171910314 -0.373358032 0.349721624 -0.158658578 0.577826874 0.275686660
49 50 51 52 53 54
0.161019438 -0.018741274 -0.290381391 -0.016057431 -0.238041609 0.277631327
55 56 57 58 59 60
0.043259237 0.027203658 0.352933707 0.288379529 0.112420925 -0.117686035
61 62 63 64 65 66
-0.543590039 0.526211711 0.281104362 -0.403106245 0.583350368 -0.160758639
67 68 69 70 71 72
0.338623992 -0.382533860 -0.375903522 0.062144545 0.291379504 -0.122294927
73 74 75 76 77 78
-0.017530255 0.198577733 0.230764908 -0.499199242 -0.462814661 0.038023109
79 80 81 82 83 84
-0.209161965 -0.488960024 -0.407165661 -0.469295565 0.235989898 -0.136514300
85 86 87 88 89 90
0.138674684 -0.027631483 -0.499178124 0.152853602 0.008973500 -0.472890120
91 92 93 94 95 96
-0.216704114 0.316397492 -0.200163633 -0.161626808 -0.409890697 0.108640980
97 98 99 100 101 102
0.245630133 0.410357800 0.257104088 0.237885174 -0.192079562 0.156977966
103 104 105 106 107 108
0.127886119 0.329103397 -0.384110214 0.211997396 -0.328319068 -0.284064762
109 110 111 112 113 114
0.303225928 0.059966229 0.116566490 -0.496866048 0.482511436 -0.447686814
115 116 117 118 119 120
0.385932502 0.097635338 0.120967466 -0.674547630 -0.194739117 0.137405517
121 122 123 124 125 126
-0.214708288 0.052805789 -0.481128463 -0.033981684 -0.167612528 0.319038430
127 128 129 130 131 132
-0.211142462 0.056076602 0.076229209 0.565738908 0.343336450 -0.090621384
133 134 135 136 137 138
0.020557873 -0.303201623 0.548857455 0.257027426 0.243091527 -0.424443057
139 140 141 142 143 144
0.315251691 -0.232483655 -0.376363756 -0.404814041 -0.078370701 -0.025770331
145 146 147 148 149 150
0.300938427 -0.355916442 0.086287076 -0.177532065 0.127645336 -0.173762613
151 152 153 154
0.049771052 -0.145589655 -0.114108977 -0.301969490
> postscript(file="/var/wessaorg/rcomp/tmp/6dwe61353436295.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 0.050526276 NA
1 0.118208345 0.050526276
2 0.074511409 0.118208345
3 0.152682204 0.074511409
4 0.198209891 0.152682204
5 -0.070915247 0.198209891
6 0.413878481 -0.070915247
7 0.442296110 0.413878481
8 -0.292335263 0.442296110
9 -0.032172346 -0.292335263
10 -0.029794958 -0.032172346
11 -0.030966621 -0.029794958
12 -0.219777385 -0.030966621
13 -0.410078360 -0.219777385
14 -0.341041437 -0.410078360
15 -0.594248587 -0.341041437
16 -0.260772080 -0.594248587
17 0.210599664 -0.260772080
18 -0.259812619 0.210599664
19 -0.438169729 -0.259812619
20 0.081444770 -0.438169729
21 0.367087220 0.081444770
22 0.372734833 0.367087220
23 0.366117720 0.372734833
24 0.424110963 0.366117720
25 -0.548284985 0.424110963
26 -0.006383875 -0.548284985
27 0.184899542 -0.006383875
28 -0.227420036 0.184899542
29 0.240370095 -0.227420036
30 0.557335801 0.240370095
31 0.552219789 0.557335801
32 0.553537336 0.552219789
33 -0.171817923 0.553537336
34 -0.152436938 -0.171817923
35 0.100981031 -0.152436938
36 0.031821089 0.100981031
37 -0.165043505 0.031821089
38 0.334313358 -0.165043505
39 -0.240444765 0.334313358
40 0.474411824 -0.240444765
41 0.535702288 0.474411824
42 -0.171910314 0.535702288
43 -0.373358032 -0.171910314
44 0.349721624 -0.373358032
45 -0.158658578 0.349721624
46 0.577826874 -0.158658578
47 0.275686660 0.577826874
48 0.161019438 0.275686660
49 -0.018741274 0.161019438
50 -0.290381391 -0.018741274
51 -0.016057431 -0.290381391
52 -0.238041609 -0.016057431
53 0.277631327 -0.238041609
54 0.043259237 0.277631327
55 0.027203658 0.043259237
56 0.352933707 0.027203658
57 0.288379529 0.352933707
58 0.112420925 0.288379529
59 -0.117686035 0.112420925
60 -0.543590039 -0.117686035
61 0.526211711 -0.543590039
62 0.281104362 0.526211711
63 -0.403106245 0.281104362
64 0.583350368 -0.403106245
65 -0.160758639 0.583350368
66 0.338623992 -0.160758639
67 -0.382533860 0.338623992
68 -0.375903522 -0.382533860
69 0.062144545 -0.375903522
70 0.291379504 0.062144545
71 -0.122294927 0.291379504
72 -0.017530255 -0.122294927
73 0.198577733 -0.017530255
74 0.230764908 0.198577733
75 -0.499199242 0.230764908
76 -0.462814661 -0.499199242
77 0.038023109 -0.462814661
78 -0.209161965 0.038023109
79 -0.488960024 -0.209161965
80 -0.407165661 -0.488960024
81 -0.469295565 -0.407165661
82 0.235989898 -0.469295565
83 -0.136514300 0.235989898
84 0.138674684 -0.136514300
85 -0.027631483 0.138674684
86 -0.499178124 -0.027631483
87 0.152853602 -0.499178124
88 0.008973500 0.152853602
89 -0.472890120 0.008973500
90 -0.216704114 -0.472890120
91 0.316397492 -0.216704114
92 -0.200163633 0.316397492
93 -0.161626808 -0.200163633
94 -0.409890697 -0.161626808
95 0.108640980 -0.409890697
96 0.245630133 0.108640980
97 0.410357800 0.245630133
98 0.257104088 0.410357800
99 0.237885174 0.257104088
100 -0.192079562 0.237885174
101 0.156977966 -0.192079562
102 0.127886119 0.156977966
103 0.329103397 0.127886119
104 -0.384110214 0.329103397
105 0.211997396 -0.384110214
106 -0.328319068 0.211997396
107 -0.284064762 -0.328319068
108 0.303225928 -0.284064762
109 0.059966229 0.303225928
110 0.116566490 0.059966229
111 -0.496866048 0.116566490
112 0.482511436 -0.496866048
113 -0.447686814 0.482511436
114 0.385932502 -0.447686814
115 0.097635338 0.385932502
116 0.120967466 0.097635338
117 -0.674547630 0.120967466
118 -0.194739117 -0.674547630
119 0.137405517 -0.194739117
120 -0.214708288 0.137405517
121 0.052805789 -0.214708288
122 -0.481128463 0.052805789
123 -0.033981684 -0.481128463
124 -0.167612528 -0.033981684
125 0.319038430 -0.167612528
126 -0.211142462 0.319038430
127 0.056076602 -0.211142462
128 0.076229209 0.056076602
129 0.565738908 0.076229209
130 0.343336450 0.565738908
131 -0.090621384 0.343336450
132 0.020557873 -0.090621384
133 -0.303201623 0.020557873
134 0.548857455 -0.303201623
135 0.257027426 0.548857455
136 0.243091527 0.257027426
137 -0.424443057 0.243091527
138 0.315251691 -0.424443057
139 -0.232483655 0.315251691
140 -0.376363756 -0.232483655
141 -0.404814041 -0.376363756
142 -0.078370701 -0.404814041
143 -0.025770331 -0.078370701
144 0.300938427 -0.025770331
145 -0.355916442 0.300938427
146 0.086287076 -0.355916442
147 -0.177532065 0.086287076
148 0.127645336 -0.177532065
149 -0.173762613 0.127645336
150 0.049771052 -0.173762613
151 -0.145589655 0.049771052
152 -0.114108977 -0.145589655
153 -0.301969490 -0.114108977
154 NA -0.301969490
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.118208345 0.050526276
[2,] 0.074511409 0.118208345
[3,] 0.152682204 0.074511409
[4,] 0.198209891 0.152682204
[5,] -0.070915247 0.198209891
[6,] 0.413878481 -0.070915247
[7,] 0.442296110 0.413878481
[8,] -0.292335263 0.442296110
[9,] -0.032172346 -0.292335263
[10,] -0.029794958 -0.032172346
[11,] -0.030966621 -0.029794958
[12,] -0.219777385 -0.030966621
[13,] -0.410078360 -0.219777385
[14,] -0.341041437 -0.410078360
[15,] -0.594248587 -0.341041437
[16,] -0.260772080 -0.594248587
[17,] 0.210599664 -0.260772080
[18,] -0.259812619 0.210599664
[19,] -0.438169729 -0.259812619
[20,] 0.081444770 -0.438169729
[21,] 0.367087220 0.081444770
[22,] 0.372734833 0.367087220
[23,] 0.366117720 0.372734833
[24,] 0.424110963 0.366117720
[25,] -0.548284985 0.424110963
[26,] -0.006383875 -0.548284985
[27,] 0.184899542 -0.006383875
[28,] -0.227420036 0.184899542
[29,] 0.240370095 -0.227420036
[30,] 0.557335801 0.240370095
[31,] 0.552219789 0.557335801
[32,] 0.553537336 0.552219789
[33,] -0.171817923 0.553537336
[34,] -0.152436938 -0.171817923
[35,] 0.100981031 -0.152436938
[36,] 0.031821089 0.100981031
[37,] -0.165043505 0.031821089
[38,] 0.334313358 -0.165043505
[39,] -0.240444765 0.334313358
[40,] 0.474411824 -0.240444765
[41,] 0.535702288 0.474411824
[42,] -0.171910314 0.535702288
[43,] -0.373358032 -0.171910314
[44,] 0.349721624 -0.373358032
[45,] -0.158658578 0.349721624
[46,] 0.577826874 -0.158658578
[47,] 0.275686660 0.577826874
[48,] 0.161019438 0.275686660
[49,] -0.018741274 0.161019438
[50,] -0.290381391 -0.018741274
[51,] -0.016057431 -0.290381391
[52,] -0.238041609 -0.016057431
[53,] 0.277631327 -0.238041609
[54,] 0.043259237 0.277631327
[55,] 0.027203658 0.043259237
[56,] 0.352933707 0.027203658
[57,] 0.288379529 0.352933707
[58,] 0.112420925 0.288379529
[59,] -0.117686035 0.112420925
[60,] -0.543590039 -0.117686035
[61,] 0.526211711 -0.543590039
[62,] 0.281104362 0.526211711
[63,] -0.403106245 0.281104362
[64,] 0.583350368 -0.403106245
[65,] -0.160758639 0.583350368
[66,] 0.338623992 -0.160758639
[67,] -0.382533860 0.338623992
[68,] -0.375903522 -0.382533860
[69,] 0.062144545 -0.375903522
[70,] 0.291379504 0.062144545
[71,] -0.122294927 0.291379504
[72,] -0.017530255 -0.122294927
[73,] 0.198577733 -0.017530255
[74,] 0.230764908 0.198577733
[75,] -0.499199242 0.230764908
[76,] -0.462814661 -0.499199242
[77,] 0.038023109 -0.462814661
[78,] -0.209161965 0.038023109
[79,] -0.488960024 -0.209161965
[80,] -0.407165661 -0.488960024
[81,] -0.469295565 -0.407165661
[82,] 0.235989898 -0.469295565
[83,] -0.136514300 0.235989898
[84,] 0.138674684 -0.136514300
[85,] -0.027631483 0.138674684
[86,] -0.499178124 -0.027631483
[87,] 0.152853602 -0.499178124
[88,] 0.008973500 0.152853602
[89,] -0.472890120 0.008973500
[90,] -0.216704114 -0.472890120
[91,] 0.316397492 -0.216704114
[92,] -0.200163633 0.316397492
[93,] -0.161626808 -0.200163633
[94,] -0.409890697 -0.161626808
[95,] 0.108640980 -0.409890697
[96,] 0.245630133 0.108640980
[97,] 0.410357800 0.245630133
[98,] 0.257104088 0.410357800
[99,] 0.237885174 0.257104088
[100,] -0.192079562 0.237885174
[101,] 0.156977966 -0.192079562
[102,] 0.127886119 0.156977966
[103,] 0.329103397 0.127886119
[104,] -0.384110214 0.329103397
[105,] 0.211997396 -0.384110214
[106,] -0.328319068 0.211997396
[107,] -0.284064762 -0.328319068
[108,] 0.303225928 -0.284064762
[109,] 0.059966229 0.303225928
[110,] 0.116566490 0.059966229
[111,] -0.496866048 0.116566490
[112,] 0.482511436 -0.496866048
[113,] -0.447686814 0.482511436
[114,] 0.385932502 -0.447686814
[115,] 0.097635338 0.385932502
[116,] 0.120967466 0.097635338
[117,] -0.674547630 0.120967466
[118,] -0.194739117 -0.674547630
[119,] 0.137405517 -0.194739117
[120,] -0.214708288 0.137405517
[121,] 0.052805789 -0.214708288
[122,] -0.481128463 0.052805789
[123,] -0.033981684 -0.481128463
[124,] -0.167612528 -0.033981684
[125,] 0.319038430 -0.167612528
[126,] -0.211142462 0.319038430
[127,] 0.056076602 -0.211142462
[128,] 0.076229209 0.056076602
[129,] 0.565738908 0.076229209
[130,] 0.343336450 0.565738908
[131,] -0.090621384 0.343336450
[132,] 0.020557873 -0.090621384
[133,] -0.303201623 0.020557873
[134,] 0.548857455 -0.303201623
[135,] 0.257027426 0.548857455
[136,] 0.243091527 0.257027426
[137,] -0.424443057 0.243091527
[138,] 0.315251691 -0.424443057
[139,] -0.232483655 0.315251691
[140,] -0.376363756 -0.232483655
[141,] -0.404814041 -0.376363756
[142,] -0.078370701 -0.404814041
[143,] -0.025770331 -0.078370701
[144,] 0.300938427 -0.025770331
[145,] -0.355916442 0.300938427
[146,] 0.086287076 -0.355916442
[147,] -0.177532065 0.086287076
[148,] 0.127645336 -0.177532065
[149,] -0.173762613 0.127645336
[150,] 0.049771052 -0.173762613
[151,] -0.145589655 0.049771052
[152,] -0.114108977 -0.145589655
[153,] -0.301969490 -0.114108977
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.118208345 0.050526276
2 0.074511409 0.118208345
3 0.152682204 0.074511409
4 0.198209891 0.152682204
5 -0.070915247 0.198209891
6 0.413878481 -0.070915247
7 0.442296110 0.413878481
8 -0.292335263 0.442296110
9 -0.032172346 -0.292335263
10 -0.029794958 -0.032172346
11 -0.030966621 -0.029794958
12 -0.219777385 -0.030966621
13 -0.410078360 -0.219777385
14 -0.341041437 -0.410078360
15 -0.594248587 -0.341041437
16 -0.260772080 -0.594248587
17 0.210599664 -0.260772080
18 -0.259812619 0.210599664
19 -0.438169729 -0.259812619
20 0.081444770 -0.438169729
21 0.367087220 0.081444770
22 0.372734833 0.367087220
23 0.366117720 0.372734833
24 0.424110963 0.366117720
25 -0.548284985 0.424110963
26 -0.006383875 -0.548284985
27 0.184899542 -0.006383875
28 -0.227420036 0.184899542
29 0.240370095 -0.227420036
30 0.557335801 0.240370095
31 0.552219789 0.557335801
32 0.553537336 0.552219789
33 -0.171817923 0.553537336
34 -0.152436938 -0.171817923
35 0.100981031 -0.152436938
36 0.031821089 0.100981031
37 -0.165043505 0.031821089
38 0.334313358 -0.165043505
39 -0.240444765 0.334313358
40 0.474411824 -0.240444765
41 0.535702288 0.474411824
42 -0.171910314 0.535702288
43 -0.373358032 -0.171910314
44 0.349721624 -0.373358032
45 -0.158658578 0.349721624
46 0.577826874 -0.158658578
47 0.275686660 0.577826874
48 0.161019438 0.275686660
49 -0.018741274 0.161019438
50 -0.290381391 -0.018741274
51 -0.016057431 -0.290381391
52 -0.238041609 -0.016057431
53 0.277631327 -0.238041609
54 0.043259237 0.277631327
55 0.027203658 0.043259237
56 0.352933707 0.027203658
57 0.288379529 0.352933707
58 0.112420925 0.288379529
59 -0.117686035 0.112420925
60 -0.543590039 -0.117686035
61 0.526211711 -0.543590039
62 0.281104362 0.526211711
63 -0.403106245 0.281104362
64 0.583350368 -0.403106245
65 -0.160758639 0.583350368
66 0.338623992 -0.160758639
67 -0.382533860 0.338623992
68 -0.375903522 -0.382533860
69 0.062144545 -0.375903522
70 0.291379504 0.062144545
71 -0.122294927 0.291379504
72 -0.017530255 -0.122294927
73 0.198577733 -0.017530255
74 0.230764908 0.198577733
75 -0.499199242 0.230764908
76 -0.462814661 -0.499199242
77 0.038023109 -0.462814661
78 -0.209161965 0.038023109
79 -0.488960024 -0.209161965
80 -0.407165661 -0.488960024
81 -0.469295565 -0.407165661
82 0.235989898 -0.469295565
83 -0.136514300 0.235989898
84 0.138674684 -0.136514300
85 -0.027631483 0.138674684
86 -0.499178124 -0.027631483
87 0.152853602 -0.499178124
88 0.008973500 0.152853602
89 -0.472890120 0.008973500
90 -0.216704114 -0.472890120
91 0.316397492 -0.216704114
92 -0.200163633 0.316397492
93 -0.161626808 -0.200163633
94 -0.409890697 -0.161626808
95 0.108640980 -0.409890697
96 0.245630133 0.108640980
97 0.410357800 0.245630133
98 0.257104088 0.410357800
99 0.237885174 0.257104088
100 -0.192079562 0.237885174
101 0.156977966 -0.192079562
102 0.127886119 0.156977966
103 0.329103397 0.127886119
104 -0.384110214 0.329103397
105 0.211997396 -0.384110214
106 -0.328319068 0.211997396
107 -0.284064762 -0.328319068
108 0.303225928 -0.284064762
109 0.059966229 0.303225928
110 0.116566490 0.059966229
111 -0.496866048 0.116566490
112 0.482511436 -0.496866048
113 -0.447686814 0.482511436
114 0.385932502 -0.447686814
115 0.097635338 0.385932502
116 0.120967466 0.097635338
117 -0.674547630 0.120967466
118 -0.194739117 -0.674547630
119 0.137405517 -0.194739117
120 -0.214708288 0.137405517
121 0.052805789 -0.214708288
122 -0.481128463 0.052805789
123 -0.033981684 -0.481128463
124 -0.167612528 -0.033981684
125 0.319038430 -0.167612528
126 -0.211142462 0.319038430
127 0.056076602 -0.211142462
128 0.076229209 0.056076602
129 0.565738908 0.076229209
130 0.343336450 0.565738908
131 -0.090621384 0.343336450
132 0.020557873 -0.090621384
133 -0.303201623 0.020557873
134 0.548857455 -0.303201623
135 0.257027426 0.548857455
136 0.243091527 0.257027426
137 -0.424443057 0.243091527
138 0.315251691 -0.424443057
139 -0.232483655 0.315251691
140 -0.376363756 -0.232483655
141 -0.404814041 -0.376363756
142 -0.078370701 -0.404814041
143 -0.025770331 -0.078370701
144 0.300938427 -0.025770331
145 -0.355916442 0.300938427
146 0.086287076 -0.355916442
147 -0.177532065 0.086287076
148 0.127645336 -0.177532065
149 -0.173762613 0.127645336
150 0.049771052 -0.173762613
151 -0.145589655 0.049771052
152 -0.114108977 -0.145589655
153 -0.301969490 -0.114108977
> 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/7lysq1353436295.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/8d85y1353436295.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/9en5b1353436295.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/1093bq1353436295.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/11hmxl1353436295.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12k5or1353436295.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13rj181353436295.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14xrvi1353436295.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/15n3gb1353436295.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/16r6031353436295.tab")
+ }
>
> try(system("convert tmp/1w0xs1353436295.ps tmp/1w0xs1353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/25fgd1353436295.ps tmp/25fgd1353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/388781353436295.ps tmp/388781353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/4u0oq1353436295.ps tmp/4u0oq1353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/52gtp1353436295.ps tmp/52gtp1353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/6dwe61353436295.ps tmp/6dwe61353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/7lysq1353436295.ps tmp/7lysq1353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/8d85y1353436295.ps tmp/8d85y1353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/9en5b1353436295.ps tmp/9en5b1353436295.png",intern=TRUE))
character(0)
> try(system("convert tmp/1093bq1353436295.ps tmp/1093bq1353436295.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.645 1.186 9.826