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(101.3,0,106.3,0,94,0,102.8,0,102,0,105.1,1,92.4,0,81.4,0,105.8,0,120.3,1,100.7,0,88.8,0,94.3,0,99.9,0,103.4,0,103.3,0,98.8,0,104.2,0,91.2,0,74.7,0,108.5,0,114.5,0,96.9,0,89.6,0,97.1,0,100.3,0,122.6,0,115.4,1,109,0,129.1,1,102.8,1,96.2,0,127.7,1,128.9,1,126.5,1,119.8,1,113.2,1,114.1,1,134.1,1,130,1,121.8,1,132.1,1,105.3,1,103,1,117.1,1,126.3,1,138.1,1,119.5,1,138,1,135.5,1,178.6,1,162.2,1,176.9,1,204.9,1,132.2,1,142.5,1,164.3,1,174.9,1,175.4,1,143,1),dim=c(2,60),dimnames=list(c('Omzet','Uitvoer'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Omzet','Uitvoer'),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
Omzet Uitvoer
1 101.3 0
2 106.3 0
3 94.0 0
4 102.8 0
5 102.0 0
6 105.1 1
7 92.4 0
8 81.4 0
9 105.8 0
10 120.3 1
11 100.7 0
12 88.8 0
13 94.3 0
14 99.9 0
15 103.4 0
16 103.3 0
17 98.8 0
18 104.2 0
19 91.2 0
20 74.7 0
21 108.5 0
22 114.5 0
23 96.9 0
24 89.6 0
25 97.1 0
26 100.3 0
27 122.6 0
28 115.4 1
29 109.0 0
30 129.1 1
31 102.8 1
32 96.2 0
33 127.7 1
34 128.9 1
35 126.5 1
36 119.8 1
37 113.2 1
38 114.1 1
39 134.1 1
40 130.0 1
41 121.8 1
42 132.1 1
43 105.3 1
44 103.0 1
45 117.1 1
46 126.3 1
47 138.1 1
48 119.5 1
49 138.0 1
50 135.5 1
51 178.6 1
52 162.2 1
53 176.9 1
54 204.9 1
55 132.2 1
56 142.5 1
57 164.3 1
58 174.9 1
59 175.4 1
60 143.0 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Uitvoer
99.26 35.85
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-32.309 -9.859 -2.259 5.341 69.791
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 99.259 3.797 26.141 < 2e-16 ***
Uitvoer 35.850 5.120 7.002 2.91e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 19.73 on 58 degrees of freedom
Multiple R-squared: 0.4581, Adjusted R-squared: 0.4487
F-statistic: 49.03 on 1 and 58 DF, p-value: 2.910e-09
> 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,] 2.121572e-02 4.243144e-02 0.9787843
[2,] 4.630430e-03 9.260861e-03 0.9953696
[3,] 3.567569e-03 7.135138e-03 0.9964324
[4,] 1.683274e-02 3.366547e-02 0.9831673
[5,] 9.260446e-03 1.852089e-02 0.9907396
[6,] 7.045364e-03 1.409073e-02 0.9929546
[7,] 2.725644e-03 5.451289e-03 0.9972744
[8,] 1.717194e-03 3.434388e-03 0.9982828
[9,] 6.616306e-04 1.323261e-03 0.9993384
[10,] 2.378302e-04 4.756603e-04 0.9997622
[11,] 1.003197e-04 2.006395e-04 0.9998997
[12,] 3.987374e-05 7.974748e-05 0.9999601
[13,] 1.246373e-05 2.492746e-05 0.9999875
[14,] 4.976310e-06 9.952621e-06 0.9999950
[15,] 2.414961e-06 4.829922e-06 0.9999976
[16,] 3.569999e-05 7.139999e-05 0.9999643
[17,] 2.540297e-05 5.080594e-05 0.9999746
[18,] 3.668808e-05 7.337615e-05 0.9999633
[19,] 1.417576e-05 2.835152e-05 0.9999858
[20,] 8.047627e-06 1.609525e-05 0.9999920
[21,] 3.025894e-06 6.051788e-06 0.9999970
[22,] 1.120162e-06 2.240325e-06 0.9999989
[23,] 6.305623e-06 1.261125e-05 0.9999937
[24,] 3.085332e-06 6.170665e-06 0.9999969
[25,] 1.768270e-06 3.536540e-06 0.9999982
[26,] 1.385094e-06 2.770187e-06 0.9999986
[27,] 2.109361e-06 4.218722e-06 0.9999979
[28,] 8.153613e-07 1.630723e-06 0.9999992
[29,] 5.608053e-07 1.121611e-06 0.9999994
[30,] 3.511028e-07 7.022056e-07 0.9999996
[31,] 1.747349e-07 3.494699e-07 0.9999998
[32,] 8.367074e-08 1.673415e-07 0.9999999
[33,] 6.257176e-08 1.251435e-07 0.9999999
[34,] 4.674378e-08 9.348756e-08 1.0000000
[35,] 4.082416e-08 8.164833e-08 1.0000000
[36,] 2.359425e-08 4.718850e-08 1.0000000
[37,] 1.314369e-08 2.628739e-08 1.0000000
[38,] 8.186359e-09 1.637272e-08 1.0000000
[39,] 4.656932e-08 9.313864e-08 1.0000000
[40,] 6.627749e-07 1.325550e-06 0.9999993
[41,] 1.513327e-06 3.026655e-06 0.9999985
[42,] 2.349972e-06 4.699945e-06 0.9999977
[43,] 3.735207e-06 7.470415e-06 0.9999963
[44,] 2.416451e-05 4.832902e-05 0.9999758
[45,] 5.563692e-05 1.112738e-04 0.9999444
[46,] 1.847819e-04 3.695638e-04 0.9998152
[47,] 4.771426e-03 9.542853e-03 0.9952286
[48,] 6.014991e-03 1.202998e-02 0.9939850
[49,] 1.339914e-02 2.679828e-02 0.9866009
[50,] 3.009715e-01 6.019430e-01 0.6990285
[51,] 3.731031e-01 7.462063e-01 0.6268969
> postscript(file="/var/www/html/rcomp/tmp/1nwf11258559956.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/2umg51258559956.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/3j67h1258559956.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/4nbp51258559956.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/5hpmi1258559956.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
2.0407407 7.0407407 -5.2592593 3.5407407 2.7407407 -30.0090909
7 8 9 10 11 12
-6.8592593 -17.8592593 6.5407407 -14.8090909 1.4407407 -10.4592593
13 14 15 16 17 18
-4.9592593 0.6407407 4.1407407 4.0407407 -0.4592593 4.9407407
19 20 21 22 23 24
-8.0592593 -24.5592593 9.2407407 15.2407407 -2.3592593 -9.6592593
25 26 27 28 29 30
-2.1592593 1.0407407 23.3407407 -19.7090909 9.7407407 -6.0090909
31 32 33 34 35 36
-32.3090909 -3.0592593 -7.4090909 -6.2090909 -8.6090909 -15.3090909
37 38 39 40 41 42
-21.9090909 -21.0090909 -1.0090909 -5.1090909 -13.3090909 -3.0090909
43 44 45 46 47 48
-29.8090909 -32.1090909 -18.0090909 -8.8090909 2.9909091 -15.6090909
49 50 51 52 53 54
2.8909091 0.3909091 43.4909091 27.0909091 41.7909091 69.7909091
55 56 57 58 59 60
-2.9090909 7.3909091 29.1909091 39.7909091 40.2909091 7.8909091
> postscript(file="/var/www/html/rcomp/tmp/6y2h71258559956.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.0407407 NA
1 7.0407407 2.0407407
2 -5.2592593 7.0407407
3 3.5407407 -5.2592593
4 2.7407407 3.5407407
5 -30.0090909 2.7407407
6 -6.8592593 -30.0090909
7 -17.8592593 -6.8592593
8 6.5407407 -17.8592593
9 -14.8090909 6.5407407
10 1.4407407 -14.8090909
11 -10.4592593 1.4407407
12 -4.9592593 -10.4592593
13 0.6407407 -4.9592593
14 4.1407407 0.6407407
15 4.0407407 4.1407407
16 -0.4592593 4.0407407
17 4.9407407 -0.4592593
18 -8.0592593 4.9407407
19 -24.5592593 -8.0592593
20 9.2407407 -24.5592593
21 15.2407407 9.2407407
22 -2.3592593 15.2407407
23 -9.6592593 -2.3592593
24 -2.1592593 -9.6592593
25 1.0407407 -2.1592593
26 23.3407407 1.0407407
27 -19.7090909 23.3407407
28 9.7407407 -19.7090909
29 -6.0090909 9.7407407
30 -32.3090909 -6.0090909
31 -3.0592593 -32.3090909
32 -7.4090909 -3.0592593
33 -6.2090909 -7.4090909
34 -8.6090909 -6.2090909
35 -15.3090909 -8.6090909
36 -21.9090909 -15.3090909
37 -21.0090909 -21.9090909
38 -1.0090909 -21.0090909
39 -5.1090909 -1.0090909
40 -13.3090909 -5.1090909
41 -3.0090909 -13.3090909
42 -29.8090909 -3.0090909
43 -32.1090909 -29.8090909
44 -18.0090909 -32.1090909
45 -8.8090909 -18.0090909
46 2.9909091 -8.8090909
47 -15.6090909 2.9909091
48 2.8909091 -15.6090909
49 0.3909091 2.8909091
50 43.4909091 0.3909091
51 27.0909091 43.4909091
52 41.7909091 27.0909091
53 69.7909091 41.7909091
54 -2.9090909 69.7909091
55 7.3909091 -2.9090909
56 29.1909091 7.3909091
57 39.7909091 29.1909091
58 40.2909091 39.7909091
59 7.8909091 40.2909091
60 NA 7.8909091
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 7.0407407 2.0407407
[2,] -5.2592593 7.0407407
[3,] 3.5407407 -5.2592593
[4,] 2.7407407 3.5407407
[5,] -30.0090909 2.7407407
[6,] -6.8592593 -30.0090909
[7,] -17.8592593 -6.8592593
[8,] 6.5407407 -17.8592593
[9,] -14.8090909 6.5407407
[10,] 1.4407407 -14.8090909
[11,] -10.4592593 1.4407407
[12,] -4.9592593 -10.4592593
[13,] 0.6407407 -4.9592593
[14,] 4.1407407 0.6407407
[15,] 4.0407407 4.1407407
[16,] -0.4592593 4.0407407
[17,] 4.9407407 -0.4592593
[18,] -8.0592593 4.9407407
[19,] -24.5592593 -8.0592593
[20,] 9.2407407 -24.5592593
[21,] 15.2407407 9.2407407
[22,] -2.3592593 15.2407407
[23,] -9.6592593 -2.3592593
[24,] -2.1592593 -9.6592593
[25,] 1.0407407 -2.1592593
[26,] 23.3407407 1.0407407
[27,] -19.7090909 23.3407407
[28,] 9.7407407 -19.7090909
[29,] -6.0090909 9.7407407
[30,] -32.3090909 -6.0090909
[31,] -3.0592593 -32.3090909
[32,] -7.4090909 -3.0592593
[33,] -6.2090909 -7.4090909
[34,] -8.6090909 -6.2090909
[35,] -15.3090909 -8.6090909
[36,] -21.9090909 -15.3090909
[37,] -21.0090909 -21.9090909
[38,] -1.0090909 -21.0090909
[39,] -5.1090909 -1.0090909
[40,] -13.3090909 -5.1090909
[41,] -3.0090909 -13.3090909
[42,] -29.8090909 -3.0090909
[43,] -32.1090909 -29.8090909
[44,] -18.0090909 -32.1090909
[45,] -8.8090909 -18.0090909
[46,] 2.9909091 -8.8090909
[47,] -15.6090909 2.9909091
[48,] 2.8909091 -15.6090909
[49,] 0.3909091 2.8909091
[50,] 43.4909091 0.3909091
[51,] 27.0909091 43.4909091
[52,] 41.7909091 27.0909091
[53,] 69.7909091 41.7909091
[54,] -2.9090909 69.7909091
[55,] 7.3909091 -2.9090909
[56,] 29.1909091 7.3909091
[57,] 39.7909091 29.1909091
[58,] 40.2909091 39.7909091
[59,] 7.8909091 40.2909091
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 7.0407407 2.0407407
2 -5.2592593 7.0407407
3 3.5407407 -5.2592593
4 2.7407407 3.5407407
5 -30.0090909 2.7407407
6 -6.8592593 -30.0090909
7 -17.8592593 -6.8592593
8 6.5407407 -17.8592593
9 -14.8090909 6.5407407
10 1.4407407 -14.8090909
11 -10.4592593 1.4407407
12 -4.9592593 -10.4592593
13 0.6407407 -4.9592593
14 4.1407407 0.6407407
15 4.0407407 4.1407407
16 -0.4592593 4.0407407
17 4.9407407 -0.4592593
18 -8.0592593 4.9407407
19 -24.5592593 -8.0592593
20 9.2407407 -24.5592593
21 15.2407407 9.2407407
22 -2.3592593 15.2407407
23 -9.6592593 -2.3592593
24 -2.1592593 -9.6592593
25 1.0407407 -2.1592593
26 23.3407407 1.0407407
27 -19.7090909 23.3407407
28 9.7407407 -19.7090909
29 -6.0090909 9.7407407
30 -32.3090909 -6.0090909
31 -3.0592593 -32.3090909
32 -7.4090909 -3.0592593
33 -6.2090909 -7.4090909
34 -8.6090909 -6.2090909
35 -15.3090909 -8.6090909
36 -21.9090909 -15.3090909
37 -21.0090909 -21.9090909
38 -1.0090909 -21.0090909
39 -5.1090909 -1.0090909
40 -13.3090909 -5.1090909
41 -3.0090909 -13.3090909
42 -29.8090909 -3.0090909
43 -32.1090909 -29.8090909
44 -18.0090909 -32.1090909
45 -8.8090909 -18.0090909
46 2.9909091 -8.8090909
47 -15.6090909 2.9909091
48 2.8909091 -15.6090909
49 0.3909091 2.8909091
50 43.4909091 0.3909091
51 27.0909091 43.4909091
52 41.7909091 27.0909091
53 69.7909091 41.7909091
54 -2.9090909 69.7909091
55 7.3909091 -2.9090909
56 29.1909091 7.3909091
57 39.7909091 29.1909091
58 40.2909091 39.7909091
59 7.8909091 40.2909091
> 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/7exlb1258559956.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/8z9881258559956.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/9xo021258559956.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/101lft1258559956.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/11ymrl1258559957.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/12ik221258559957.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/13cz7u1258559957.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/14zfa31258559957.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/15n4q61258559957.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/16pxxt1258559957.tab")
+ }
>
> system("convert tmp/1nwf11258559956.ps tmp/1nwf11258559956.png")
> system("convert tmp/2umg51258559956.ps tmp/2umg51258559956.png")
> system("convert tmp/3j67h1258559956.ps tmp/3j67h1258559956.png")
> system("convert tmp/4nbp51258559956.ps tmp/4nbp51258559956.png")
> system("convert tmp/5hpmi1258559956.ps tmp/5hpmi1258559956.png")
> system("convert tmp/6y2h71258559956.ps tmp/6y2h71258559956.png")
> system("convert tmp/7exlb1258559956.ps tmp/7exlb1258559956.png")
> system("convert tmp/8z9881258559956.ps tmp/8z9881258559956.png")
> system("convert tmp/9xo021258559956.ps tmp/9xo021258559956.png")
> system("convert tmp/101lft1258559956.ps tmp/101lft1258559956.png")
>
>
> proc.time()
user system elapsed
2.431 1.517 2.824