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(1576.23,1546.37,1545.05,1552.34,1594.3,1605.78,1673.21,1612.94,1566.34,1530.17,1582.54,1702.16,1701.93,1811.15,1924.2,2034.25,2011.13,2013.04,2151.67,1902.09,1944.01,1916.67,1967.31,2119.88,2216.38,2522.83,2647.64,2631.23,2693.41,3021.76,2953.67,2796.8,2672.05,2251.23,2046.08,2420.04,2608.89,2660.47,2493.98,2541.7,2554.6,2699.61,2805.48,2956.66,3149.51,3372.5,3379.33,3517.54,3527.34,3281.06,3089.65,3222.76,3165.76,3232.43,3229.54,3071.74,2850.17),dim=c(1,57),dimnames=list(c('PrijsCacao'),1:57))
> y <- array(NA,dim=c(1,57),dimnames=list(c('PrijsCacao'),1:57))
> 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 = 'Include Monthly 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
PrijsCacao M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 1576.23 1 0 0 0 0 0 0 0 0 0 0 1
2 1546.37 0 1 0 0 0 0 0 0 0 0 0 2
3 1545.05 0 0 1 0 0 0 0 0 0 0 0 3
4 1552.34 0 0 0 1 0 0 0 0 0 0 0 4
5 1594.30 0 0 0 0 1 0 0 0 0 0 0 5
6 1605.78 0 0 0 0 0 1 0 0 0 0 0 6
7 1673.21 0 0 0 0 0 0 1 0 0 0 0 7
8 1612.94 0 0 0 0 0 0 0 1 0 0 0 8
9 1566.34 0 0 0 0 0 0 0 0 1 0 0 9
10 1530.17 0 0 0 0 0 0 0 0 0 1 0 10
11 1582.54 0 0 0 0 0 0 0 0 0 0 1 11
12 1702.16 0 0 0 0 0 0 0 0 0 0 0 12
13 1701.93 1 0 0 0 0 0 0 0 0 0 0 13
14 1811.15 0 1 0 0 0 0 0 0 0 0 0 14
15 1924.20 0 0 1 0 0 0 0 0 0 0 0 15
16 2034.25 0 0 0 1 0 0 0 0 0 0 0 16
17 2011.13 0 0 0 0 1 0 0 0 0 0 0 17
18 2013.04 0 0 0 0 0 1 0 0 0 0 0 18
19 2151.67 0 0 0 0 0 0 1 0 0 0 0 19
20 1902.09 0 0 0 0 0 0 0 1 0 0 0 20
21 1944.01 0 0 0 0 0 0 0 0 1 0 0 21
22 1916.67 0 0 0 0 0 0 0 0 0 1 0 22
23 1967.31 0 0 0 0 0 0 0 0 0 0 1 23
24 2119.88 0 0 0 0 0 0 0 0 0 0 0 24
25 2216.38 1 0 0 0 0 0 0 0 0 0 0 25
26 2522.83 0 1 0 0 0 0 0 0 0 0 0 26
27 2647.64 0 0 1 0 0 0 0 0 0 0 0 27
28 2631.23 0 0 0 1 0 0 0 0 0 0 0 28
29 2693.41 0 0 0 0 1 0 0 0 0 0 0 29
30 3021.76 0 0 0 0 0 1 0 0 0 0 0 30
31 2953.67 0 0 0 0 0 0 1 0 0 0 0 31
32 2796.80 0 0 0 0 0 0 0 1 0 0 0 32
33 2672.05 0 0 0 0 0 0 0 0 1 0 0 33
34 2251.23 0 0 0 0 0 0 0 0 0 1 0 34
35 2046.08 0 0 0 0 0 0 0 0 0 0 1 35
36 2420.04 0 0 0 0 0 0 0 0 0 0 0 36
37 2608.89 1 0 0 0 0 0 0 0 0 0 0 37
38 2660.47 0 1 0 0 0 0 0 0 0 0 0 38
39 2493.98 0 0 1 0 0 0 0 0 0 0 0 39
40 2541.70 0 0 0 1 0 0 0 0 0 0 0 40
41 2554.60 0 0 0 0 1 0 0 0 0 0 0 41
42 2699.61 0 0 0 0 0 1 0 0 0 0 0 42
43 2805.48 0 0 0 0 0 0 1 0 0 0 0 43
44 2956.66 0 0 0 0 0 0 0 1 0 0 0 44
45 3149.51 0 0 0 0 0 0 0 0 1 0 0 45
46 3372.50 0 0 0 0 0 0 0 0 0 1 0 46
47 3379.33 0 0 0 0 0 0 0 0 0 0 1 47
48 3517.54 0 0 0 0 0 0 0 0 0 0 0 48
49 3527.34 1 0 0 0 0 0 0 0 0 0 0 49
50 3281.06 0 1 0 0 0 0 0 0 0 0 0 50
51 3089.65 0 0 1 0 0 0 0 0 0 0 0 51
52 3222.76 0 0 0 1 0 0 0 0 0 0 0 52
53 3165.76 0 0 0 0 1 0 0 0 0 0 0 53
54 3232.43 0 0 0 0 0 1 0 0 0 0 0 54
55 3229.54 0 0 0 0 0 0 1 0 0 0 0 55
56 3071.74 0 0 0 0 0 0 0 1 0 0 0 56
57 2850.17 0 0 0 0 0 0 0 0 1 0 0 57
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
1384.864 62.089 65.143 5.703 26.887 -0.897
M6 M7 M8 M9 M10 M11
74.619 87.641 -42.195 -108.993 -101.926 -160.922
t
35.168
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-430.28 -139.28 -45.47 72.65 507.24
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1384.864 141.256 9.804 1.23e-12 ***
M1 62.089 170.633 0.364 0.718
M2 65.143 170.521 0.382 0.704
M3 5.703 170.433 0.033 0.973
M4 26.887 170.370 0.158 0.875
M5 -0.897 170.333 -0.005 0.996
M6 74.619 170.321 0.438 0.663
M7 87.641 170.333 0.515 0.609
M8 -42.195 170.370 -0.248 0.806
M9 -108.993 170.433 -0.640 0.526
M10 -101.927 179.581 -0.568 0.573
M11 -160.922 179.545 -0.896 0.375
t 35.168 2.065 17.032 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 253.9 on 44 degrees of freedom
Multiple R-squared: 0.871, Adjusted R-squared: 0.8358
F-statistic: 24.76 on 12 and 44 DF, p-value: 1.131e-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,] 5.344086e-02 1.068817e-01 0.9465591
[2,] 1.807306e-02 3.614611e-02 0.9819269
[3,] 5.398979e-03 1.079796e-02 0.9946010
[4,] 2.070349e-03 4.140697e-03 0.9979297
[5,] 6.208275e-04 1.241655e-03 0.9993792
[6,] 1.497684e-04 2.995368e-04 0.9998502
[7,] 3.772199e-05 7.544397e-05 0.9999623
[8,] 8.295003e-06 1.659001e-05 0.9999917
[9,] 2.146128e-06 4.292256e-06 0.9999979
[10,] 5.160746e-07 1.032149e-06 0.9999995
[11,] 3.735002e-06 7.470005e-06 0.9999963
[12,] 1.540936e-05 3.081872e-05 0.9999846
[13,] 1.046374e-05 2.092748e-05 0.9999895
[14,] 1.028938e-05 2.057877e-05 0.9999897
[15,] 3.802960e-04 7.605919e-04 0.9996197
[16,] 8.737362e-04 1.747472e-03 0.9991263
[17,] 1.616139e-03 3.232279e-03 0.9983839
[18,] 2.265659e-03 4.531318e-03 0.9977343
[19,] 3.490417e-03 6.980834e-03 0.9965096
[20,] 3.907300e-02 7.814600e-02 0.9609270
[21,] 8.376745e-02 1.675349e-01 0.9162326
[22,] 1.261503e-01 2.523005e-01 0.8738497
[23,] 1.083778e-01 2.167556e-01 0.8916222
[24,] 1.279562e-01 2.559125e-01 0.8720438
[25,] 1.661100e-01 3.322200e-01 0.8338900
[26,] 1.999797e-01 3.999594e-01 0.8000203
> postscript(file="/var/www/html/rcomp/tmp/1waqg1291062143.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/www/html/rcomp/tmp/2waqg1291062143.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/www/html/rcomp/tmp/3okpj1291062143.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/www/html/rcomp/tmp/4okpj1291062143.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/www/html/rcomp/tmp/5okpj1291062143.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 = 57
Frequency = 1
1 2 3 4 5
94.10847619 26.02647619 48.97847619 -0.08352381 34.49247619
6 7 8 9 10
-64.71152381 -45.47152381 -11.07352381 -26.04352381 -104.44814286
11 12 13 14 15
-28.25064286 -104.72064286 -202.20776190 -131.20976190 6.11223810
16 17 18 19 20
59.81023810 29.30623810 -79.46776190 10.97223810 -143.93976190
21 22 23 24 25
-70.38976190 -139.96438095 -65.49688095 -109.01688095 -109.77400000
26 27 28 29 30
158.45400000 307.53600000 234.77400000 289.57000000 507.23600000
31 32 33 34 35
390.95600000 328.75400000 235.63400000 -227.42061905 -408.74311905
36 37 38 39 40
-230.87311905 -139.28023810 -125.92223810 -268.14023810 -276.77223810
41 42 43 44 45
-271.25623810 -236.93023810 -179.25023810 66.59776190 291.07776190
46 47 48 49 50
471.83314286 502.49064286 444.61064286 357.15352381 72.65152381
51 52 53 54 55
-94.48647619 -17.72847619 -82.11247619 -126.12647619 -177.20647619
56 57
-240.33847619 -430.27847619
> postscript(file="/var/www/html/rcomp/tmp/6hb641291062143.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 = 57
Frequency = 1
lag(myerror, k = 1) myerror
0 94.10847619 NA
1 26.02647619 94.10847619
2 48.97847619 26.02647619
3 -0.08352381 48.97847619
4 34.49247619 -0.08352381
5 -64.71152381 34.49247619
6 -45.47152381 -64.71152381
7 -11.07352381 -45.47152381
8 -26.04352381 -11.07352381
9 -104.44814286 -26.04352381
10 -28.25064286 -104.44814286
11 -104.72064286 -28.25064286
12 -202.20776190 -104.72064286
13 -131.20976190 -202.20776190
14 6.11223810 -131.20976190
15 59.81023810 6.11223810
16 29.30623810 59.81023810
17 -79.46776190 29.30623810
18 10.97223810 -79.46776190
19 -143.93976190 10.97223810
20 -70.38976190 -143.93976190
21 -139.96438095 -70.38976190
22 -65.49688095 -139.96438095
23 -109.01688095 -65.49688095
24 -109.77400000 -109.01688095
25 158.45400000 -109.77400000
26 307.53600000 158.45400000
27 234.77400000 307.53600000
28 289.57000000 234.77400000
29 507.23600000 289.57000000
30 390.95600000 507.23600000
31 328.75400000 390.95600000
32 235.63400000 328.75400000
33 -227.42061905 235.63400000
34 -408.74311905 -227.42061905
35 -230.87311905 -408.74311905
36 -139.28023810 -230.87311905
37 -125.92223810 -139.28023810
38 -268.14023810 -125.92223810
39 -276.77223810 -268.14023810
40 -271.25623810 -276.77223810
41 -236.93023810 -271.25623810
42 -179.25023810 -236.93023810
43 66.59776190 -179.25023810
44 291.07776190 66.59776190
45 471.83314286 291.07776190
46 502.49064286 471.83314286
47 444.61064286 502.49064286
48 357.15352381 444.61064286
49 72.65152381 357.15352381
50 -94.48647619 72.65152381
51 -17.72847619 -94.48647619
52 -82.11247619 -17.72847619
53 -126.12647619 -82.11247619
54 -177.20647619 -126.12647619
55 -240.33847619 -177.20647619
56 -430.27847619 -240.33847619
57 NA -430.27847619
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 26.02647619 94.10847619
[2,] 48.97847619 26.02647619
[3,] -0.08352381 48.97847619
[4,] 34.49247619 -0.08352381
[5,] -64.71152381 34.49247619
[6,] -45.47152381 -64.71152381
[7,] -11.07352381 -45.47152381
[8,] -26.04352381 -11.07352381
[9,] -104.44814286 -26.04352381
[10,] -28.25064286 -104.44814286
[11,] -104.72064286 -28.25064286
[12,] -202.20776190 -104.72064286
[13,] -131.20976190 -202.20776190
[14,] 6.11223810 -131.20976190
[15,] 59.81023810 6.11223810
[16,] 29.30623810 59.81023810
[17,] -79.46776190 29.30623810
[18,] 10.97223810 -79.46776190
[19,] -143.93976190 10.97223810
[20,] -70.38976190 -143.93976190
[21,] -139.96438095 -70.38976190
[22,] -65.49688095 -139.96438095
[23,] -109.01688095 -65.49688095
[24,] -109.77400000 -109.01688095
[25,] 158.45400000 -109.77400000
[26,] 307.53600000 158.45400000
[27,] 234.77400000 307.53600000
[28,] 289.57000000 234.77400000
[29,] 507.23600000 289.57000000
[30,] 390.95600000 507.23600000
[31,] 328.75400000 390.95600000
[32,] 235.63400000 328.75400000
[33,] -227.42061905 235.63400000
[34,] -408.74311905 -227.42061905
[35,] -230.87311905 -408.74311905
[36,] -139.28023810 -230.87311905
[37,] -125.92223810 -139.28023810
[38,] -268.14023810 -125.92223810
[39,] -276.77223810 -268.14023810
[40,] -271.25623810 -276.77223810
[41,] -236.93023810 -271.25623810
[42,] -179.25023810 -236.93023810
[43,] 66.59776190 -179.25023810
[44,] 291.07776190 66.59776190
[45,] 471.83314286 291.07776190
[46,] 502.49064286 471.83314286
[47,] 444.61064286 502.49064286
[48,] 357.15352381 444.61064286
[49,] 72.65152381 357.15352381
[50,] -94.48647619 72.65152381
[51,] -17.72847619 -94.48647619
[52,] -82.11247619 -17.72847619
[53,] -126.12647619 -82.11247619
[54,] -177.20647619 -126.12647619
[55,] -240.33847619 -177.20647619
[56,] -430.27847619 -240.33847619
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 26.02647619 94.10847619
2 48.97847619 26.02647619
3 -0.08352381 48.97847619
4 34.49247619 -0.08352381
5 -64.71152381 34.49247619
6 -45.47152381 -64.71152381
7 -11.07352381 -45.47152381
8 -26.04352381 -11.07352381
9 -104.44814286 -26.04352381
10 -28.25064286 -104.44814286
11 -104.72064286 -28.25064286
12 -202.20776190 -104.72064286
13 -131.20976190 -202.20776190
14 6.11223810 -131.20976190
15 59.81023810 6.11223810
16 29.30623810 59.81023810
17 -79.46776190 29.30623810
18 10.97223810 -79.46776190
19 -143.93976190 10.97223810
20 -70.38976190 -143.93976190
21 -139.96438095 -70.38976190
22 -65.49688095 -139.96438095
23 -109.01688095 -65.49688095
24 -109.77400000 -109.01688095
25 158.45400000 -109.77400000
26 307.53600000 158.45400000
27 234.77400000 307.53600000
28 289.57000000 234.77400000
29 507.23600000 289.57000000
30 390.95600000 507.23600000
31 328.75400000 390.95600000
32 235.63400000 328.75400000
33 -227.42061905 235.63400000
34 -408.74311905 -227.42061905
35 -230.87311905 -408.74311905
36 -139.28023810 -230.87311905
37 -125.92223810 -139.28023810
38 -268.14023810 -125.92223810
39 -276.77223810 -268.14023810
40 -271.25623810 -276.77223810
41 -236.93023810 -271.25623810
42 -179.25023810 -236.93023810
43 66.59776190 -179.25023810
44 291.07776190 66.59776190
45 471.83314286 291.07776190
46 502.49064286 471.83314286
47 444.61064286 502.49064286
48 357.15352381 444.61064286
49 72.65152381 357.15352381
50 -94.48647619 72.65152381
51 -17.72847619 -94.48647619
52 -82.11247619 -17.72847619
53 -126.12647619 -82.11247619
54 -177.20647619 -126.12647619
55 -240.33847619 -177.20647619
56 -430.27847619 -240.33847619
> 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/7sk5p1291062143.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/www/html/rcomp/tmp/8sk5p1291062143.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/www/html/rcomp/tmp/9sk5p1291062143.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/www/html/rcomp/tmp/102tna1291062143.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/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/11oc3x1291062143.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/129c2l1291062143.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/13n40u1291062143.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/1495y01291062143.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/15cneo1291062143.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/16qfcf1291062143.tab")
+ }
>
> try(system("convert tmp/1waqg1291062143.ps tmp/1waqg1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/2waqg1291062143.ps tmp/2waqg1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/3okpj1291062143.ps tmp/3okpj1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/4okpj1291062143.ps tmp/4okpj1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/5okpj1291062143.ps tmp/5okpj1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/6hb641291062143.ps tmp/6hb641291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/7sk5p1291062143.ps tmp/7sk5p1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/8sk5p1291062143.ps tmp/8sk5p1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/9sk5p1291062143.ps tmp/9sk5p1291062143.png",intern=TRUE))
character(0)
> try(system("convert tmp/102tna1291062143.ps tmp/102tna1291062143.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.393 1.602 6.185