R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
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(36700,0,35600,0,80900,0,174000,0,169422,0,153452,0,173570,0,193036,0,174652,0,105367,0,95963,0,82896,0,121747,0,120196,0,103983,0,81103,0,70944,0,57248,0,47830,0,60095,0,60931,0,82955,0,99559,0,77911,0,70753,0,69287,0,88426,0,91756,1,96933,1,174484,1,232595,1,266197,1,290435,1,304296,1,322310,1,415555,1,490042,1,545109,1,545720,1,505944,1,477930,1,466106,1,424476,1,383018,1,364696,1,391116,1,435721,1,511435,1,553997,1,555252,1,544897,1,540562,1,505282,1,507626,1,474427,1,469740,1,491480,1,538974,1,576612,1),dim=c(2,59),dimnames=list(c('Werklozen','Oliecrisis'),1:59))
> y <- array(NA,dim=c(2,59),dimnames=list(c('Werklozen','Oliecrisis'),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 = '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
Werklozen Oliecrisis t
1 36700 0 1
2 35600 0 2
3 80900 0 3
4 174000 0 4
5 169422 0 5
6 153452 0 6
7 173570 0 7
8 193036 0 8
9 174652 0 9
10 105367 0 10
11 95963 0 11
12 82896 0 12
13 121747 0 13
14 120196 0 14
15 103983 0 15
16 81103 0 16
17 70944 0 17
18 57248 0 18
19 47830 0 19
20 60095 0 20
21 60931 0 21
22 82955 0 22
23 99559 0 23
24 77911 0 24
25 70753 0 25
26 69287 0 26
27 88426 0 27
28 91756 1 28
29 96933 1 29
30 174484 1 30
31 232595 1 31
32 266197 1 32
33 290435 1 33
34 304296 1 34
35 322310 1 35
36 415555 1 36
37 490042 1 37
38 545109 1 38
39 545720 1 39
40 505944 1 40
41 477930 1 41
42 466106 1 42
43 424476 1 43
44 383018 1 44
45 364696 1 45
46 391116 1 46
47 435721 1 47
48 511435 1 48
49 553997 1 49
50 555252 1 50
51 544897 1 51
52 540562 1 52
53 505282 1 53
54 507626 1 54
55 474427 1 55
56 469740 1 56
57 491480 1 57
58 538974 1 58
59 576612 1 59
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Oliecrisis t
14397 142652 6084
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-236557 -65717 5808 64741 156862
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14397 25857 0.557 0.57990
Oliecrisis 142652 46732 3.053 0.00347 **
t 6084 1367 4.450 4.13e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 90340 on 56 degrees of freedom
Multiple R-squared: 0.7863, Adjusted R-squared: 0.7786
F-statistic: 103 on 2 and 56 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.1021580056 0.2043160112 0.897841994
[2,] 0.0561111136 0.1122222272 0.943888886
[3,] 0.0298784176 0.0597568352 0.970121582
[4,] 0.0296371244 0.0592742488 0.970362876
[5,] 0.1150927746 0.2301855492 0.884907225
[6,] 0.1639837267 0.3279674534 0.836016273
[7,] 0.1836890433 0.3673780865 0.816310957
[8,] 0.1444247012 0.2888494025 0.855575299
[9,] 0.1128610843 0.2257221685 0.887138916
[10,] 0.0901929672 0.1803859344 0.909807033
[11,] 0.0762046041 0.1524092082 0.923795396
[12,] 0.0620415494 0.1240830987 0.937958451
[13,] 0.0497378453 0.0994756906 0.950262155
[14,] 0.0379447534 0.0758895069 0.962055247
[15,] 0.0243928816 0.0487857632 0.975607118
[16,] 0.0146473051 0.0292946102 0.985352695
[17,] 0.0084578616 0.0169157232 0.991542138
[18,] 0.0052439741 0.0104879482 0.994756026
[19,] 0.0027920986 0.0055841972 0.997207901
[20,] 0.0014175365 0.0028350730 0.998582463
[21,] 0.0006935537 0.0013871074 0.999306446
[22,] 0.0003497889 0.0006995778 0.999650211
[23,] 0.0004752994 0.0009505988 0.999524701
[24,] 0.0012736713 0.0025473426 0.998726329
[25,] 0.0042714789 0.0085429578 0.995728521
[26,] 0.0170609174 0.0341218349 0.982939083
[27,] 0.0535206388 0.1070412775 0.946479361
[28,] 0.1302818962 0.2605637924 0.869718104
[29,] 0.2646552712 0.5293105424 0.735344729
[30,] 0.4734771336 0.9469542673 0.526522866
[31,] 0.6824084902 0.6351830196 0.317591510
[32,] 0.8559891122 0.2880217755 0.144010888
[33,] 0.9623924836 0.0752150328 0.037607516
[34,] 0.9904910012 0.0190179975 0.009508999
[35,] 0.9942761693 0.0114476615 0.005723831
[36,] 0.9940435629 0.0119128742 0.005956437
[37,] 0.9924522081 0.0150955838 0.007547792
[38,] 0.9857321320 0.0285357360 0.014267868
[39,] 0.9788404050 0.0423191900 0.021159595
[40,] 0.9853918908 0.0292162184 0.014608109
[41,] 0.9936039778 0.0127920443 0.006396022
[42,] 0.9971224886 0.0057550228 0.002877511
[43,] 0.9940937976 0.0118124048 0.005906202
[44,] 0.9881471752 0.0237056496 0.011852825
[45,] 0.9795842994 0.0408314012 0.020415701
[46,] 0.9664759150 0.0670481700 0.033524085
[47,] 0.9627749983 0.0744500033 0.037225002
[48,] 0.9298381523 0.1403236954 0.070161848
> postscript(file="/var/www/html/freestat/rcomp/tmp/1umpe1292678807.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/freestat/rcomp/tmp/2md7h1292678807.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/freestat/rcomp/tmp/3md7h1292678807.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/freestat/rcomp/tmp/4md7h1292678807.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/freestat/rcomp/tmp/5md7h1292678807.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 = 59
Frequency = 1
1 2 3 4 5 6
16219.132 9034.965 48250.798 135266.632 124604.465 102550.298
7 8 9 10 11 12
116584.131 129965.964 105497.797 30128.630 14640.464 -4510.703
13 14 15 16 17 18
28256.130 20620.963 -1676.204 -30640.371 -46883.538 -66663.704
19 20 21 22 23 24
-82165.871 -75985.038 -81233.205 -65293.372 -54773.539 -82505.706
25 26 27 28 29 30
-95747.872 -103298.039 -90243.206 -235649.507 -236556.674 -165089.841
31 32 33 34 35 36
-113063.008 -85545.175 -67391.342 -59614.509 -47684.675 39476.158
37 38 39 40 41 42
107878.991 156861.824 151388.657 105528.490 71430.323 53522.157
43 44 45 46 47 48
5807.990 -41734.177 -66140.344 -45804.511 -7283.678 62346.155
49 50 51 52 53 54
98823.989 93994.822 77555.655 67136.488 25772.321 22032.154
55 56 57 58 59
-17251.013 -28022.179 -12366.346 29043.487 60597.320
> postscript(file="/var/www/html/freestat/rcomp/tmp/6kpv81292678807.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 = 59
Frequency = 1
lag(myerror, k = 1) myerror
0 16219.132 NA
1 9034.965 16219.132
2 48250.798 9034.965
3 135266.632 48250.798
4 124604.465 135266.632
5 102550.298 124604.465
6 116584.131 102550.298
7 129965.964 116584.131
8 105497.797 129965.964
9 30128.630 105497.797
10 14640.464 30128.630
11 -4510.703 14640.464
12 28256.130 -4510.703
13 20620.963 28256.130
14 -1676.204 20620.963
15 -30640.371 -1676.204
16 -46883.538 -30640.371
17 -66663.704 -46883.538
18 -82165.871 -66663.704
19 -75985.038 -82165.871
20 -81233.205 -75985.038
21 -65293.372 -81233.205
22 -54773.539 -65293.372
23 -82505.706 -54773.539
24 -95747.872 -82505.706
25 -103298.039 -95747.872
26 -90243.206 -103298.039
27 -235649.507 -90243.206
28 -236556.674 -235649.507
29 -165089.841 -236556.674
30 -113063.008 -165089.841
31 -85545.175 -113063.008
32 -67391.342 -85545.175
33 -59614.509 -67391.342
34 -47684.675 -59614.509
35 39476.158 -47684.675
36 107878.991 39476.158
37 156861.824 107878.991
38 151388.657 156861.824
39 105528.490 151388.657
40 71430.323 105528.490
41 53522.157 71430.323
42 5807.990 53522.157
43 -41734.177 5807.990
44 -66140.344 -41734.177
45 -45804.511 -66140.344
46 -7283.678 -45804.511
47 62346.155 -7283.678
48 98823.989 62346.155
49 93994.822 98823.989
50 77555.655 93994.822
51 67136.488 77555.655
52 25772.321 67136.488
53 22032.154 25772.321
54 -17251.013 22032.154
55 -28022.179 -17251.013
56 -12366.346 -28022.179
57 29043.487 -12366.346
58 60597.320 29043.487
59 NA 60597.320
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 9034.965 16219.132
[2,] 48250.798 9034.965
[3,] 135266.632 48250.798
[4,] 124604.465 135266.632
[5,] 102550.298 124604.465
[6,] 116584.131 102550.298
[7,] 129965.964 116584.131
[8,] 105497.797 129965.964
[9,] 30128.630 105497.797
[10,] 14640.464 30128.630
[11,] -4510.703 14640.464
[12,] 28256.130 -4510.703
[13,] 20620.963 28256.130
[14,] -1676.204 20620.963
[15,] -30640.371 -1676.204
[16,] -46883.538 -30640.371
[17,] -66663.704 -46883.538
[18,] -82165.871 -66663.704
[19,] -75985.038 -82165.871
[20,] -81233.205 -75985.038
[21,] -65293.372 -81233.205
[22,] -54773.539 -65293.372
[23,] -82505.706 -54773.539
[24,] -95747.872 -82505.706
[25,] -103298.039 -95747.872
[26,] -90243.206 -103298.039
[27,] -235649.507 -90243.206
[28,] -236556.674 -235649.507
[29,] -165089.841 -236556.674
[30,] -113063.008 -165089.841
[31,] -85545.175 -113063.008
[32,] -67391.342 -85545.175
[33,] -59614.509 -67391.342
[34,] -47684.675 -59614.509
[35,] 39476.158 -47684.675
[36,] 107878.991 39476.158
[37,] 156861.824 107878.991
[38,] 151388.657 156861.824
[39,] 105528.490 151388.657
[40,] 71430.323 105528.490
[41,] 53522.157 71430.323
[42,] 5807.990 53522.157
[43,] -41734.177 5807.990
[44,] -66140.344 -41734.177
[45,] -45804.511 -66140.344
[46,] -7283.678 -45804.511
[47,] 62346.155 -7283.678
[48,] 98823.989 62346.155
[49,] 93994.822 98823.989
[50,] 77555.655 93994.822
[51,] 67136.488 77555.655
[52,] 25772.321 67136.488
[53,] 22032.154 25772.321
[54,] -17251.013 22032.154
[55,] -28022.179 -17251.013
[56,] -12366.346 -28022.179
[57,] 29043.487 -12366.346
[58,] 60597.320 29043.487
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 9034.965 16219.132
2 48250.798 9034.965
3 135266.632 48250.798
4 124604.465 135266.632
5 102550.298 124604.465
6 116584.131 102550.298
7 129965.964 116584.131
8 105497.797 129965.964
9 30128.630 105497.797
10 14640.464 30128.630
11 -4510.703 14640.464
12 28256.130 -4510.703
13 20620.963 28256.130
14 -1676.204 20620.963
15 -30640.371 -1676.204
16 -46883.538 -30640.371
17 -66663.704 -46883.538
18 -82165.871 -66663.704
19 -75985.038 -82165.871
20 -81233.205 -75985.038
21 -65293.372 -81233.205
22 -54773.539 -65293.372
23 -82505.706 -54773.539
24 -95747.872 -82505.706
25 -103298.039 -95747.872
26 -90243.206 -103298.039
27 -235649.507 -90243.206
28 -236556.674 -235649.507
29 -165089.841 -236556.674
30 -113063.008 -165089.841
31 -85545.175 -113063.008
32 -67391.342 -85545.175
33 -59614.509 -67391.342
34 -47684.675 -59614.509
35 39476.158 -47684.675
36 107878.991 39476.158
37 156861.824 107878.991
38 151388.657 156861.824
39 105528.490 151388.657
40 71430.323 105528.490
41 53522.157 71430.323
42 5807.990 53522.157
43 -41734.177 5807.990
44 -66140.344 -41734.177
45 -45804.511 -66140.344
46 -7283.678 -45804.511
47 62346.155 -7283.678
48 98823.989 62346.155
49 93994.822 98823.989
50 77555.655 93994.822
51 67136.488 77555.655
52 25772.321 67136.488
53 22032.154 25772.321
54 -17251.013 22032.154
55 -28022.179 -17251.013
56 -12366.346 -28022.179
57 29043.487 -12366.346
58 60597.320 29043.487
> 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/freestat/rcomp/tmp/7qe5n1292678807.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/freestat/rcomp/tmp/8qe5n1292678807.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/freestat/rcomp/tmp/9qe5n1292678807.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/freestat/rcomp/tmp/10j5581292678807.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11453v1292678807.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/freestat/rcomp/tmp/12p6j11292678807.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/freestat/rcomp/tmp/13lxzs1292678807.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/freestat/rcomp/tmp/14pgyy1292678807.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/freestat/rcomp/tmp/15szwm1292678807.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/freestat/rcomp/tmp/16ezda1292678807.tab")
+ }
> try(system("convert tmp/1umpe1292678807.ps tmp/1umpe1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/2md7h1292678807.ps tmp/2md7h1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/3md7h1292678807.ps tmp/3md7h1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/4md7h1292678807.ps tmp/4md7h1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/5md7h1292678807.ps tmp/5md7h1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/6kpv81292678807.ps tmp/6kpv81292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qe5n1292678807.ps tmp/7qe5n1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qe5n1292678807.ps tmp/8qe5n1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qe5n1292678807.ps tmp/9qe5n1292678807.png",intern=TRUE))
character(0)
> try(system("convert tmp/10j5581292678807.ps tmp/10j5581292678807.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.763 2.440 4.086