R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(239.4,192,321.9,231.2,362.7,250.8,413.6,268.4,407.1,266.9,383.2,268.5,347.7,268.2,333.8,265.3,312.3,253.8,295.4,243.4,283.3,213.6,287.6,221,265.7,227.3,250.2,221.6,234.7,222.1,244,232.2,231.2,229.6,223.8,238.9,223.5,238.2,210.5,223.9,201.6,215,190.7,211.1,207.5,210.6,198.8,206.6,196.6,207,204.2,201.7,227.4,204.5,229.7,204.5,217.9,195.1,221.4,205.5,216.3,187.5,197,173.5,193.8,172.3,196.8,167.5,180.5,157.5,174.8,151.1,181.6,148.5,190,147.9,190.6,145.6,179,139.8,174.1,138.9,161.1,141.4,168.6,148.7,169.4,150.9,152.2,147.3,148.3,144.5,137.7,134,145,135.1,153.4,131.4,141.7,128.4,142.7,127.6,135.9,127.4,131.8,124,134.6,123.5,127.5,128,126.5,129.9,118.7,127.6,117.1,121.8,110.7,114.1,107.1,111.4,105.4,109.1),dim=c(2,61),dimnames=list(c('alg_indexcijfer_grondstoffen','indexcijfer_industr_grondstoffen'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('alg_indexcijfer_grondstoffen','indexcijfer_industr_grondstoffen'),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 = '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.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
alg_indexcijfer_grondstoffen indexcijfer_industr_grondstoffen
1 239.4 192.0
2 321.9 231.2
3 362.7 250.8
4 413.6 268.4
5 407.1 266.9
6 383.2 268.5
7 347.7 268.2
8 333.8 265.3
9 312.3 253.8
10 295.4 243.4
11 283.3 213.6
12 287.6 221.0
13 265.7 227.3
14 250.2 221.6
15 234.7 222.1
16 244.0 232.2
17 231.2 229.6
18 223.8 238.9
19 223.5 238.2
20 210.5 223.9
21 201.6 215.0
22 190.7 211.1
23 207.5 210.6
24 198.8 206.6
25 196.6 207.0
26 204.2 201.7
27 227.4 204.5
28 229.7 204.5
29 217.9 195.1
30 221.4 205.5
31 216.3 187.5
32 197.0 173.5
33 193.8 172.3
34 196.8 167.5
35 180.5 157.5
36 174.8 151.1
37 181.6 148.5
38 190.0 147.9
39 190.6 145.6
40 179.0 139.8
41 174.1 138.9
42 161.1 141.4
43 168.6 148.7
44 169.4 150.9
45 152.2 147.3
46 148.3 144.5
47 137.7 134.0
48 145.0 135.1
49 153.4 131.4
50 141.7 128.4
51 142.7 127.6
52 135.9 127.4
53 131.8 124.0
54 134.6 123.5
55 127.5 128.0
56 126.5 129.9
57 118.7 127.6
58 117.1 121.8
59 110.7 114.1
60 107.1 111.4
61 105.4 109.1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) indexcijfer_industr_grondstoffen
-46.020 1.395
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-63.356 -11.781 1.052 10.766 85.303
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -46.01961 15.70882 -2.93 0.00482 **
indexcijfer_industr_grondstoffen 1.39462 0.08287 16.83 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 31.53 on 59 degrees of freedom
Multiple R-squared: 0.8276, Adjusted R-squared: 0.8247
F-statistic: 283.2 on 1 and 59 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.01291988 2.583975e-02 9.870801e-01
[2,] 0.10819962 2.163992e-01 8.918004e-01
[3,] 0.67424943 6.515011e-01 3.257506e-01
[4,] 0.89395346 2.120931e-01 1.060465e-01
[5,] 0.95346477 9.307045e-02 4.653523e-02
[6,] 0.97243294 5.513413e-02 2.756706e-02
[7,] 0.98209087 3.581825e-02 1.790913e-02
[8,] 0.99133994 1.732013e-02 8.660064e-03
[9,] 0.99604121 7.917579e-03 3.958790e-03
[10,] 0.99776199 4.476024e-03 2.238012e-03
[11,] 0.99907349 1.853012e-03 9.265061e-04
[12,] 0.99971780 5.644020e-04 2.822010e-04
[13,] 0.99990680 1.864020e-04 9.320100e-05
[14,] 0.99999416 1.167549e-05 5.837747e-06
[15,] 0.99999919 1.624868e-06 8.124339e-07
[16,] 0.99999959 8.212955e-07 4.106477e-07
[17,] 0.99999970 6.039959e-07 3.019979e-07
[18,] 0.99999991 1.812001e-07 9.060007e-08
[19,] 0.99999988 2.335024e-07 1.167512e-07
[20,] 0.99999992 1.544792e-07 7.723959e-08
[21,] 0.99999998 3.286205e-08 1.643103e-08
[22,] 0.99999999 1.905360e-08 9.526800e-09
[23,] 0.99999998 3.871981e-08 1.935990e-08
[24,] 0.99999996 7.950543e-08 3.975272e-08
[25,] 0.99999993 1.304247e-07 6.521236e-08
[26,] 0.99999997 5.907963e-08 2.953982e-08
[27,] 0.99999997 6.975768e-08 3.487884e-08
[28,] 0.99999996 7.301210e-08 3.650605e-08
[29,] 0.99999997 6.414501e-08 3.207250e-08
[30,] 0.99999995 9.616605e-08 4.808303e-08
[31,] 0.99999992 1.603197e-07 8.015984e-08
[32,] 0.99999983 3.456826e-07 1.728413e-07
[33,] 0.99999968 6.496930e-07 3.248465e-07
[34,] 0.99999973 5.419324e-07 2.709662e-07
[35,] 0.99999992 1.553377e-07 7.766883e-08
[36,] 0.99999999 2.884598e-08 1.442299e-08
[37,] 1.00000000 3.688096e-09 1.844048e-09
[38,] 0.99999999 1.064481e-08 5.322403e-09
[39,] 0.99999998 3.767837e-08 1.883918e-08
[40,] 0.99999993 1.388588e-07 6.942939e-08
[41,] 0.99999976 4.885913e-07 2.442956e-07
[42,] 0.99999939 1.226572e-06 6.132861e-07
[43,] 0.99999784 4.326096e-06 2.163048e-06
[44,] 0.99999056 1.888231e-05 9.441156e-06
[45,] 0.99998951 2.098341e-05 1.049171e-05
[46,] 0.99997355 5.289196e-05 2.644598e-05
[47,] 0.99996872 6.256747e-05 3.128374e-05
[48,] 0.99991217 1.756569e-04 8.782845e-05
[49,] 0.99980606 3.878739e-04 1.939369e-04
[50,] 0.99998854 2.292330e-05 1.146165e-05
[51,] 0.99996659 6.681548e-05 3.340774e-05
[52,] 0.99990206 1.958733e-04 9.793666e-05
> postscript(file="/var/www/html/rcomp/tmp/12iba1227788082.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/2ur2l1227788082.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/3d4zt1227788082.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/4mdm61227788082.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/5sl961227788082.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
17.6519497 45.4827186 58.9481030 85.3027339 80.8946688 54.7632716
7 8 9 10 11 12
19.6816585 9.8260660 4.3642332 1.9683150 31.4280876 25.4078756
13 14 15 16 17 18
-5.2782508 -12.8288983 -29.0262099 -33.8119047 -42.9858843 -63.3558804
19 20 21 22 23 24
-62.6796442 -55.7365318 -52.2243849 -57.6853543 -40.1880426 -43.3095497
25 26 27 28 29 30
-46.0673990 -31.0758958 -11.7808408 -9.4808408 -8.1713824 -19.1754641
31 32 33 34 35 36
0.8277543 1.0524797 -0.4739724 9.2202192 6.8664516 10.0920403
37 38 39 40 41 42
20.5180608 29.7548347 33.5624682 30.0512830 26.4064439 9.9198858
43 44 45 46 47 48
7.2391361 4.9709650 -7.2083913 -7.2034462 -3.1599022 2.6060122
49 50 51 52 53 54
16.1661182 8.6499880 10.7656866 4.2446112 4.8863302 8.3836419
55 56 57 58 59 60
-4.9921627 -8.6419469 -13.2343134 -6.7454986 -2.4068996 -2.2414169
61
-0.7337834
> postscript(file="/var/www/html/rcomp/tmp/6ehso1227788082.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 17.6519497 NA
1 45.4827186 17.6519497
2 58.9481030 45.4827186
3 85.3027339 58.9481030
4 80.8946688 85.3027339
5 54.7632716 80.8946688
6 19.6816585 54.7632716
7 9.8260660 19.6816585
8 4.3642332 9.8260660
9 1.9683150 4.3642332
10 31.4280876 1.9683150
11 25.4078756 31.4280876
12 -5.2782508 25.4078756
13 -12.8288983 -5.2782508
14 -29.0262099 -12.8288983
15 -33.8119047 -29.0262099
16 -42.9858843 -33.8119047
17 -63.3558804 -42.9858843
18 -62.6796442 -63.3558804
19 -55.7365318 -62.6796442
20 -52.2243849 -55.7365318
21 -57.6853543 -52.2243849
22 -40.1880426 -57.6853543
23 -43.3095497 -40.1880426
24 -46.0673990 -43.3095497
25 -31.0758958 -46.0673990
26 -11.7808408 -31.0758958
27 -9.4808408 -11.7808408
28 -8.1713824 -9.4808408
29 -19.1754641 -8.1713824
30 0.8277543 -19.1754641
31 1.0524797 0.8277543
32 -0.4739724 1.0524797
33 9.2202192 -0.4739724
34 6.8664516 9.2202192
35 10.0920403 6.8664516
36 20.5180608 10.0920403
37 29.7548347 20.5180608
38 33.5624682 29.7548347
39 30.0512830 33.5624682
40 26.4064439 30.0512830
41 9.9198858 26.4064439
42 7.2391361 9.9198858
43 4.9709650 7.2391361
44 -7.2083913 4.9709650
45 -7.2034462 -7.2083913
46 -3.1599022 -7.2034462
47 2.6060122 -3.1599022
48 16.1661182 2.6060122
49 8.6499880 16.1661182
50 10.7656866 8.6499880
51 4.2446112 10.7656866
52 4.8863302 4.2446112
53 8.3836419 4.8863302
54 -4.9921627 8.3836419
55 -8.6419469 -4.9921627
56 -13.2343134 -8.6419469
57 -6.7454986 -13.2343134
58 -2.4068996 -6.7454986
59 -2.2414169 -2.4068996
60 -0.7337834 -2.2414169
61 NA -0.7337834
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 45.4827186 17.6519497
[2,] 58.9481030 45.4827186
[3,] 85.3027339 58.9481030
[4,] 80.8946688 85.3027339
[5,] 54.7632716 80.8946688
[6,] 19.6816585 54.7632716
[7,] 9.8260660 19.6816585
[8,] 4.3642332 9.8260660
[9,] 1.9683150 4.3642332
[10,] 31.4280876 1.9683150
[11,] 25.4078756 31.4280876
[12,] -5.2782508 25.4078756
[13,] -12.8288983 -5.2782508
[14,] -29.0262099 -12.8288983
[15,] -33.8119047 -29.0262099
[16,] -42.9858843 -33.8119047
[17,] -63.3558804 -42.9858843
[18,] -62.6796442 -63.3558804
[19,] -55.7365318 -62.6796442
[20,] -52.2243849 -55.7365318
[21,] -57.6853543 -52.2243849
[22,] -40.1880426 -57.6853543
[23,] -43.3095497 -40.1880426
[24,] -46.0673990 -43.3095497
[25,] -31.0758958 -46.0673990
[26,] -11.7808408 -31.0758958
[27,] -9.4808408 -11.7808408
[28,] -8.1713824 -9.4808408
[29,] -19.1754641 -8.1713824
[30,] 0.8277543 -19.1754641
[31,] 1.0524797 0.8277543
[32,] -0.4739724 1.0524797
[33,] 9.2202192 -0.4739724
[34,] 6.8664516 9.2202192
[35,] 10.0920403 6.8664516
[36,] 20.5180608 10.0920403
[37,] 29.7548347 20.5180608
[38,] 33.5624682 29.7548347
[39,] 30.0512830 33.5624682
[40,] 26.4064439 30.0512830
[41,] 9.9198858 26.4064439
[42,] 7.2391361 9.9198858
[43,] 4.9709650 7.2391361
[44,] -7.2083913 4.9709650
[45,] -7.2034462 -7.2083913
[46,] -3.1599022 -7.2034462
[47,] 2.6060122 -3.1599022
[48,] 16.1661182 2.6060122
[49,] 8.6499880 16.1661182
[50,] 10.7656866 8.6499880
[51,] 4.2446112 10.7656866
[52,] 4.8863302 4.2446112
[53,] 8.3836419 4.8863302
[54,] -4.9921627 8.3836419
[55,] -8.6419469 -4.9921627
[56,] -13.2343134 -8.6419469
[57,] -6.7454986 -13.2343134
[58,] -2.4068996 -6.7454986
[59,] -2.2414169 -2.4068996
[60,] -0.7337834 -2.2414169
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 45.4827186 17.6519497
2 58.9481030 45.4827186
3 85.3027339 58.9481030
4 80.8946688 85.3027339
5 54.7632716 80.8946688
6 19.6816585 54.7632716
7 9.8260660 19.6816585
8 4.3642332 9.8260660
9 1.9683150 4.3642332
10 31.4280876 1.9683150
11 25.4078756 31.4280876
12 -5.2782508 25.4078756
13 -12.8288983 -5.2782508
14 -29.0262099 -12.8288983
15 -33.8119047 -29.0262099
16 -42.9858843 -33.8119047
17 -63.3558804 -42.9858843
18 -62.6796442 -63.3558804
19 -55.7365318 -62.6796442
20 -52.2243849 -55.7365318
21 -57.6853543 -52.2243849
22 -40.1880426 -57.6853543
23 -43.3095497 -40.1880426
24 -46.0673990 -43.3095497
25 -31.0758958 -46.0673990
26 -11.7808408 -31.0758958
27 -9.4808408 -11.7808408
28 -8.1713824 -9.4808408
29 -19.1754641 -8.1713824
30 0.8277543 -19.1754641
31 1.0524797 0.8277543
32 -0.4739724 1.0524797
33 9.2202192 -0.4739724
34 6.8664516 9.2202192
35 10.0920403 6.8664516
36 20.5180608 10.0920403
37 29.7548347 20.5180608
38 33.5624682 29.7548347
39 30.0512830 33.5624682
40 26.4064439 30.0512830
41 9.9198858 26.4064439
42 7.2391361 9.9198858
43 4.9709650 7.2391361
44 -7.2083913 4.9709650
45 -7.2034462 -7.2083913
46 -3.1599022 -7.2034462
47 2.6060122 -3.1599022
48 16.1661182 2.6060122
49 8.6499880 16.1661182
50 10.7656866 8.6499880
51 4.2446112 10.7656866
52 4.8863302 4.2446112
53 8.3836419 4.8863302
54 -4.9921627 8.3836419
55 -8.6419469 -4.9921627
56 -13.2343134 -8.6419469
57 -6.7454986 -13.2343134
58 -2.4068996 -6.7454986
59 -2.2414169 -2.4068996
60 -0.7337834 -2.2414169
> 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/709xl1227788082.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/8b03p1227788082.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/97xcm1227788082.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/10gaib1227788082.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/119wht1227788082.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/12ebfd1227788082.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/13maup1227788082.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/14s7cq1227788082.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/151l911227788082.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/16ld551227788082.tab")
+ }
>
> system("convert tmp/12iba1227788082.ps tmp/12iba1227788082.png")
> system("convert tmp/2ur2l1227788082.ps tmp/2ur2l1227788082.png")
> system("convert tmp/3d4zt1227788082.ps tmp/3d4zt1227788082.png")
> system("convert tmp/4mdm61227788082.ps tmp/4mdm61227788082.png")
> system("convert tmp/5sl961227788082.ps tmp/5sl961227788082.png")
> system("convert tmp/6ehso1227788082.ps tmp/6ehso1227788082.png")
> system("convert tmp/709xl1227788082.ps tmp/709xl1227788082.png")
> system("convert tmp/8b03p1227788082.ps tmp/8b03p1227788082.png")
> system("convert tmp/97xcm1227788082.ps tmp/97xcm1227788082.png")
> system("convert tmp/10gaib1227788082.ps tmp/10gaib1227788082.png")
>
>
> proc.time()
user system elapsed
2.430 1.533 3.338