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(9
+ ,5
+ ,-1
+ ,6
+ ,24
+ ,11
+ ,5
+ ,-4
+ ,6
+ ,29
+ ,13
+ ,9
+ ,-6
+ ,8
+ ,29
+ ,12
+ ,10
+ ,-9
+ ,4
+ ,25
+ ,13
+ ,14
+ ,-13
+ ,8
+ ,16
+ ,15
+ ,19
+ ,-13
+ ,10
+ ,18
+ ,13
+ ,18
+ ,-10
+ ,9
+ ,13
+ ,16
+ ,16
+ ,-12
+ ,12
+ ,22
+ ,10
+ ,8
+ ,-9
+ ,9
+ ,15
+ ,14
+ ,10
+ ,-15
+ ,11
+ ,20
+ ,14
+ ,12
+ ,-14
+ ,11
+ ,19
+ ,15
+ ,13
+ ,-18
+ ,11
+ ,18
+ ,13
+ ,15
+ ,-13
+ ,11
+ ,13
+ ,8
+ ,3
+ ,-2
+ ,11
+ ,17
+ ,7
+ ,2
+ ,-1
+ ,9
+ ,17
+ ,3
+ ,-2
+ ,5
+ ,8
+ ,13
+ ,3
+ ,1
+ ,8
+ ,6
+ ,14
+ ,4
+ ,1
+ ,6
+ ,7
+ ,13
+ ,4
+ ,-1
+ ,7
+ ,8
+ ,17
+ ,0
+ ,-6
+ ,15
+ ,6
+ ,17
+ ,-4
+ ,-13
+ ,23
+ ,5
+ ,15
+ ,-14
+ ,-25
+ ,43
+ ,2
+ ,9
+ ,-18
+ ,-26
+ ,60
+ ,3
+ ,10
+ ,-8
+ ,-9
+ ,36
+ ,3
+ ,9
+ ,-1
+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numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
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 EcoSituatie Werkloosheid FinancieleSituatie
1 9 5 -1 6
2 11 5 -4 6
3 13 9 -6 8
4 12 10 -9 4
5 13 14 -13 8
6 15 19 -13 10
7 13 18 -10 9
8 16 16 -12 12
9 10 8 -9 9
10 14 10 -15 11
11 14 12 -14 11
12 15 13 -18 11
13 13 15 -13 11
14 8 3 -2 11
15 7 2 -1 9
16 3 -2 5 8
17 3 1 8 6
18 4 1 6 7
19 4 -1 7 8
20 0 -6 15 6
21 -4 -13 23 5
22 -14 -25 43 2
23 -18 -26 60 3
24 -8 -9 36 3
25 -1 1 28 7
26 1 3 23 8
27 2 6 23 7
28 0 2 22 7
29 1 5 22 6
30 0 5 24 6
31 -1 0 32 7
32 -3 -5 27 5
33 -3 -4 27 5
34 -3 -2 27 5
35 -4 -1 29 4
36 -8 -8 38 4
37 -9 -16 40 4
38 -13 -19 45 1
39 -18 -28 50 -1
40 -11 -11 43 3
41 -9 -4 44 4
42 -10 -9 44 3
43 -13 -12 49 2
44 -11 -10 42 1
45 -5 -2 36 4
46 -15 -13 57 3
47 -6 0 42 5
48 -6 0 39 6
49 -3 4 33 6
50 -1 7 32 6
51 -3 5 34 6
52 -4 2 37 6
53 -6 -2 38 5
54 0 6 28 6
55 -4 -3 31 5
56 -2 1 28 6
57 -2 0 30 5
58 -6 -7 39 7
59 -7 -6 38 4
60 -6 -4 39 5
61 -6 -4 38 6
62 -3 -2 37 6
63 -2 2 32 5
64 -5 -5 32 3
65 -11 -15 44 2
66 -11 -16 43 3
67 -11 -18 42 3
68 -10 -13 38 2
69 -14 -23 37 0
70 -8 -10 35 4
71 -9 -10 37 4
72 -5 -6 33 5
73 -1 -3 24 6
74 -2 -4 24 6
75 -5 -7 31 5
76 -4 -7 25 5
77 -6 -7 28 3
78 -2 -3 24 5
79 -2 0 25 5
80 -2 -5 16 5
81 -2 -3 17 3
82 2 3 11 6
83 1 2 12 6
84 -8 -7 39 4
85 -1 -1 19 6
86 1 0 14 5
87 -1 -3 15 4
88 2 4 7 5
89 2 2 12 5
90 1 3 12 4
91 -1 0 14 3
92 -2 -10 9 2
93 -2 -10 8 3
94 -1 -9 4 2
95 -8 -22 7 -1
96 -4 -16 3 0
97 -6 -18 5 -2
98 -3 -14 0 1
99 -3 -12 -2 -2
100 -7 -17 6 -2
101 -9 -23 11 -2
102 -11 -28 9 -6
103 -13 -31 17 -4
104 -11 -21 21 -2
105 -9 -19 21 0
106 -17 -22 41 -5
107 -22 -22 57 -4
108 -25 -25 65 -5
109 -20 -16 68 -1
110 -24 -22 73 -2
111 -24 -21 71 -4
112 -22 -10 71 -1
113 -19 -7 70 1
114 -18 -5 69 1
115 -17 -4 65 -2
116 -11 7 57 1
117 -11 6 57 1
118 -12 3 57 3
119 -10 10 55 3
120 -15 0 65 1
121 -15 -2 65 1
122 -15 -1 64 0
123 -13 2 60 2
124 -8 8 43 2
125 -13 -6 47 -1
126 -9 -4 40 1
127 -7 4 31 0
128 -4 7 27 1
129 -4 3 24 1
130 -2 3 23 3
131 0 8 17 2
132 -2 3 16 0
133 -3 -3 15 0
134 1 4 8 3
135 -2 -5 5 -2
136 -1 -1 6 0
137 1 5 5 1
138 -3 0 12 -1
139 -4 -6 8 -2
140 -9 -13 17 -1
141 -9 -15 22 -1
142 -7 -8 24 1
143 -14 -20 36 -2
144 -12 -10 31 -5
145 -16 -22 34 -5
Spaarvermogen
1 24
2 29
3 29
4 25
5 16
6 18
7 13
8 22
9 15
10 20
11 19
12 18
13 13
14 17
15 17
16 13
17 14
18 13
19 17
20 17
21 15
22 9
23 10
24 9
25 14
26 18
27 18
28 12
29 16
30 12
31 19
32 13
33 12
34 13
35 11
36 10
37 16
38 12
39 6
40 8
41 6
42 8
43 8
44 9
45 13
46 8
47 11
48 8
49 10
50 15
51 12
52 13
53 12
54 15
55 13
56 13
57 16
58 14
59 12
60 15
61 14
62 19
63 16
64 16
65 11
66 13
67 12
68 11
69 6
70 9
71 6
72 15
73 17
74 13
75 12
76 13
77 10
78 14
79 13
80 10
81 11
82 12
83 7
84 11
85 9
86 13
87 12
88 5
89 13
90 11
91 8
92 8
93 8
94 8
95 0
96 3
97 0
98 -1
99 -1
100 -4
101 1
102 -1
103 0
104 -1
105 6
106 0
107 -3
108 -3
109 4
110 1
111 0
112 -4
113 -2
114 3
115 2
116 5
117 6
118 6
119 3
120 4
121 7
122 5
123 6
124 1
125 3
126 6
127 0
128 3
129 4
130 7
131 6
132 6
133 6
134 6
135 2
136 2
137 2
138 3
139 -1
140 -4
141 4
142 5
143 3
144 -1
145 -4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) EcoSituatie Werkloosheid FinancieleSituatie
-0.0003961 0.2502627 -0.2506043 0.2705993
Spaarvermogen
0.2410699
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.72416 -0.23192 0.02927 0.26397 0.58796
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.0003961 0.0724527 -0.005 0.996
EcoSituatie 0.2502627 0.0036974 67.686 <2e-16 ***
Werkloosheid -0.2506043 0.0013956 -179.565 <2e-16 ***
FinancieleSituatie 0.2705993 0.0158933 17.026 <2e-16 ***
Spaarvermogen 0.2410699 0.0073192 32.937 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3188 on 140 degrees of freedom
Multiple R-squared: 0.9986, Adjusted R-squared: 0.9986
F-statistic: 2.555e+04 on 4 and 140 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.300115364 0.600230727 0.6998846
[2,] 0.362040176 0.724080352 0.6379598
[3,] 0.234896155 0.469792310 0.7651038
[4,] 0.141685721 0.283371441 0.8583143
[5,] 0.079046917 0.158093833 0.9209531
[6,] 0.051837183 0.103674365 0.9481628
[7,] 0.028667190 0.057334380 0.9713328
[8,] 0.014588619 0.029177238 0.9854114
[9,] 0.008614999 0.017229997 0.9913850
[10,] 0.004119572 0.008239144 0.9958804
[11,] 0.025384558 0.050769117 0.9746154
[12,] 0.015048660 0.030097320 0.9849513
[13,] 0.012262603 0.024525205 0.9877374
[14,] 0.034249397 0.068498795 0.9657506
[15,] 0.097087558 0.194175116 0.9029124
[16,] 0.070002356 0.140004713 0.9299976
[17,] 0.052130889 0.104261778 0.9478691
[18,] 0.038637501 0.077275002 0.9613625
[19,] 0.271284832 0.542569664 0.7287152
[20,] 0.244720622 0.489441243 0.7552794
[21,] 0.198569220 0.397138441 0.8014308
[22,] 0.243430367 0.486860733 0.7565696
[23,] 0.198878162 0.397756324 0.8011218
[24,] 0.241566454 0.483132909 0.7584335
[25,] 0.283156041 0.566312082 0.7168440
[26,] 0.308137851 0.616275701 0.6918621
[27,] 0.351344524 0.702689049 0.6486555
[28,] 0.401244649 0.802489298 0.5987554
[29,] 0.354738122 0.709476244 0.6452619
[30,] 0.304005415 0.608010831 0.6959946
[31,] 0.283483812 0.566967624 0.7165162
[32,] 0.282866662 0.565733324 0.7171333
[33,] 0.295668651 0.591337302 0.7043313
[34,] 0.301011231 0.602022462 0.6989888
[35,] 0.328093420 0.656186840 0.6719066
[36,] 0.354436410 0.708872820 0.6455636
[37,] 0.463308575 0.926617149 0.5366914
[38,] 0.433386902 0.866773803 0.5666131
[39,] 0.443304741 0.886609482 0.5566953
[40,] 0.471294364 0.942588728 0.5287056
[41,] 0.428914205 0.857828411 0.5710858
[42,] 0.389979250 0.779958499 0.6100208
[43,] 0.359642600 0.719285200 0.6403574
[44,] 0.384009324 0.768018648 0.6159907
[45,] 0.343685427 0.687370854 0.6563146
[46,] 0.340440271 0.680880541 0.6595597
[47,] 0.317376290 0.634752580 0.6826237
[48,] 0.275606564 0.551213128 0.7243934
[49,] 0.237262714 0.474525428 0.7627373
[50,] 0.229338253 0.458676506 0.7706617
[51,] 0.217566701 0.435133402 0.7824333
[52,] 0.186031340 0.372062680 0.8139687
[53,] 0.176739591 0.353479182 0.8232604
[54,] 0.230310166 0.460620331 0.7696898
[55,] 0.330911843 0.661823687 0.6690882
[56,] 0.336419691 0.672839382 0.6635803
[57,] 0.370707694 0.741415388 0.6292923
[58,] 0.514075804 0.971848392 0.4859242
[59,] 0.480629601 0.961259202 0.5193704
[60,] 0.521973196 0.956053607 0.4780268
[61,] 0.547597512 0.904804976 0.4524025
[62,] 0.552940643 0.894118713 0.4470594
[63,] 0.509309135 0.981381729 0.4906909
[64,] 0.501451128 0.997097744 0.4985489
[65,] 0.471837608 0.943675217 0.5281624
[66,] 0.446280495 0.892560989 0.5537195
[67,] 0.470449636 0.940899273 0.5295504
[68,] 0.513226280 0.973547440 0.4867737
[69,] 0.529467950 0.941064101 0.4705321
[70,] 0.547758719 0.904482562 0.4522413
[71,] 0.525822405 0.948355190 0.4741776
[72,] 0.494429616 0.988859233 0.5055704
[73,] 0.514591737 0.970816526 0.4854083
[74,] 0.518277138 0.963445725 0.4817229
[75,] 0.552923213 0.894153574 0.4470768
[76,] 0.541635299 0.916729403 0.4583647
[77,] 0.507636774 0.984726452 0.4923632
[78,] 0.513948911 0.972102178 0.4860511
[79,] 0.482325607 0.964651214 0.5176744
[80,] 0.481469267 0.962938533 0.5185307
[81,] 0.473816871 0.947633741 0.5261831
[82,] 0.441183134 0.882366268 0.5588169
[83,] 0.457078982 0.914157964 0.5429210
[84,] 0.416479876 0.832959751 0.5835201
[85,] 0.472155938 0.944311876 0.5278441
[86,] 0.423410543 0.846821086 0.5765895
[87,] 0.378860940 0.757721880 0.6211391
[88,] 0.412087220 0.824174440 0.5879128
[89,] 0.385555911 0.771111822 0.6144441
[90,] 0.405302522 0.810605043 0.5946975
[91,] 0.491284987 0.982569973 0.5087150
[92,] 0.472887990 0.945775980 0.5271120
[93,] 0.452890576 0.905781151 0.5471094
[94,] 0.410275118 0.820550236 0.5897249
[95,] 0.363569772 0.727139544 0.6364302
[96,] 0.321939119 0.643878239 0.6780609
[97,] 0.332420881 0.664841762 0.6675791
[98,] 0.333643056 0.667286112 0.6663569
[99,] 0.288142129 0.576284257 0.7118579
[100,] 0.318639075 0.637278151 0.6813609
[101,] 0.356073167 0.712146335 0.6439268
[102,] 0.388813018 0.777626036 0.6111870
[103,] 0.359944760 0.719889520 0.6400552
[104,] 0.322884464 0.645768928 0.6771155
[105,] 0.378853955 0.757707910 0.6211460
[106,] 0.575795829 0.848408342 0.4242042
[107,] 0.564740232 0.870519535 0.4352598
[108,] 0.578239069 0.843521862 0.4217609
[109,] 0.522276266 0.955447468 0.4777237
[110,] 0.470535637 0.941071274 0.5294644
[111,] 0.607859411 0.784281178 0.3921406
[112,] 0.564906464 0.870187071 0.4350935
[113,] 0.518460573 0.963078854 0.4815394
[114,] 0.451758319 0.903516637 0.5482417
[115,] 0.423916582 0.847833164 0.5760834
[116,] 0.406554488 0.813108976 0.5934455
[117,] 0.336072788 0.672145577 0.6639272
[118,] 0.276579379 0.553158758 0.7234206
[119,] 0.324091150 0.648182300 0.6759089
[120,] 0.302597196 0.605194391 0.6974028
[121,] 0.240352304 0.480704607 0.7596477
[122,] 0.180102344 0.360204689 0.8198977
[123,] 0.419879048 0.839758095 0.5801210
[124,] 0.619456426 0.761087148 0.3805436
[125,] 0.517364823 0.965270355 0.4826352
[126,] 0.446480566 0.892961131 0.5535194
[127,] 0.346463289 0.692926579 0.6535367
[128,] 0.315267729 0.630535458 0.6847323
[129,] 0.285082273 0.570164545 0.7149177
[130,] 0.523293212 0.953413577 0.4767068
> postscript(file="/var/wessaorg/rcomp/tmp/1wnjf1352121631.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/2bvzv1352121631.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/31adf1352121631.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/4iax91352121631.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/54oj51352121631.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 = 145
Frequency = 1
1 2 3 4 5 6
0.089204847 0.132042330 0.088584319 0.133185308 0.216949312 -0.057702579
7 8 9 10 11 12
0.420321909 0.438211724 -0.308586475 -0.059285905 -0.068137094 -0.079747193
13 14 15 16 17 18
-0.121901449 -0.326380987 -0.284315434 -0.544759750 -0.243606301 0.225655700
19 20 21 22 23 24
-0.258093449 -0.460746782 0.048665865 0.322122112 0.320989165 0.293089208
25 26 27 28 29 30
0.497880923 -0.490545015 0.029266111 0.226132085 -0.218336425 0.247151859
31 32 33 34 35 36
0.545211385 0.531121292 0.521928490 -0.219666841 -0.215981827 0.032365977
37 38 39 40 41 42
0.089256859 -0.130855974 0.362148018 -0.211085192 0.499220714 0.538993710
43 44 45 46 47 48
-0.186597277 -0.411823618 0.306371335 -0.202099232 0.521012417 0.221809913
49 50 51 52 53 54
0.234993306 0.028251304 -0.246804899 0.014726297 -0.221949366 0.276096718
55 56 57 58 59 60
0.033013167 0.009550091 0.308410982 0.256630176 0.049700737 -0.194029347
61 62 63 64 65 66
-0.474163022 0.569357687 0.309094209 -0.397868296 0.587959508 -0.165121182
67 68 69 70 71 72
0.325869824 -0.416191859 -0.417621010 0.022148335 0.246566711 -0.197129870
73 74 75 76 77 78
0.043904002 0.258446349 0.275133920 -0.469561934 -0.453340717 0.037712988
79 80 81 82 83 84
-0.221400911 -0.502316547 -0.452109035 -0.510178933 0.196037648 -0.208362319
85 86 87 88 89 90
0.218916232 0.021951523 -0.464986852 0.195229682 0.020217453 -0.477306181
91 92 93 94 95 96
-0.231500414 0.288704335 -0.232499249 -0.214579997 -0.468994732 0.033202719
97 98 99 100 101 102
0.299345035 0.474544702 0.284608409 0.263966284 -0.186785374 0.127856387
103 104 105 106 107 108
0.101210686 0.300872263 -0.428341040 0.133949326 -0.403771020 -0.377549035
109 110 111 112 113 114
0.352013139 0.100420012 0.131217080 -0.469190882 0.506078324 -0.450400967
115 116 117 118 119 120
0.349786712 0.057054793 0.066247595 -0.724162790 -0.254000688 0.054798273
121 122 123 124 125 126
-0.167886033 0.083986010 -0.451487847 -0.007988079 -0.172234869 0.308601195
127 128 129 130 131 132
-0.231920697 0.021064887 0.029232849 0.514220280 0.270949948 -0.187142303
133 134 135 136 137 138
0.063829639 -0.254037384 0.563789974 0.272144936 0.249365087 -0.444962480
139 140 141 142 143 144
0.289075384 -0.251036253 -0.426048483 -0.458947239 -0.154605221 -0.134176539
145
0.343998693
> postscript(file="/var/wessaorg/rcomp/tmp/6yv0b1352121631.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 = 145
Frequency = 1
lag(myerror, k = 1) myerror
0 0.089204847 NA
1 0.132042330 0.089204847
2 0.088584319 0.132042330
3 0.133185308 0.088584319
4 0.216949312 0.133185308
5 -0.057702579 0.216949312
6 0.420321909 -0.057702579
7 0.438211724 0.420321909
8 -0.308586475 0.438211724
9 -0.059285905 -0.308586475
10 -0.068137094 -0.059285905
11 -0.079747193 -0.068137094
12 -0.121901449 -0.079747193
13 -0.326380987 -0.121901449
14 -0.284315434 -0.326380987
15 -0.544759750 -0.284315434
16 -0.243606301 -0.544759750
17 0.225655700 -0.243606301
18 -0.258093449 0.225655700
19 -0.460746782 -0.258093449
20 0.048665865 -0.460746782
21 0.322122112 0.048665865
22 0.320989165 0.322122112
23 0.293089208 0.320989165
24 0.497880923 0.293089208
25 -0.490545015 0.497880923
26 0.029266111 -0.490545015
27 0.226132085 0.029266111
28 -0.218336425 0.226132085
29 0.247151859 -0.218336425
30 0.545211385 0.247151859
31 0.531121292 0.545211385
32 0.521928490 0.531121292
33 -0.219666841 0.521928490
34 -0.215981827 -0.219666841
35 0.032365977 -0.215981827
36 0.089256859 0.032365977
37 -0.130855974 0.089256859
38 0.362148018 -0.130855974
39 -0.211085192 0.362148018
40 0.499220714 -0.211085192
41 0.538993710 0.499220714
42 -0.186597277 0.538993710
43 -0.411823618 -0.186597277
44 0.306371335 -0.411823618
45 -0.202099232 0.306371335
46 0.521012417 -0.202099232
47 0.221809913 0.521012417
48 0.234993306 0.221809913
49 0.028251304 0.234993306
50 -0.246804899 0.028251304
51 0.014726297 -0.246804899
52 -0.221949366 0.014726297
53 0.276096718 -0.221949366
54 0.033013167 0.276096718
55 0.009550091 0.033013167
56 0.308410982 0.009550091
57 0.256630176 0.308410982
58 0.049700737 0.256630176
59 -0.194029347 0.049700737
60 -0.474163022 -0.194029347
61 0.569357687 -0.474163022
62 0.309094209 0.569357687
63 -0.397868296 0.309094209
64 0.587959508 -0.397868296
65 -0.165121182 0.587959508
66 0.325869824 -0.165121182
67 -0.416191859 0.325869824
68 -0.417621010 -0.416191859
69 0.022148335 -0.417621010
70 0.246566711 0.022148335
71 -0.197129870 0.246566711
72 0.043904002 -0.197129870
73 0.258446349 0.043904002
74 0.275133920 0.258446349
75 -0.469561934 0.275133920
76 -0.453340717 -0.469561934
77 0.037712988 -0.453340717
78 -0.221400911 0.037712988
79 -0.502316547 -0.221400911
80 -0.452109035 -0.502316547
81 -0.510178933 -0.452109035
82 0.196037648 -0.510178933
83 -0.208362319 0.196037648
84 0.218916232 -0.208362319
85 0.021951523 0.218916232
86 -0.464986852 0.021951523
87 0.195229682 -0.464986852
88 0.020217453 0.195229682
89 -0.477306181 0.020217453
90 -0.231500414 -0.477306181
91 0.288704335 -0.231500414
92 -0.232499249 0.288704335
93 -0.214579997 -0.232499249
94 -0.468994732 -0.214579997
95 0.033202719 -0.468994732
96 0.299345035 0.033202719
97 0.474544702 0.299345035
98 0.284608409 0.474544702
99 0.263966284 0.284608409
100 -0.186785374 0.263966284
101 0.127856387 -0.186785374
102 0.101210686 0.127856387
103 0.300872263 0.101210686
104 -0.428341040 0.300872263
105 0.133949326 -0.428341040
106 -0.403771020 0.133949326
107 -0.377549035 -0.403771020
108 0.352013139 -0.377549035
109 0.100420012 0.352013139
110 0.131217080 0.100420012
111 -0.469190882 0.131217080
112 0.506078324 -0.469190882
113 -0.450400967 0.506078324
114 0.349786712 -0.450400967
115 0.057054793 0.349786712
116 0.066247595 0.057054793
117 -0.724162790 0.066247595
118 -0.254000688 -0.724162790
119 0.054798273 -0.254000688
120 -0.167886033 0.054798273
121 0.083986010 -0.167886033
122 -0.451487847 0.083986010
123 -0.007988079 -0.451487847
124 -0.172234869 -0.007988079
125 0.308601195 -0.172234869
126 -0.231920697 0.308601195
127 0.021064887 -0.231920697
128 0.029232849 0.021064887
129 0.514220280 0.029232849
130 0.270949948 0.514220280
131 -0.187142303 0.270949948
132 0.063829639 -0.187142303
133 -0.254037384 0.063829639
134 0.563789974 -0.254037384
135 0.272144936 0.563789974
136 0.249365087 0.272144936
137 -0.444962480 0.249365087
138 0.289075384 -0.444962480
139 -0.251036253 0.289075384
140 -0.426048483 -0.251036253
141 -0.458947239 -0.426048483
142 -0.154605221 -0.458947239
143 -0.134176539 -0.154605221
144 0.343998693 -0.134176539
145 NA 0.343998693
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.132042330 0.089204847
[2,] 0.088584319 0.132042330
[3,] 0.133185308 0.088584319
[4,] 0.216949312 0.133185308
[5,] -0.057702579 0.216949312
[6,] 0.420321909 -0.057702579
[7,] 0.438211724 0.420321909
[8,] -0.308586475 0.438211724
[9,] -0.059285905 -0.308586475
[10,] -0.068137094 -0.059285905
[11,] -0.079747193 -0.068137094
[12,] -0.121901449 -0.079747193
[13,] -0.326380987 -0.121901449
[14,] -0.284315434 -0.326380987
[15,] -0.544759750 -0.284315434
[16,] -0.243606301 -0.544759750
[17,] 0.225655700 -0.243606301
[18,] -0.258093449 0.225655700
[19,] -0.460746782 -0.258093449
[20,] 0.048665865 -0.460746782
[21,] 0.322122112 0.048665865
[22,] 0.320989165 0.322122112
[23,] 0.293089208 0.320989165
[24,] 0.497880923 0.293089208
[25,] -0.490545015 0.497880923
[26,] 0.029266111 -0.490545015
[27,] 0.226132085 0.029266111
[28,] -0.218336425 0.226132085
[29,] 0.247151859 -0.218336425
[30,] 0.545211385 0.247151859
[31,] 0.531121292 0.545211385
[32,] 0.521928490 0.531121292
[33,] -0.219666841 0.521928490
[34,] -0.215981827 -0.219666841
[35,] 0.032365977 -0.215981827
[36,] 0.089256859 0.032365977
[37,] -0.130855974 0.089256859
[38,] 0.362148018 -0.130855974
[39,] -0.211085192 0.362148018
[40,] 0.499220714 -0.211085192
[41,] 0.538993710 0.499220714
[42,] -0.186597277 0.538993710
[43,] -0.411823618 -0.186597277
[44,] 0.306371335 -0.411823618
[45,] -0.202099232 0.306371335
[46,] 0.521012417 -0.202099232
[47,] 0.221809913 0.521012417
[48,] 0.234993306 0.221809913
[49,] 0.028251304 0.234993306
[50,] -0.246804899 0.028251304
[51,] 0.014726297 -0.246804899
[52,] -0.221949366 0.014726297
[53,] 0.276096718 -0.221949366
[54,] 0.033013167 0.276096718
[55,] 0.009550091 0.033013167
[56,] 0.308410982 0.009550091
[57,] 0.256630176 0.308410982
[58,] 0.049700737 0.256630176
[59,] -0.194029347 0.049700737
[60,] -0.474163022 -0.194029347
[61,] 0.569357687 -0.474163022
[62,] 0.309094209 0.569357687
[63,] -0.397868296 0.309094209
[64,] 0.587959508 -0.397868296
[65,] -0.165121182 0.587959508
[66,] 0.325869824 -0.165121182
[67,] -0.416191859 0.325869824
[68,] -0.417621010 -0.416191859
[69,] 0.022148335 -0.417621010
[70,] 0.246566711 0.022148335
[71,] -0.197129870 0.246566711
[72,] 0.043904002 -0.197129870
[73,] 0.258446349 0.043904002
[74,] 0.275133920 0.258446349
[75,] -0.469561934 0.275133920
[76,] -0.453340717 -0.469561934
[77,] 0.037712988 -0.453340717
[78,] -0.221400911 0.037712988
[79,] -0.502316547 -0.221400911
[80,] -0.452109035 -0.502316547
[81,] -0.510178933 -0.452109035
[82,] 0.196037648 -0.510178933
[83,] -0.208362319 0.196037648
[84,] 0.218916232 -0.208362319
[85,] 0.021951523 0.218916232
[86,] -0.464986852 0.021951523
[87,] 0.195229682 -0.464986852
[88,] 0.020217453 0.195229682
[89,] -0.477306181 0.020217453
[90,] -0.231500414 -0.477306181
[91,] 0.288704335 -0.231500414
[92,] -0.232499249 0.288704335
[93,] -0.214579997 -0.232499249
[94,] -0.468994732 -0.214579997
[95,] 0.033202719 -0.468994732
[96,] 0.299345035 0.033202719
[97,] 0.474544702 0.299345035
[98,] 0.284608409 0.474544702
[99,] 0.263966284 0.284608409
[100,] -0.186785374 0.263966284
[101,] 0.127856387 -0.186785374
[102,] 0.101210686 0.127856387
[103,] 0.300872263 0.101210686
[104,] -0.428341040 0.300872263
[105,] 0.133949326 -0.428341040
[106,] -0.403771020 0.133949326
[107,] -0.377549035 -0.403771020
[108,] 0.352013139 -0.377549035
[109,] 0.100420012 0.352013139
[110,] 0.131217080 0.100420012
[111,] -0.469190882 0.131217080
[112,] 0.506078324 -0.469190882
[113,] -0.450400967 0.506078324
[114,] 0.349786712 -0.450400967
[115,] 0.057054793 0.349786712
[116,] 0.066247595 0.057054793
[117,] -0.724162790 0.066247595
[118,] -0.254000688 -0.724162790
[119,] 0.054798273 -0.254000688
[120,] -0.167886033 0.054798273
[121,] 0.083986010 -0.167886033
[122,] -0.451487847 0.083986010
[123,] -0.007988079 -0.451487847
[124,] -0.172234869 -0.007988079
[125,] 0.308601195 -0.172234869
[126,] -0.231920697 0.308601195
[127,] 0.021064887 -0.231920697
[128,] 0.029232849 0.021064887
[129,] 0.514220280 0.029232849
[130,] 0.270949948 0.514220280
[131,] -0.187142303 0.270949948
[132,] 0.063829639 -0.187142303
[133,] -0.254037384 0.063829639
[134,] 0.563789974 -0.254037384
[135,] 0.272144936 0.563789974
[136,] 0.249365087 0.272144936
[137,] -0.444962480 0.249365087
[138,] 0.289075384 -0.444962480
[139,] -0.251036253 0.289075384
[140,] -0.426048483 -0.251036253
[141,] -0.458947239 -0.426048483
[142,] -0.154605221 -0.458947239
[143,] -0.134176539 -0.154605221
[144,] 0.343998693 -0.134176539
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.132042330 0.089204847
2 0.088584319 0.132042330
3 0.133185308 0.088584319
4 0.216949312 0.133185308
5 -0.057702579 0.216949312
6 0.420321909 -0.057702579
7 0.438211724 0.420321909
8 -0.308586475 0.438211724
9 -0.059285905 -0.308586475
10 -0.068137094 -0.059285905
11 -0.079747193 -0.068137094
12 -0.121901449 -0.079747193
13 -0.326380987 -0.121901449
14 -0.284315434 -0.326380987
15 -0.544759750 -0.284315434
16 -0.243606301 -0.544759750
17 0.225655700 -0.243606301
18 -0.258093449 0.225655700
19 -0.460746782 -0.258093449
20 0.048665865 -0.460746782
21 0.322122112 0.048665865
22 0.320989165 0.322122112
23 0.293089208 0.320989165
24 0.497880923 0.293089208
25 -0.490545015 0.497880923
26 0.029266111 -0.490545015
27 0.226132085 0.029266111
28 -0.218336425 0.226132085
29 0.247151859 -0.218336425
30 0.545211385 0.247151859
31 0.531121292 0.545211385
32 0.521928490 0.531121292
33 -0.219666841 0.521928490
34 -0.215981827 -0.219666841
35 0.032365977 -0.215981827
36 0.089256859 0.032365977
37 -0.130855974 0.089256859
38 0.362148018 -0.130855974
39 -0.211085192 0.362148018
40 0.499220714 -0.211085192
41 0.538993710 0.499220714
42 -0.186597277 0.538993710
43 -0.411823618 -0.186597277
44 0.306371335 -0.411823618
45 -0.202099232 0.306371335
46 0.521012417 -0.202099232
47 0.221809913 0.521012417
48 0.234993306 0.221809913
49 0.028251304 0.234993306
50 -0.246804899 0.028251304
51 0.014726297 -0.246804899
52 -0.221949366 0.014726297
53 0.276096718 -0.221949366
54 0.033013167 0.276096718
55 0.009550091 0.033013167
56 0.308410982 0.009550091
57 0.256630176 0.308410982
58 0.049700737 0.256630176
59 -0.194029347 0.049700737
60 -0.474163022 -0.194029347
61 0.569357687 -0.474163022
62 0.309094209 0.569357687
63 -0.397868296 0.309094209
64 0.587959508 -0.397868296
65 -0.165121182 0.587959508
66 0.325869824 -0.165121182
67 -0.416191859 0.325869824
68 -0.417621010 -0.416191859
69 0.022148335 -0.417621010
70 0.246566711 0.022148335
71 -0.197129870 0.246566711
72 0.043904002 -0.197129870
73 0.258446349 0.043904002
74 0.275133920 0.258446349
75 -0.469561934 0.275133920
76 -0.453340717 -0.469561934
77 0.037712988 -0.453340717
78 -0.221400911 0.037712988
79 -0.502316547 -0.221400911
80 -0.452109035 -0.502316547
81 -0.510178933 -0.452109035
82 0.196037648 -0.510178933
83 -0.208362319 0.196037648
84 0.218916232 -0.208362319
85 0.021951523 0.218916232
86 -0.464986852 0.021951523
87 0.195229682 -0.464986852
88 0.020217453 0.195229682
89 -0.477306181 0.020217453
90 -0.231500414 -0.477306181
91 0.288704335 -0.231500414
92 -0.232499249 0.288704335
93 -0.214579997 -0.232499249
94 -0.468994732 -0.214579997
95 0.033202719 -0.468994732
96 0.299345035 0.033202719
97 0.474544702 0.299345035
98 0.284608409 0.474544702
99 0.263966284 0.284608409
100 -0.186785374 0.263966284
101 0.127856387 -0.186785374
102 0.101210686 0.127856387
103 0.300872263 0.101210686
104 -0.428341040 0.300872263
105 0.133949326 -0.428341040
106 -0.403771020 0.133949326
107 -0.377549035 -0.403771020
108 0.352013139 -0.377549035
109 0.100420012 0.352013139
110 0.131217080 0.100420012
111 -0.469190882 0.131217080
112 0.506078324 -0.469190882
113 -0.450400967 0.506078324
114 0.349786712 -0.450400967
115 0.057054793 0.349786712
116 0.066247595 0.057054793
117 -0.724162790 0.066247595
118 -0.254000688 -0.724162790
119 0.054798273 -0.254000688
120 -0.167886033 0.054798273
121 0.083986010 -0.167886033
122 -0.451487847 0.083986010
123 -0.007988079 -0.451487847
124 -0.172234869 -0.007988079
125 0.308601195 -0.172234869
126 -0.231920697 0.308601195
127 0.021064887 -0.231920697
128 0.029232849 0.021064887
129 0.514220280 0.029232849
130 0.270949948 0.514220280
131 -0.187142303 0.270949948
132 0.063829639 -0.187142303
133 -0.254037384 0.063829639
134 0.563789974 -0.254037384
135 0.272144936 0.563789974
136 0.249365087 0.272144936
137 -0.444962480 0.249365087
138 0.289075384 -0.444962480
139 -0.251036253 0.289075384
140 -0.426048483 -0.251036253
141 -0.458947239 -0.426048483
142 -0.154605221 -0.458947239
143 -0.134176539 -0.154605221
144 0.343998693 -0.134176539
> 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/7f2a01352121631.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/8ecux1352121631.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/9e9zn1352121631.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/10caxb1352121631.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/11v3fn1352121631.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/12ogtf1352121631.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/13p1yz1352121632.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/14cm631352121632.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/15zdix1352121632.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/16tfhx1352121632.tab")
+ }
>
> try(system("convert tmp/1wnjf1352121631.ps tmp/1wnjf1352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/2bvzv1352121631.ps tmp/2bvzv1352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/31adf1352121631.ps tmp/31adf1352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/4iax91352121631.ps tmp/4iax91352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/54oj51352121631.ps tmp/54oj51352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/6yv0b1352121631.ps tmp/6yv0b1352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/7f2a01352121631.ps tmp/7f2a01352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ecux1352121631.ps tmp/8ecux1352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/9e9zn1352121631.ps tmp/9e9zn1352121631.png",intern=TRUE))
character(0)
> try(system("convert tmp/10caxb1352121631.ps tmp/10caxb1352121631.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
9.205 1.260 10.447