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(100.95,0,101.26,0,101.42,0,101.68,0,101.75,0,101.89,0,102.07,0,102.22,0,102.45,0,102.62,0,102.67,0,102.86,0,104.78,0,104.87,0,105.06,0,105.14,0,105.32,0,105.54,0,105.68,0,105.77,0,106.07,0,106.03,0,106.13,0,106.28,0,106.61,0,106.74,0,107.01,0,107.1,0,107.28,0,107.4,0,107.59,0,107.69,0,107.78,0,108.02,0,108,0,108.07,0,108.36,0,108.74,0,108.99,0,109.21,0,109.31,0,109.41,0,109.54,0,109.81,1,109.85,1,110.01,1,110.23,1),dim=c(2,47),dimnames=list(c('Huur','Dummy'),1:47))
> y <- array(NA,dim=c(2,47),dimnames=list(c('Huur','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
Huur Dummy
1 100.95 0
2 101.26 0
3 101.42 0
4 101.68 0
5 101.75 0
6 101.89 0
7 102.07 0
8 102.22 0
9 102.45 0
10 102.62 0
11 102.67 0
12 102.86 0
13 104.78 0
14 104.87 0
15 105.06 0
16 105.14 0
17 105.32 0
18 105.54 0
19 105.68 0
20 105.77 0
21 106.07 0
22 106.03 0
23 106.13 0
24 106.28 0
25 106.61 0
26 106.74 0
27 107.01 0
28 107.10 0
29 107.28 0
30 107.40 0
31 107.59 0
32 107.69 0
33 107.78 0
34 108.02 0
35 108.00 0
36 108.07 0
37 108.36 0
38 108.74 0
39 108.99 0
40 109.21 0
41 109.31 0
42 109.41 0
43 109.54 0
44 109.81 1
45 109.85 1
46 110.01 1
47 110.23 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
105.660 4.315
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4.710 -1.840 0.255 1.980 3.880
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 105.659 0.389 271.612 < 2e-16 ***
Dummy 4.316 1.333 3.236 0.00227 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.551 on 45 degrees of freedom
Multiple R-squared: 0.1888, Adjusted R-squared: 0.1708
F-statistic: 10.47 on 1 and 45 DF, p-value: 0.002274
> 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.0069712977 1.394260e-02 9.930287e-01
[2,] 0.0024389602 4.877920e-03 9.975610e-01
[3,] 0.0012753204 2.550641e-03 9.987247e-01
[4,] 0.0008920654 1.784131e-03 9.991079e-01
[5,] 0.0009998242 1.999648e-03 9.990002e-01
[6,] 0.0014535404 2.907081e-03 9.985465e-01
[7,] 0.0023092106 4.618421e-03 9.976908e-01
[8,] 0.0056440411 1.128808e-02 9.943560e-01
[9,] 0.1490965389 2.981931e-01 8.509035e-01
[10,] 0.4083952395 8.167905e-01 5.916048e-01
[11,] 0.6494411356 7.011177e-01 3.505589e-01
[12,] 0.8095165657 3.809669e-01 1.904834e-01
[13,] 0.9053136592 1.893727e-01 9.468634e-02
[14,] 0.9558731039 8.825379e-02 4.412690e-02
[15,] 0.9800687599 3.986248e-02 1.993124e-02
[16,] 0.9913276537 1.734469e-02 8.672346e-03
[17,] 0.9961156697 7.768661e-03 3.884330e-03
[18,] 0.9983799307 3.240139e-03 1.620069e-03
[19,] 0.9993767890 1.246422e-03 6.232110e-04
[20,] 0.9997762846 4.474308e-04 2.237154e-04
[21,] 0.9999054576 1.890848e-04 9.454239e-05
[22,] 0.9999596486 8.070290e-05 4.035145e-05
[23,] 0.9999784778 4.304436e-05 2.152218e-05
[24,] 0.9999883462 2.330764e-05 1.165382e-05
[25,] 0.9999926702 1.465965e-05 7.329826e-06
[26,] 0.9999951004 9.799215e-06 4.899608e-06
[27,] 0.9999959824 8.035268e-06 4.017634e-06
[28,] 0.9999965880 6.824013e-06 3.412007e-06
[29,] 0.9999972119 5.576103e-06 2.788051e-06
[30,] 0.9999967633 6.473326e-06 3.236663e-06
[31,] 0.9999975942 4.811509e-06 2.405754e-06
[32,] 0.9999991579 1.684198e-06 8.420992e-07
[33,] 0.9999997572 4.855598e-07 2.427799e-07
[34,] 0.9999997935 4.129054e-07 2.064527e-07
[35,] 0.9999995311 9.378465e-07 4.689233e-07
[36,] 0.9999963488 7.302376e-06 3.651188e-06
[37,] 0.9999600734 7.985321e-05 3.992661e-05
[38,] 0.9994678385 1.064323e-03 5.321615e-04
> postscript(file="/var/www/html/freestat/rcomp/tmp/1w2d81229796073.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/freestat/rcomp/tmp/21a471229796073.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/freestat/rcomp/tmp/3yg4n1229796073.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/freestat/rcomp/tmp/4pj5t1229796073.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/freestat/rcomp/tmp/5kt5g1229796073.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
-4.70953488 -4.39953488 -4.23953488 -3.97953488 -3.90953488 -3.76953488
7 8 9 10 11 12
-3.58953488 -3.43953488 -3.20953488 -3.03953488 -2.98953488 -2.79953488
13 14 15 16 17 18
-0.87953488 -0.78953488 -0.59953488 -0.51953488 -0.33953488 -0.11953488
19 20 21 22 23 24
0.02046512 0.11046512 0.41046512 0.37046512 0.47046512 0.62046512
25 26 27 28 29 30
0.95046512 1.08046512 1.35046512 1.44046512 1.62046512 1.74046512
31 32 33 34 35 36
1.93046512 2.03046512 2.12046512 2.36046512 2.34046512 2.41046512
37 38 39 40 41 42
2.70046512 3.08046512 3.33046512 3.55046512 3.65046512 3.75046512
43 44 45 46 47
3.88046512 -0.16500000 -0.12500000 0.03500000 0.25500000
> postscript(file="/var/www/html/freestat/rcomp/tmp/6lbtp1229796073.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 -4.70953488 NA
1 -4.39953488 -4.70953488
2 -4.23953488 -4.39953488
3 -3.97953488 -4.23953488
4 -3.90953488 -3.97953488
5 -3.76953488 -3.90953488
6 -3.58953488 -3.76953488
7 -3.43953488 -3.58953488
8 -3.20953488 -3.43953488
9 -3.03953488 -3.20953488
10 -2.98953488 -3.03953488
11 -2.79953488 -2.98953488
12 -0.87953488 -2.79953488
13 -0.78953488 -0.87953488
14 -0.59953488 -0.78953488
15 -0.51953488 -0.59953488
16 -0.33953488 -0.51953488
17 -0.11953488 -0.33953488
18 0.02046512 -0.11953488
19 0.11046512 0.02046512
20 0.41046512 0.11046512
21 0.37046512 0.41046512
22 0.47046512 0.37046512
23 0.62046512 0.47046512
24 0.95046512 0.62046512
25 1.08046512 0.95046512
26 1.35046512 1.08046512
27 1.44046512 1.35046512
28 1.62046512 1.44046512
29 1.74046512 1.62046512
30 1.93046512 1.74046512
31 2.03046512 1.93046512
32 2.12046512 2.03046512
33 2.36046512 2.12046512
34 2.34046512 2.36046512
35 2.41046512 2.34046512
36 2.70046512 2.41046512
37 3.08046512 2.70046512
38 3.33046512 3.08046512
39 3.55046512 3.33046512
40 3.65046512 3.55046512
41 3.75046512 3.65046512
42 3.88046512 3.75046512
43 -0.16500000 3.88046512
44 -0.12500000 -0.16500000
45 0.03500000 -0.12500000
46 0.25500000 0.03500000
47 NA 0.25500000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -4.39953488 -4.70953488
[2,] -4.23953488 -4.39953488
[3,] -3.97953488 -4.23953488
[4,] -3.90953488 -3.97953488
[5,] -3.76953488 -3.90953488
[6,] -3.58953488 -3.76953488
[7,] -3.43953488 -3.58953488
[8,] -3.20953488 -3.43953488
[9,] -3.03953488 -3.20953488
[10,] -2.98953488 -3.03953488
[11,] -2.79953488 -2.98953488
[12,] -0.87953488 -2.79953488
[13,] -0.78953488 -0.87953488
[14,] -0.59953488 -0.78953488
[15,] -0.51953488 -0.59953488
[16,] -0.33953488 -0.51953488
[17,] -0.11953488 -0.33953488
[18,] 0.02046512 -0.11953488
[19,] 0.11046512 0.02046512
[20,] 0.41046512 0.11046512
[21,] 0.37046512 0.41046512
[22,] 0.47046512 0.37046512
[23,] 0.62046512 0.47046512
[24,] 0.95046512 0.62046512
[25,] 1.08046512 0.95046512
[26,] 1.35046512 1.08046512
[27,] 1.44046512 1.35046512
[28,] 1.62046512 1.44046512
[29,] 1.74046512 1.62046512
[30,] 1.93046512 1.74046512
[31,] 2.03046512 1.93046512
[32,] 2.12046512 2.03046512
[33,] 2.36046512 2.12046512
[34,] 2.34046512 2.36046512
[35,] 2.41046512 2.34046512
[36,] 2.70046512 2.41046512
[37,] 3.08046512 2.70046512
[38,] 3.33046512 3.08046512
[39,] 3.55046512 3.33046512
[40,] 3.65046512 3.55046512
[41,] 3.75046512 3.65046512
[42,] 3.88046512 3.75046512
[43,] -0.16500000 3.88046512
[44,] -0.12500000 -0.16500000
[45,] 0.03500000 -0.12500000
[46,] 0.25500000 0.03500000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -4.39953488 -4.70953488
2 -4.23953488 -4.39953488
3 -3.97953488 -4.23953488
4 -3.90953488 -3.97953488
5 -3.76953488 -3.90953488
6 -3.58953488 -3.76953488
7 -3.43953488 -3.58953488
8 -3.20953488 -3.43953488
9 -3.03953488 -3.20953488
10 -2.98953488 -3.03953488
11 -2.79953488 -2.98953488
12 -0.87953488 -2.79953488
13 -0.78953488 -0.87953488
14 -0.59953488 -0.78953488
15 -0.51953488 -0.59953488
16 -0.33953488 -0.51953488
17 -0.11953488 -0.33953488
18 0.02046512 -0.11953488
19 0.11046512 0.02046512
20 0.41046512 0.11046512
21 0.37046512 0.41046512
22 0.47046512 0.37046512
23 0.62046512 0.47046512
24 0.95046512 0.62046512
25 1.08046512 0.95046512
26 1.35046512 1.08046512
27 1.44046512 1.35046512
28 1.62046512 1.44046512
29 1.74046512 1.62046512
30 1.93046512 1.74046512
31 2.03046512 1.93046512
32 2.12046512 2.03046512
33 2.36046512 2.12046512
34 2.34046512 2.36046512
35 2.41046512 2.34046512
36 2.70046512 2.41046512
37 3.08046512 2.70046512
38 3.33046512 3.08046512
39 3.55046512 3.33046512
40 3.65046512 3.55046512
41 3.75046512 3.65046512
42 3.88046512 3.75046512
43 -0.16500000 3.88046512
44 -0.12500000 -0.16500000
45 0.03500000 -0.12500000
46 0.25500000 0.03500000
> 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/freestat/rcomp/tmp/737wi1229796073.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/freestat/rcomp/tmp/89sle1229796073.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/freestat/rcomp/tmp/91z4o1229796073.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/freestat/rcomp/tmp/10as261229796073.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/114jxt1229796073.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/freestat/rcomp/tmp/127e651229796073.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/freestat/rcomp/tmp/13j14o1229796073.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/freestat/rcomp/tmp/14xyn11229796073.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/freestat/rcomp/tmp/15tfnn1229796073.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/freestat/rcomp/tmp/16w9ch1229796073.tab")
+ }
>
> system("convert tmp/1w2d81229796073.ps tmp/1w2d81229796073.png")
> system("convert tmp/21a471229796073.ps tmp/21a471229796073.png")
> system("convert tmp/3yg4n1229796073.ps tmp/3yg4n1229796073.png")
> system("convert tmp/4pj5t1229796073.ps tmp/4pj5t1229796073.png")
> system("convert tmp/5kt5g1229796073.ps tmp/5kt5g1229796073.png")
> system("convert tmp/6lbtp1229796073.ps tmp/6lbtp1229796073.png")
> system("convert tmp/737wi1229796073.ps tmp/737wi1229796073.png")
> system("convert tmp/89sle1229796073.ps tmp/89sle1229796073.png")
> system("convert tmp/91z4o1229796073.ps tmp/91z4o1229796073.png")
> system("convert tmp/10as261229796073.ps tmp/10as261229796073.png")
>
>
> proc.time()
user system elapsed
3.496 2.435 3.931