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(2756.76,0,2849.27,0,2921.44,0,2981.85,0,3080.58,0,3106.22,0,3119.31,0,3061.26,0,3097.31,0,3161.69,0,3257.16,0,3277.01,0,3295.32,0,3363.99,0,3494.17,0,3667.03,1,3813.06,1,3917.96,1,3895.51,1,3801.06,1,3570.12,0,3701.61,1,3862.27,1,3970.1,1,4138.52,1,4199.75,1,4290.89,1,4443.91,1,4502.64,1,4356.98,1,4591.27,1,4696.96,1,4621.4,1,4562.84,1,4202.52,1,4296.49,1,4435.23,1,4105.18,1,4116.68,1,3844.49,1,3720.98,1,3674.4,1,3857.62,1,3801.06,1,3504.37,1,3032.6,1,3047.03,0,2962.34,1,2197.82,1,2014.45,1,1862.83,0,1905.41,0,1810.99,0,1670.07,0,1864.44,0,2052.02,0,2029.6,0,2070.83,0,2293.41,0,2443.27,0),dim=c(2,60),dimnames=list(c('BEL20','X
'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('BEL20','X
'),1:60))
> 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
BEL20 X\r\r t
1 2756.76 0 1
2 2849.27 0 2
3 2921.44 0 3
4 2981.85 0 4
5 3080.58 0 5
6 3106.22 0 6
7 3119.31 0 7
8 3061.26 0 8
9 3097.31 0 9
10 3161.69 0 10
11 3257.16 0 11
12 3277.01 0 12
13 3295.32 0 13
14 3363.99 0 14
15 3494.17 0 15
16 3667.03 1 16
17 3813.06 1 17
18 3917.96 1 18
19 3895.51 1 19
20 3801.06 1 20
21 3570.12 0 21
22 3701.61 1 22
23 3862.27 1 23
24 3970.10 1 24
25 4138.52 1 25
26 4199.75 1 26
27 4290.89 1 27
28 4443.91 1 28
29 4502.64 1 29
30 4356.98 1 30
31 4591.27 1 31
32 4696.96 1 32
33 4621.40 1 33
34 4562.84 1 34
35 4202.52 1 35
36 4296.49 1 36
37 4435.23 1 37
38 4105.18 1 38
39 4116.68 1 39
40 3844.49 1 40
41 3720.98 1 41
42 3674.40 1 42
43 3857.62 1 43
44 3801.06 1 44
45 3504.37 1 45
46 3032.60 1 46
47 3047.03 0 47
48 2962.34 1 48
49 2197.82 1 49
50 2014.45 1 50
51 1862.83 0 51
52 1905.41 0 52
53 1810.99 0 53
54 1670.07 0 54
55 1864.44 0 55
56 2052.02 0 56
57 2029.60 0 57
58 2070.83 0 58
59 2293.41 0 59
60 2443.27 0 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `X\r\r` t
3339.87 1304.99 -22.52
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1504.36 -321.46 -12.55 341.04 772.77
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3339.865 134.536 24.82 < 2e-16 ***
`X\r\r` 1304.988 124.829 10.45 7.20e-15 ***
t -22.521 3.586 -6.28 4.98e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 475.2 on 57 degrees of freedom
Multiple R-squared: 0.6976, Adjusted R-squared: 0.687
F-statistic: 65.74 on 2 and 57 DF, p-value: 1.577e-15
> 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,] 1.242091e-04 2.484183e-04 0.9998757909
[2,] 5.549159e-05 1.109832e-04 0.9999445084
[3,] 1.251801e-04 2.503603e-04 0.9998748199
[4,] 3.640167e-05 7.280334e-05 0.9999635983
[5,] 5.395463e-06 1.079093e-05 0.9999946045
[6,] 6.841966e-07 1.368393e-06 0.9999993158
[7,] 7.695113e-08 1.539023e-07 0.9999999230
[8,] 8.737035e-09 1.747407e-08 0.9999999913
[9,] 8.885587e-10 1.777117e-09 0.9999999991
[10,] 3.066310e-10 6.132620e-10 0.9999999997
[11,] 4.597904e-11 9.195807e-11 1.0000000000
[12,] 1.613535e-11 3.227071e-11 1.0000000000
[13,] 8.801606e-12 1.760321e-11 1.0000000000
[14,] 1.485873e-12 2.971747e-12 1.0000000000
[15,] 2.136754e-12 4.273507e-12 1.0000000000
[16,] 6.079734e-13 1.215947e-12 1.0000000000
[17,] 6.974973e-11 1.394995e-10 0.9999999999
[18,] 6.169464e-11 1.233893e-10 0.9999999999
[19,] 3.367289e-11 6.734577e-11 1.0000000000
[20,] 3.716202e-11 7.432404e-11 1.0000000000
[21,] 4.532554e-11 9.065108e-11 1.0000000000
[22,] 8.151612e-11 1.630322e-10 0.9999999999
[23,] 4.780827e-10 9.561654e-10 0.9999999995
[24,] 1.149541e-09 2.299081e-09 0.9999999989
[25,] 5.235455e-10 1.047091e-09 0.9999999995
[26,] 5.449118e-10 1.089824e-09 0.9999999995
[27,] 7.185201e-10 1.437040e-09 0.9999999993
[28,] 2.240893e-10 4.481785e-10 0.9999999998
[29,] 6.403631e-11 1.280726e-10 0.9999999999
[30,] 2.877518e-09 5.755036e-09 0.9999999971
[31,] 7.822281e-09 1.564456e-08 0.9999999922
[32,] 6.986477e-09 1.397295e-08 0.9999999930
[33,] 1.569569e-07 3.139137e-07 0.9999998430
[34,] 1.014462e-06 2.028923e-06 0.9999989855
[35,] 2.376005e-05 4.752011e-05 0.9999762399
[36,] 2.334142e-04 4.668285e-04 0.9997665858
[37,] 9.364528e-04 1.872906e-03 0.9990635472
[38,] 2.344553e-03 4.689106e-03 0.9976554471
[39,] 1.035907e-02 2.071815e-02 0.9896409268
[40,] 5.408455e-02 1.081691e-01 0.9459154516
[41,] 1.762988e-01 3.525977e-01 0.8237011563
[42,] 7.426009e-01 5.147981e-01 0.2573990649
[43,] 9.978828e-01 4.234347e-03 0.0021171734
[44,] 9.992109e-01 1.578185e-03 0.0007890923
[45,] 9.989020e-01 2.196015e-03 0.0010980073
[46,] 9.982074e-01 3.585122e-03 0.0017925608
[47,] 9.989012e-01 2.197660e-03 0.0010988299
[48,] 9.983999e-01 3.200215e-03 0.0016001074
[49,] 9.921585e-01 1.568309e-02 0.0078415451
> postscript(file="/var/www/html/rcomp/tmp/1sgzi1258905202.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/2yggf1258905202.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/3fdet1258905202.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/4p51m1258905202.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/5le6g1258905202.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 = 60
Frequency = 1
1 2 3 4 5 6
-560.584272 -445.553413 -350.862553 -267.931694 -146.680835 -98.519975
7 8 9 10 11 12
-62.909116 -98.438256 -39.867397 47.033463 165.024322 207.395181
13 14 15 16 17 18
248.226041 339.416900 492.117760 -617.489710 -448.938850 -321.517991
19 20 21 22 23 24
-321.447131 -393.376272 703.192916 -447.784553 -264.603694 -134.252834
25 26 27 28 29 30
56.688025 140.438885 254.099744 429.640603 510.891463 387.752322
31 32 33 34 35 36
644.563182 772.774041 719.734901 683.695760 345.896619 462.387479
37 38 39 40 41 42
623.648338 316.119198 350.140057 100.470917 -0.518224 -24.577365
43 44 45 46 47 48
181.163495 147.124354 -127.044786 -576.293927 765.645262 -601.512208
49 50 51 52 53 54
-1343.511349 -1504.360489 -328.471301 -263.370441 -335.269582 -453.668722
55 56 57 58 59 60
-236.777863 -26.677004 -26.576144 37.174715 282.275575 454.656434
> postscript(file="/var/www/html/rcomp/tmp/6qu9h1258905202.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -560.584272 NA
1 -445.553413 -560.584272
2 -350.862553 -445.553413
3 -267.931694 -350.862553
4 -146.680835 -267.931694
5 -98.519975 -146.680835
6 -62.909116 -98.519975
7 -98.438256 -62.909116
8 -39.867397 -98.438256
9 47.033463 -39.867397
10 165.024322 47.033463
11 207.395181 165.024322
12 248.226041 207.395181
13 339.416900 248.226041
14 492.117760 339.416900
15 -617.489710 492.117760
16 -448.938850 -617.489710
17 -321.517991 -448.938850
18 -321.447131 -321.517991
19 -393.376272 -321.447131
20 703.192916 -393.376272
21 -447.784553 703.192916
22 -264.603694 -447.784553
23 -134.252834 -264.603694
24 56.688025 -134.252834
25 140.438885 56.688025
26 254.099744 140.438885
27 429.640603 254.099744
28 510.891463 429.640603
29 387.752322 510.891463
30 644.563182 387.752322
31 772.774041 644.563182
32 719.734901 772.774041
33 683.695760 719.734901
34 345.896619 683.695760
35 462.387479 345.896619
36 623.648338 462.387479
37 316.119198 623.648338
38 350.140057 316.119198
39 100.470917 350.140057
40 -0.518224 100.470917
41 -24.577365 -0.518224
42 181.163495 -24.577365
43 147.124354 181.163495
44 -127.044786 147.124354
45 -576.293927 -127.044786
46 765.645262 -576.293927
47 -601.512208 765.645262
48 -1343.511349 -601.512208
49 -1504.360489 -1343.511349
50 -328.471301 -1504.360489
51 -263.370441 -328.471301
52 -335.269582 -263.370441
53 -453.668722 -335.269582
54 -236.777863 -453.668722
55 -26.677004 -236.777863
56 -26.576144 -26.677004
57 37.174715 -26.576144
58 282.275575 37.174715
59 454.656434 282.275575
60 NA 454.656434
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -445.553413 -560.584272
[2,] -350.862553 -445.553413
[3,] -267.931694 -350.862553
[4,] -146.680835 -267.931694
[5,] -98.519975 -146.680835
[6,] -62.909116 -98.519975
[7,] -98.438256 -62.909116
[8,] -39.867397 -98.438256
[9,] 47.033463 -39.867397
[10,] 165.024322 47.033463
[11,] 207.395181 165.024322
[12,] 248.226041 207.395181
[13,] 339.416900 248.226041
[14,] 492.117760 339.416900
[15,] -617.489710 492.117760
[16,] -448.938850 -617.489710
[17,] -321.517991 -448.938850
[18,] -321.447131 -321.517991
[19,] -393.376272 -321.447131
[20,] 703.192916 -393.376272
[21,] -447.784553 703.192916
[22,] -264.603694 -447.784553
[23,] -134.252834 -264.603694
[24,] 56.688025 -134.252834
[25,] 140.438885 56.688025
[26,] 254.099744 140.438885
[27,] 429.640603 254.099744
[28,] 510.891463 429.640603
[29,] 387.752322 510.891463
[30,] 644.563182 387.752322
[31,] 772.774041 644.563182
[32,] 719.734901 772.774041
[33,] 683.695760 719.734901
[34,] 345.896619 683.695760
[35,] 462.387479 345.896619
[36,] 623.648338 462.387479
[37,] 316.119198 623.648338
[38,] 350.140057 316.119198
[39,] 100.470917 350.140057
[40,] -0.518224 100.470917
[41,] -24.577365 -0.518224
[42,] 181.163495 -24.577365
[43,] 147.124354 181.163495
[44,] -127.044786 147.124354
[45,] -576.293927 -127.044786
[46,] 765.645262 -576.293927
[47,] -601.512208 765.645262
[48,] -1343.511349 -601.512208
[49,] -1504.360489 -1343.511349
[50,] -328.471301 -1504.360489
[51,] -263.370441 -328.471301
[52,] -335.269582 -263.370441
[53,] -453.668722 -335.269582
[54,] -236.777863 -453.668722
[55,] -26.677004 -236.777863
[56,] -26.576144 -26.677004
[57,] 37.174715 -26.576144
[58,] 282.275575 37.174715
[59,] 454.656434 282.275575
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -445.553413 -560.584272
2 -350.862553 -445.553413
3 -267.931694 -350.862553
4 -146.680835 -267.931694
5 -98.519975 -146.680835
6 -62.909116 -98.519975
7 -98.438256 -62.909116
8 -39.867397 -98.438256
9 47.033463 -39.867397
10 165.024322 47.033463
11 207.395181 165.024322
12 248.226041 207.395181
13 339.416900 248.226041
14 492.117760 339.416900
15 -617.489710 492.117760
16 -448.938850 -617.489710
17 -321.517991 -448.938850
18 -321.447131 -321.517991
19 -393.376272 -321.447131
20 703.192916 -393.376272
21 -447.784553 703.192916
22 -264.603694 -447.784553
23 -134.252834 -264.603694
24 56.688025 -134.252834
25 140.438885 56.688025
26 254.099744 140.438885
27 429.640603 254.099744
28 510.891463 429.640603
29 387.752322 510.891463
30 644.563182 387.752322
31 772.774041 644.563182
32 719.734901 772.774041
33 683.695760 719.734901
34 345.896619 683.695760
35 462.387479 345.896619
36 623.648338 462.387479
37 316.119198 623.648338
38 350.140057 316.119198
39 100.470917 350.140057
40 -0.518224 100.470917
41 -24.577365 -0.518224
42 181.163495 -24.577365
43 147.124354 181.163495
44 -127.044786 147.124354
45 -576.293927 -127.044786
46 765.645262 -576.293927
47 -601.512208 765.645262
48 -1343.511349 -601.512208
49 -1504.360489 -1343.511349
50 -328.471301 -1504.360489
51 -263.370441 -328.471301
52 -335.269582 -263.370441
53 -453.668722 -335.269582
54 -236.777863 -453.668722
55 -26.677004 -236.777863
56 -26.576144 -26.677004
57 37.174715 -26.576144
58 282.275575 37.174715
59 454.656434 282.275575
> 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/7uwc51258905202.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/8xj6r1258905202.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/91pup1258905202.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/105siw1258905202.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/1126ys1258905202.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/12d6z21258905202.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/130xwo1258905202.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/140oaj1258905202.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/15vn0m1258905202.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/166jds1258905202.tab")
+ }
>
> system("convert tmp/1sgzi1258905202.ps tmp/1sgzi1258905202.png")
> system("convert tmp/2yggf1258905202.ps tmp/2yggf1258905202.png")
> system("convert tmp/3fdet1258905202.ps tmp/3fdet1258905202.png")
> system("convert tmp/4p51m1258905202.ps tmp/4p51m1258905202.png")
> system("convert tmp/5le6g1258905202.ps tmp/5le6g1258905202.png")
> system("convert tmp/6qu9h1258905202.ps tmp/6qu9h1258905202.png")
> system("convert tmp/7uwc51258905202.ps tmp/7uwc51258905202.png")
> system("convert tmp/8xj6r1258905202.ps tmp/8xj6r1258905202.png")
> system("convert tmp/91pup1258905202.ps tmp/91pup1258905202.png")
> system("convert tmp/105siw1258905202.ps tmp/105siw1258905202.png")
>
>
> proc.time()
user system elapsed
2.407 1.576 3.247