R version 2.7.0 (2008-04-22)
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(100.29,0,101.12,0,102.65,0,102.71,0,103.39,0,102.8,0,102.07,0,102.15,0,101.21,0,101.27,0,101.86,0,101.65,0,101.94,0,102.62,0,102.71,0,103.39,0,104.51,0,104.09,0,104.29,0,104.57,0,105.39,0,105.15,0,106.13,0,105.46,0,106.47,0,106.62,0,106.52,0,108.04,0,107.15,0,107.32,0,107.76,0,107.26,0,107.89,0,109.08,0,110.4,0,111.03,0,112.05,0,112.28,0,112.8,0,114.17,0,114.92,0,114.65,0,115.49,0,114.67,1,114.71,1,115.15,1,115.03,1),dim=c(2,47),dimnames=list(c('Voedingsmiddelen','Dummy'),1:47))
> y <- array(NA,dim=c(2,47),dimnames=list(c('Voedingsmiddelen','Dummy'),1:47))
> 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
Voedingsmiddelen Dummy
1 100.29 0
2 101.12 0
3 102.65 0
4 102.71 0
5 103.39 0
6 102.80 0
7 102.07 0
8 102.15 0
9 101.21 0
10 101.27 0
11 101.86 0
12 101.65 0
13 101.94 0
14 102.62 0
15 102.71 0
16 103.39 0
17 104.51 0
18 104.09 0
19 104.29 0
20 104.57 0
21 105.39 0
22 105.15 0
23 106.13 0
24 105.46 0
25 106.47 0
26 106.62 0
27 106.52 0
28 108.04 0
29 107.15 0
30 107.32 0
31 107.76 0
32 107.26 0
33 107.89 0
34 109.08 0
35 110.40 0
36 111.03 0
37 112.05 0
38 112.28 0
39 112.80 0
40 114.17 0
41 114.92 0
42 114.65 0
43 115.49 0
44 114.67 1
45 114.71 1
46 115.15 1
47 115.03 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
106.17 8.72
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.880 -3.460 -0.220 1.655 9.320
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 106.1702 0.6299 168.540 < 2e-16 ***
Dummy 8.7198 2.1593 4.038 0.000207 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.131 on 45 degrees of freedom
Multiple R-squared: 0.266, Adjusted R-squared: 0.2497
F-statistic: 16.31 on 1 and 45 DF, p-value: 0.0002071
> 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,] 5.921649e-02 1.184330e-01 9.407835e-01
[2,] 2.021309e-02 4.042618e-02 9.797869e-01
[3,] 5.922187e-03 1.184437e-02 9.940778e-01
[4,] 1.644614e-03 3.289229e-03 9.983554e-01
[5,] 6.635146e-04 1.327029e-03 9.993365e-01
[6,] 2.579941e-04 5.159883e-04 9.997420e-01
[7,] 7.923842e-05 1.584768e-04 9.999208e-01
[8,] 2.707206e-05 5.414412e-05 9.999729e-01
[9,] 9.157992e-06 1.831598e-05 9.999908e-01
[10,] 4.033814e-06 8.067629e-06 9.999960e-01
[11,] 2.038235e-06 4.076471e-06 9.999980e-01
[12,] 2.206996e-06 4.413991e-06 9.999978e-01
[13,] 1.087855e-05 2.175710e-05 9.999891e-01
[14,] 1.745750e-05 3.491501e-05 9.999825e-01
[15,] 3.065783e-05 6.131566e-05 9.999693e-01
[16,] 6.260389e-05 1.252078e-04 9.999374e-01
[17,] 2.162675e-04 4.325350e-04 9.997837e-01
[18,] 4.799706e-04 9.599412e-04 9.995200e-01
[19,] 1.607638e-03 3.215275e-03 9.983924e-01
[20,] 3.241967e-03 6.483934e-03 9.967580e-01
[21,] 8.356152e-03 1.671230e-02 9.916438e-01
[22,] 1.865784e-02 3.731569e-02 9.813422e-01
[23,] 3.738595e-02 7.477190e-02 9.626141e-01
[24,] 8.033135e-02 1.606627e-01 9.196687e-01
[25,] 1.351758e-01 2.703516e-01 8.648242e-01
[26,] 2.222070e-01 4.444141e-01 7.777930e-01
[27,] 3.464863e-01 6.929727e-01 6.535137e-01
[28,] 5.725984e-01 8.548032e-01 4.274016e-01
[29,] 8.222209e-01 3.555582e-01 1.777791e-01
[30,] 9.517270e-01 9.654597e-02 4.827299e-02
[31,] 9.866264e-01 2.674726e-02 1.337363e-02
[32,] 9.968538e-01 6.292491e-03 3.146246e-03
[33,] 9.986769e-01 2.646156e-03 1.323078e-03
[34,] 9.996566e-01 6.868038e-04 3.434019e-04
[35,] 9.999823e-01 3.534981e-05 1.767490e-05
[36,] 9.999821e-01 3.583917e-05 1.791959e-05
[37,] 9.998519e-01 2.962866e-04 1.481433e-04
[38,] 9.997340e-01 5.320477e-04 2.660238e-04
> postscript(file="/var/www/html/rcomp/tmp/1v5d01229797029.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/2ij331229797029.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/3fmls1229797029.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/4ayzo1229797029.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/5yt0s1229797029.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 = 47
Frequency = 1
1 2 3 4 5 6
-5.88023256 -5.05023256 -3.52023256 -3.46023256 -2.78023256 -3.37023256
7 8 9 10 11 12
-4.10023256 -4.02023256 -4.96023256 -4.90023256 -4.31023256 -4.52023256
13 14 15 16 17 18
-4.23023256 -3.55023256 -3.46023256 -2.78023256 -1.66023256 -2.08023256
19 20 21 22 23 24
-1.88023256 -1.60023256 -0.78023256 -1.02023256 -0.04023256 -0.71023256
25 26 27 28 29 30
0.29976744 0.44976744 0.34976744 1.86976744 0.97976744 1.14976744
31 32 33 34 35 36
1.58976744 1.08976744 1.71976744 2.90976744 4.22976744 4.85976744
37 38 39 40 41 42
5.87976744 6.10976744 6.62976744 7.99976744 8.74976744 8.47976744
43 44 45 46 47
9.31976744 -0.22000000 -0.18000000 0.26000000 0.14000000
> postscript(file="/var/www/html/rcomp/tmp/61dwd1229797029.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 = 47
Frequency = 1
lag(myerror, k = 1) myerror
0 -5.88023256 NA
1 -5.05023256 -5.88023256
2 -3.52023256 -5.05023256
3 -3.46023256 -3.52023256
4 -2.78023256 -3.46023256
5 -3.37023256 -2.78023256
6 -4.10023256 -3.37023256
7 -4.02023256 -4.10023256
8 -4.96023256 -4.02023256
9 -4.90023256 -4.96023256
10 -4.31023256 -4.90023256
11 -4.52023256 -4.31023256
12 -4.23023256 -4.52023256
13 -3.55023256 -4.23023256
14 -3.46023256 -3.55023256
15 -2.78023256 -3.46023256
16 -1.66023256 -2.78023256
17 -2.08023256 -1.66023256
18 -1.88023256 -2.08023256
19 -1.60023256 -1.88023256
20 -0.78023256 -1.60023256
21 -1.02023256 -0.78023256
22 -0.04023256 -1.02023256
23 -0.71023256 -0.04023256
24 0.29976744 -0.71023256
25 0.44976744 0.29976744
26 0.34976744 0.44976744
27 1.86976744 0.34976744
28 0.97976744 1.86976744
29 1.14976744 0.97976744
30 1.58976744 1.14976744
31 1.08976744 1.58976744
32 1.71976744 1.08976744
33 2.90976744 1.71976744
34 4.22976744 2.90976744
35 4.85976744 4.22976744
36 5.87976744 4.85976744
37 6.10976744 5.87976744
38 6.62976744 6.10976744
39 7.99976744 6.62976744
40 8.74976744 7.99976744
41 8.47976744 8.74976744
42 9.31976744 8.47976744
43 -0.22000000 9.31976744
44 -0.18000000 -0.22000000
45 0.26000000 -0.18000000
46 0.14000000 0.26000000
47 NA 0.14000000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -5.05023256 -5.88023256
[2,] -3.52023256 -5.05023256
[3,] -3.46023256 -3.52023256
[4,] -2.78023256 -3.46023256
[5,] -3.37023256 -2.78023256
[6,] -4.10023256 -3.37023256
[7,] -4.02023256 -4.10023256
[8,] -4.96023256 -4.02023256
[9,] -4.90023256 -4.96023256
[10,] -4.31023256 -4.90023256
[11,] -4.52023256 -4.31023256
[12,] -4.23023256 -4.52023256
[13,] -3.55023256 -4.23023256
[14,] -3.46023256 -3.55023256
[15,] -2.78023256 -3.46023256
[16,] -1.66023256 -2.78023256
[17,] -2.08023256 -1.66023256
[18,] -1.88023256 -2.08023256
[19,] -1.60023256 -1.88023256
[20,] -0.78023256 -1.60023256
[21,] -1.02023256 -0.78023256
[22,] -0.04023256 -1.02023256
[23,] -0.71023256 -0.04023256
[24,] 0.29976744 -0.71023256
[25,] 0.44976744 0.29976744
[26,] 0.34976744 0.44976744
[27,] 1.86976744 0.34976744
[28,] 0.97976744 1.86976744
[29,] 1.14976744 0.97976744
[30,] 1.58976744 1.14976744
[31,] 1.08976744 1.58976744
[32,] 1.71976744 1.08976744
[33,] 2.90976744 1.71976744
[34,] 4.22976744 2.90976744
[35,] 4.85976744 4.22976744
[36,] 5.87976744 4.85976744
[37,] 6.10976744 5.87976744
[38,] 6.62976744 6.10976744
[39,] 7.99976744 6.62976744
[40,] 8.74976744 7.99976744
[41,] 8.47976744 8.74976744
[42,] 9.31976744 8.47976744
[43,] -0.22000000 9.31976744
[44,] -0.18000000 -0.22000000
[45,] 0.26000000 -0.18000000
[46,] 0.14000000 0.26000000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -5.05023256 -5.88023256
2 -3.52023256 -5.05023256
3 -3.46023256 -3.52023256
4 -2.78023256 -3.46023256
5 -3.37023256 -2.78023256
6 -4.10023256 -3.37023256
7 -4.02023256 -4.10023256
8 -4.96023256 -4.02023256
9 -4.90023256 -4.96023256
10 -4.31023256 -4.90023256
11 -4.52023256 -4.31023256
12 -4.23023256 -4.52023256
13 -3.55023256 -4.23023256
14 -3.46023256 -3.55023256
15 -2.78023256 -3.46023256
16 -1.66023256 -2.78023256
17 -2.08023256 -1.66023256
18 -1.88023256 -2.08023256
19 -1.60023256 -1.88023256
20 -0.78023256 -1.60023256
21 -1.02023256 -0.78023256
22 -0.04023256 -1.02023256
23 -0.71023256 -0.04023256
24 0.29976744 -0.71023256
25 0.44976744 0.29976744
26 0.34976744 0.44976744
27 1.86976744 0.34976744
28 0.97976744 1.86976744
29 1.14976744 0.97976744
30 1.58976744 1.14976744
31 1.08976744 1.58976744
32 1.71976744 1.08976744
33 2.90976744 1.71976744
34 4.22976744 2.90976744
35 4.85976744 4.22976744
36 5.87976744 4.85976744
37 6.10976744 5.87976744
38 6.62976744 6.10976744
39 7.99976744 6.62976744
40 8.74976744 7.99976744
41 8.47976744 8.74976744
42 9.31976744 8.47976744
43 -0.22000000 9.31976744
44 -0.18000000 -0.22000000
45 0.26000000 -0.18000000
46 0.14000000 0.26000000
> 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/741wj1229797029.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/8hs6s1229797029.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/9dsxu1229797029.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/10gc3w1229797029.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/11x29s1229797029.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/12lphc1229797029.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/13msj61229797029.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/14o8he1229797029.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/15bl9n1229797029.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/16gd6h1229797029.tab")
+ }
>
> system("convert tmp/1v5d01229797029.ps tmp/1v5d01229797029.png")
> system("convert tmp/2ij331229797029.ps tmp/2ij331229797029.png")
> system("convert tmp/3fmls1229797029.ps tmp/3fmls1229797029.png")
> system("convert tmp/4ayzo1229797029.ps tmp/4ayzo1229797029.png")
> system("convert tmp/5yt0s1229797029.ps tmp/5yt0s1229797029.png")
> system("convert tmp/61dwd1229797029.ps tmp/61dwd1229797029.png")
> system("convert tmp/741wj1229797029.ps tmp/741wj1229797029.png")
> system("convert tmp/8hs6s1229797029.ps tmp/8hs6s1229797029.png")
> system("convert tmp/9dsxu1229797029.ps tmp/9dsxu1229797029.png")
> system("convert tmp/10gc3w1229797029.ps tmp/10gc3w1229797029.png")
>
>
> proc.time()
user system elapsed
4.803 2.670 5.170