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,2.1,6.406028945,4,9.1,4.02325246,4,15.8,-1.638272164,1,5.2,5.204119983,4,10.9,3.51851394,1,8.3,4.717337583,1,11.0,-0.37161107,4,3.2,5.667452953,5,6.3,-1.124938737,1,8.6,3.477121255,2,6.6,-0.105130343,2,9.5,-0.698970004,2,3.3,4.441852176,5,11.0,-0.920818754,2,4.7,4.929418926,1,10.4,-0.995678626,3,7.4,3.017033339,4,2.1,5.716837723,5,7.7,-2.301029996,4,17.9,-2,1,6.1,4.792391689,1,11.9,-1.638272164,3,10.8,-1.318758763,3,13.8,3.230448921,1,14.3,3.544068044,1,15.2,-0.318758763,2,10.0,4,4,11.9,3.209515015,2,6.5,5.283301229,4,7.5,3.397940009,5,10.6,-0.552841969,3,7.4,3.626853415,1,8.4,3.832508913,2,5.7,-0.124938737,2,4.9,3.556302501,3,3.2,4.744292983,5,11.0,-0.045757491,2,4.9,3.301029996,3,13.2,-0.982966661,2,9.7,3.622214023,4,12.8,3.544068044,1),dim=c(3,42),dimnames=list(c('SWS','LogWb','D'),1:42))
> y <- array(NA,dim=c(3,42),dimnames=list(c('SWS','LogWb','D'),1:42))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> ylab = ''
> xlab = ''
> main = ''
> #'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 LogWb D
1 6.3 3.00000000 3
2 2.1 6.40602895 4
3 9.1 4.02325246 4
4 15.8 -1.63827216 1
5 5.2 5.20411998 4
6 10.9 3.51851394 1
7 8.3 4.71733758 1
8 11.0 -0.37161107 4
9 3.2 5.66745295 5
10 6.3 -1.12493874 1
11 8.6 3.47712126 2
12 6.6 -0.10513034 2
13 9.5 -0.69897000 2
14 3.3 4.44185218 5
15 11.0 -0.92081875 2
16 4.7 4.92941893 1
17 10.4 -0.99567863 3
18 7.4 3.01703334 4
19 2.1 5.71683772 5
20 7.7 -2.30103000 4
21 17.9 -2.00000000 1
22 6.1 4.79239169 1
23 11.9 -1.63827216 3
24 10.8 -1.31875876 3
25 13.8 3.23044892 1
26 14.3 3.54406804 1
27 15.2 -0.31875876 2
28 10.0 4.00000000 4
29 11.9 3.20951502 2
30 6.5 5.28330123 4
31 7.5 3.39794001 5
32 10.6 -0.55284197 3
33 7.4 3.62685341 1
34 8.4 3.83250891 2
35 5.7 -0.12493874 2
36 4.9 3.55630250 3
37 3.2 4.74429298 5
38 11.0 -0.04575749 2
39 4.9 3.30103000 3
40 13.2 -0.98296666 2
41 9.7 3.62221402 4
42 12.8 3.54406804 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) LogWb D
13.2022 -0.6785 -1.1010
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.564 -1.910 -0.036 2.069 4.604
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13.2022 0.9669 13.654 < 2e-16 ***
LogWb -0.6785 0.1744 -3.891 0.000378 ***
D -1.1010 0.3320 -3.316 0.001981 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.822 on 39 degrees of freedom
Multiple R-squared: 0.4856, Adjusted R-squared: 0.4592
F-statistic: 18.41 on 2 and 39 DF, p-value: 2.349e-06
> 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.3866663 0.7733325 0.6133337
[2,] 0.2244688 0.4489375 0.7755312
[3,] 0.1249391 0.2498783 0.8750609
[4,] 0.0616557 0.1233114 0.9383443
[5,] 0.6720082 0.6559835 0.3279918
[6,] 0.5619982 0.8760035 0.4380018
[7,] 0.6521378 0.6957245 0.3478622
[8,] 0.5745548 0.8508904 0.4254452
[9,] 0.4922229 0.9844457 0.5077771
[10,] 0.3984713 0.7969427 0.6015287
[11,] 0.4560612 0.9121224 0.5439388
[12,] 0.3616378 0.7232757 0.6383622
[13,] 0.2801220 0.5602440 0.7198780
[14,] 0.2315431 0.4630862 0.7684569
[15,] 0.2253841 0.4507683 0.7746159
[16,] 0.3857458 0.7714916 0.6142542
[17,] 0.3963658 0.7927316 0.6036342
[18,] 0.3181920 0.6363839 0.6818080
[19,] 0.2374070 0.4748140 0.7625930
[20,] 0.3023779 0.6047558 0.6976221
[21,] 0.4204007 0.8408014 0.5795993
[22,] 0.5167698 0.9664603 0.4832302
[23,] 0.5668595 0.8662809 0.4331405
[24,] 0.5858043 0.8283915 0.4141957
[25,] 0.4899104 0.9798209 0.5100896
[26,] 0.4331512 0.8663025 0.5668488
[27,] 0.3350155 0.6700309 0.6649845
[28,] 0.2951331 0.5902662 0.7048669
[29,] 0.1943366 0.3886732 0.8056634
[30,] 0.4077199 0.8154398 0.5922801
[31,] 0.3918999 0.7837998 0.6081001
> postscript(file="/var/www/html/rcomp/tmp/1k4vq1292319101.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/2dvct1292319101.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/3dvct1292319101.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/4dvct1292319101.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/56mte1292319101.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 = 42
Frequency = 1
1 2 3 4 5
-1.5635238086 -2.3514088869 3.0318109256 2.5872204867 -0.0669375818
6 7 8 9 10
1.1862434359 -0.6003213441 1.9497736566 -0.6515238111 -6.5644684906
11 12 13 14 15
-0.0408132031 -4.4714706511 -1.9744073951 -1.3831280620 -0.6249379487
16 17 18 19 20
-4.0564182480 -0.1747030060 0.6490632364 -1.7180148696 -2.6593908045
21 22 23 24 25
4.4417780785 -2.7493950435 0.8892793871 0.0060781257 3.8907833001
26 27 28 29 30
4.6035826070 3.9835765180 3.9160334841 3.0776085122 1.2867890982
31 32 33 34 35
2.1085484676 0.3257739955 -2.2402452139 0.0003272177 -5.3849111979
36 37 38 39 40
-2.5860570729 -1.2779135538 -0.0311845179 -2.7592665749 1.5328929660
41 42
3.3596951802 3.1035826070
> postscript(file="/var/www/html/rcomp/tmp/66mte1292319101.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 = 42
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.5635238086 NA
1 -2.3514088869 -1.5635238086
2 3.0318109256 -2.3514088869
3 2.5872204867 3.0318109256
4 -0.0669375818 2.5872204867
5 1.1862434359 -0.0669375818
6 -0.6003213441 1.1862434359
7 1.9497736566 -0.6003213441
8 -0.6515238111 1.9497736566
9 -6.5644684906 -0.6515238111
10 -0.0408132031 -6.5644684906
11 -4.4714706511 -0.0408132031
12 -1.9744073951 -4.4714706511
13 -1.3831280620 -1.9744073951
14 -0.6249379487 -1.3831280620
15 -4.0564182480 -0.6249379487
16 -0.1747030060 -4.0564182480
17 0.6490632364 -0.1747030060
18 -1.7180148696 0.6490632364
19 -2.6593908045 -1.7180148696
20 4.4417780785 -2.6593908045
21 -2.7493950435 4.4417780785
22 0.8892793871 -2.7493950435
23 0.0060781257 0.8892793871
24 3.8907833001 0.0060781257
25 4.6035826070 3.8907833001
26 3.9835765180 4.6035826070
27 3.9160334841 3.9835765180
28 3.0776085122 3.9160334841
29 1.2867890982 3.0776085122
30 2.1085484676 1.2867890982
31 0.3257739955 2.1085484676
32 -2.2402452139 0.3257739955
33 0.0003272177 -2.2402452139
34 -5.3849111979 0.0003272177
35 -2.5860570729 -5.3849111979
36 -1.2779135538 -2.5860570729
37 -0.0311845179 -1.2779135538
38 -2.7592665749 -0.0311845179
39 1.5328929660 -2.7592665749
40 3.3596951802 1.5328929660
41 3.1035826070 3.3596951802
42 NA 3.1035826070
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.3514088869 -1.5635238086
[2,] 3.0318109256 -2.3514088869
[3,] 2.5872204867 3.0318109256
[4,] -0.0669375818 2.5872204867
[5,] 1.1862434359 -0.0669375818
[6,] -0.6003213441 1.1862434359
[7,] 1.9497736566 -0.6003213441
[8,] -0.6515238111 1.9497736566
[9,] -6.5644684906 -0.6515238111
[10,] -0.0408132031 -6.5644684906
[11,] -4.4714706511 -0.0408132031
[12,] -1.9744073951 -4.4714706511
[13,] -1.3831280620 -1.9744073951
[14,] -0.6249379487 -1.3831280620
[15,] -4.0564182480 -0.6249379487
[16,] -0.1747030060 -4.0564182480
[17,] 0.6490632364 -0.1747030060
[18,] -1.7180148696 0.6490632364
[19,] -2.6593908045 -1.7180148696
[20,] 4.4417780785 -2.6593908045
[21,] -2.7493950435 4.4417780785
[22,] 0.8892793871 -2.7493950435
[23,] 0.0060781257 0.8892793871
[24,] 3.8907833001 0.0060781257
[25,] 4.6035826070 3.8907833001
[26,] 3.9835765180 4.6035826070
[27,] 3.9160334841 3.9835765180
[28,] 3.0776085122 3.9160334841
[29,] 1.2867890982 3.0776085122
[30,] 2.1085484676 1.2867890982
[31,] 0.3257739955 2.1085484676
[32,] -2.2402452139 0.3257739955
[33,] 0.0003272177 -2.2402452139
[34,] -5.3849111979 0.0003272177
[35,] -2.5860570729 -5.3849111979
[36,] -1.2779135538 -2.5860570729
[37,] -0.0311845179 -1.2779135538
[38,] -2.7592665749 -0.0311845179
[39,] 1.5328929660 -2.7592665749
[40,] 3.3596951802 1.5328929660
[41,] 3.1035826070 3.3596951802
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.3514088869 -1.5635238086
2 3.0318109256 -2.3514088869
3 2.5872204867 3.0318109256
4 -0.0669375818 2.5872204867
5 1.1862434359 -0.0669375818
6 -0.6003213441 1.1862434359
7 1.9497736566 -0.6003213441
8 -0.6515238111 1.9497736566
9 -6.5644684906 -0.6515238111
10 -0.0408132031 -6.5644684906
11 -4.4714706511 -0.0408132031
12 -1.9744073951 -4.4714706511
13 -1.3831280620 -1.9744073951
14 -0.6249379487 -1.3831280620
15 -4.0564182480 -0.6249379487
16 -0.1747030060 -4.0564182480
17 0.6490632364 -0.1747030060
18 -1.7180148696 0.6490632364
19 -2.6593908045 -1.7180148696
20 4.4417780785 -2.6593908045
21 -2.7493950435 4.4417780785
22 0.8892793871 -2.7493950435
23 0.0060781257 0.8892793871
24 3.8907833001 0.0060781257
25 4.6035826070 3.8907833001
26 3.9835765180 4.6035826070
27 3.9160334841 3.9835765180
28 3.0776085122 3.9160334841
29 1.2867890982 3.0776085122
30 2.1085484676 1.2867890982
31 0.3257739955 2.1085484676
32 -2.2402452139 0.3257739955
33 0.0003272177 -2.2402452139
34 -5.3849111979 0.0003272177
35 -2.5860570729 -5.3849111979
36 -1.2779135538 -2.5860570729
37 -0.0311845179 -1.2779135538
38 -2.7592665749 -0.0311845179
39 1.5328929660 -2.7592665749
40 3.3596951802 1.5328929660
41 3.1035826070 3.3596951802
> 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/7zvth1292319101.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/8zvth1292319101.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/9rna21292319101.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/10rna21292319101.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/11v5881292319101.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/12yo7w1292319101.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/13cyn51292319101.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/14yg3t1292319101.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/151zkz1292319101.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/164him1292319101.tab")
+ }
>
> try(system("convert tmp/1k4vq1292319101.ps tmp/1k4vq1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/2dvct1292319101.ps tmp/2dvct1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/3dvct1292319101.ps tmp/3dvct1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/4dvct1292319101.ps tmp/4dvct1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/56mte1292319101.ps tmp/56mte1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/66mte1292319101.ps tmp/66mte1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/7zvth1292319101.ps tmp/7zvth1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/8zvth1292319101.ps tmp/8zvth1292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/9rna21292319101.ps tmp/9rna21292319101.png",intern=TRUE))
character(0)
> try(system("convert tmp/10rna21292319101.ps tmp/10rna21292319101.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.403 1.657 6.811