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(1515,0,1510,0,1225,0,1577,0,1417,0,1224,0,1693,0,1633,0,1639,0,1914,0,1586,0,1552,0,2081,0,1500,0,1437,0,1470,0,1849,0,1387,0,1592,0,1589,0,1798,0,1935,0,1887,0,2027,0,2080,0,1556,0,1682,0,1785,0,1869,0,1781,0,2082,0,2570,1,1862,1,1936,1,1504,1,1765,1,1607,1,1577,1,1493,1,1615,1,1700,1,1335,1,1523,1,1623,1,1540,1,1637,1,1524,1,1419,1,1821,1,1593,1,1357,1,1263,1,1750,1,1405,1,1393,1,1639,1,1679,1,1551,1,1744,1,1429,1,1784,1),dim=c(2,61),dimnames=list(c('Gebouwen','Dummy'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Gebouwen','Dummy'),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
Gebouwen Dummy
1 1515 0
2 1510 0
3 1225 0
4 1577 0
5 1417 0
6 1224 0
7 1693 0
8 1633 0
9 1639 0
10 1914 0
11 1586 0
12 1552 0
13 2081 0
14 1500 0
15 1437 0
16 1470 0
17 1849 0
18 1387 0
19 1592 0
20 1589 0
21 1798 0
22 1935 0
23 1887 0
24 2027 0
25 2080 0
26 1556 0
27 1682 0
28 1785 0
29 1869 0
30 1781 0
31 2082 0
32 2570 1
33 1862 1
34 1936 1
35 1504 1
36 1765 1
37 1607 1
38 1577 1
39 1493 1
40 1615 1
41 1700 1
42 1335 1
43 1523 1
44 1623 1
45 1540 1
46 1637 1
47 1524 1
48 1419 1
49 1821 1
50 1593 1
51 1357 1
52 1263 1
53 1750 1
54 1405 1
55 1393 1
56 1639 1
57 1679 1
58 1551 1
59 1744 1
60 1429 1
61 1784 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
1673.29 -52.02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-449.29 -158.29 -34.29 128.73 948.73
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1673.29 43.13 38.792 <2e-16 ***
Dummy -52.02 61.51 -0.846 0.401
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 240.2 on 59 degrees of freedom
Multiple R-squared: 0.01198, Adjusted R-squared: -0.004766
F-statistic: 0.7154 on 1 and 59 DF, p-value: 0.4011
> 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.2816173 0.563234615 0.718382693
[2,] 0.3090509 0.618101784 0.690949108
[3,] 0.3717506 0.743501169 0.628249415
[4,] 0.3183916 0.636783126 0.681608437
[5,] 0.2631501 0.526300203 0.736849898
[6,] 0.4737762 0.947552473 0.526223763
[7,] 0.3759382 0.751876433 0.624061783
[8,] 0.2892174 0.578434868 0.710782566
[9,] 0.6187673 0.762465424 0.381232712
[10,] 0.5539636 0.892072824 0.446036412
[11,] 0.5228101 0.954379731 0.477189865
[12,] 0.4813786 0.962757202 0.518621399
[13,] 0.4906896 0.981379216 0.509310392
[14,] 0.5195279 0.960944179 0.480472089
[15,] 0.4619961 0.923992225 0.538003888
[16,] 0.4128078 0.825615684 0.587192158
[17,] 0.3913754 0.782750773 0.608624613
[18,] 0.4404575 0.880914975 0.559542513
[19,] 0.4404397 0.880879481 0.559560259
[20,] 0.5274092 0.945181665 0.472590832
[21,] 0.6392911 0.721417725 0.360708863
[22,] 0.6078685 0.784262934 0.392131467
[23,] 0.5520353 0.895929384 0.447964692
[24,] 0.4971111 0.994222175 0.502888912
[25,] 0.4561697 0.912339446 0.543830277
[26,] 0.4189257 0.837851302 0.581074349
[27,] 0.4558419 0.911683793 0.544158104
[28,] 0.9605093 0.078981409 0.039490704
[29,] 0.9850402 0.029919657 0.014959828
[30,] 0.9945834 0.010833122 0.005416561
[31,] 0.9963139 0.007372215 0.003686107
[32,] 0.9963258 0.007348460 0.003674230
[33,] 0.9948638 0.010272426 0.005136213
[34,] 0.9924265 0.015146968 0.007573484
[35,] 0.9899244 0.020151103 0.010075551
[36,] 0.9840405 0.031918957 0.015959478
[37,] 0.9784758 0.043048398 0.021524199
[38,] 0.9842131 0.031573842 0.015786921
[39,] 0.9748076 0.050384702 0.025192351
[40,] 0.9596682 0.080663523 0.040331762
[41,] 0.9369605 0.126078970 0.063039485
[42,] 0.9062228 0.187554332 0.093777166
[43,] 0.8627749 0.274450138 0.137225069
[44,] 0.8350722 0.329855625 0.164927813
[45,] 0.8543217 0.291356646 0.145678323
[46,] 0.7861232 0.427753679 0.213876840
[47,] 0.7757149 0.448570166 0.224285083
[48,] 0.8717775 0.256444938 0.128222469
[49,] 0.8397958 0.320408379 0.160204189
[50,] 0.8213910 0.357218075 0.178609037
[51,] 0.8486459 0.302708194 0.151354097
[52,] 0.7085873 0.582825476 0.291412738
> postscript(file="/var/www/html/rcomp/tmp/1hq5m1227455285.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/2zguj1227455285.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/39xl41227455285.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/48n161227455285.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/54d7d1227455285.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
-158.290323 -163.290323 -448.290323 -96.290323 -256.290323 -449.290323
7 8 9 10 11 12
19.709677 -40.290323 -34.290323 240.709677 -87.290323 -121.290323
13 14 15 16 17 18
407.709677 -173.290323 -236.290323 -203.290323 175.709677 -286.290323
19 20 21 22 23 24
-81.290323 -84.290323 124.709677 261.709677 213.709677 353.709677
25 26 27 28 29 30
406.709677 -117.290323 8.709677 111.709677 195.709677 107.709677
31 32 33 34 35 36
408.709677 948.733333 240.733333 314.733333 -117.266667 143.733333
37 38 39 40 41 42
-14.266667 -44.266667 -128.266667 -6.266667 78.733333 -286.266667
43 44 45 46 47 48
-98.266667 1.733333 -81.266667 15.733333 -97.266667 -202.266667
49 50 51 52 53 54
199.733333 -28.266667 -264.266667 -358.266667 128.733333 -216.266667
55 56 57 58 59 60
-228.266667 17.733333 57.733333 -70.266667 122.733333 -192.266667
61
162.733333
> postscript(file="/var/www/html/rcomp/tmp/6x3xy1227455285.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 -158.290323 NA
1 -163.290323 -158.290323
2 -448.290323 -163.290323
3 -96.290323 -448.290323
4 -256.290323 -96.290323
5 -449.290323 -256.290323
6 19.709677 -449.290323
7 -40.290323 19.709677
8 -34.290323 -40.290323
9 240.709677 -34.290323
10 -87.290323 240.709677
11 -121.290323 -87.290323
12 407.709677 -121.290323
13 -173.290323 407.709677
14 -236.290323 -173.290323
15 -203.290323 -236.290323
16 175.709677 -203.290323
17 -286.290323 175.709677
18 -81.290323 -286.290323
19 -84.290323 -81.290323
20 124.709677 -84.290323
21 261.709677 124.709677
22 213.709677 261.709677
23 353.709677 213.709677
24 406.709677 353.709677
25 -117.290323 406.709677
26 8.709677 -117.290323
27 111.709677 8.709677
28 195.709677 111.709677
29 107.709677 195.709677
30 408.709677 107.709677
31 948.733333 408.709677
32 240.733333 948.733333
33 314.733333 240.733333
34 -117.266667 314.733333
35 143.733333 -117.266667
36 -14.266667 143.733333
37 -44.266667 -14.266667
38 -128.266667 -44.266667
39 -6.266667 -128.266667
40 78.733333 -6.266667
41 -286.266667 78.733333
42 -98.266667 -286.266667
43 1.733333 -98.266667
44 -81.266667 1.733333
45 15.733333 -81.266667
46 -97.266667 15.733333
47 -202.266667 -97.266667
48 199.733333 -202.266667
49 -28.266667 199.733333
50 -264.266667 -28.266667
51 -358.266667 -264.266667
52 128.733333 -358.266667
53 -216.266667 128.733333
54 -228.266667 -216.266667
55 17.733333 -228.266667
56 57.733333 17.733333
57 -70.266667 57.733333
58 122.733333 -70.266667
59 -192.266667 122.733333
60 162.733333 -192.266667
61 NA 162.733333
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -163.290323 -158.290323
[2,] -448.290323 -163.290323
[3,] -96.290323 -448.290323
[4,] -256.290323 -96.290323
[5,] -449.290323 -256.290323
[6,] 19.709677 -449.290323
[7,] -40.290323 19.709677
[8,] -34.290323 -40.290323
[9,] 240.709677 -34.290323
[10,] -87.290323 240.709677
[11,] -121.290323 -87.290323
[12,] 407.709677 -121.290323
[13,] -173.290323 407.709677
[14,] -236.290323 -173.290323
[15,] -203.290323 -236.290323
[16,] 175.709677 -203.290323
[17,] -286.290323 175.709677
[18,] -81.290323 -286.290323
[19,] -84.290323 -81.290323
[20,] 124.709677 -84.290323
[21,] 261.709677 124.709677
[22,] 213.709677 261.709677
[23,] 353.709677 213.709677
[24,] 406.709677 353.709677
[25,] -117.290323 406.709677
[26,] 8.709677 -117.290323
[27,] 111.709677 8.709677
[28,] 195.709677 111.709677
[29,] 107.709677 195.709677
[30,] 408.709677 107.709677
[31,] 948.733333 408.709677
[32,] 240.733333 948.733333
[33,] 314.733333 240.733333
[34,] -117.266667 314.733333
[35,] 143.733333 -117.266667
[36,] -14.266667 143.733333
[37,] -44.266667 -14.266667
[38,] -128.266667 -44.266667
[39,] -6.266667 -128.266667
[40,] 78.733333 -6.266667
[41,] -286.266667 78.733333
[42,] -98.266667 -286.266667
[43,] 1.733333 -98.266667
[44,] -81.266667 1.733333
[45,] 15.733333 -81.266667
[46,] -97.266667 15.733333
[47,] -202.266667 -97.266667
[48,] 199.733333 -202.266667
[49,] -28.266667 199.733333
[50,] -264.266667 -28.266667
[51,] -358.266667 -264.266667
[52,] 128.733333 -358.266667
[53,] -216.266667 128.733333
[54,] -228.266667 -216.266667
[55,] 17.733333 -228.266667
[56,] 57.733333 17.733333
[57,] -70.266667 57.733333
[58,] 122.733333 -70.266667
[59,] -192.266667 122.733333
[60,] 162.733333 -192.266667
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -163.290323 -158.290323
2 -448.290323 -163.290323
3 -96.290323 -448.290323
4 -256.290323 -96.290323
5 -449.290323 -256.290323
6 19.709677 -449.290323
7 -40.290323 19.709677
8 -34.290323 -40.290323
9 240.709677 -34.290323
10 -87.290323 240.709677
11 -121.290323 -87.290323
12 407.709677 -121.290323
13 -173.290323 407.709677
14 -236.290323 -173.290323
15 -203.290323 -236.290323
16 175.709677 -203.290323
17 -286.290323 175.709677
18 -81.290323 -286.290323
19 -84.290323 -81.290323
20 124.709677 -84.290323
21 261.709677 124.709677
22 213.709677 261.709677
23 353.709677 213.709677
24 406.709677 353.709677
25 -117.290323 406.709677
26 8.709677 -117.290323
27 111.709677 8.709677
28 195.709677 111.709677
29 107.709677 195.709677
30 408.709677 107.709677
31 948.733333 408.709677
32 240.733333 948.733333
33 314.733333 240.733333
34 -117.266667 314.733333
35 143.733333 -117.266667
36 -14.266667 143.733333
37 -44.266667 -14.266667
38 -128.266667 -44.266667
39 -6.266667 -128.266667
40 78.733333 -6.266667
41 -286.266667 78.733333
42 -98.266667 -286.266667
43 1.733333 -98.266667
44 -81.266667 1.733333
45 15.733333 -81.266667
46 -97.266667 15.733333
47 -202.266667 -97.266667
48 199.733333 -202.266667
49 -28.266667 199.733333
50 -264.266667 -28.266667
51 -358.266667 -264.266667
52 128.733333 -358.266667
53 -216.266667 128.733333
54 -228.266667 -216.266667
55 17.733333 -228.266667
56 57.733333 17.733333
57 -70.266667 57.733333
58 122.733333 -70.266667
59 -192.266667 122.733333
60 162.733333 -192.266667
> 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/7t5y21227455285.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/84n9x1227455285.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/9l9u81227455285.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/10bor51227455285.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/115sks1227455285.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/12iwpp1227455285.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/13zqb31227455285.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/14q2ii1227455285.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/15674l1227455285.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/16oaeq1227455285.tab")
+ }
>
> system("convert tmp/1hq5m1227455285.ps tmp/1hq5m1227455285.png")
> system("convert tmp/2zguj1227455285.ps tmp/2zguj1227455285.png")
> system("convert tmp/39xl41227455285.ps tmp/39xl41227455285.png")
> system("convert tmp/48n161227455285.ps tmp/48n161227455285.png")
> system("convert tmp/54d7d1227455285.ps tmp/54d7d1227455285.png")
> system("convert tmp/6x3xy1227455285.ps tmp/6x3xy1227455285.png")
> system("convert tmp/7t5y21227455285.ps tmp/7t5y21227455285.png")
> system("convert tmp/84n9x1227455285.ps tmp/84n9x1227455285.png")
> system("convert tmp/9l9u81227455285.ps tmp/9l9u81227455285.png")
> system("convert tmp/10bor51227455285.ps tmp/10bor51227455285.png")
>
>
> proc.time()
user system elapsed
2.516 1.592 2.905