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 = '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 t
1 1515 0 1
2 1510 0 2
3 1225 0 3
4 1577 0 4
5 1417 0 5
6 1224 0 6
7 1693 0 7
8 1633 0 8
9 1639 0 9
10 1914 0 10
11 1586 0 11
12 1552 0 12
13 2081 0 13
14 1500 0 14
15 1437 0 15
16 1470 0 16
17 1849 0 17
18 1387 0 18
19 1592 0 19
20 1589 0 20
21 1798 0 21
22 1935 0 22
23 1887 0 23
24 2027 0 24
25 2080 0 25
26 1556 0 26
27 1682 0 27
28 1785 0 28
29 1869 0 29
30 1781 0 30
31 2082 0 31
32 2570 1 32
33 1862 1 33
34 1936 1 34
35 1504 1 35
36 1765 1 36
37 1607 1 37
38 1577 1 38
39 1493 1 39
40 1615 1 40
41 1700 1 41
42 1335 1 42
43 1523 1 43
44 1623 1 44
45 1540 1 45
46 1637 1 46
47 1524 1 47
48 1419 1 48
49 1821 1 49
50 1593 1 50
51 1357 1 51
52 1263 1 52
53 1750 1 53
54 1405 1 54
55 1393 1 55
56 1639 1 56
57 1679 1 57
58 1551 1 58
59 1744 1 59
60 1429 1 60
61 1784 1 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy t
1622.605 -148.643 3.168
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-417.61 -118.94 -17.34 108.87 994.67
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1622.605 70.705 22.949 <2e-16 ***
Dummy -148.643 123.204 -1.206 0.233
t 3.168 3.498 0.906 0.369
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 240.5 on 58 degrees of freedom
Multiple R-squared: 0.02575, Adjusted R-squared: -0.007841
F-statistic: 0.7666 on 2 and 58 DF, p-value: 0.4692
> 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.3624976 0.72499522 0.63750239
[2,] 0.5045834 0.99083317 0.49541659
[3,] 0.3974074 0.79481475 0.60259262
[4,] 0.2826768 0.56535354 0.71732323
[5,] 0.3043222 0.60864444 0.69567778
[6,] 0.2493508 0.49870156 0.75064922
[7,] 0.2138332 0.42766635 0.78616683
[8,] 0.3101682 0.62033646 0.68983177
[9,] 0.3803512 0.76070239 0.61964880
[10,] 0.4682604 0.93652087 0.53173957
[11,] 0.4934804 0.98696088 0.50651956
[12,] 0.4338709 0.86774182 0.56612909
[13,] 0.5633477 0.87330454 0.43665227
[14,] 0.5256942 0.94861166 0.47430583
[15,] 0.4993151 0.99863029 0.50068485
[16,] 0.4429896 0.88597912 0.55701044
[17,] 0.4184582 0.83691638 0.58154181
[18,] 0.3581308 0.71626151 0.64186925
[19,] 0.3454640 0.69092808 0.65453596
[20,] 0.3503108 0.70062156 0.64968922
[21,] 0.4201980 0.84039593 0.57980203
[22,] 0.3957699 0.79153985 0.60423008
[23,] 0.3360083 0.67201663 0.66399168
[24,] 0.2705365 0.54107304 0.72946348
[25,] 0.2407484 0.48149670 0.75925165
[26,] 0.2086252 0.41725031 0.79137484
[27,] 0.7834420 0.43311600 0.21655800
[28,] 0.9047061 0.19058780 0.09529390
[29,] 0.9550243 0.08995149 0.04497575
[30,] 0.9765219 0.04695616 0.02347808
[31,] 0.9789123 0.04217531 0.02108766
[32,] 0.9763591 0.04728178 0.02364089
[33,] 0.9714669 0.05706629 0.02853314
[34,] 0.9670765 0.06584695 0.03292348
[35,] 0.9559421 0.08811574 0.04405787
[36,] 0.9528906 0.09421882 0.04710941
[37,] 0.9628292 0.07434155 0.03717078
[38,] 0.9460908 0.10781834 0.05390917
[39,] 0.9246025 0.15079509 0.07539755
[40,] 0.8921472 0.21570567 0.10785283
[41,] 0.8623493 0.27530140 0.13765070
[42,] 0.8111511 0.37769770 0.18884885
[43,] 0.7645050 0.47099005 0.23549503
[44,] 0.8632554 0.27348914 0.13674457
[45,] 0.8529870 0.29402602 0.14701301
[46,] 0.7945060 0.41098800 0.20549400
[47,] 0.8131580 0.37368391 0.18684195
[48,] 0.8631307 0.27373870 0.13686935
[49,] 0.7708885 0.45822299 0.22911150
[50,] 0.7172935 0.56541296 0.28270648
> postscript(file="/var/www/html/rcomp/tmp/132mf1227455586.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/2kxsg1227455586.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/354oh1227455586.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/45qsy1227455586.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/5inmw1227455586.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
-110.772607 -118.940455 -407.108302 -58.276150 -221.443998 -417.611846
7 8 9 10 11 12
48.220307 -14.947541 -12.115389 259.716764 -71.451084 -108.618932
13 14 15 16 17 18
417.213221 -166.954627 -233.122475 -203.290323 172.541830 -292.626018
19 20 21 22 23 24
-90.793866 -96.961713 108.870439 242.702591 191.534744 328.366896
25 26 27 28 29 30
378.199048 -148.968800 -26.136647 73.695505 154.527657 63.359810
31 32 33 34 35 36
361.191962 994.667125 283.499277 354.331430 -80.836418 176.995734
37 38 39 40 41 42
15.827886 -17.339961 -104.507809 14.324343 96.156496 -272.011352
43 44 45 46 47 48
-87.179200 9.652953 -76.514895 17.317257 -98.850591 -207.018438
49 50 51 52 53 54
191.813714 -39.354134 -278.521981 -375.689829 108.142323 -240.025524
55 56 57 58 59 60
-255.193372 -12.361220 24.470932 -106.696915 83.135237 -235.032611
61
116.799542
> postscript(file="/var/www/html/rcomp/tmp/6gjfc1227455586.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 -110.772607 NA
1 -118.940455 -110.772607
2 -407.108302 -118.940455
3 -58.276150 -407.108302
4 -221.443998 -58.276150
5 -417.611846 -221.443998
6 48.220307 -417.611846
7 -14.947541 48.220307
8 -12.115389 -14.947541
9 259.716764 -12.115389
10 -71.451084 259.716764
11 -108.618932 -71.451084
12 417.213221 -108.618932
13 -166.954627 417.213221
14 -233.122475 -166.954627
15 -203.290323 -233.122475
16 172.541830 -203.290323
17 -292.626018 172.541830
18 -90.793866 -292.626018
19 -96.961713 -90.793866
20 108.870439 -96.961713
21 242.702591 108.870439
22 191.534744 242.702591
23 328.366896 191.534744
24 378.199048 328.366896
25 -148.968800 378.199048
26 -26.136647 -148.968800
27 73.695505 -26.136647
28 154.527657 73.695505
29 63.359810 154.527657
30 361.191962 63.359810
31 994.667125 361.191962
32 283.499277 994.667125
33 354.331430 283.499277
34 -80.836418 354.331430
35 176.995734 -80.836418
36 15.827886 176.995734
37 -17.339961 15.827886
38 -104.507809 -17.339961
39 14.324343 -104.507809
40 96.156496 14.324343
41 -272.011352 96.156496
42 -87.179200 -272.011352
43 9.652953 -87.179200
44 -76.514895 9.652953
45 17.317257 -76.514895
46 -98.850591 17.317257
47 -207.018438 -98.850591
48 191.813714 -207.018438
49 -39.354134 191.813714
50 -278.521981 -39.354134
51 -375.689829 -278.521981
52 108.142323 -375.689829
53 -240.025524 108.142323
54 -255.193372 -240.025524
55 -12.361220 -255.193372
56 24.470932 -12.361220
57 -106.696915 24.470932
58 83.135237 -106.696915
59 -235.032611 83.135237
60 116.799542 -235.032611
61 NA 116.799542
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -118.940455 -110.772607
[2,] -407.108302 -118.940455
[3,] -58.276150 -407.108302
[4,] -221.443998 -58.276150
[5,] -417.611846 -221.443998
[6,] 48.220307 -417.611846
[7,] -14.947541 48.220307
[8,] -12.115389 -14.947541
[9,] 259.716764 -12.115389
[10,] -71.451084 259.716764
[11,] -108.618932 -71.451084
[12,] 417.213221 -108.618932
[13,] -166.954627 417.213221
[14,] -233.122475 -166.954627
[15,] -203.290323 -233.122475
[16,] 172.541830 -203.290323
[17,] -292.626018 172.541830
[18,] -90.793866 -292.626018
[19,] -96.961713 -90.793866
[20,] 108.870439 -96.961713
[21,] 242.702591 108.870439
[22,] 191.534744 242.702591
[23,] 328.366896 191.534744
[24,] 378.199048 328.366896
[25,] -148.968800 378.199048
[26,] -26.136647 -148.968800
[27,] 73.695505 -26.136647
[28,] 154.527657 73.695505
[29,] 63.359810 154.527657
[30,] 361.191962 63.359810
[31,] 994.667125 361.191962
[32,] 283.499277 994.667125
[33,] 354.331430 283.499277
[34,] -80.836418 354.331430
[35,] 176.995734 -80.836418
[36,] 15.827886 176.995734
[37,] -17.339961 15.827886
[38,] -104.507809 -17.339961
[39,] 14.324343 -104.507809
[40,] 96.156496 14.324343
[41,] -272.011352 96.156496
[42,] -87.179200 -272.011352
[43,] 9.652953 -87.179200
[44,] -76.514895 9.652953
[45,] 17.317257 -76.514895
[46,] -98.850591 17.317257
[47,] -207.018438 -98.850591
[48,] 191.813714 -207.018438
[49,] -39.354134 191.813714
[50,] -278.521981 -39.354134
[51,] -375.689829 -278.521981
[52,] 108.142323 -375.689829
[53,] -240.025524 108.142323
[54,] -255.193372 -240.025524
[55,] -12.361220 -255.193372
[56,] 24.470932 -12.361220
[57,] -106.696915 24.470932
[58,] 83.135237 -106.696915
[59,] -235.032611 83.135237
[60,] 116.799542 -235.032611
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -118.940455 -110.772607
2 -407.108302 -118.940455
3 -58.276150 -407.108302
4 -221.443998 -58.276150
5 -417.611846 -221.443998
6 48.220307 -417.611846
7 -14.947541 48.220307
8 -12.115389 -14.947541
9 259.716764 -12.115389
10 -71.451084 259.716764
11 -108.618932 -71.451084
12 417.213221 -108.618932
13 -166.954627 417.213221
14 -233.122475 -166.954627
15 -203.290323 -233.122475
16 172.541830 -203.290323
17 -292.626018 172.541830
18 -90.793866 -292.626018
19 -96.961713 -90.793866
20 108.870439 -96.961713
21 242.702591 108.870439
22 191.534744 242.702591
23 328.366896 191.534744
24 378.199048 328.366896
25 -148.968800 378.199048
26 -26.136647 -148.968800
27 73.695505 -26.136647
28 154.527657 73.695505
29 63.359810 154.527657
30 361.191962 63.359810
31 994.667125 361.191962
32 283.499277 994.667125
33 354.331430 283.499277
34 -80.836418 354.331430
35 176.995734 -80.836418
36 15.827886 176.995734
37 -17.339961 15.827886
38 -104.507809 -17.339961
39 14.324343 -104.507809
40 96.156496 14.324343
41 -272.011352 96.156496
42 -87.179200 -272.011352
43 9.652953 -87.179200
44 -76.514895 9.652953
45 17.317257 -76.514895
46 -98.850591 17.317257
47 -207.018438 -98.850591
48 191.813714 -207.018438
49 -39.354134 191.813714
50 -278.521981 -39.354134
51 -375.689829 -278.521981
52 108.142323 -375.689829
53 -240.025524 108.142323
54 -255.193372 -240.025524
55 -12.361220 -255.193372
56 24.470932 -12.361220
57 -106.696915 24.470932
58 83.135237 -106.696915
59 -235.032611 83.135237
60 116.799542 -235.032611
> 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/7u5n81227455586.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/8b5mm1227455586.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/91pwp1227455586.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/10yfw61227455586.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/11c46j1227455586.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/126wru1227455586.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/139ker1227455586.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/14j9lf1227455586.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/156sq51227455586.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/16v5uc1227455586.tab")
+ }
>
> system("convert tmp/132mf1227455586.ps tmp/132mf1227455586.png")
> system("convert tmp/2kxsg1227455586.ps tmp/2kxsg1227455586.png")
> system("convert tmp/354oh1227455586.ps tmp/354oh1227455586.png")
> system("convert tmp/45qsy1227455586.ps tmp/45qsy1227455586.png")
> system("convert tmp/5inmw1227455586.ps tmp/5inmw1227455586.png")
> system("convert tmp/6gjfc1227455586.ps tmp/6gjfc1227455586.png")
> system("convert tmp/7u5n81227455586.ps tmp/7u5n81227455586.png")
> system("convert tmp/8b5mm1227455586.ps tmp/8b5mm1227455586.png")
> system("convert tmp/91pwp1227455586.ps tmp/91pwp1227455586.png")
> system("convert tmp/10yfw61227455586.ps tmp/10yfw61227455586.png")
>
>
> proc.time()
user system elapsed
2.445 1.524 2.955