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(6.3,3,3.00,2.1,4,6.41,9.1,4,4.02,15.8,1,-1.64,5.2,4,5.20,10.9,1,3.52,8.3,1,4.72,11.0,4,-0.37,3.2,5,5.67,7.6,2,-0.26,6.3,1,-1.12,8.6,2,3.48,6.6,2,-0.11,9.5,2,-0.70,4.8,1,3.15,12.0,1,4.78,3.3,5,4.44,11.0,2,-0.92,4.7,1,4.93,10.4,3,-1.00,7.4,4,3.02,2.1,5,5.72,7.7,4,-2.30,17.9,1,-2.00,6.1,1,4.79,8.2,1,-0.91,8.4,3,3.13,11.9,3,-1.64,10.8,3,-1.32,13.8,1,3.23,14.3,1,3.54,15.2,2,-0.32,10.0,4,4.00,11.9,2,3.21,6.5,4,5.28,7.5,5,3.40,10.6,3,-0.55,7.4,1,3.63,8.4,2,3.83,5.7,2,-0.12,4.9,3,3.56,3.2,5,4.74,8.1,2,-1.22,11.0,2,-0.05,4.9,3,3.30,13.2,2,-0.98,9.7,4,3.62,12.8,1,3.54),dim=c(3,48),dimnames=list(c('SWS','D','Wb'),1:48))
> y <- array(NA,dim=c(3,48),dimnames=list(c('SWS','D','Wb'),1:48))
> 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
SWS D Wb
1 6.3 3 3.00
2 2.1 4 6.41
3 9.1 4 4.02
4 15.8 1 -1.64
5 5.2 4 5.20
6 10.9 1 3.52
7 8.3 1 4.72
8 11.0 4 -0.37
9 3.2 5 5.67
10 7.6 2 -0.26
11 6.3 1 -1.12
12 8.6 2 3.48
13 6.6 2 -0.11
14 9.5 2 -0.70
15 4.8 1 3.15
16 12.0 1 4.78
17 3.3 5 4.44
18 11.0 2 -0.92
19 4.7 1 4.93
20 10.4 3 -1.00
21 7.4 4 3.02
22 2.1 5 5.72
23 7.7 4 -2.30
24 17.9 1 -2.00
25 6.1 1 4.79
26 8.2 1 -0.91
27 8.4 3 3.13
28 11.9 3 -1.64
29 10.8 3 -1.32
30 13.8 1 3.23
31 14.3 1 3.54
32 15.2 2 -0.32
33 10.0 4 4.00
34 11.9 2 3.21
35 6.5 4 5.28
36 7.5 5 3.40
37 10.6 3 -0.55
38 7.4 1 3.63
39 8.4 2 3.83
40 5.7 2 -0.12
41 4.9 3 3.56
42 3.2 5 4.74
43 8.1 2 -1.22
44 11.0 2 -0.05
45 4.9 3 3.30
46 13.2 2 -0.98
47 9.7 4 3.62
48 12.8 1 3.54
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) D Wb
12.4251 -0.9894 -0.5764
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.7813 -2.1962 0.1605 2.2214 5.3114
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 12.4251 0.9135 13.602 < 2e-16 ***
D -0.9894 0.3252 -3.042 0.00391 **
Wb -0.5764 0.1699 -3.393 0.00145 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.926 on 45 degrees of freedom
Multiple R-squared: 0.3901, Adjusted R-squared: 0.363
F-statistic: 14.39 on 2 and 45 DF, p-value: 1.472e-05
> 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.36920803 0.7384161 0.6307920
[2,] 0.21065279 0.4213056 0.7893472
[3,] 0.11587110 0.2317422 0.8841289
[4,] 0.05678271 0.1135654 0.9432173
[5,] 0.24066100 0.4813220 0.7593390
[6,] 0.60485018 0.7902996 0.3951498
[7,] 0.49968695 0.9993739 0.5003130
[8,] 0.53347512 0.9330498 0.4665249
[9,] 0.43936923 0.8787385 0.5606308
[10,] 0.52440588 0.9511882 0.4755941
[11,] 0.59965057 0.8006989 0.4003494
[12,] 0.52745979 0.9450804 0.4725402
[13,] 0.44370527 0.8874105 0.5562947
[14,] 0.49636209 0.9927242 0.5036379
[15,] 0.41231543 0.8246309 0.5876846
[16,] 0.33383183 0.6676637 0.6661682
[17,] 0.29388927 0.5877785 0.7061107
[18,] 0.25168872 0.5033774 0.7483113
[19,] 0.45811719 0.9162344 0.5418828
[20,] 0.46063595 0.9212719 0.5393640
[21,] 0.52426312 0.9514738 0.4757369
[22,] 0.44662791 0.8932558 0.5533721
[23,] 0.38669236 0.7733847 0.6133076
[24,] 0.30937770 0.6187554 0.6906223
[25,] 0.36444389 0.7288878 0.6355561
[26,] 0.47331261 0.9466252 0.5266874
[27,] 0.61281260 0.7743748 0.3871874
[28,] 0.64558207 0.7088359 0.3544179
[29,] 0.66753744 0.6649251 0.3324626
[30,] 0.57480326 0.8503935 0.4251967
[31,] 0.51850920 0.9629816 0.4814908
[32,] 0.44462569 0.8892514 0.5553743
[33,] 0.40635028 0.8127006 0.5936497
[34,] 0.29655092 0.5931018 0.7034491
[35,] 0.40789682 0.8157936 0.5921032
[36,] 0.38901790 0.7780358 0.6109821
[37,] 0.27170224 0.5434045 0.7282978
> postscript(file="/var/www/html/rcomp/tmp/1ecrj1292279222.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/rcomp/tmp/2o3rm1292279222.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/rcomp/tmp/3o3rm1292279222.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/rcomp/tmp/4o3rm1292279222.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/rcomp/tmp/5zuqo1292279222.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 = 48
Frequency = 1
1 2 3 4 5 6
-1.42763148 -2.67259840 2.94972387 3.41892891 -0.27008378 1.49332936
7 8 9 10 11 12
-0.41494960 2.31917775 -1.00976723 -2.99619943 -5.78132531 0.15966446
13 14 15 16 17 18
-3.90973430 -1.34983047 -4.81995129 3.31963645 -1.61878130 0.02335400
19 20 21 22 23 24
-3.89389842 0.36663174 0.67328968 -2.08094552 -2.09334025 5.31141260
25 26 27 28 29 30
-2.57459921 -3.76027413 0.74730497 1.49771385 0.58217279 4.22616345
31 32 33 34 35 36
4.90485805 4.56921452 3.83819519 3.30402723 1.07603096 1.98172714
37 38 39 40 41 42
0.82602713 -1.94326288 0.16141643 -4.81549864 -2.50482833 -1.54585104
43 44 45 46 47 48
-3.04957626 0.52485175 -2.65470122 2.18876795 3.31915019 3.40485805
> postscript(file="/var/www/html/rcomp/tmp/6zuqo1292279222.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 = 48
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.42763148 NA
1 -2.67259840 -1.42763148
2 2.94972387 -2.67259840
3 3.41892891 2.94972387
4 -0.27008378 3.41892891
5 1.49332936 -0.27008378
6 -0.41494960 1.49332936
7 2.31917775 -0.41494960
8 -1.00976723 2.31917775
9 -2.99619943 -1.00976723
10 -5.78132531 -2.99619943
11 0.15966446 -5.78132531
12 -3.90973430 0.15966446
13 -1.34983047 -3.90973430
14 -4.81995129 -1.34983047
15 3.31963645 -4.81995129
16 -1.61878130 3.31963645
17 0.02335400 -1.61878130
18 -3.89389842 0.02335400
19 0.36663174 -3.89389842
20 0.67328968 0.36663174
21 -2.08094552 0.67328968
22 -2.09334025 -2.08094552
23 5.31141260 -2.09334025
24 -2.57459921 5.31141260
25 -3.76027413 -2.57459921
26 0.74730497 -3.76027413
27 1.49771385 0.74730497
28 0.58217279 1.49771385
29 4.22616345 0.58217279
30 4.90485805 4.22616345
31 4.56921452 4.90485805
32 3.83819519 4.56921452
33 3.30402723 3.83819519
34 1.07603096 3.30402723
35 1.98172714 1.07603096
36 0.82602713 1.98172714
37 -1.94326288 0.82602713
38 0.16141643 -1.94326288
39 -4.81549864 0.16141643
40 -2.50482833 -4.81549864
41 -1.54585104 -2.50482833
42 -3.04957626 -1.54585104
43 0.52485175 -3.04957626
44 -2.65470122 0.52485175
45 2.18876795 -2.65470122
46 3.31915019 2.18876795
47 3.40485805 3.31915019
48 NA 3.40485805
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.67259840 -1.42763148
[2,] 2.94972387 -2.67259840
[3,] 3.41892891 2.94972387
[4,] -0.27008378 3.41892891
[5,] 1.49332936 -0.27008378
[6,] -0.41494960 1.49332936
[7,] 2.31917775 -0.41494960
[8,] -1.00976723 2.31917775
[9,] -2.99619943 -1.00976723
[10,] -5.78132531 -2.99619943
[11,] 0.15966446 -5.78132531
[12,] -3.90973430 0.15966446
[13,] -1.34983047 -3.90973430
[14,] -4.81995129 -1.34983047
[15,] 3.31963645 -4.81995129
[16,] -1.61878130 3.31963645
[17,] 0.02335400 -1.61878130
[18,] -3.89389842 0.02335400
[19,] 0.36663174 -3.89389842
[20,] 0.67328968 0.36663174
[21,] -2.08094552 0.67328968
[22,] -2.09334025 -2.08094552
[23,] 5.31141260 -2.09334025
[24,] -2.57459921 5.31141260
[25,] -3.76027413 -2.57459921
[26,] 0.74730497 -3.76027413
[27,] 1.49771385 0.74730497
[28,] 0.58217279 1.49771385
[29,] 4.22616345 0.58217279
[30,] 4.90485805 4.22616345
[31,] 4.56921452 4.90485805
[32,] 3.83819519 4.56921452
[33,] 3.30402723 3.83819519
[34,] 1.07603096 3.30402723
[35,] 1.98172714 1.07603096
[36,] 0.82602713 1.98172714
[37,] -1.94326288 0.82602713
[38,] 0.16141643 -1.94326288
[39,] -4.81549864 0.16141643
[40,] -2.50482833 -4.81549864
[41,] -1.54585104 -2.50482833
[42,] -3.04957626 -1.54585104
[43,] 0.52485175 -3.04957626
[44,] -2.65470122 0.52485175
[45,] 2.18876795 -2.65470122
[46,] 3.31915019 2.18876795
[47,] 3.40485805 3.31915019
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.67259840 -1.42763148
2 2.94972387 -2.67259840
3 3.41892891 2.94972387
4 -0.27008378 3.41892891
5 1.49332936 -0.27008378
6 -0.41494960 1.49332936
7 2.31917775 -0.41494960
8 -1.00976723 2.31917775
9 -2.99619943 -1.00976723
10 -5.78132531 -2.99619943
11 0.15966446 -5.78132531
12 -3.90973430 0.15966446
13 -1.34983047 -3.90973430
14 -4.81995129 -1.34983047
15 3.31963645 -4.81995129
16 -1.61878130 3.31963645
17 0.02335400 -1.61878130
18 -3.89389842 0.02335400
19 0.36663174 -3.89389842
20 0.67328968 0.36663174
21 -2.08094552 0.67328968
22 -2.09334025 -2.08094552
23 5.31141260 -2.09334025
24 -2.57459921 5.31141260
25 -3.76027413 -2.57459921
26 0.74730497 -3.76027413
27 1.49771385 0.74730497
28 0.58217279 1.49771385
29 4.22616345 0.58217279
30 4.90485805 4.22616345
31 4.56921452 4.90485805
32 3.83819519 4.56921452
33 3.30402723 3.83819519
34 1.07603096 3.30402723
35 1.98172714 1.07603096
36 0.82602713 1.98172714
37 -1.94326288 0.82602713
38 0.16141643 -1.94326288
39 -4.81549864 0.16141643
40 -2.50482833 -4.81549864
41 -1.54585104 -2.50482833
42 -3.04957626 -1.54585104
43 0.52485175 -3.04957626
44 -2.65470122 0.52485175
45 2.18876795 -2.65470122
46 3.31915019 2.18876795
47 3.40485805 3.31915019
> 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/7slp91292279222.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/rcomp/tmp/8slp91292279222.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/rcomp/tmp/92d6c1292279222.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/rcomp/tmp/102d6c1292279222.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/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/11ovn01292279222.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/12re3o1292279222.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/13yxii1292279222.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/142xh61292279222.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/15nyfc1292279222.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/168gw01292279222.tab")
+ }
>
> try(system("convert tmp/1ecrj1292279222.ps tmp/1ecrj1292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/2o3rm1292279222.ps tmp/2o3rm1292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/3o3rm1292279222.ps tmp/3o3rm1292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/4o3rm1292279222.ps tmp/4o3rm1292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/5zuqo1292279222.ps tmp/5zuqo1292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/6zuqo1292279222.ps tmp/6zuqo1292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/7slp91292279222.ps tmp/7slp91292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/8slp91292279222.ps tmp/8slp91292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/92d6c1292279222.ps tmp/92d6c1292279222.png",intern=TRUE))
character(0)
> try(system("convert tmp/102d6c1292279222.ps tmp/102d6c1292279222.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.438 1.617 6.523