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(3016.70
+ ,2756.76
+ ,3052.40
+ ,2849.27
+ ,3099.60
+ ,2921.44
+ ,3103.30
+ ,2981.85
+ ,3119.80
+ ,3080.58
+ ,3093.70
+ ,3106.22
+ ,3164.90
+ ,3119.31
+ ,3311.50
+ ,3061.26
+ ,3410.60
+ ,3097.31
+ ,3392.60
+ ,3161.69
+ ,3338.20
+ ,3257.16
+ ,3285.10
+ ,3277.01
+ ,3294.80
+ ,3295.32
+ ,3611.20
+ ,3363.99
+ ,3611.30
+ ,3494.17
+ ,3521.00
+ ,3667.03
+ ,3519.30
+ ,3813.06
+ ,3438.30
+ ,3917.96
+ ,3534.90
+ ,3895.51
+ ,3705.80
+ ,3801.06
+ ,3807.60
+ ,3570.12
+ ,3663.00
+ ,3701.61
+ ,3604.50
+ ,3862.27
+ ,3563.80
+ ,3970.10
+ ,3511.40
+ ,4138.52
+ ,3546.50
+ ,4199.75
+ ,3525.40
+ ,4290.89
+ ,3529.90
+ ,4443.91
+ ,3591.60
+ ,4502.64
+ ,3668.30
+ ,4356.98
+ ,3728.80
+ ,4591.27
+ ,3853.60
+ ,4696.96
+ ,3897.70
+ ,4621.40
+ ,3640.70
+ ,4562.84
+ ,3495.50
+ ,4202.52
+ ,3495.10
+ ,4296.49
+ ,3268.00
+ ,4435.23
+ ,3479.10
+ ,4105.18
+ ,3417.80
+ ,4116.68
+ ,3521.30
+ ,3844.49
+ ,3487.10
+ ,3720.98
+ ,3529.90
+ ,3674.40
+ ,3544.30
+ ,3857.62
+ ,3710.80
+ ,3801.06
+ ,3641.90
+ ,3504.37
+ ,3447.10
+ ,3032.60
+ ,3386.80
+ ,3047.03
+ ,3438.50
+ ,2962.34
+ ,3364.30
+ ,2197.82
+ ,3462.70
+ ,2014.45
+ ,3291.90
+ ,1862.83
+ ,3550.00
+ ,1905.41
+ ,3611.00
+ ,1810.99
+ ,3708.60
+ ,1670.07
+ ,3771.10
+ ,1864.44
+ ,4042.70
+ ,2052.02
+ ,3988.40
+ ,2029.60
+ ,3851.20
+ ,2070.83
+ ,3876.70
+ ,2293.41)
+ ,dim=c(2
+ ,59)
+ ,dimnames=list(c('Zichtrekeningen'
+ ,'Bel20
')
+ ,1:59))
> y <- array(NA,dim=c(2,59),dimnames=list(c('Zichtrekeningen','Bel20
'),1:59))
> 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
Zichtrekeningen Bel20\r
1 3016.7 2756.76
2 3052.4 2849.27
3 3099.6 2921.44
4 3103.3 2981.85
5 3119.8 3080.58
6 3093.7 3106.22
7 3164.9 3119.31
8 3311.5 3061.26
9 3410.6 3097.31
10 3392.6 3161.69
11 3338.2 3257.16
12 3285.1 3277.01
13 3294.8 3295.32
14 3611.2 3363.99
15 3611.3 3494.17
16 3521.0 3667.03
17 3519.3 3813.06
18 3438.3 3917.96
19 3534.9 3895.51
20 3705.8 3801.06
21 3807.6 3570.12
22 3663.0 3701.61
23 3604.5 3862.27
24 3563.8 3970.10
25 3511.4 4138.52
26 3546.5 4199.75
27 3525.4 4290.89
28 3529.9 4443.91
29 3591.6 4502.64
30 3668.3 4356.98
31 3728.8 4591.27
32 3853.6 4696.96
33 3897.7 4621.40
34 3640.7 4562.84
35 3495.5 4202.52
36 3495.1 4296.49
37 3268.0 4435.23
38 3479.1 4105.18
39 3417.8 4116.68
40 3521.3 3844.49
41 3487.1 3720.98
42 3529.9 3674.40
43 3544.3 3857.62
44 3710.8 3801.06
45 3641.9 3504.37
46 3447.1 3032.60
47 3386.8 3047.03
48 3438.5 2962.34
49 3364.3 2197.82
50 3462.7 2014.45
51 3291.9 1862.83
52 3550.0 1905.41
53 3611.0 1810.99
54 3708.6 1670.07
55 3771.1 1864.44
56 4042.7 2052.02
57 3988.4 2029.60
58 3851.2 2070.83
59 3876.7 2293.41
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `Bel20\r`
3.464e+03 1.396e-02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-485.353 -117.204 4.067 125.780 550.482
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.464e+03 1.255e+02 27.593 <2e-16 ***
`Bel20\r` 1.396e-02 3.598e-02 0.388 0.7
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 232.3 on 57 degrees of freedom
Multiple R-squared: 0.002633, Adjusted R-squared: -0.01486
F-statistic: 0.1505 on 1 and 57 DF, p-value: 0.6995
> 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.0005700933 0.0011401867 0.9994299
[2,] 0.0003458266 0.0006916532 0.9996542
[3,] 0.0001393865 0.0002787731 0.9998606
[4,] 0.0168838463 0.0337676927 0.9831162
[5,] 0.0778007626 0.1556015252 0.9221992
[6,] 0.0696561322 0.1393122643 0.9303439
[7,] 0.0424692629 0.0849385259 0.9575307
[8,] 0.0325549833 0.0651099667 0.9674450
[9,] 0.0243456830 0.0486913659 0.9756543
[10,] 0.0445176681 0.0890353362 0.9554823
[11,] 0.0278087892 0.0556175784 0.9721912
[12,] 0.0280143591 0.0560287181 0.9719856
[13,] 0.0338041717 0.0676083434 0.9661958
[14,] 0.0618465477 0.1236930955 0.9381535
[15,] 0.0430446851 0.0860893702 0.9569553
[16,] 0.0394579792 0.0789159585 0.9605420
[17,] 0.1275311282 0.2550622564 0.8724689
[18,] 0.1006178253 0.2012356507 0.8993822
[19,] 0.0707986586 0.1415973172 0.9292013
[20,] 0.0579406568 0.1158813136 0.9420593
[21,] 0.0714359779 0.1428719559 0.9285640
[22,] 0.0684546762 0.1369093523 0.9315453
[23,] 0.0703179451 0.1406358902 0.9296821
[24,] 0.0734391387 0.1468782773 0.9265609
[25,] 0.0595633383 0.1191266767 0.9404367
[26,] 0.0414357935 0.0828715871 0.9585642
[27,] 0.0313673744 0.0627347489 0.9686326
[28,] 0.0376660823 0.0753321646 0.9623339
[29,] 0.0763176100 0.1526352200 0.9236824
[30,] 0.0735491981 0.1470983963 0.9264508
[31,] 0.0581233845 0.1162467690 0.9418766
[32,] 0.0479016534 0.0958033067 0.9520983
[33,] 0.1153330259 0.2306660518 0.8846670
[34,] 0.0845893415 0.1691786829 0.9154107
[35,] 0.0680498165 0.1360996331 0.9319502
[36,] 0.0456509851 0.0913019701 0.9543490
[37,] 0.0301288511 0.0602577023 0.9698711
[38,] 0.0197088253 0.0394176506 0.9802912
[39,] 0.0118803606 0.0237607211 0.9881196
[40,] 0.0145184599 0.0290369198 0.9854815
[41,] 0.0175125112 0.0350250224 0.9824875
[42,] 0.0119562907 0.0239125813 0.9880437
[43,] 0.0079970154 0.0159940309 0.9920030
[44,] 0.0097664066 0.0195328131 0.9902336
[45,] 0.0564973428 0.1129946857 0.9435027
[46,] 0.1338847393 0.2677694786 0.8661153
[47,] 0.5350163366 0.9299673267 0.4649837
[48,] 0.7333783334 0.5332433332 0.2666217
[49,] 0.8021672577 0.3956654845 0.1978327
[50,] 0.7324823786 0.5350352429 0.2675176
> postscript(file="/var/www/html/rcomp/tmp/15v9k1258733572.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/2e54i1258733572.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/38hxp1258733572.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/417t71258733572.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/5s1j61258733572.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 = 59
Frequency = 1
1 2 3 4 5 6
-485.353187 -450.944205 -404.751369 -401.894418 -386.772238 -413.230056
7 8 9 10 11 12
-342.212733 -194.802619 -96.205713 -115.104164 -170.836490 -224.213506
13 14 15 16 17 18
-214.769030 100.672650 98.955931 6.243593 2.505680 -79.958246
19 20 21 22 23 24
16.955054 189.173145 294.196015 147.761014 87.018933 44.814118
25 26 27 28 29 30
-9.936258 24.309250 1.937352 4.301890 65.182287 143.915036
31 32 33 34 35 36
201.145416 324.470466 369.624939 113.442169 -26.729406 -28.440799
37 38 39 40 41 42
-257.476977 -41.770983 -103.231471 4.067061 -28.409303 15.040742
43 44 45 46 47 48
26.883826 194.173145 129.413585 -58.802656 -119.304033 -66.422147
49 50 51 52 53 54
-129.952933 -28.993924 -197.678000 59.827778 122.145450 221.712051
55 56 57 58 59
281.499532 550.481770 496.494651 358.719268 381.113066
> postscript(file="/var/www/html/rcomp/tmp/63sv41258733572.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 = 59
Frequency = 1
lag(myerror, k = 1) myerror
0 -485.353187 NA
1 -450.944205 -485.353187
2 -404.751369 -450.944205
3 -401.894418 -404.751369
4 -386.772238 -401.894418
5 -413.230056 -386.772238
6 -342.212733 -413.230056
7 -194.802619 -342.212733
8 -96.205713 -194.802619
9 -115.104164 -96.205713
10 -170.836490 -115.104164
11 -224.213506 -170.836490
12 -214.769030 -224.213506
13 100.672650 -214.769030
14 98.955931 100.672650
15 6.243593 98.955931
16 2.505680 6.243593
17 -79.958246 2.505680
18 16.955054 -79.958246
19 189.173145 16.955054
20 294.196015 189.173145
21 147.761014 294.196015
22 87.018933 147.761014
23 44.814118 87.018933
24 -9.936258 44.814118
25 24.309250 -9.936258
26 1.937352 24.309250
27 4.301890 1.937352
28 65.182287 4.301890
29 143.915036 65.182287
30 201.145416 143.915036
31 324.470466 201.145416
32 369.624939 324.470466
33 113.442169 369.624939
34 -26.729406 113.442169
35 -28.440799 -26.729406
36 -257.476977 -28.440799
37 -41.770983 -257.476977
38 -103.231471 -41.770983
39 4.067061 -103.231471
40 -28.409303 4.067061
41 15.040742 -28.409303
42 26.883826 15.040742
43 194.173145 26.883826
44 129.413585 194.173145
45 -58.802656 129.413585
46 -119.304033 -58.802656
47 -66.422147 -119.304033
48 -129.952933 -66.422147
49 -28.993924 -129.952933
50 -197.678000 -28.993924
51 59.827778 -197.678000
52 122.145450 59.827778
53 221.712051 122.145450
54 281.499532 221.712051
55 550.481770 281.499532
56 496.494651 550.481770
57 358.719268 496.494651
58 381.113066 358.719268
59 NA 381.113066
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -450.944205 -485.353187
[2,] -404.751369 -450.944205
[3,] -401.894418 -404.751369
[4,] -386.772238 -401.894418
[5,] -413.230056 -386.772238
[6,] -342.212733 -413.230056
[7,] -194.802619 -342.212733
[8,] -96.205713 -194.802619
[9,] -115.104164 -96.205713
[10,] -170.836490 -115.104164
[11,] -224.213506 -170.836490
[12,] -214.769030 -224.213506
[13,] 100.672650 -214.769030
[14,] 98.955931 100.672650
[15,] 6.243593 98.955931
[16,] 2.505680 6.243593
[17,] -79.958246 2.505680
[18,] 16.955054 -79.958246
[19,] 189.173145 16.955054
[20,] 294.196015 189.173145
[21,] 147.761014 294.196015
[22,] 87.018933 147.761014
[23,] 44.814118 87.018933
[24,] -9.936258 44.814118
[25,] 24.309250 -9.936258
[26,] 1.937352 24.309250
[27,] 4.301890 1.937352
[28,] 65.182287 4.301890
[29,] 143.915036 65.182287
[30,] 201.145416 143.915036
[31,] 324.470466 201.145416
[32,] 369.624939 324.470466
[33,] 113.442169 369.624939
[34,] -26.729406 113.442169
[35,] -28.440799 -26.729406
[36,] -257.476977 -28.440799
[37,] -41.770983 -257.476977
[38,] -103.231471 -41.770983
[39,] 4.067061 -103.231471
[40,] -28.409303 4.067061
[41,] 15.040742 -28.409303
[42,] 26.883826 15.040742
[43,] 194.173145 26.883826
[44,] 129.413585 194.173145
[45,] -58.802656 129.413585
[46,] -119.304033 -58.802656
[47,] -66.422147 -119.304033
[48,] -129.952933 -66.422147
[49,] -28.993924 -129.952933
[50,] -197.678000 -28.993924
[51,] 59.827778 -197.678000
[52,] 122.145450 59.827778
[53,] 221.712051 122.145450
[54,] 281.499532 221.712051
[55,] 550.481770 281.499532
[56,] 496.494651 550.481770
[57,] 358.719268 496.494651
[58,] 381.113066 358.719268
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -450.944205 -485.353187
2 -404.751369 -450.944205
3 -401.894418 -404.751369
4 -386.772238 -401.894418
5 -413.230056 -386.772238
6 -342.212733 -413.230056
7 -194.802619 -342.212733
8 -96.205713 -194.802619
9 -115.104164 -96.205713
10 -170.836490 -115.104164
11 -224.213506 -170.836490
12 -214.769030 -224.213506
13 100.672650 -214.769030
14 98.955931 100.672650
15 6.243593 98.955931
16 2.505680 6.243593
17 -79.958246 2.505680
18 16.955054 -79.958246
19 189.173145 16.955054
20 294.196015 189.173145
21 147.761014 294.196015
22 87.018933 147.761014
23 44.814118 87.018933
24 -9.936258 44.814118
25 24.309250 -9.936258
26 1.937352 24.309250
27 4.301890 1.937352
28 65.182287 4.301890
29 143.915036 65.182287
30 201.145416 143.915036
31 324.470466 201.145416
32 369.624939 324.470466
33 113.442169 369.624939
34 -26.729406 113.442169
35 -28.440799 -26.729406
36 -257.476977 -28.440799
37 -41.770983 -257.476977
38 -103.231471 -41.770983
39 4.067061 -103.231471
40 -28.409303 4.067061
41 15.040742 -28.409303
42 26.883826 15.040742
43 194.173145 26.883826
44 129.413585 194.173145
45 -58.802656 129.413585
46 -119.304033 -58.802656
47 -66.422147 -119.304033
48 -129.952933 -66.422147
49 -28.993924 -129.952933
50 -197.678000 -28.993924
51 59.827778 -197.678000
52 122.145450 59.827778
53 221.712051 122.145450
54 281.499532 221.712051
55 550.481770 281.499532
56 496.494651 550.481770
57 358.719268 496.494651
58 381.113066 358.719268
> 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/7r7hj1258733573.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/83p351258733573.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/9rsvl1258733573.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/104i2r1258733573.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/11q97r1258733573.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/12f5nc1258733573.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/13mr3d1258733573.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/14frav1258733573.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/15ni8u1258733573.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/16oz8o1258733573.tab")
+ }
>
> system("convert tmp/15v9k1258733572.ps tmp/15v9k1258733572.png")
> system("convert tmp/2e54i1258733572.ps tmp/2e54i1258733572.png")
> system("convert tmp/38hxp1258733572.ps tmp/38hxp1258733572.png")
> system("convert tmp/417t71258733572.ps tmp/417t71258733572.png")
> system("convert tmp/5s1j61258733572.ps tmp/5s1j61258733572.png")
> system("convert tmp/63sv41258733572.ps tmp/63sv41258733572.png")
> system("convert tmp/7r7hj1258733573.ps tmp/7r7hj1258733573.png")
> system("convert tmp/83p351258733573.ps tmp/83p351258733573.png")
> system("convert tmp/9rsvl1258733573.ps tmp/9rsvl1258733573.png")
> system("convert tmp/104i2r1258733573.ps tmp/104i2r1258733573.png")
>
>
> proc.time()
user system elapsed
2.539 1.608 5.988