R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(114.08,136.49,112.95,142.62,135.31,141.71,134.31,149.51,133.03,147.39,140.11,131.96,124.69,136.38,131.68,127.34,150.95,133.85,137.26,125.14,130.51,141.25,143.15,149.32,118.01,120.92,122.56,134.85,147.97,131.93,135.74,134.22,151.62,143.07,154.82,145.37,145.59,134.32,147.12,126.31,175.86,162.21,140.66,124.09,152.69,153.91,154.38,154.34,132.45,138.70,136.44,150.98,153.24,146.39,154.11,178.30,155.93,168.23,142.53,162.52,148.73,158.86,147.73,152.17,166.79,171.01,144.30,171.49,156.07,189.62,161.70,177.46,152.10,179.98,140.45,156.96,155.56,167.89,174.53,194.78,167.16,192.78,159.48,165.06,173.22,196.60,176.13,151.64,180.31,187.02,185.84,210.99,169.43,219.08,195.25,235.68,174.99,241.44,156.42,187.46,182.08,229.57,182.00,208.44,153.28,215.09,136.72,217.00,130.19,171.08,132.04,178.41,143.89,196.34,133.38,172.11,127.98,154.93,150.45,182.26,133.55,181.74),dim=c(2,61),dimnames=list(c('InvoerEU','InvoerAM'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('InvoerEU','InvoerAM'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = '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.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
InvoerEU InvoerAM t
1 114.08 136.49 1
2 112.95 142.62 2
3 135.31 141.71 3
4 134.31 149.51 4
5 133.03 147.39 5
6 140.11 131.96 6
7 124.69 136.38 7
8 131.68 127.34 8
9 150.95 133.85 9
10 137.26 125.14 10
11 130.51 141.25 11
12 143.15 149.32 12
13 118.01 120.92 13
14 122.56 134.85 14
15 147.97 131.93 15
16 135.74 134.22 16
17 151.62 143.07 17
18 154.82 145.37 18
19 145.59 134.32 19
20 147.12 126.31 20
21 175.86 162.21 21
22 140.66 124.09 22
23 152.69 153.91 23
24 154.38 154.34 24
25 132.45 138.70 25
26 136.44 150.98 26
27 153.24 146.39 27
28 154.11 178.30 28
29 155.93 168.23 29
30 142.53 162.52 30
31 148.73 158.86 31
32 147.73 152.17 32
33 166.79 171.01 33
34 144.30 171.49 34
35 156.07 189.62 35
36 161.70 177.46 36
37 152.10 179.98 37
38 140.45 156.96 38
39 155.56 167.89 39
40 174.53 194.78 40
41 167.16 192.78 41
42 159.48 165.06 42
43 173.22 196.60 43
44 176.13 151.64 44
45 180.31 187.02 45
46 185.84 210.99 46
47 169.43 219.08 47
48 195.25 235.68 48
49 174.99 241.44 49
50 156.42 187.46 50
51 182.08 229.57 51
52 182.00 208.44 52
53 153.28 215.09 53
54 136.72 217.00 54
55 130.19 171.08 55
56 132.04 178.41 56
57 143.89 196.34 57
58 133.38 172.11 58
59 127.98 154.93 59
60 150.45 182.26 60
61 133.55 181.74 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) InvoerAM t
75.9046 0.4698 -0.1418
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-33.4710 -10.1920 -0.9504 10.9138 35.2262
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 75.90462 12.22998 6.206 6.21e-08 ***
InvoerAM 0.46979 0.09354 5.022 5.19e-06 ***
t -0.14180 0.15936 -0.890 0.377
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 14.03 on 58 degrees of freedom
Multiple R-squared: 0.446, Adjusted R-squared: 0.4269
F-statistic: 23.35 on 2 and 58 DF, p-value: 3.639e-08
> 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.20040952 0.4008190 0.7995905
[2,] 0.36136917 0.7227383 0.6386308
[3,] 0.23687855 0.4737571 0.7631214
[4,] 0.19879958 0.3975992 0.8012004
[5,] 0.13075905 0.2615181 0.8692409
[6,] 0.22467216 0.4493443 0.7753278
[7,] 0.15515753 0.3103151 0.8448425
[8,] 0.32566503 0.6513301 0.6743350
[9,] 0.43632471 0.8726494 0.5636753
[10,] 0.40638246 0.8127649 0.5936175
[11,] 0.34788590 0.6957718 0.6521141
[12,] 0.28970479 0.5794096 0.7102952
[13,] 0.23048577 0.4609715 0.7695142
[14,] 0.16908143 0.3381629 0.8309186
[15,] 0.12316462 0.2463292 0.8768354
[16,] 0.12304302 0.2460860 0.8769570
[17,] 0.09089492 0.1817898 0.9091051
[18,] 0.08486205 0.1697241 0.9151380
[19,] 0.06850902 0.1370180 0.9314910
[20,] 0.12680781 0.2536156 0.8731922
[21,] 0.20755278 0.4151056 0.7924472
[22,] 0.15664688 0.3132938 0.8433531
[23,] 0.15832128 0.3166426 0.8416787
[24,] 0.12269659 0.2453932 0.8773034
[25,] 0.15298553 0.3059711 0.8470145
[26,] 0.12954149 0.2590830 0.8704585
[27,] 0.10367239 0.2073448 0.8963276
[28,] 0.07825406 0.1565081 0.9217459
[29,] 0.11510788 0.2302158 0.8848921
[30,] 0.12674072 0.2534814 0.8732593
[31,] 0.09812754 0.1962551 0.9018725
[32,] 0.12203850 0.2440770 0.8779615
[33,] 0.22124343 0.4424869 0.7787566
[34,] 0.23505219 0.4701044 0.7649478
[35,] 0.21057578 0.4211516 0.7894242
[36,] 0.21494302 0.4298860 0.7850570
[37,] 0.22040769 0.4408154 0.7795923
[38,] 0.20679805 0.4135961 0.7932019
[39,] 0.21158969 0.4231794 0.7884103
[40,] 0.18885763 0.3777153 0.8111424
[41,] 0.17593856 0.3518771 0.8240614
[42,] 0.14281550 0.2856310 0.8571845
[43,] 0.16895609 0.3379122 0.8310439
[44,] 0.12918177 0.2583635 0.8708182
[45,] 0.10136491 0.2027298 0.8986351
[46,] 0.10003238 0.2000648 0.8999676
[47,] 0.78597713 0.4280457 0.2140229
[48,] 0.87401564 0.2519687 0.1259844
[49,] 0.89215123 0.2156975 0.1078488
[50,] 0.80708896 0.3858221 0.1929110
> postscript(file="/var/www/html/rcomp/tmp/1fdwu1259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2fvar1259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3dj211259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4f5qi1259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5txg61259087393.ps",horizontal=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 = 61
Frequency = 1
1 2 3 4 5 6
-25.8038123 -29.6717988 -6.7424970 -11.2650249 -11.4072829 3.0633013
7 8 9 10 11 12
-14.2913524 -2.9126962 13.4407988 3.9844259 -10.1920177 -1.2013877
13 14 15 16 17 18
-12.8576885 -14.7100002 12.2135701 -0.9504410 10.9137566 13.1750477
19 20 21 22 23 24
9.2779723 14.7127496 26.7292553 9.5792674 7.7420676 9.3718572
25 26 27 28 29 30
-5.0689038 -6.7060697 12.3920420 -1.5870091 5.1055259 -5.4702029
31 32 33 34 35 36
2.5910085 4.8756693 15.2267119 -7.3469878 -3.9523977 7.5319886
37 38 39 40 41 42
-3.1100731 -3.8038187 6.3132255 12.7924965 6.5038644 11.9881095
43 44 45 46 47 48
11.0528791 35.2262225 22.9270166 17.3380607 -2.7307050 15.4326566
49 50 51 52 53 54
-7.3915093 -0.4607027 5.5584364 15.5467966 -16.1554782 -33.4709708
55 56 57 58 59 60
-18.2866336 -19.7383624 -16.1698152 -15.1551207 -12.3424123 -2.5698467
61
-19.0837611
> postscript(file="/var/www/html/rcomp/tmp/6bg531259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -25.8038123 NA
1 -29.6717988 -25.8038123
2 -6.7424970 -29.6717988
3 -11.2650249 -6.7424970
4 -11.4072829 -11.2650249
5 3.0633013 -11.4072829
6 -14.2913524 3.0633013
7 -2.9126962 -14.2913524
8 13.4407988 -2.9126962
9 3.9844259 13.4407988
10 -10.1920177 3.9844259
11 -1.2013877 -10.1920177
12 -12.8576885 -1.2013877
13 -14.7100002 -12.8576885
14 12.2135701 -14.7100002
15 -0.9504410 12.2135701
16 10.9137566 -0.9504410
17 13.1750477 10.9137566
18 9.2779723 13.1750477
19 14.7127496 9.2779723
20 26.7292553 14.7127496
21 9.5792674 26.7292553
22 7.7420676 9.5792674
23 9.3718572 7.7420676
24 -5.0689038 9.3718572
25 -6.7060697 -5.0689038
26 12.3920420 -6.7060697
27 -1.5870091 12.3920420
28 5.1055259 -1.5870091
29 -5.4702029 5.1055259
30 2.5910085 -5.4702029
31 4.8756693 2.5910085
32 15.2267119 4.8756693
33 -7.3469878 15.2267119
34 -3.9523977 -7.3469878
35 7.5319886 -3.9523977
36 -3.1100731 7.5319886
37 -3.8038187 -3.1100731
38 6.3132255 -3.8038187
39 12.7924965 6.3132255
40 6.5038644 12.7924965
41 11.9881095 6.5038644
42 11.0528791 11.9881095
43 35.2262225 11.0528791
44 22.9270166 35.2262225
45 17.3380607 22.9270166
46 -2.7307050 17.3380607
47 15.4326566 -2.7307050
48 -7.3915093 15.4326566
49 -0.4607027 -7.3915093
50 5.5584364 -0.4607027
51 15.5467966 5.5584364
52 -16.1554782 15.5467966
53 -33.4709708 -16.1554782
54 -18.2866336 -33.4709708
55 -19.7383624 -18.2866336
56 -16.1698152 -19.7383624
57 -15.1551207 -16.1698152
58 -12.3424123 -15.1551207
59 -2.5698467 -12.3424123
60 -19.0837611 -2.5698467
61 NA -19.0837611
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -29.6717988 -25.8038123
[2,] -6.7424970 -29.6717988
[3,] -11.2650249 -6.7424970
[4,] -11.4072829 -11.2650249
[5,] 3.0633013 -11.4072829
[6,] -14.2913524 3.0633013
[7,] -2.9126962 -14.2913524
[8,] 13.4407988 -2.9126962
[9,] 3.9844259 13.4407988
[10,] -10.1920177 3.9844259
[11,] -1.2013877 -10.1920177
[12,] -12.8576885 -1.2013877
[13,] -14.7100002 -12.8576885
[14,] 12.2135701 -14.7100002
[15,] -0.9504410 12.2135701
[16,] 10.9137566 -0.9504410
[17,] 13.1750477 10.9137566
[18,] 9.2779723 13.1750477
[19,] 14.7127496 9.2779723
[20,] 26.7292553 14.7127496
[21,] 9.5792674 26.7292553
[22,] 7.7420676 9.5792674
[23,] 9.3718572 7.7420676
[24,] -5.0689038 9.3718572
[25,] -6.7060697 -5.0689038
[26,] 12.3920420 -6.7060697
[27,] -1.5870091 12.3920420
[28,] 5.1055259 -1.5870091
[29,] -5.4702029 5.1055259
[30,] 2.5910085 -5.4702029
[31,] 4.8756693 2.5910085
[32,] 15.2267119 4.8756693
[33,] -7.3469878 15.2267119
[34,] -3.9523977 -7.3469878
[35,] 7.5319886 -3.9523977
[36,] -3.1100731 7.5319886
[37,] -3.8038187 -3.1100731
[38,] 6.3132255 -3.8038187
[39,] 12.7924965 6.3132255
[40,] 6.5038644 12.7924965
[41,] 11.9881095 6.5038644
[42,] 11.0528791 11.9881095
[43,] 35.2262225 11.0528791
[44,] 22.9270166 35.2262225
[45,] 17.3380607 22.9270166
[46,] -2.7307050 17.3380607
[47,] 15.4326566 -2.7307050
[48,] -7.3915093 15.4326566
[49,] -0.4607027 -7.3915093
[50,] 5.5584364 -0.4607027
[51,] 15.5467966 5.5584364
[52,] -16.1554782 15.5467966
[53,] -33.4709708 -16.1554782
[54,] -18.2866336 -33.4709708
[55,] -19.7383624 -18.2866336
[56,] -16.1698152 -19.7383624
[57,] -15.1551207 -16.1698152
[58,] -12.3424123 -15.1551207
[59,] -2.5698467 -12.3424123
[60,] -19.0837611 -2.5698467
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -29.6717988 -25.8038123
2 -6.7424970 -29.6717988
3 -11.2650249 -6.7424970
4 -11.4072829 -11.2650249
5 3.0633013 -11.4072829
6 -14.2913524 3.0633013
7 -2.9126962 -14.2913524
8 13.4407988 -2.9126962
9 3.9844259 13.4407988
10 -10.1920177 3.9844259
11 -1.2013877 -10.1920177
12 -12.8576885 -1.2013877
13 -14.7100002 -12.8576885
14 12.2135701 -14.7100002
15 -0.9504410 12.2135701
16 10.9137566 -0.9504410
17 13.1750477 10.9137566
18 9.2779723 13.1750477
19 14.7127496 9.2779723
20 26.7292553 14.7127496
21 9.5792674 26.7292553
22 7.7420676 9.5792674
23 9.3718572 7.7420676
24 -5.0689038 9.3718572
25 -6.7060697 -5.0689038
26 12.3920420 -6.7060697
27 -1.5870091 12.3920420
28 5.1055259 -1.5870091
29 -5.4702029 5.1055259
30 2.5910085 -5.4702029
31 4.8756693 2.5910085
32 15.2267119 4.8756693
33 -7.3469878 15.2267119
34 -3.9523977 -7.3469878
35 7.5319886 -3.9523977
36 -3.1100731 7.5319886
37 -3.8038187 -3.1100731
38 6.3132255 -3.8038187
39 12.7924965 6.3132255
40 6.5038644 12.7924965
41 11.9881095 6.5038644
42 11.0528791 11.9881095
43 35.2262225 11.0528791
44 22.9270166 35.2262225
45 17.3380607 22.9270166
46 -2.7307050 17.3380607
47 15.4326566 -2.7307050
48 -7.3915093 15.4326566
49 -0.4607027 -7.3915093
50 5.5584364 -0.4607027
51 15.5467966 5.5584364
52 -16.1554782 15.5467966
53 -33.4709708 -16.1554782
54 -18.2866336 -33.4709708
55 -19.7383624 -18.2866336
56 -16.1698152 -19.7383624
57 -15.1551207 -16.1698152
58 -12.3424123 -15.1551207
59 -2.5698467 -12.3424123
60 -19.0837611 -2.5698467
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7x6od1259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8eohs1259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9i31d1259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10c5v31259087393.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11ar5u1259087394.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12cof51259087394.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13hal81259087394.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/144vl21259087394.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/154smm1259087394.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16jvg91259087394.tab")
+ }
>
> system("convert tmp/1fdwu1259087393.ps tmp/1fdwu1259087393.png")
> system("convert tmp/2fvar1259087393.ps tmp/2fvar1259087393.png")
> system("convert tmp/3dj211259087393.ps tmp/3dj211259087393.png")
> system("convert tmp/4f5qi1259087393.ps tmp/4f5qi1259087393.png")
> system("convert tmp/5txg61259087393.ps tmp/5txg61259087393.png")
> system("convert tmp/6bg531259087393.ps tmp/6bg531259087393.png")
> system("convert tmp/7x6od1259087393.ps tmp/7x6od1259087393.png")
> system("convert tmp/8eohs1259087393.ps tmp/8eohs1259087393.png")
> system("convert tmp/9i31d1259087393.ps tmp/9i31d1259087393.png")
> system("convert tmp/10c5v31259087393.ps tmp/10c5v31259087393.png")
>
>
> proc.time()
user system elapsed
2.517 1.588 4.019