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(67,189,342,432,517,623,605,716,677,710,839,886,891,917,820,793,932,906,844,801,957,1159,1264,1097,1240,1411,1535,1862,1894,2239,2465,2423,2692,2856,3450,4162,4260,4225,4092,4160,3896,3628,3754,3749,3907,4449,5272,6197,6446,7157,7559,7674,6929,7156,6805,7095,7222,7593,7910),dim=c(1,59),dimnames=list(c('Faillissementen'),1:59))
> y <- array(NA,dim=c(1,59),dimnames=list(c('Faillissementen'),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
Faillissementen t
1 67 1
2 189 2
3 342 3
4 432 4
5 517 5
6 623 6
7 605 7
8 716 8
9 677 9
10 710 10
11 839 11
12 886 12
13 891 13
14 917 14
15 820 15
16 793 16
17 932 17
18 906 18
19 844 19
20 801 20
21 957 21
22 1159 22
23 1264 23
24 1097 24
25 1240 25
26 1411 26
27 1535 27
28 1862 28
29 1894 29
30 2239 30
31 2465 31
32 2423 32
33 2692 33
34 2856 34
35 3450 35
36 4162 36
37 4260 37
38 4225 38
39 4092 39
40 4160 40
41 3896 41
42 3628 42
43 3754 43
44 3749 44
45 3907 45
46 4449 46
47 5272 47
48 6197 48
49 6446 49
50 7157 50
51 7559 51
52 7674 52
53 6929 53
54 7156 54
55 6805 55
56 7095 56
57 7222 57
58 7593 58
59 7910 59
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) t
-1116.5 137.4
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1180.70 -761.21 -69.94 736.36 1667.40
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1116.531 216.920 -5.147 3.40e-06 ***
t 137.414 6.288 21.853 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 822.5 on 57 degrees of freedom
Multiple R-squared: 0.8934, Adjusted R-squared: 0.8915
F-statistic: 477.5 on 1 and 57 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,] 4.422715e-05 8.845430e-05 0.9999557729
[2,] 1.907627e-06 3.815254e-06 0.9999980924
[3,] 4.797581e-06 9.595162e-06 0.9999952024
[4,] 5.432924e-07 1.086585e-06 0.9999994567
[5,] 5.480377e-07 1.096075e-06 0.9999994520
[6,] 2.603165e-07 5.206330e-07 0.9999997397
[7,] 3.965995e-08 7.931991e-08 0.9999999603
[8,] 6.832662e-09 1.366532e-08 0.9999999932
[9,] 2.077813e-09 4.155625e-09 0.9999999979
[10,] 8.106163e-10 1.621233e-09 0.9999999992
[11,] 3.471165e-09 6.942330e-09 0.9999999965
[12,] 1.055288e-08 2.110576e-08 0.9999999894
[13,] 4.172825e-09 8.345651e-09 0.9999999958
[14,] 2.431554e-09 4.863108e-09 0.9999999976
[15,] 2.915230e-09 5.830460e-09 0.9999999971
[16,] 4.345795e-09 8.691590e-09 0.9999999957
[17,] 1.320419e-09 2.640839e-09 0.9999999987
[18,] 3.808875e-10 7.617750e-10 0.9999999996
[19,] 1.451195e-10 2.902390e-10 0.9999999999
[20,] 3.583904e-11 7.167808e-11 1.0000000000
[21,] 7.089024e-12 1.417805e-11 1.0000000000
[22,] 2.687945e-12 5.375891e-12 1.0000000000
[23,] 1.854085e-12 3.708170e-12 1.0000000000
[24,] 4.424589e-11 8.849177e-11 1.0000000000
[25,] 1.280086e-10 2.560173e-10 0.9999999999
[26,] 4.244865e-09 8.489730e-09 0.9999999958
[27,] 9.226831e-08 1.845366e-07 0.9999999077
[28,] 1.911781e-07 3.823562e-07 0.9999998088
[29,] 7.476085e-07 1.495217e-06 0.9999992524
[30,] 2.245440e-06 4.490879e-06 0.9999977546
[31,] 5.145868e-05 1.029174e-04 0.9999485413
[32,] 4.126506e-03 8.253013e-03 0.9958734935
[33,] 3.008976e-02 6.017953e-02 0.9699102363
[34,] 7.078729e-02 1.415746e-01 0.9292127103
[35,] 8.738777e-02 1.747755e-01 0.9126122255
[36,] 9.501766e-02 1.900353e-01 0.9049823370
[37,] 6.962010e-02 1.392402e-01 0.9303798977
[38,] 4.918457e-02 9.836914e-02 0.9508154308
[39,] 3.875343e-02 7.750685e-02 0.9612465750
[40,] 5.044118e-02 1.008824e-01 0.9495588241
[41,] 1.377784e-01 2.755568e-01 0.8622216195
[42,] 4.375412e-01 8.750823e-01 0.5624588442
[43,] 7.941901e-01 4.116197e-01 0.2058098689
[44,] 8.949430e-01 2.101140e-01 0.1050570134
[45,] 9.480614e-01 1.038772e-01 0.0519385771
[46,] 9.455496e-01 1.089008e-01 0.0544503843
[47,] 9.577809e-01 8.443817e-02 0.0422190857
[48,] 9.957928e-01 8.414439e-03 0.0042072197
[49,] 9.885671e-01 2.286589e-02 0.0114329465
[50,] 9.991667e-01 1.666565e-03 0.0008332825
> postscript(file="/var/www/html/freestat/rcomp/tmp/1lqqw1292700188.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/2lqqw1292700188.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/3lqqw1292700188.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/4ehph1292700188.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/5ehph1292700188.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
1046.11695 1030.70263 1046.28831 998.87399 946.45967 915.04535
7 8 9 10 11 12
759.63103 733.21672 556.80240 452.38808 443.97376 353.55944
13 14 15 16 17 18
221.14512 109.73080 -124.68352 -289.09784 -287.51216 -450.92648
19 20 21 22 23 24
-650.34079 -830.75511 -812.16943 -747.58375 -779.99807 -1084.41239
25 26 27 28 29 30
-1078.82671 -1045.24103 -1058.65535 -869.06967 -974.48399 -766.89831
31 32 33 34 35 36
-678.31262 -857.72694 -726.14126 -699.55558 -242.96990 331.61578
37 38 39 40 41 42
292.20146 119.78714 -150.62718 -220.04150 -621.45582 -1026.87013
43 44 45 46 47 48
-1038.28445 -1180.69877 -1160.11309 -755.52741 -69.94173 717.64395
49 50 51 52 53 54
829.22963 1402.81531 1667.40099 1644.98667 762.57236 852.15804
55 56 57 58 59
363.74372 516.32940 505.91508 739.50076 919.08644
> postscript(file="/var/www/html/freestat/rcomp/tmp/678ok1292700188.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 1046.11695 NA
1 1030.70263 1046.11695
2 1046.28831 1030.70263
3 998.87399 1046.28831
4 946.45967 998.87399
5 915.04535 946.45967
6 759.63103 915.04535
7 733.21672 759.63103
8 556.80240 733.21672
9 452.38808 556.80240
10 443.97376 452.38808
11 353.55944 443.97376
12 221.14512 353.55944
13 109.73080 221.14512
14 -124.68352 109.73080
15 -289.09784 -124.68352
16 -287.51216 -289.09784
17 -450.92648 -287.51216
18 -650.34079 -450.92648
19 -830.75511 -650.34079
20 -812.16943 -830.75511
21 -747.58375 -812.16943
22 -779.99807 -747.58375
23 -1084.41239 -779.99807
24 -1078.82671 -1084.41239
25 -1045.24103 -1078.82671
26 -1058.65535 -1045.24103
27 -869.06967 -1058.65535
28 -974.48399 -869.06967
29 -766.89831 -974.48399
30 -678.31262 -766.89831
31 -857.72694 -678.31262
32 -726.14126 -857.72694
33 -699.55558 -726.14126
34 -242.96990 -699.55558
35 331.61578 -242.96990
36 292.20146 331.61578
37 119.78714 292.20146
38 -150.62718 119.78714
39 -220.04150 -150.62718
40 -621.45582 -220.04150
41 -1026.87013 -621.45582
42 -1038.28445 -1026.87013
43 -1180.69877 -1038.28445
44 -1160.11309 -1180.69877
45 -755.52741 -1160.11309
46 -69.94173 -755.52741
47 717.64395 -69.94173
48 829.22963 717.64395
49 1402.81531 829.22963
50 1667.40099 1402.81531
51 1644.98667 1667.40099
52 762.57236 1644.98667
53 852.15804 762.57236
54 363.74372 852.15804
55 516.32940 363.74372
56 505.91508 516.32940
57 739.50076 505.91508
58 919.08644 739.50076
59 NA 919.08644
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1030.70263 1046.11695
[2,] 1046.28831 1030.70263
[3,] 998.87399 1046.28831
[4,] 946.45967 998.87399
[5,] 915.04535 946.45967
[6,] 759.63103 915.04535
[7,] 733.21672 759.63103
[8,] 556.80240 733.21672
[9,] 452.38808 556.80240
[10,] 443.97376 452.38808
[11,] 353.55944 443.97376
[12,] 221.14512 353.55944
[13,] 109.73080 221.14512
[14,] -124.68352 109.73080
[15,] -289.09784 -124.68352
[16,] -287.51216 -289.09784
[17,] -450.92648 -287.51216
[18,] -650.34079 -450.92648
[19,] -830.75511 -650.34079
[20,] -812.16943 -830.75511
[21,] -747.58375 -812.16943
[22,] -779.99807 -747.58375
[23,] -1084.41239 -779.99807
[24,] -1078.82671 -1084.41239
[25,] -1045.24103 -1078.82671
[26,] -1058.65535 -1045.24103
[27,] -869.06967 -1058.65535
[28,] -974.48399 -869.06967
[29,] -766.89831 -974.48399
[30,] -678.31262 -766.89831
[31,] -857.72694 -678.31262
[32,] -726.14126 -857.72694
[33,] -699.55558 -726.14126
[34,] -242.96990 -699.55558
[35,] 331.61578 -242.96990
[36,] 292.20146 331.61578
[37,] 119.78714 292.20146
[38,] -150.62718 119.78714
[39,] -220.04150 -150.62718
[40,] -621.45582 -220.04150
[41,] -1026.87013 -621.45582
[42,] -1038.28445 -1026.87013
[43,] -1180.69877 -1038.28445
[44,] -1160.11309 -1180.69877
[45,] -755.52741 -1160.11309
[46,] -69.94173 -755.52741
[47,] 717.64395 -69.94173
[48,] 829.22963 717.64395
[49,] 1402.81531 829.22963
[50,] 1667.40099 1402.81531
[51,] 1644.98667 1667.40099
[52,] 762.57236 1644.98667
[53,] 852.15804 762.57236
[54,] 363.74372 852.15804
[55,] 516.32940 363.74372
[56,] 505.91508 516.32940
[57,] 739.50076 505.91508
[58,] 919.08644 739.50076
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1030.70263 1046.11695
2 1046.28831 1030.70263
3 998.87399 1046.28831
4 946.45967 998.87399
5 915.04535 946.45967
6 759.63103 915.04535
7 733.21672 759.63103
8 556.80240 733.21672
9 452.38808 556.80240
10 443.97376 452.38808
11 353.55944 443.97376
12 221.14512 353.55944
13 109.73080 221.14512
14 -124.68352 109.73080
15 -289.09784 -124.68352
16 -287.51216 -289.09784
17 -450.92648 -287.51216
18 -650.34079 -450.92648
19 -830.75511 -650.34079
20 -812.16943 -830.75511
21 -747.58375 -812.16943
22 -779.99807 -747.58375
23 -1084.41239 -779.99807
24 -1078.82671 -1084.41239
25 -1045.24103 -1078.82671
26 -1058.65535 -1045.24103
27 -869.06967 -1058.65535
28 -974.48399 -869.06967
29 -766.89831 -974.48399
30 -678.31262 -766.89831
31 -857.72694 -678.31262
32 -726.14126 -857.72694
33 -699.55558 -726.14126
34 -242.96990 -699.55558
35 331.61578 -242.96990
36 292.20146 331.61578
37 119.78714 292.20146
38 -150.62718 119.78714
39 -220.04150 -150.62718
40 -621.45582 -220.04150
41 -1026.87013 -621.45582
42 -1038.28445 -1026.87013
43 -1180.69877 -1038.28445
44 -1160.11309 -1180.69877
45 -755.52741 -1160.11309
46 -69.94173 -755.52741
47 717.64395 -69.94173
48 829.22963 717.64395
49 1402.81531 829.22963
50 1667.40099 1402.81531
51 1644.98667 1667.40099
52 762.57236 1644.98667
53 852.15804 762.57236
54 363.74372 852.15804
55 516.32940 363.74372
56 505.91508 516.32940
57 739.50076 505.91508
58 919.08644 739.50076
> 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/7hin51292700188.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/8hin51292700188.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/9hin51292700188.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/10sr5q1292700188.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/11e9le1292700188.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/126j3h1292700188.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/13d2ht1292700188.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/146bhe1292700188.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/159bfj1292700188.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/16n3va1292700188.tab")
+ }
>
> try(system("convert tmp/1lqqw1292700188.ps tmp/1lqqw1292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/2lqqw1292700188.ps tmp/2lqqw1292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/3lqqw1292700188.ps tmp/3lqqw1292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ehph1292700188.ps tmp/4ehph1292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ehph1292700188.ps tmp/5ehph1292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/678ok1292700188.ps tmp/678ok1292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/7hin51292700188.ps tmp/7hin51292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/8hin51292700188.ps tmp/8hin51292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/9hin51292700188.ps tmp/9hin51292700188.png",intern=TRUE))
character(0)
> try(system("convert tmp/10sr5q1292700188.ps tmp/10sr5q1292700188.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.824 2.488 4.275