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(3.2,1,1.9,1,0,1,0.6,1,0.2,1,0.9,1,2.4,1,4.7,1,9.4,1,12.5,1,15.8,1,18.2,1,16.8,0,17.3,0,19.3,0,17.9,0,20.2,0,18.7,0,20.1,0,18.2,0,18.4,0,18.2,0,18.9,0,19.9,0,21.3,0,20,0,19.5,0,19.6,0,20.9,0,21,0,19.9,0,19.6,0,20.9,0,21.7,0,22.9,0,21.5,0,21.3,0,23.5,0,21.6,0,24.5,0,22.2,0,23.5,0,20.9,0,20.7,0,18.1,0,17.1,0,14.8,0,13.8,0,15.2,0,16,0,17.6,0,15,0,15,0,16.3,0,19.4,0,21.3,0,20.5,0,21.1,0,21.6,0,22.6,0),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> 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
Y X
1 3.2 1
2 1.9 1
3 0.0 1
4 0.6 1
5 0.2 1
6 0.9 1
7 2.4 1
8 4.7 1
9 9.4 1
10 12.5 1
11 15.8 1
12 18.2 1
13 16.8 0
14 17.3 0
15 19.3 0
16 17.9 0
17 20.2 0
18 18.7 0
19 20.1 0
20 18.2 0
21 18.4 0
22 18.2 0
23 18.9 0
24 19.9 0
25 21.3 0
26 20.0 0
27 19.5 0
28 19.6 0
29 20.9 0
30 21.0 0
31 19.9 0
32 19.6 0
33 20.9 0
34 21.7 0
35 22.9 0
36 21.5 0
37 21.3 0
38 23.5 0
39 21.6 0
40 24.5 0
41 22.2 0
42 23.5 0
43 20.9 0
44 20.7 0
45 18.1 0
46 17.1 0
47 14.8 0
48 13.8 0
49 15.2 0
50 16.0 0
51 17.6 0
52 15.0 0
53 15.0 0
54 16.3 0
55 19.4 0
56 21.3 0
57 20.5 0
58 21.1 0
59 21.6 0
60 22.6 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
19.51 -13.69
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.81667 -2.45885 0.09375 1.79375 12.38333
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 19.5063 0.5216 37.40 <2e-16 ***
X -13.6896 1.1664 -11.74 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.614 on 58 degrees of freedom
Multiple R-squared: 0.7037, Adjusted R-squared: 0.6986
F-statistic: 137.7 on 1 and 58 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.12315051 2.463010e-01 8.768495e-01
[2,] 0.06077206 1.215441e-01 9.392279e-01
[3,] 0.04680953 9.361906e-02 9.531905e-01
[4,] 0.16595333 3.319067e-01 8.340467e-01
[5,] 0.84056568 3.188686e-01 1.594343e-01
[6,] 0.99465891 1.068217e-02 5.341086e-03
[7,] 0.99993587 1.282594e-04 6.412972e-05
[8,] 0.99999896 2.085180e-06 1.042590e-06
[9,] 0.99999785 4.292522e-06 2.146261e-06
[10,] 0.99999538 9.239595e-06 4.619798e-06
[11,] 0.99998915 2.169675e-05 1.084837e-05
[12,] 0.99997648 4.703514e-05 2.351757e-05
[13,] 0.99995094 9.812095e-05 4.906048e-05
[14,] 0.99989389 2.122100e-04 1.061050e-04
[15,] 0.99978514 4.297157e-04 2.148579e-04
[16,] 0.99958853 8.229308e-04 4.114654e-04
[17,] 0.99922488 1.550232e-03 7.751159e-04
[18,] 0.99861990 2.760198e-03 1.380099e-03
[19,] 0.99749987 5.000266e-03 2.500133e-03
[20,] 0.99563639 8.727215e-03 4.363608e-03
[21,] 0.99355190 1.289621e-02 6.448105e-03
[22,] 0.98929685 2.140629e-02 1.070315e-02
[23,] 0.98257371 3.485259e-02 1.742629e-02
[24,] 0.97253719 5.492561e-02 2.746281e-02
[25,] 0.96057624 7.884753e-02 3.942376e-02
[26,] 0.94499826 1.100035e-01 5.500174e-02
[27,] 0.92034636 1.593073e-01 7.965364e-02
[28,] 0.88762460 2.247508e-01 1.123754e-01
[29,] 0.85255621 2.948876e-01 1.474438e-01
[30,] 0.82180842 3.563832e-01 1.781916e-01
[31,] 0.81557081 3.688584e-01 1.844292e-01
[32,] 0.77740707 4.451859e-01 2.225929e-01
[33,] 0.73164100 5.367180e-01 2.683590e-01
[34,] 0.75272547 4.945491e-01 2.472745e-01
[35,] 0.71500640 5.699872e-01 2.849936e-01
[36,] 0.80024446 3.995111e-01 1.997555e-01
[37,] 0.79524153 4.095169e-01 2.047585e-01
[38,] 0.85153975 2.969205e-01 1.484602e-01
[39,] 0.82819753 3.436049e-01 1.718025e-01
[40,] 0.80151495 3.969701e-01 1.984850e-01
[41,] 0.73643719 5.271256e-01 2.635628e-01
[42,] 0.66916092 6.616782e-01 3.308391e-01
[43,] 0.67651804 6.469639e-01 3.234820e-01
[44,] 0.75302774 4.939445e-01 2.469723e-01
[45,] 0.75991327 4.801735e-01 2.400867e-01
[46,] 0.73764415 5.247117e-01 2.623559e-01
[47,] 0.65361524 6.927695e-01 3.463848e-01
[48,] 0.72824753 5.435049e-01 2.717525e-01
[49,] 0.87532539 2.493492e-01 1.246746e-01
[50,] 0.98115831 3.768339e-02 1.884169e-02
[51,] 0.98173463 3.653074e-02 1.826537e-02
> postscript(file="/var/www/html/rcomp/tmp/1ytb71258737574.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/rcomp/tmp/22aaq1258737574.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/rcomp/tmp/329mk1258737574.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/rcomp/tmp/4x2wt1258737574.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/rcomp/tmp/5ut2n1258737574.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 = 60
Frequency = 1
1 2 3 4 5 6 7 8
-2.616667 -3.916667 -5.816667 -5.216667 -5.616667 -4.916667 -3.416667 -1.116667
9 10 11 12 13 14 15 16
3.583333 6.683333 9.983333 12.383333 -2.706250 -2.206250 -0.206250 -1.606250
17 18 19 20 21 22 23 24
0.693750 -0.806250 0.593750 -1.306250 -1.106250 -1.306250 -0.606250 0.393750
25 26 27 28 29 30 31 32
1.793750 0.493750 -0.006250 0.093750 1.393750 1.493750 0.393750 0.093750
33 34 35 36 37 38 39 40
1.393750 2.193750 3.393750 1.993750 1.793750 3.993750 2.093750 4.993750
41 42 43 44 45 46 47 48
2.693750 3.993750 1.393750 1.193750 -1.406250 -2.406250 -4.706250 -5.706250
49 50 51 52 53 54 55 56
-4.306250 -3.506250 -1.906250 -4.506250 -4.506250 -3.206250 -0.106250 1.793750
57 58 59 60
0.993750 1.593750 2.093750 3.093750
> postscript(file="/var/www/html/rcomp/tmp/6mt9c1258737574.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.616667 NA
1 -3.916667 -2.616667
2 -5.816667 -3.916667
3 -5.216667 -5.816667
4 -5.616667 -5.216667
5 -4.916667 -5.616667
6 -3.416667 -4.916667
7 -1.116667 -3.416667
8 3.583333 -1.116667
9 6.683333 3.583333
10 9.983333 6.683333
11 12.383333 9.983333
12 -2.706250 12.383333
13 -2.206250 -2.706250
14 -0.206250 -2.206250
15 -1.606250 -0.206250
16 0.693750 -1.606250
17 -0.806250 0.693750
18 0.593750 -0.806250
19 -1.306250 0.593750
20 -1.106250 -1.306250
21 -1.306250 -1.106250
22 -0.606250 -1.306250
23 0.393750 -0.606250
24 1.793750 0.393750
25 0.493750 1.793750
26 -0.006250 0.493750
27 0.093750 -0.006250
28 1.393750 0.093750
29 1.493750 1.393750
30 0.393750 1.493750
31 0.093750 0.393750
32 1.393750 0.093750
33 2.193750 1.393750
34 3.393750 2.193750
35 1.993750 3.393750
36 1.793750 1.993750
37 3.993750 1.793750
38 2.093750 3.993750
39 4.993750 2.093750
40 2.693750 4.993750
41 3.993750 2.693750
42 1.393750 3.993750
43 1.193750 1.393750
44 -1.406250 1.193750
45 -2.406250 -1.406250
46 -4.706250 -2.406250
47 -5.706250 -4.706250
48 -4.306250 -5.706250
49 -3.506250 -4.306250
50 -1.906250 -3.506250
51 -4.506250 -1.906250
52 -4.506250 -4.506250
53 -3.206250 -4.506250
54 -0.106250 -3.206250
55 1.793750 -0.106250
56 0.993750 1.793750
57 1.593750 0.993750
58 2.093750 1.593750
59 3.093750 2.093750
60 NA 3.093750
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -3.916667 -2.616667
[2,] -5.816667 -3.916667
[3,] -5.216667 -5.816667
[4,] -5.616667 -5.216667
[5,] -4.916667 -5.616667
[6,] -3.416667 -4.916667
[7,] -1.116667 -3.416667
[8,] 3.583333 -1.116667
[9,] 6.683333 3.583333
[10,] 9.983333 6.683333
[11,] 12.383333 9.983333
[12,] -2.706250 12.383333
[13,] -2.206250 -2.706250
[14,] -0.206250 -2.206250
[15,] -1.606250 -0.206250
[16,] 0.693750 -1.606250
[17,] -0.806250 0.693750
[18,] 0.593750 -0.806250
[19,] -1.306250 0.593750
[20,] -1.106250 -1.306250
[21,] -1.306250 -1.106250
[22,] -0.606250 -1.306250
[23,] 0.393750 -0.606250
[24,] 1.793750 0.393750
[25,] 0.493750 1.793750
[26,] -0.006250 0.493750
[27,] 0.093750 -0.006250
[28,] 1.393750 0.093750
[29,] 1.493750 1.393750
[30,] 0.393750 1.493750
[31,] 0.093750 0.393750
[32,] 1.393750 0.093750
[33,] 2.193750 1.393750
[34,] 3.393750 2.193750
[35,] 1.993750 3.393750
[36,] 1.793750 1.993750
[37,] 3.993750 1.793750
[38,] 2.093750 3.993750
[39,] 4.993750 2.093750
[40,] 2.693750 4.993750
[41,] 3.993750 2.693750
[42,] 1.393750 3.993750
[43,] 1.193750 1.393750
[44,] -1.406250 1.193750
[45,] -2.406250 -1.406250
[46,] -4.706250 -2.406250
[47,] -5.706250 -4.706250
[48,] -4.306250 -5.706250
[49,] -3.506250 -4.306250
[50,] -1.906250 -3.506250
[51,] -4.506250 -1.906250
[52,] -4.506250 -4.506250
[53,] -3.206250 -4.506250
[54,] -0.106250 -3.206250
[55,] 1.793750 -0.106250
[56,] 0.993750 1.793750
[57,] 1.593750 0.993750
[58,] 2.093750 1.593750
[59,] 3.093750 2.093750
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -3.916667 -2.616667
2 -5.816667 -3.916667
3 -5.216667 -5.816667
4 -5.616667 -5.216667
5 -4.916667 -5.616667
6 -3.416667 -4.916667
7 -1.116667 -3.416667
8 3.583333 -1.116667
9 6.683333 3.583333
10 9.983333 6.683333
11 12.383333 9.983333
12 -2.706250 12.383333
13 -2.206250 -2.706250
14 -0.206250 -2.206250
15 -1.606250 -0.206250
16 0.693750 -1.606250
17 -0.806250 0.693750
18 0.593750 -0.806250
19 -1.306250 0.593750
20 -1.106250 -1.306250
21 -1.306250 -1.106250
22 -0.606250 -1.306250
23 0.393750 -0.606250
24 1.793750 0.393750
25 0.493750 1.793750
26 -0.006250 0.493750
27 0.093750 -0.006250
28 1.393750 0.093750
29 1.493750 1.393750
30 0.393750 1.493750
31 0.093750 0.393750
32 1.393750 0.093750
33 2.193750 1.393750
34 3.393750 2.193750
35 1.993750 3.393750
36 1.793750 1.993750
37 3.993750 1.793750
38 2.093750 3.993750
39 4.993750 2.093750
40 2.693750 4.993750
41 3.993750 2.693750
42 1.393750 3.993750
43 1.193750 1.393750
44 -1.406250 1.193750
45 -2.406250 -1.406250
46 -4.706250 -2.406250
47 -5.706250 -4.706250
48 -4.306250 -5.706250
49 -3.506250 -4.306250
50 -1.906250 -3.506250
51 -4.506250 -1.906250
52 -4.506250 -4.506250
53 -3.206250 -4.506250
54 -0.106250 -3.206250
55 1.793750 -0.106250
56 0.993750 1.793750
57 1.593750 0.993750
58 2.093750 1.593750
59 3.093750 2.093750
> 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/7clb91258737574.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/rcomp/tmp/8a0kc1258737574.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/rcomp/tmp/9aflj1258737574.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/rcomp/tmp/106itu1258737574.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/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/11cfjx1258737574.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/12m6bo1258737574.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/130ges1258737574.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/14kfzg1258737574.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/15d6z31258737574.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/1617al1258737574.tab")
+ }
> system("convert tmp/1ytb71258737574.ps tmp/1ytb71258737574.png")
> system("convert tmp/22aaq1258737574.ps tmp/22aaq1258737574.png")
> system("convert tmp/329mk1258737574.ps tmp/329mk1258737574.png")
> system("convert tmp/4x2wt1258737574.ps tmp/4x2wt1258737574.png")
> system("convert tmp/5ut2n1258737574.ps tmp/5ut2n1258737574.png")
> system("convert tmp/6mt9c1258737574.ps tmp/6mt9c1258737574.png")
> system("convert tmp/7clb91258737574.ps tmp/7clb91258737574.png")
> system("convert tmp/8a0kc1258737574.ps tmp/8a0kc1258737574.png")
> system("convert tmp/9aflj1258737574.ps tmp/9aflj1258737574.png")
> system("convert tmp/106itu1258737574.ps tmp/106itu1258737574.png")
>
>
> proc.time()
user system elapsed
2.499 1.572 5.156