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.
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(604.4,0,883.9,0,527.9,0,756.2,0,812.9,0,655.6,0,707.6,0,612.6,0,659.2,0,833.4,0,727.8,0,797.2,0,753,0,762,0,613.7,0,759.2,0,816.4,0,736.8,0,680.1,0,736.5,0,637.2,0,801.9,0,772.3,0,897.3,0,792.1,0,826.8,0,666.8,0,906.6,0,871.4,0,891,0,739.2,0,833.6,0,715.6,0,871.6,0,751.6,0,1005.5,0,681.2,0,837.3,0,674.7,0,806.3,0,860.2,0,689.8,0,691.6,0,682.6,0,800.1,0,1023.7,0,733.5,0,875.3,0,770.2,0,1005.7,1,982.3,1,742.9,1,974.2,1,822.3,1,773.2,1,750.9,1,708,1,690,1,652.8,1,620.7,1,461.9,1),dim=c(2,61),dimnames=list(c('UitvoerBEVS','Dummy'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('UitvoerBEVS','Dummy'),1:61))
> 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
UitvoerBEVS Dummy
1 604.4 0
2 883.9 0
3 527.9 0
4 756.2 0
5 812.9 0
6 655.6 0
7 707.6 0
8 612.6 0
9 659.2 0
10 833.4 0
11 727.8 0
12 797.2 0
13 753.0 0
14 762.0 0
15 613.7 0
16 759.2 0
17 816.4 0
18 736.8 0
19 680.1 0
20 736.5 0
21 637.2 0
22 801.9 0
23 772.3 0
24 897.3 0
25 792.1 0
26 826.8 0
27 666.8 0
28 906.6 0
29 871.4 0
30 891.0 0
31 739.2 0
32 833.6 0
33 715.6 0
34 871.6 0
35 751.6 0
36 1005.5 0
37 681.2 0
38 837.3 0
39 674.7 0
40 806.3 0
41 860.2 0
42 689.8 0
43 691.6 0
44 682.6 0
45 800.1 0
46 1023.7 0
47 733.5 0
48 875.3 0
49 770.2 0
50 1005.7 1
51 982.3 1
52 742.9 1
53 974.2 1
54 822.3 1
55 773.2 1
56 750.9 1
57 708.0 1
58 690.0 1
59 652.8 1
60 620.7 1
61 461.9 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
766.1918 -0.7835
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-303.508 -76.392 -9.992 67.208 257.508
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 766.1918 16.4374 46.613 <2e-16 ***
Dummy -0.7835 37.0602 -0.021 0.983
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 115.1 on 59 degrees of freedom
Multiple R-squared: 7.575e-06, Adjusted R-squared: -0.01694
F-statistic: 0.000447 on 1 and 59 DF, p-value: 0.9832
> 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.912536040 0.17492792 0.08746396
[2,] 0.855771225 0.28845755 0.14422877
[3,] 0.766055254 0.46788949 0.23394475
[4,] 0.730941228 0.53811754 0.26905877
[5,] 0.647286767 0.70542647 0.35271323
[6,] 0.660385083 0.67922983 0.33961492
[7,] 0.563935207 0.87212959 0.43606479
[8,] 0.508565044 0.98286991 0.49143496
[9,] 0.418714673 0.83742935 0.58128533
[10,] 0.337658728 0.67531746 0.66234127
[11,] 0.350893693 0.70178739 0.64910631
[12,] 0.280799524 0.56159905 0.71920048
[13,] 0.253625332 0.50725066 0.74637467
[14,] 0.192007003 0.38401401 0.80799300
[15,] 0.155778339 0.31155668 0.84422166
[16,] 0.113394466 0.22678893 0.88660553
[17,] 0.113468951 0.22693790 0.88653105
[18,] 0.093634653 0.18726931 0.90636535
[19,] 0.068788434 0.13757687 0.93121157
[20,] 0.102906863 0.20581373 0.89709314
[21,] 0.077764557 0.15552911 0.92223544
[22,] 0.065037555 0.13007511 0.93496244
[23,] 0.058737856 0.11747571 0.94126214
[24,] 0.082472210 0.16494442 0.91752779
[25,] 0.082992152 0.16598430 0.91700785
[26,] 0.091790281 0.18358056 0.90820972
[27,] 0.066269183 0.13253837 0.93373082
[28,] 0.052240071 0.10448014 0.94775993
[29,] 0.038546183 0.07709237 0.96145382
[30,] 0.035901760 0.07180352 0.96409824
[31,] 0.023790438 0.04758088 0.97620956
[32,] 0.080815974 0.16163195 0.91918403
[33,] 0.069474246 0.13894849 0.93052575
[34,] 0.053378452 0.10675690 0.94662155
[35,] 0.047350729 0.09470146 0.95264927
[36,] 0.032120207 0.06424041 0.96787979
[37,] 0.025785156 0.05157031 0.97421484
[38,] 0.020549954 0.04109991 0.97945005
[39,] 0.016915389 0.03383078 0.98308461
[40,] 0.016322897 0.03264579 0.98367710
[41,] 0.010260517 0.02052103 0.98973948
[42,] 0.034063592 0.06812718 0.96593641
[43,] 0.023182288 0.04636458 0.97681771
[44,] 0.017584809 0.03516962 0.98241519
[45,] 0.009822067 0.01964413 0.99017793
[46,] 0.023528131 0.04705626 0.97647187
[47,] 0.066053181 0.13210636 0.93394682
[48,] 0.055896633 0.11179327 0.94410337
[49,] 0.247523814 0.49504763 0.75247619
[50,] 0.307565848 0.61513170 0.69243415
[51,] 0.317779423 0.63555885 0.68222058
[52,] 0.318777246 0.63755449 0.68122275
> postscript(file="/var/www/html/freestat/rcomp/tmp/1jqct1227375587.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/freestat/rcomp/tmp/26hfz1227375587.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/freestat/rcomp/tmp/3r1x91227375587.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/freestat/rcomp/tmp/413i91227375587.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/freestat/rcomp/tmp/5daem1227375587.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 = 61
Frequency = 1
1 2 3 4 5 6
-161.791837 117.708163 -238.291837 -9.991837 46.708163 -110.591837
7 8 9 10 11 12
-58.591837 -153.591837 -106.991837 67.208163 -38.391837 31.008163
13 14 15 16 17 18
-13.191837 -4.191837 -152.491837 -6.991837 50.208163 -29.391837
19 20 21 22 23 24
-86.091837 -29.691837 -128.991837 35.708163 6.108163 131.108163
25 26 27 28 29 30
25.908163 60.608163 -99.391837 140.408163 105.208163 124.808163
31 32 33 34 35 36
-26.991837 67.408163 -50.591837 105.408163 -14.591837 239.308163
37 38 39 40 41 42
-84.991837 71.108163 -91.491837 40.108163 94.008163 -76.391837
43 44 45 46 47 48
-74.591837 -83.591837 33.908163 257.508163 -32.691837 109.108163
49 50 51 52 53 54
4.008163 240.291667 216.891667 -22.508333 208.791667 56.891667
55 56 57 58 59 60
7.791667 -14.508333 -57.408333 -75.408333 -112.608333 -144.708333
61
-303.508333
> postscript(file="/var/www/html/freestat/rcomp/tmp/6ymoj1227375587.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -161.791837 NA
1 117.708163 -161.791837
2 -238.291837 117.708163
3 -9.991837 -238.291837
4 46.708163 -9.991837
5 -110.591837 46.708163
6 -58.591837 -110.591837
7 -153.591837 -58.591837
8 -106.991837 -153.591837
9 67.208163 -106.991837
10 -38.391837 67.208163
11 31.008163 -38.391837
12 -13.191837 31.008163
13 -4.191837 -13.191837
14 -152.491837 -4.191837
15 -6.991837 -152.491837
16 50.208163 -6.991837
17 -29.391837 50.208163
18 -86.091837 -29.391837
19 -29.691837 -86.091837
20 -128.991837 -29.691837
21 35.708163 -128.991837
22 6.108163 35.708163
23 131.108163 6.108163
24 25.908163 131.108163
25 60.608163 25.908163
26 -99.391837 60.608163
27 140.408163 -99.391837
28 105.208163 140.408163
29 124.808163 105.208163
30 -26.991837 124.808163
31 67.408163 -26.991837
32 -50.591837 67.408163
33 105.408163 -50.591837
34 -14.591837 105.408163
35 239.308163 -14.591837
36 -84.991837 239.308163
37 71.108163 -84.991837
38 -91.491837 71.108163
39 40.108163 -91.491837
40 94.008163 40.108163
41 -76.391837 94.008163
42 -74.591837 -76.391837
43 -83.591837 -74.591837
44 33.908163 -83.591837
45 257.508163 33.908163
46 -32.691837 257.508163
47 109.108163 -32.691837
48 4.008163 109.108163
49 240.291667 4.008163
50 216.891667 240.291667
51 -22.508333 216.891667
52 208.791667 -22.508333
53 56.891667 208.791667
54 7.791667 56.891667
55 -14.508333 7.791667
56 -57.408333 -14.508333
57 -75.408333 -57.408333
58 -112.608333 -75.408333
59 -144.708333 -112.608333
60 -303.508333 -144.708333
61 NA -303.508333
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 117.708163 -161.791837
[2,] -238.291837 117.708163
[3,] -9.991837 -238.291837
[4,] 46.708163 -9.991837
[5,] -110.591837 46.708163
[6,] -58.591837 -110.591837
[7,] -153.591837 -58.591837
[8,] -106.991837 -153.591837
[9,] 67.208163 -106.991837
[10,] -38.391837 67.208163
[11,] 31.008163 -38.391837
[12,] -13.191837 31.008163
[13,] -4.191837 -13.191837
[14,] -152.491837 -4.191837
[15,] -6.991837 -152.491837
[16,] 50.208163 -6.991837
[17,] -29.391837 50.208163
[18,] -86.091837 -29.391837
[19,] -29.691837 -86.091837
[20,] -128.991837 -29.691837
[21,] 35.708163 -128.991837
[22,] 6.108163 35.708163
[23,] 131.108163 6.108163
[24,] 25.908163 131.108163
[25,] 60.608163 25.908163
[26,] -99.391837 60.608163
[27,] 140.408163 -99.391837
[28,] 105.208163 140.408163
[29,] 124.808163 105.208163
[30,] -26.991837 124.808163
[31,] 67.408163 -26.991837
[32,] -50.591837 67.408163
[33,] 105.408163 -50.591837
[34,] -14.591837 105.408163
[35,] 239.308163 -14.591837
[36,] -84.991837 239.308163
[37,] 71.108163 -84.991837
[38,] -91.491837 71.108163
[39,] 40.108163 -91.491837
[40,] 94.008163 40.108163
[41,] -76.391837 94.008163
[42,] -74.591837 -76.391837
[43,] -83.591837 -74.591837
[44,] 33.908163 -83.591837
[45,] 257.508163 33.908163
[46,] -32.691837 257.508163
[47,] 109.108163 -32.691837
[48,] 4.008163 109.108163
[49,] 240.291667 4.008163
[50,] 216.891667 240.291667
[51,] -22.508333 216.891667
[52,] 208.791667 -22.508333
[53,] 56.891667 208.791667
[54,] 7.791667 56.891667
[55,] -14.508333 7.791667
[56,] -57.408333 -14.508333
[57,] -75.408333 -57.408333
[58,] -112.608333 -75.408333
[59,] -144.708333 -112.608333
[60,] -303.508333 -144.708333
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 117.708163 -161.791837
2 -238.291837 117.708163
3 -9.991837 -238.291837
4 46.708163 -9.991837
5 -110.591837 46.708163
6 -58.591837 -110.591837
7 -153.591837 -58.591837
8 -106.991837 -153.591837
9 67.208163 -106.991837
10 -38.391837 67.208163
11 31.008163 -38.391837
12 -13.191837 31.008163
13 -4.191837 -13.191837
14 -152.491837 -4.191837
15 -6.991837 -152.491837
16 50.208163 -6.991837
17 -29.391837 50.208163
18 -86.091837 -29.391837
19 -29.691837 -86.091837
20 -128.991837 -29.691837
21 35.708163 -128.991837
22 6.108163 35.708163
23 131.108163 6.108163
24 25.908163 131.108163
25 60.608163 25.908163
26 -99.391837 60.608163
27 140.408163 -99.391837
28 105.208163 140.408163
29 124.808163 105.208163
30 -26.991837 124.808163
31 67.408163 -26.991837
32 -50.591837 67.408163
33 105.408163 -50.591837
34 -14.591837 105.408163
35 239.308163 -14.591837
36 -84.991837 239.308163
37 71.108163 -84.991837
38 -91.491837 71.108163
39 40.108163 -91.491837
40 94.008163 40.108163
41 -76.391837 94.008163
42 -74.591837 -76.391837
43 -83.591837 -74.591837
44 33.908163 -83.591837
45 257.508163 33.908163
46 -32.691837 257.508163
47 109.108163 -32.691837
48 4.008163 109.108163
49 240.291667 4.008163
50 216.891667 240.291667
51 -22.508333 216.891667
52 208.791667 -22.508333
53 56.891667 208.791667
54 7.791667 56.891667
55 -14.508333 7.791667
56 -57.408333 -14.508333
57 -75.408333 -57.408333
58 -112.608333 -75.408333
59 -144.708333 -112.608333
60 -303.508333 -144.708333
> 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/7cxon1227375587.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/freestat/rcomp/tmp/827u41227375587.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/freestat/rcomp/tmp/9tp1f1227375587.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/freestat/rcomp/tmp/10pbjh1227375587.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/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/11os1v1227375587.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/12drrf1227375587.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/13s64f1227375587.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/143oey1227375587.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/15ndtd1227375587.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/16qa481227375587.tab")
+ }
>
> system("convert tmp/1jqct1227375587.ps tmp/1jqct1227375587.png")
> system("convert tmp/26hfz1227375587.ps tmp/26hfz1227375587.png")
> system("convert tmp/3r1x91227375587.ps tmp/3r1x91227375587.png")
> system("convert tmp/413i91227375587.ps tmp/413i91227375587.png")
> system("convert tmp/5daem1227375587.ps tmp/5daem1227375587.png")
> system("convert tmp/6ymoj1227375587.ps tmp/6ymoj1227375587.png")
> system("convert tmp/7cxon1227375587.ps tmp/7cxon1227375587.png")
> system("convert tmp/827u41227375587.ps tmp/827u41227375587.png")
> system("convert tmp/9tp1f1227375587.ps tmp/9tp1f1227375587.png")
> system("convert tmp/10pbjh1227375587.ps tmp/10pbjh1227375587.png")
>
>
> proc.time()
user system elapsed
3.691 2.481 4.054