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(16,0,8,0,-10,0,-24,0,-19,0,8,0,24,0,14,0,7,0,9,0,-26,0,19,0,15,0,-1,0,-10,0,-21,0,-14,0,-27,0,26,0,23,0,5,0,19,0,-19,0,24,0,17,0,1,0,-9,0,-16,0,-21,0,-14,0,31,0,27,0,10,0,12,0,-23,0,13,0,26,0,-1,0,4,0,-16,0,-5,0,9,0,23,0,9,0,2,0,10,1,-29,1,17,1,9,1,9,1,-10,1,-23,1,13,1,13,1,-9,1,9,1,5,1,8,1,-18,1,7,1,4,0),dim=c(2,61),dimnames=list(c('x','y'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('x','y'),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
x y
1 16 0
2 8 0
3 -10 0
4 -24 0
5 -19 0
6 8 0
7 24 0
8 14 0
9 7 0
10 9 0
11 -26 0
12 19 0
13 15 0
14 -1 0
15 -10 0
16 -21 0
17 -14 0
18 -27 0
19 26 0
20 23 0
21 5 0
22 19 0
23 -19 0
24 24 0
25 17 0
26 1 0
27 -9 0
28 -16 0
29 -21 0
30 -14 0
31 31 0
32 27 0
33 10 0
34 12 0
35 -23 0
36 13 0
37 26 0
38 -1 0
39 4 0
40 -16 0
41 -5 0
42 9 0
43 23 0
44 9 0
45 2 0
46 10 1
47 -29 1
48 17 1
49 9 1
50 9 1
51 -10 1
52 -23 1
53 13 1
54 13 1
55 -9 1
56 9 1
57 5 1
58 8 1
59 -18 1
60 7 1
61 4 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) y
2.804 -2.071
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-29.804 -12.804 5.196 12.196 28.196
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.804 2.411 1.163 0.249
y -2.071 4.862 -0.426 0.672
Residual standard error: 16.35 on 59 degrees of freedom
Multiple R-squared: 0.003066, Adjusted R-squared: -0.01383
F-statistic: 0.1815 on 1 and 59 DF, p-value: 0.6717
> 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.7776865 0.4446271 0.22231353
[2,] 0.7033134 0.5933732 0.29668658
[3,] 0.7976621 0.4046757 0.20233785
[4,] 0.7459366 0.5081268 0.25406340
[5,] 0.6486117 0.7027766 0.35138828
[6,] 0.5520795 0.8958411 0.44792053
[7,] 0.7151248 0.5697504 0.28487520
[8,] 0.7118638 0.5762724 0.28813621
[9,] 0.6686791 0.6626417 0.33132086
[10,] 0.5838688 0.8322624 0.41613119
[11,] 0.5424803 0.9150395 0.45751975
[12,] 0.6136546 0.7726908 0.38634541
[13,] 0.5986769 0.8026463 0.40132313
[14,] 0.7321602 0.5356795 0.26783977
[15,] 0.8045642 0.3908716 0.19543580
[16,] 0.8323072 0.3353855 0.16769277
[17,] 0.7793813 0.4412374 0.22061869
[18,] 0.7758042 0.4483915 0.22419576
[19,] 0.8101272 0.3797456 0.18987279
[20,] 0.8389303 0.3221394 0.16106972
[21,] 0.8243803 0.3512394 0.17561970
[22,] 0.7711710 0.4576580 0.22882902
[23,] 0.7411183 0.5177635 0.25888173
[24,] 0.7591759 0.4816482 0.24082412
[25,] 0.8242411 0.3515178 0.17575889
[26,] 0.8374535 0.3250930 0.16254651
[27,] 0.9034572 0.1930856 0.09654278
[28,] 0.9320924 0.1358151 0.06790757
[29,] 0.9079632 0.1840735 0.09203677
[30,] 0.8825684 0.2348632 0.11743161
[31,] 0.9391054 0.1217891 0.06089455
[32,] 0.9200323 0.1599355 0.07996774
[33,] 0.9449146 0.1101708 0.05508540
[34,] 0.9206942 0.1586116 0.07930581
[35,] 0.8860207 0.2279587 0.11397934
[36,] 0.9122545 0.1754909 0.08774545
[37,] 0.8981566 0.2036867 0.10184337
[38,] 0.8566506 0.2866988 0.14334942
[39,] 0.8630744 0.2738513 0.13692563
[40,] 0.8146798 0.3706405 0.18532023
[41,] 0.7485088 0.5029823 0.25149117
[42,] 0.6931844 0.6136312 0.30681561
[43,] 0.8725185 0.2549630 0.12748151
[44,] 0.8808909 0.2382183 0.11910913
[45,] 0.8399039 0.3201923 0.16009614
[46,] 0.7912246 0.4175508 0.20877538
[47,] 0.7418002 0.5163996 0.25819981
[48,] 0.8868051 0.2263897 0.11319487
[49,] 0.8544358 0.2911283 0.14556416
[50,] 0.8270826 0.3458349 0.17291743
[51,] 0.7711050 0.4577900 0.22889502
[52,] 0.6556470 0.6887060 0.34435299
> postscript(file="/var/www/html/rcomp/tmp/1wr1o1227466124.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/2w3sf1227466124.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/3mxib1227466124.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/42bg51227466124.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/5vdzd1227466124.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
13.1956522 5.1956522 -12.8043478 -26.8043478 -21.8043478 5.1956522
7 8 9 10 11 12
21.1956522 11.1956522 4.1956522 6.1956522 -28.8043478 16.1956522
13 14 15 16 17 18
12.1956522 -3.8043478 -12.8043478 -23.8043478 -16.8043478 -29.8043478
19 20 21 22 23 24
23.1956522 20.1956522 2.1956522 16.1956522 -21.8043478 21.1956522
25 26 27 28 29 30
14.1956522 -1.8043478 -11.8043478 -18.8043478 -23.8043478 -16.8043478
31 32 33 34 35 36
28.1956522 24.1956522 7.1956522 9.1956522 -25.8043478 10.1956522
37 38 39 40 41 42
23.1956522 -3.8043478 1.1956522 -18.8043478 -7.8043478 6.1956522
43 44 45 46 47 48
20.1956522 6.1956522 -0.8043478 9.2666667 -29.7333333 16.2666667
49 50 51 52 53 54
8.2666667 8.2666667 -10.7333333 -23.7333333 12.2666667 12.2666667
55 56 57 58 59 60
-9.7333333 8.2666667 4.2666667 7.2666667 -18.7333333 6.2666667
61
1.1956522
> postscript(file="/var/www/html/rcomp/tmp/6bofd1227466124.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 13.1956522 NA
1 5.1956522 13.1956522
2 -12.8043478 5.1956522
3 -26.8043478 -12.8043478
4 -21.8043478 -26.8043478
5 5.1956522 -21.8043478
6 21.1956522 5.1956522
7 11.1956522 21.1956522
8 4.1956522 11.1956522
9 6.1956522 4.1956522
10 -28.8043478 6.1956522
11 16.1956522 -28.8043478
12 12.1956522 16.1956522
13 -3.8043478 12.1956522
14 -12.8043478 -3.8043478
15 -23.8043478 -12.8043478
16 -16.8043478 -23.8043478
17 -29.8043478 -16.8043478
18 23.1956522 -29.8043478
19 20.1956522 23.1956522
20 2.1956522 20.1956522
21 16.1956522 2.1956522
22 -21.8043478 16.1956522
23 21.1956522 -21.8043478
24 14.1956522 21.1956522
25 -1.8043478 14.1956522
26 -11.8043478 -1.8043478
27 -18.8043478 -11.8043478
28 -23.8043478 -18.8043478
29 -16.8043478 -23.8043478
30 28.1956522 -16.8043478
31 24.1956522 28.1956522
32 7.1956522 24.1956522
33 9.1956522 7.1956522
34 -25.8043478 9.1956522
35 10.1956522 -25.8043478
36 23.1956522 10.1956522
37 -3.8043478 23.1956522
38 1.1956522 -3.8043478
39 -18.8043478 1.1956522
40 -7.8043478 -18.8043478
41 6.1956522 -7.8043478
42 20.1956522 6.1956522
43 6.1956522 20.1956522
44 -0.8043478 6.1956522
45 9.2666667 -0.8043478
46 -29.7333333 9.2666667
47 16.2666667 -29.7333333
48 8.2666667 16.2666667
49 8.2666667 8.2666667
50 -10.7333333 8.2666667
51 -23.7333333 -10.7333333
52 12.2666667 -23.7333333
53 12.2666667 12.2666667
54 -9.7333333 12.2666667
55 8.2666667 -9.7333333
56 4.2666667 8.2666667
57 7.2666667 4.2666667
58 -18.7333333 7.2666667
59 6.2666667 -18.7333333
60 1.1956522 6.2666667
61 NA 1.1956522
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 5.1956522 13.1956522
[2,] -12.8043478 5.1956522
[3,] -26.8043478 -12.8043478
[4,] -21.8043478 -26.8043478
[5,] 5.1956522 -21.8043478
[6,] 21.1956522 5.1956522
[7,] 11.1956522 21.1956522
[8,] 4.1956522 11.1956522
[9,] 6.1956522 4.1956522
[10,] -28.8043478 6.1956522
[11,] 16.1956522 -28.8043478
[12,] 12.1956522 16.1956522
[13,] -3.8043478 12.1956522
[14,] -12.8043478 -3.8043478
[15,] -23.8043478 -12.8043478
[16,] -16.8043478 -23.8043478
[17,] -29.8043478 -16.8043478
[18,] 23.1956522 -29.8043478
[19,] 20.1956522 23.1956522
[20,] 2.1956522 20.1956522
[21,] 16.1956522 2.1956522
[22,] -21.8043478 16.1956522
[23,] 21.1956522 -21.8043478
[24,] 14.1956522 21.1956522
[25,] -1.8043478 14.1956522
[26,] -11.8043478 -1.8043478
[27,] -18.8043478 -11.8043478
[28,] -23.8043478 -18.8043478
[29,] -16.8043478 -23.8043478
[30,] 28.1956522 -16.8043478
[31,] 24.1956522 28.1956522
[32,] 7.1956522 24.1956522
[33,] 9.1956522 7.1956522
[34,] -25.8043478 9.1956522
[35,] 10.1956522 -25.8043478
[36,] 23.1956522 10.1956522
[37,] -3.8043478 23.1956522
[38,] 1.1956522 -3.8043478
[39,] -18.8043478 1.1956522
[40,] -7.8043478 -18.8043478
[41,] 6.1956522 -7.8043478
[42,] 20.1956522 6.1956522
[43,] 6.1956522 20.1956522
[44,] -0.8043478 6.1956522
[45,] 9.2666667 -0.8043478
[46,] -29.7333333 9.2666667
[47,] 16.2666667 -29.7333333
[48,] 8.2666667 16.2666667
[49,] 8.2666667 8.2666667
[50,] -10.7333333 8.2666667
[51,] -23.7333333 -10.7333333
[52,] 12.2666667 -23.7333333
[53,] 12.2666667 12.2666667
[54,] -9.7333333 12.2666667
[55,] 8.2666667 -9.7333333
[56,] 4.2666667 8.2666667
[57,] 7.2666667 4.2666667
[58,] -18.7333333 7.2666667
[59,] 6.2666667 -18.7333333
[60,] 1.1956522 6.2666667
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 5.1956522 13.1956522
2 -12.8043478 5.1956522
3 -26.8043478 -12.8043478
4 -21.8043478 -26.8043478
5 5.1956522 -21.8043478
6 21.1956522 5.1956522
7 11.1956522 21.1956522
8 4.1956522 11.1956522
9 6.1956522 4.1956522
10 -28.8043478 6.1956522
11 16.1956522 -28.8043478
12 12.1956522 16.1956522
13 -3.8043478 12.1956522
14 -12.8043478 -3.8043478
15 -23.8043478 -12.8043478
16 -16.8043478 -23.8043478
17 -29.8043478 -16.8043478
18 23.1956522 -29.8043478
19 20.1956522 23.1956522
20 2.1956522 20.1956522
21 16.1956522 2.1956522
22 -21.8043478 16.1956522
23 21.1956522 -21.8043478
24 14.1956522 21.1956522
25 -1.8043478 14.1956522
26 -11.8043478 -1.8043478
27 -18.8043478 -11.8043478
28 -23.8043478 -18.8043478
29 -16.8043478 -23.8043478
30 28.1956522 -16.8043478
31 24.1956522 28.1956522
32 7.1956522 24.1956522
33 9.1956522 7.1956522
34 -25.8043478 9.1956522
35 10.1956522 -25.8043478
36 23.1956522 10.1956522
37 -3.8043478 23.1956522
38 1.1956522 -3.8043478
39 -18.8043478 1.1956522
40 -7.8043478 -18.8043478
41 6.1956522 -7.8043478
42 20.1956522 6.1956522
43 6.1956522 20.1956522
44 -0.8043478 6.1956522
45 9.2666667 -0.8043478
46 -29.7333333 9.2666667
47 16.2666667 -29.7333333
48 8.2666667 16.2666667
49 8.2666667 8.2666667
50 -10.7333333 8.2666667
51 -23.7333333 -10.7333333
52 12.2666667 -23.7333333
53 12.2666667 12.2666667
54 -9.7333333 12.2666667
55 8.2666667 -9.7333333
56 4.2666667 8.2666667
57 7.2666667 4.2666667
58 -18.7333333 7.2666667
59 6.2666667 -18.7333333
60 1.1956522 6.2666667
> 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/7pq3f1227466124.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/85lpk1227466124.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/975nk1227466124.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/10f3a61227466124.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/119ezb1227466124.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/12df831227466124.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/13tq7u1227466124.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/14anm91227466124.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/15g44f1227466124.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/16o2p61227466124.tab")
+ }
>
> system("convert tmp/1wr1o1227466124.ps tmp/1wr1o1227466124.png")
> system("convert tmp/2w3sf1227466124.ps tmp/2w3sf1227466124.png")
> system("convert tmp/3mxib1227466124.ps tmp/3mxib1227466124.png")
> system("convert tmp/42bg51227466124.ps tmp/42bg51227466124.png")
> system("convert tmp/5vdzd1227466124.ps tmp/5vdzd1227466124.png")
> system("convert tmp/6bofd1227466124.ps tmp/6bofd1227466124.png")
> system("convert tmp/7pq3f1227466124.ps tmp/7pq3f1227466124.png")
> system("convert tmp/85lpk1227466124.ps tmp/85lpk1227466124.png")
> system("convert tmp/975nk1227466124.ps tmp/975nk1227466124.png")
> system("convert tmp/10f3a61227466124.ps tmp/10f3a61227466124.png")
>
>
> proc.time()
user system elapsed
2.493 1.589 2.900