R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(112.3,1,117.3,1,111.1,1,102.2,1,104.3,1,122.9,0,107.6,0,121.3,0,131.5,0,89,0,104.4,0,128.9,0,135.9,0,133.3,0,121.3,0,120.5,0,120.4,0,137.9,0,126.1,0,133.2,0,151.1,0,105,0,119,0,140.4,0,156.6,1,137.1,1,122.7,1,125.8,1,139.3,1,134.9,1,149.2,1,132.3,1,149,1,117.2,1,119.6,1,152,1,149.4,1,127.3,1,114.1,1,102.1,1,107.7,1,104.4,1,102.1,1,96,1,109.3,1,90,1,83.9,1,112,1,114.3,1,103.6,1,91.7,1,80.8,1,87.2,1,109.2,1,102.7,1,95.1,1,117.5,1,85.1,1,92.1,1,113.5,1),dim=c(2,60),dimnames=list(c('Promet','Dummy'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Promet','Dummy'),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
> 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
Promet Dummy
1 112.3 1
2 117.3 1
3 111.1 1
4 102.2 1
5 104.3 1
6 122.9 0
7 107.6 0
8 121.3 0
9 131.5 0
10 89.0 0
11 104.4 0
12 128.9 0
13 135.9 0
14 133.3 0
15 121.3 0
16 120.5 0
17 120.4 0
18 137.9 0
19 126.1 0
20 133.2 0
21 151.1 0
22 105.0 0
23 119.0 0
24 140.4 0
25 156.6 1
26 137.1 1
27 122.7 1
28 125.8 1
29 139.3 1
30 134.9 1
31 149.2 1
32 132.3 1
33 149.0 1
34 117.2 1
35 119.6 1
36 152.0 1
37 149.4 1
38 127.3 1
39 114.1 1
40 102.1 1
41 107.7 1
42 104.4 1
43 102.1 1
44 96.0 1
45 109.3 1
46 90.0 1
47 83.9 1
48 112.0 1
49 114.3 1
50 103.6 1
51 91.7 1
52 80.8 1
53 87.2 1
54 109.2 1
55 102.7 1
56 95.1 1
57 117.5 1
58 85.1 1
59 92.1 1
60 113.5 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
123.668 -9.668
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-34.67 -11.82 -1.85 10.17 42.60
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 123.668 4.262 29.018 <2e-16 ***
Dummy -9.668 5.156 -1.875 0.0658 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 18.58 on 58 degrees of freedom
Multiple R-squared: 0.05717, Adjusted R-squared: 0.04091
F-statistic: 3.517 on 1 and 58 DF, p-value: 0.06578
> 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.061627101 0.12325420 0.93837290
[2,] 0.017948167 0.03589633 0.98205183
[3,] 0.018092867 0.03618573 0.98190713
[4,] 0.007317224 0.01463445 0.99268278
[5,] 0.008315520 0.01663104 0.99168448
[6,] 0.094779719 0.18955944 0.90522028
[7,] 0.070826745 0.14165349 0.92917326
[8,] 0.065225144 0.13045029 0.93477486
[9,] 0.079086777 0.15817355 0.92091322
[10,] 0.069526964 0.13905393 0.93047304
[11,] 0.042299228 0.08459846 0.95770077
[12,] 0.024788281 0.04957656 0.97521172
[13,] 0.014072105 0.02814421 0.98592789
[14,] 0.015065835 0.03013167 0.98493416
[15,] 0.008681253 0.01736251 0.99131875
[16,] 0.006172248 0.01234450 0.99382775
[17,] 0.018271892 0.03654378 0.98172811
[18,] 0.020797222 0.04159444 0.97920278
[19,] 0.013665253 0.02733051 0.98633475
[20,] 0.012484441 0.02496888 0.98751556
[21,] 0.104662196 0.20932439 0.89533780
[22,] 0.112857445 0.22571489 0.88714256
[23,] 0.082794446 0.16558889 0.91720555
[24,] 0.062165755 0.12433151 0.93783425
[25,] 0.072144740 0.14428948 0.92785526
[26,] 0.069547044 0.13909409 0.93045296
[27,] 0.138205186 0.27641037 0.86179481
[28,] 0.131202911 0.26240582 0.86879709
[29,] 0.262189470 0.52437894 0.73781053
[30,] 0.225510639 0.45102128 0.77448936
[31,] 0.193337964 0.38667593 0.80666204
[32,] 0.506108030 0.98778394 0.49389197
[33,] 0.884965546 0.23006891 0.11503445
[34,] 0.938831057 0.12233789 0.06116894
[35,] 0.941204800 0.11759040 0.05879520
[36,] 0.934945381 0.13010924 0.06505462
[37,] 0.924573327 0.15085335 0.07542667
[38,] 0.909012426 0.18197515 0.09098757
[39,] 0.888425454 0.22314909 0.11157455
[40,] 0.871903089 0.25619382 0.12809691
[41,] 0.847910213 0.30417957 0.15208979
[42,] 0.845056338 0.30988732 0.15494366
[43,] 0.881435380 0.23712924 0.11856462
[44,] 0.857615591 0.28476882 0.14238441
[45,] 0.854021274 0.29195745 0.14597873
[46,] 0.795907515 0.40818497 0.20409248
[47,] 0.737721359 0.52455728 0.26227864
[48,] 0.795858658 0.40828268 0.20414134
[49,] 0.785432948 0.42913410 0.21456705
[50,] 0.681603748 0.63679250 0.31839625
[51,] 0.515311080 0.96937784 0.48468892
> postscript(file="/var/www/rcomp/tmp/1ynkp1292961882.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/rcomp/tmp/2ynkp1292961882.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/rcomp/tmp/38eja1292961882.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/rcomp/tmp/48eja1292961882.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/rcomp/tmp/58eja1292961882.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 = 60
Frequency = 1
1 2 3 4 5 6 7
-1.700000 3.300000 -2.900000 -11.800000 -9.700000 -0.768421 -16.068421
8 9 10 11 12 13 14
-2.368421 7.831579 -34.668421 -19.268421 5.231579 12.231579 9.631579
15 16 17 18 19 20 21
-2.368421 -3.168421 -3.268421 14.231579 2.431579 9.531579 27.431579
22 23 24 25 26 27 28
-18.668421 -4.668421 16.731579 42.600000 23.100000 8.700000 11.800000
29 30 31 32 33 34 35
25.300000 20.900000 35.200000 18.300000 35.000000 3.200000 5.600000
36 37 38 39 40 41 42
38.000000 35.400000 13.300000 0.100000 -11.900000 -6.300000 -9.600000
43 44 45 46 47 48 49
-11.900000 -18.000000 -4.700000 -24.000000 -30.100000 -2.000000 0.300000
50 51 52 53 54 55 56
-10.400000 -22.300000 -33.200000 -26.800000 -4.800000 -11.300000 -18.900000
57 58 59 60
3.500000 -28.900000 -21.900000 -0.500000
> postscript(file="/var/www/rcomp/tmp/6j51v1292961882.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.700000 NA
1 3.300000 -1.700000
2 -2.900000 3.300000
3 -11.800000 -2.900000
4 -9.700000 -11.800000
5 -0.768421 -9.700000
6 -16.068421 -0.768421
7 -2.368421 -16.068421
8 7.831579 -2.368421
9 -34.668421 7.831579
10 -19.268421 -34.668421
11 5.231579 -19.268421
12 12.231579 5.231579
13 9.631579 12.231579
14 -2.368421 9.631579
15 -3.168421 -2.368421
16 -3.268421 -3.168421
17 14.231579 -3.268421
18 2.431579 14.231579
19 9.531579 2.431579
20 27.431579 9.531579
21 -18.668421 27.431579
22 -4.668421 -18.668421
23 16.731579 -4.668421
24 42.600000 16.731579
25 23.100000 42.600000
26 8.700000 23.100000
27 11.800000 8.700000
28 25.300000 11.800000
29 20.900000 25.300000
30 35.200000 20.900000
31 18.300000 35.200000
32 35.000000 18.300000
33 3.200000 35.000000
34 5.600000 3.200000
35 38.000000 5.600000
36 35.400000 38.000000
37 13.300000 35.400000
38 0.100000 13.300000
39 -11.900000 0.100000
40 -6.300000 -11.900000
41 -9.600000 -6.300000
42 -11.900000 -9.600000
43 -18.000000 -11.900000
44 -4.700000 -18.000000
45 -24.000000 -4.700000
46 -30.100000 -24.000000
47 -2.000000 -30.100000
48 0.300000 -2.000000
49 -10.400000 0.300000
50 -22.300000 -10.400000
51 -33.200000 -22.300000
52 -26.800000 -33.200000
53 -4.800000 -26.800000
54 -11.300000 -4.800000
55 -18.900000 -11.300000
56 3.500000 -18.900000
57 -28.900000 3.500000
58 -21.900000 -28.900000
59 -0.500000 -21.900000
60 NA -0.500000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.300000 -1.700000
[2,] -2.900000 3.300000
[3,] -11.800000 -2.900000
[4,] -9.700000 -11.800000
[5,] -0.768421 -9.700000
[6,] -16.068421 -0.768421
[7,] -2.368421 -16.068421
[8,] 7.831579 -2.368421
[9,] -34.668421 7.831579
[10,] -19.268421 -34.668421
[11,] 5.231579 -19.268421
[12,] 12.231579 5.231579
[13,] 9.631579 12.231579
[14,] -2.368421 9.631579
[15,] -3.168421 -2.368421
[16,] -3.268421 -3.168421
[17,] 14.231579 -3.268421
[18,] 2.431579 14.231579
[19,] 9.531579 2.431579
[20,] 27.431579 9.531579
[21,] -18.668421 27.431579
[22,] -4.668421 -18.668421
[23,] 16.731579 -4.668421
[24,] 42.600000 16.731579
[25,] 23.100000 42.600000
[26,] 8.700000 23.100000
[27,] 11.800000 8.700000
[28,] 25.300000 11.800000
[29,] 20.900000 25.300000
[30,] 35.200000 20.900000
[31,] 18.300000 35.200000
[32,] 35.000000 18.300000
[33,] 3.200000 35.000000
[34,] 5.600000 3.200000
[35,] 38.000000 5.600000
[36,] 35.400000 38.000000
[37,] 13.300000 35.400000
[38,] 0.100000 13.300000
[39,] -11.900000 0.100000
[40,] -6.300000 -11.900000
[41,] -9.600000 -6.300000
[42,] -11.900000 -9.600000
[43,] -18.000000 -11.900000
[44,] -4.700000 -18.000000
[45,] -24.000000 -4.700000
[46,] -30.100000 -24.000000
[47,] -2.000000 -30.100000
[48,] 0.300000 -2.000000
[49,] -10.400000 0.300000
[50,] -22.300000 -10.400000
[51,] -33.200000 -22.300000
[52,] -26.800000 -33.200000
[53,] -4.800000 -26.800000
[54,] -11.300000 -4.800000
[55,] -18.900000 -11.300000
[56,] 3.500000 -18.900000
[57,] -28.900000 3.500000
[58,] -21.900000 -28.900000
[59,] -0.500000 -21.900000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.300000 -1.700000
2 -2.900000 3.300000
3 -11.800000 -2.900000
4 -9.700000 -11.800000
5 -0.768421 -9.700000
6 -16.068421 -0.768421
7 -2.368421 -16.068421
8 7.831579 -2.368421
9 -34.668421 7.831579
10 -19.268421 -34.668421
11 5.231579 -19.268421
12 12.231579 5.231579
13 9.631579 12.231579
14 -2.368421 9.631579
15 -3.168421 -2.368421
16 -3.268421 -3.168421
17 14.231579 -3.268421
18 2.431579 14.231579
19 9.531579 2.431579
20 27.431579 9.531579
21 -18.668421 27.431579
22 -4.668421 -18.668421
23 16.731579 -4.668421
24 42.600000 16.731579
25 23.100000 42.600000
26 8.700000 23.100000
27 11.800000 8.700000
28 25.300000 11.800000
29 20.900000 25.300000
30 35.200000 20.900000
31 18.300000 35.200000
32 35.000000 18.300000
33 3.200000 35.000000
34 5.600000 3.200000
35 38.000000 5.600000
36 35.400000 38.000000
37 13.300000 35.400000
38 0.100000 13.300000
39 -11.900000 0.100000
40 -6.300000 -11.900000
41 -9.600000 -6.300000
42 -11.900000 -9.600000
43 -18.000000 -11.900000
44 -4.700000 -18.000000
45 -24.000000 -4.700000
46 -30.100000 -24.000000
47 -2.000000 -30.100000
48 0.300000 -2.000000
49 -10.400000 0.300000
50 -22.300000 -10.400000
51 -33.200000 -22.300000
52 -26.800000 -33.200000
53 -4.800000 -26.800000
54 -11.300000 -4.800000
55 -18.900000 -11.300000
56 3.500000 -18.900000
57 -28.900000 3.500000
58 -21.900000 -28.900000
59 -0.500000 -21.900000
> 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/rcomp/tmp/7uf0y1292961882.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/rcomp/tmp/8uf0y1292961882.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/rcomp/tmp/9uf0y1292961882.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/rcomp/tmp/10mozj1292961882.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/118of61292961882.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/rcomp/tmp/12tpwu1292961882.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/rcomp/tmp/137hu31292961882.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/rcomp/tmp/140qt61292961882.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/rcomp/tmp/15mqac1292961882.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/rcomp/tmp/16i0731292961882.tab")
+ }
>
> try(system("convert tmp/1ynkp1292961882.ps tmp/1ynkp1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ynkp1292961882.ps tmp/2ynkp1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/38eja1292961882.ps tmp/38eja1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/48eja1292961882.ps tmp/48eja1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/58eja1292961882.ps tmp/58eja1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/6j51v1292961882.ps tmp/6j51v1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/7uf0y1292961882.ps tmp/7uf0y1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/8uf0y1292961882.ps tmp/8uf0y1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/9uf0y1292961882.ps tmp/9uf0y1292961882.png",intern=TRUE))
character(0)
> try(system("convert tmp/10mozj1292961882.ps tmp/10mozj1292961882.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.02 1.21 4.23