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(96.8,92.9,114.1,107.7,110.3,103.5,103.9,91.1,101.6,79.8,94.6,71.9,95.9,82.9,104.7,90.1,102.8,100.7,98.1,90.7,113.9,108.8,80.9,44.1,95.7,93.6,113.2,107.4,105.9,96.5,108.8,93.6,102.3,76.5,99,76.7,100.7,84,115.5,103.3,100.7,88.5,109.9,99,114.6,105.9,85.4,44.7,100.5,94,114.8,107.1,116.5,104.8,112.9,102.5,102,77.7,106,85.2,105.3,91.3,118.8,106.5,106.1,92.4,109.3,97.5,117.2,107,92.5,51.1,104.2,98.6,112.5,102.2,122.4,114.3,113.3,99.4,100,72.5,110.7,92.3,112.8,99.4,109.8,85.9,117.3,109.4,109.1,97.6,115.9,104.7,96,56.9,99.8,86.7,116.8,108.5,115.7,103.4,99.4,86.2,94.3,71,91,75.9,93.2,87.1,103.1,102,94.1,88.5,91.8,87.8,102.7,100.8,82.6,50.6),dim=c(2,60),dimnames=list(c('Totind','Bouw'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Totind','Bouw'),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 = '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
Totind Bouw
1 96.8 92.9
2 114.1 107.7
3 110.3 103.5
4 103.9 91.1
5 101.6 79.8
6 94.6 71.9
7 95.9 82.9
8 104.7 90.1
9 102.8 100.7
10 98.1 90.7
11 113.9 108.8
12 80.9 44.1
13 95.7 93.6
14 113.2 107.4
15 105.9 96.5
16 108.8 93.6
17 102.3 76.5
18 99.0 76.7
19 100.7 84.0
20 115.5 103.3
21 100.7 88.5
22 109.9 99.0
23 114.6 105.9
24 85.4 44.7
25 100.5 94.0
26 114.8 107.1
27 116.5 104.8
28 112.9 102.5
29 102.0 77.7
30 106.0 85.2
31 105.3 91.3
32 118.8 106.5
33 106.1 92.4
34 109.3 97.5
35 117.2 107.0
36 92.5 51.1
37 104.2 98.6
38 112.5 102.2
39 122.4 114.3
40 113.3 99.4
41 100.0 72.5
42 110.7 92.3
43 112.8 99.4
44 109.8 85.9
45 117.3 109.4
46 109.1 97.6
47 115.9 104.7
48 96.0 56.9
49 99.8 86.7
50 116.8 108.5
51 115.7 103.4
52 99.4 86.2
53 94.3 71.0
54 91.0 75.9
55 93.2 87.1
56 103.1 102.0
57 94.1 88.5
58 91.8 87.8
59 102.7 100.8
60 82.6 50.6
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Bouw
59.9181 0.4942
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-11.5052 -2.9537 0.9566 3.8168 7.9643
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 59.91813 3.60208 16.63 <2e-16 ***
Bouw 0.49416 0.03916 12.62 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.933 on 58 degrees of freedom
Multiple R-squared: 0.7331, Adjusted R-squared: 0.7285
F-statistic: 159.3 on 1 and 58 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.61554606 0.76890787 0.3844539
[2,] 0.44598351 0.89196702 0.5540165
[3,] 0.37412573 0.74825147 0.6258743
[4,] 0.27010975 0.54021950 0.7298902
[5,] 0.28916919 0.57833837 0.7108308
[6,] 0.28612598 0.57225195 0.7138740
[7,] 0.22973879 0.45947759 0.7702612
[8,] 0.15887460 0.31774921 0.8411254
[9,] 0.34497983 0.68995966 0.6550202
[10,] 0.29580794 0.59161588 0.7041921
[11,] 0.22535280 0.45070561 0.7746472
[12,] 0.22835740 0.45671479 0.7716426
[13,] 0.27370407 0.54740815 0.7262959
[14,] 0.22001152 0.44002305 0.7799885
[15,] 0.16329662 0.32659325 0.8367034
[16,] 0.19552081 0.39104162 0.8044792
[17,] 0.15406803 0.30813607 0.8459320
[18,] 0.11899015 0.23798031 0.8810098
[19,] 0.09925253 0.19850507 0.9007475
[20,] 0.08465742 0.16931483 0.9153426
[21,] 0.09253661 0.18507322 0.9074634
[22,] 0.07459750 0.14919500 0.9254025
[23,] 0.08290487 0.16580974 0.9170951
[24,] 0.06478336 0.12956672 0.9352166
[25,] 0.05652455 0.11304911 0.9434754
[26,] 0.05057256 0.10114511 0.9494274
[27,] 0.03362530 0.06725060 0.9663747
[28,] 0.04472380 0.08944759 0.9552762
[29,] 0.02950292 0.05900585 0.9704971
[30,] 0.01928354 0.03856708 0.9807165
[31,] 0.01740664 0.03481328 0.9825934
[32,] 0.02972468 0.05944936 0.9702753
[33,] 0.02696911 0.05393822 0.9730309
[34,] 0.01829238 0.03658476 0.9817076
[35,] 0.02166009 0.04332018 0.9783399
[36,] 0.01903547 0.03807094 0.9809645
[37,] 0.01717862 0.03435723 0.9828214
[38,] 0.01857109 0.03714219 0.9814289
[39,] 0.01599506 0.03199011 0.9840049
[40,] 0.03493461 0.06986921 0.9650654
[41,] 0.03271328 0.06542656 0.9672867
[42,] 0.02368770 0.04737539 0.9763123
[43,] 0.03562085 0.07124171 0.9643791
[44,] 0.14373618 0.28747235 0.8562638
[45,] 0.10608676 0.21217351 0.8939132
[46,] 0.17258659 0.34517318 0.8274134
[47,] 0.77194719 0.45610561 0.2280528
[48,] 0.78510643 0.42978715 0.2148936
[49,] 0.87107470 0.25785061 0.1289253
[50,] 0.78321670 0.43356661 0.2167833
[51,] 0.70732734 0.58534532 0.2926727
> postscript(file="/var/www/html/rcomp/tmp/1b47n1258724895.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/2af8c1258724895.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/3zi6z1258724895.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/419sk1258724895.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/5hove1258724895.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
-9.0254089 0.9610518 -0.7634843 -1.0359244 2.2480617 -0.8480896
7 8 9 10 11 12
-4.9838283 0.2582337 -6.8798418 -6.6382612 0.2174779 -0.8104956
13 14 15 16 17 18
-10.4713195 0.2092992 -1.7043779 2.6286805 4.5787833 1.1799517
19 20 21 22 23 24
-0.7274022 4.5353473 -2.9511134 1.0602269 2.3505363 3.3930096
25 26 27 28 29 30
-5.8689828 1.9575466 4.7941102 2.3306737 3.6857936 3.9796082
31 32 33 34 35 36
0.2652440 6.2540415 0.5216701 1.2014640 4.4069625 7.3303980
37 38 39 40 41 42
-4.4421098 2.0789211 5.9996086 4.2625637 4.2554155 5.1710859
43 44 45 46 47 48
3.7625637 7.4336975 3.3209831 0.9520482 4.2435260 7.9642813
49 50 51 52 53 54
-2.9616289 3.2657254 4.6859315 -3.1145499 -0.7033474 -6.4247219
55 56 57 58 59 60
-9.7592921 -7.2222472 -9.5511134 -11.5052028 -7.0292576 -2.3225230
> postscript(file="/var/www/html/rcomp/tmp/61q3p1258724895.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 -9.0254089 NA
1 0.9610518 -9.0254089
2 -0.7634843 0.9610518
3 -1.0359244 -0.7634843
4 2.2480617 -1.0359244
5 -0.8480896 2.2480617
6 -4.9838283 -0.8480896
7 0.2582337 -4.9838283
8 -6.8798418 0.2582337
9 -6.6382612 -6.8798418
10 0.2174779 -6.6382612
11 -0.8104956 0.2174779
12 -10.4713195 -0.8104956
13 0.2092992 -10.4713195
14 -1.7043779 0.2092992
15 2.6286805 -1.7043779
16 4.5787833 2.6286805
17 1.1799517 4.5787833
18 -0.7274022 1.1799517
19 4.5353473 -0.7274022
20 -2.9511134 4.5353473
21 1.0602269 -2.9511134
22 2.3505363 1.0602269
23 3.3930096 2.3505363
24 -5.8689828 3.3930096
25 1.9575466 -5.8689828
26 4.7941102 1.9575466
27 2.3306737 4.7941102
28 3.6857936 2.3306737
29 3.9796082 3.6857936
30 0.2652440 3.9796082
31 6.2540415 0.2652440
32 0.5216701 6.2540415
33 1.2014640 0.5216701
34 4.4069625 1.2014640
35 7.3303980 4.4069625
36 -4.4421098 7.3303980
37 2.0789211 -4.4421098
38 5.9996086 2.0789211
39 4.2625637 5.9996086
40 4.2554155 4.2625637
41 5.1710859 4.2554155
42 3.7625637 5.1710859
43 7.4336975 3.7625637
44 3.3209831 7.4336975
45 0.9520482 3.3209831
46 4.2435260 0.9520482
47 7.9642813 4.2435260
48 -2.9616289 7.9642813
49 3.2657254 -2.9616289
50 4.6859315 3.2657254
51 -3.1145499 4.6859315
52 -0.7033474 -3.1145499
53 -6.4247219 -0.7033474
54 -9.7592921 -6.4247219
55 -7.2222472 -9.7592921
56 -9.5511134 -7.2222472
57 -11.5052028 -9.5511134
58 -7.0292576 -11.5052028
59 -2.3225230 -7.0292576
60 NA -2.3225230
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.9610518 -9.0254089
[2,] -0.7634843 0.9610518
[3,] -1.0359244 -0.7634843
[4,] 2.2480617 -1.0359244
[5,] -0.8480896 2.2480617
[6,] -4.9838283 -0.8480896
[7,] 0.2582337 -4.9838283
[8,] -6.8798418 0.2582337
[9,] -6.6382612 -6.8798418
[10,] 0.2174779 -6.6382612
[11,] -0.8104956 0.2174779
[12,] -10.4713195 -0.8104956
[13,] 0.2092992 -10.4713195
[14,] -1.7043779 0.2092992
[15,] 2.6286805 -1.7043779
[16,] 4.5787833 2.6286805
[17,] 1.1799517 4.5787833
[18,] -0.7274022 1.1799517
[19,] 4.5353473 -0.7274022
[20,] -2.9511134 4.5353473
[21,] 1.0602269 -2.9511134
[22,] 2.3505363 1.0602269
[23,] 3.3930096 2.3505363
[24,] -5.8689828 3.3930096
[25,] 1.9575466 -5.8689828
[26,] 4.7941102 1.9575466
[27,] 2.3306737 4.7941102
[28,] 3.6857936 2.3306737
[29,] 3.9796082 3.6857936
[30,] 0.2652440 3.9796082
[31,] 6.2540415 0.2652440
[32,] 0.5216701 6.2540415
[33,] 1.2014640 0.5216701
[34,] 4.4069625 1.2014640
[35,] 7.3303980 4.4069625
[36,] -4.4421098 7.3303980
[37,] 2.0789211 -4.4421098
[38,] 5.9996086 2.0789211
[39,] 4.2625637 5.9996086
[40,] 4.2554155 4.2625637
[41,] 5.1710859 4.2554155
[42,] 3.7625637 5.1710859
[43,] 7.4336975 3.7625637
[44,] 3.3209831 7.4336975
[45,] 0.9520482 3.3209831
[46,] 4.2435260 0.9520482
[47,] 7.9642813 4.2435260
[48,] -2.9616289 7.9642813
[49,] 3.2657254 -2.9616289
[50,] 4.6859315 3.2657254
[51,] -3.1145499 4.6859315
[52,] -0.7033474 -3.1145499
[53,] -6.4247219 -0.7033474
[54,] -9.7592921 -6.4247219
[55,] -7.2222472 -9.7592921
[56,] -9.5511134 -7.2222472
[57,] -11.5052028 -9.5511134
[58,] -7.0292576 -11.5052028
[59,] -2.3225230 -7.0292576
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.9610518 -9.0254089
2 -0.7634843 0.9610518
3 -1.0359244 -0.7634843
4 2.2480617 -1.0359244
5 -0.8480896 2.2480617
6 -4.9838283 -0.8480896
7 0.2582337 -4.9838283
8 -6.8798418 0.2582337
9 -6.6382612 -6.8798418
10 0.2174779 -6.6382612
11 -0.8104956 0.2174779
12 -10.4713195 -0.8104956
13 0.2092992 -10.4713195
14 -1.7043779 0.2092992
15 2.6286805 -1.7043779
16 4.5787833 2.6286805
17 1.1799517 4.5787833
18 -0.7274022 1.1799517
19 4.5353473 -0.7274022
20 -2.9511134 4.5353473
21 1.0602269 -2.9511134
22 2.3505363 1.0602269
23 3.3930096 2.3505363
24 -5.8689828 3.3930096
25 1.9575466 -5.8689828
26 4.7941102 1.9575466
27 2.3306737 4.7941102
28 3.6857936 2.3306737
29 3.9796082 3.6857936
30 0.2652440 3.9796082
31 6.2540415 0.2652440
32 0.5216701 6.2540415
33 1.2014640 0.5216701
34 4.4069625 1.2014640
35 7.3303980 4.4069625
36 -4.4421098 7.3303980
37 2.0789211 -4.4421098
38 5.9996086 2.0789211
39 4.2625637 5.9996086
40 4.2554155 4.2625637
41 5.1710859 4.2554155
42 3.7625637 5.1710859
43 7.4336975 3.7625637
44 3.3209831 7.4336975
45 0.9520482 3.3209831
46 4.2435260 0.9520482
47 7.9642813 4.2435260
48 -2.9616289 7.9642813
49 3.2657254 -2.9616289
50 4.6859315 3.2657254
51 -3.1145499 4.6859315
52 -0.7033474 -3.1145499
53 -6.4247219 -0.7033474
54 -9.7592921 -6.4247219
55 -7.2222472 -9.7592921
56 -9.5511134 -7.2222472
57 -11.5052028 -9.5511134
58 -7.0292576 -11.5052028
59 -2.3225230 -7.0292576
> 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/7t8sz1258724895.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/8lzwy1258724895.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/9zqey1258724895.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/10rfym1258724895.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/11r0be1258724895.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/12vxwv1258724895.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/13mnv91258724895.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/145nek1258724895.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/15x5oy1258724895.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/16xrsb1258724895.tab")
+ }
>
> system("convert tmp/1b47n1258724895.ps tmp/1b47n1258724895.png")
> system("convert tmp/2af8c1258724895.ps tmp/2af8c1258724895.png")
> system("convert tmp/3zi6z1258724895.ps tmp/3zi6z1258724895.png")
> system("convert tmp/419sk1258724895.ps tmp/419sk1258724895.png")
> system("convert tmp/5hove1258724895.ps tmp/5hove1258724895.png")
> system("convert tmp/61q3p1258724895.ps tmp/61q3p1258724895.png")
> system("convert tmp/7t8sz1258724895.ps tmp/7t8sz1258724895.png")
> system("convert tmp/8lzwy1258724895.ps tmp/8lzwy1258724895.png")
> system("convert tmp/9zqey1258724895.ps tmp/9zqey1258724895.png")
> system("convert tmp/10rfym1258724895.ps tmp/10rfym1258724895.png")
>
>
> proc.time()
user system elapsed
2.496 1.596 5.689