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,1,2570,1,1862,0,1936,0,1504,0,1765,0,1607,0,1577,0,1493,0,1615,0,1700,0,1335,0,1523,0,1623,0,1540,0,1637,0,1524,0,1419,0,1821,0,1593,0,1357,0,1263,0,1750,0,1405,0,1393,0,1639,0,1679,0,1551,0,1744,0,1429,0,1784,0),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 1
32 2570 1
33 1862 0
34 1936 0
35 1504 0
36 1765 0
37 1607 0
38 1577 0
39 1493 0
40 1615 0
41 1700 0
42 1335 0
43 1523 0
44 1623 0
45 1540 0
46 1637 0
47 1524 0
48 1419 0
49 1821 0
50 1593 0
51 1357 0
52 1263 0
53 1750 0
54 1405 0
55 1393 0
56 1639 0
57 1679 0
58 1551 0
59 1744 0
60 1429 0
61 1784 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy
1624.7 701.3
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-400.71 -124.71 -31.71 156.29 456.29
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1624.71 26.76 60.711 < 2e-16 ***
Dummy 701.29 147.79 4.745 1.37e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 205.6 on 59 degrees of freedom
Multiple R-squared: 0.2762, Adjusted R-squared: 0.2639
F-statistic: 22.52 on 1 and 59 DF, p-value: 1.366e-05
> 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.3858791 0.77175822 0.61412089
[2,] 0.4398032 0.87960645 0.56019677
[3,] 0.5330778 0.93384439 0.46692220
[4,] 0.4848481 0.96969615 0.51515192
[5,] 0.4279851 0.85597017 0.57201492
[6,] 0.6939278 0.61214445 0.30607222
[7,] 0.6002670 0.79946598 0.39973299
[8,] 0.5017846 0.99643070 0.49821535
[9,] 0.8585717 0.28285659 0.14142829
[10,] 0.8130575 0.37388507 0.18694253
[11,] 0.7825720 0.43485602 0.21742801
[12,] 0.7366384 0.52672325 0.26336162
[13,] 0.7668823 0.46623549 0.23311775
[14,] 0.7657183 0.46856344 0.23428172
[15,] 0.7001153 0.59976944 0.29988472
[16,] 0.6283115 0.74337697 0.37168849
[17,] 0.6207462 0.75850753 0.37925376
[18,] 0.7187484 0.56250328 0.28125164
[19,] 0.7570200 0.48596002 0.24298001
[20,] 0.8838476 0.23230478 0.11615239
[21,] 0.9704029 0.05919428 0.02959714
[22,] 0.9570163 0.08596731 0.04298365
[23,] 0.9384836 0.12303274 0.06151637
[24,] 0.9291000 0.14179995 0.07089997
[25,] 0.9405095 0.11898104 0.05949052
[26,] 0.9327700 0.13445999 0.06723000
[27,] 0.9530196 0.09396071 0.04698035
[28,] 0.9530329 0.09393415 0.04696707
[29,] 0.9646670 0.07066598 0.03533299
[30,] 0.9871856 0.02562876 0.01281438
[31,] 0.9816301 0.03673987 0.01836993
[32,] 0.9811599 0.03768022 0.01884011
[33,] 0.9707339 0.05853225 0.02926613
[34,] 0.9554510 0.08909809 0.04454904
[35,] 0.9395955 0.12080910 0.06040455
[36,] 0.9130371 0.17392589 0.08696295
[37,] 0.8938496 0.21230090 0.10615045
[38,] 0.9176532 0.16469359 0.08234680
[39,] 0.8841191 0.23176184 0.11588092
[40,] 0.8391286 0.32174280 0.16087140
[41,] 0.7817314 0.43653714 0.21826857
[42,] 0.7173786 0.56524279 0.28262140
[43,] 0.6401003 0.71979935 0.35989968
[44,] 0.6057057 0.78858863 0.39429431
[45,] 0.6564237 0.68715261 0.34357630
[46,] 0.5602905 0.87941896 0.43970948
[47,] 0.5656754 0.86864912 0.43432456
[48,] 0.7400268 0.51994631 0.25997315
[49,] 0.7043531 0.59129382 0.29564691
[50,] 0.6964808 0.60703833 0.30351917
[51,] 0.7569765 0.48604709 0.24302355
[52,] 0.5929850 0.81402992 0.40701496
> postscript(file="/var/www/html/rcomp/tmp/1gj7i1228160428.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/2a11c1228160428.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/3ldr21228160428.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/42xos1228160428.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/55n9j1228160428.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
-109.711864 -114.711864 -399.711864 -47.711864 -207.711864 -400.711864
7 8 9 10 11 12
68.288136 8.288136 14.288136 289.288136 -38.711864 -72.711864
13 14 15 16 17 18
456.288136 -124.711864 -187.711864 -154.711864 224.288136 -237.711864
19 20 21 22 23 24
-32.711864 -35.711864 173.288136 310.288136 262.288136 402.288136
25 26 27 28 29 30
455.288136 -68.711864 57.288136 160.288136 244.288136 156.288136
31 32 33 34 35 36
-244.000000 244.000000 237.288136 311.288136 -120.711864 140.288136
37 38 39 40 41 42
-17.711864 -47.711864 -131.711864 -9.711864 75.288136 -289.711864
43 44 45 46 47 48
-101.711864 -1.711864 -84.711864 12.288136 -100.711864 -205.711864
49 50 51 52 53 54
196.288136 -31.711864 -267.711864 -361.711864 125.288136 -219.711864
55 56 57 58 59 60
-231.711864 14.288136 54.288136 -73.711864 119.288136 -195.711864
61
159.288136
> postscript(file="/var/www/html/rcomp/tmp/6cjgn1228160428.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 -109.711864 NA
1 -114.711864 -109.711864
2 -399.711864 -114.711864
3 -47.711864 -399.711864
4 -207.711864 -47.711864
5 -400.711864 -207.711864
6 68.288136 -400.711864
7 8.288136 68.288136
8 14.288136 8.288136
9 289.288136 14.288136
10 -38.711864 289.288136
11 -72.711864 -38.711864
12 456.288136 -72.711864
13 -124.711864 456.288136
14 -187.711864 -124.711864
15 -154.711864 -187.711864
16 224.288136 -154.711864
17 -237.711864 224.288136
18 -32.711864 -237.711864
19 -35.711864 -32.711864
20 173.288136 -35.711864
21 310.288136 173.288136
22 262.288136 310.288136
23 402.288136 262.288136
24 455.288136 402.288136
25 -68.711864 455.288136
26 57.288136 -68.711864
27 160.288136 57.288136
28 244.288136 160.288136
29 156.288136 244.288136
30 -244.000000 156.288136
31 244.000000 -244.000000
32 237.288136 244.000000
33 311.288136 237.288136
34 -120.711864 311.288136
35 140.288136 -120.711864
36 -17.711864 140.288136
37 -47.711864 -17.711864
38 -131.711864 -47.711864
39 -9.711864 -131.711864
40 75.288136 -9.711864
41 -289.711864 75.288136
42 -101.711864 -289.711864
43 -1.711864 -101.711864
44 -84.711864 -1.711864
45 12.288136 -84.711864
46 -100.711864 12.288136
47 -205.711864 -100.711864
48 196.288136 -205.711864
49 -31.711864 196.288136
50 -267.711864 -31.711864
51 -361.711864 -267.711864
52 125.288136 -361.711864
53 -219.711864 125.288136
54 -231.711864 -219.711864
55 14.288136 -231.711864
56 54.288136 14.288136
57 -73.711864 54.288136
58 119.288136 -73.711864
59 -195.711864 119.288136
60 159.288136 -195.711864
61 NA 159.288136
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -114.711864 -109.711864
[2,] -399.711864 -114.711864
[3,] -47.711864 -399.711864
[4,] -207.711864 -47.711864
[5,] -400.711864 -207.711864
[6,] 68.288136 -400.711864
[7,] 8.288136 68.288136
[8,] 14.288136 8.288136
[9,] 289.288136 14.288136
[10,] -38.711864 289.288136
[11,] -72.711864 -38.711864
[12,] 456.288136 -72.711864
[13,] -124.711864 456.288136
[14,] -187.711864 -124.711864
[15,] -154.711864 -187.711864
[16,] 224.288136 -154.711864
[17,] -237.711864 224.288136
[18,] -32.711864 -237.711864
[19,] -35.711864 -32.711864
[20,] 173.288136 -35.711864
[21,] 310.288136 173.288136
[22,] 262.288136 310.288136
[23,] 402.288136 262.288136
[24,] 455.288136 402.288136
[25,] -68.711864 455.288136
[26,] 57.288136 -68.711864
[27,] 160.288136 57.288136
[28,] 244.288136 160.288136
[29,] 156.288136 244.288136
[30,] -244.000000 156.288136
[31,] 244.000000 -244.000000
[32,] 237.288136 244.000000
[33,] 311.288136 237.288136
[34,] -120.711864 311.288136
[35,] 140.288136 -120.711864
[36,] -17.711864 140.288136
[37,] -47.711864 -17.711864
[38,] -131.711864 -47.711864
[39,] -9.711864 -131.711864
[40,] 75.288136 -9.711864
[41,] -289.711864 75.288136
[42,] -101.711864 -289.711864
[43,] -1.711864 -101.711864
[44,] -84.711864 -1.711864
[45,] 12.288136 -84.711864
[46,] -100.711864 12.288136
[47,] -205.711864 -100.711864
[48,] 196.288136 -205.711864
[49,] -31.711864 196.288136
[50,] -267.711864 -31.711864
[51,] -361.711864 -267.711864
[52,] 125.288136 -361.711864
[53,] -219.711864 125.288136
[54,] -231.711864 -219.711864
[55,] 14.288136 -231.711864
[56,] 54.288136 14.288136
[57,] -73.711864 54.288136
[58,] 119.288136 -73.711864
[59,] -195.711864 119.288136
[60,] 159.288136 -195.711864
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -114.711864 -109.711864
2 -399.711864 -114.711864
3 -47.711864 -399.711864
4 -207.711864 -47.711864
5 -400.711864 -207.711864
6 68.288136 -400.711864
7 8.288136 68.288136
8 14.288136 8.288136
9 289.288136 14.288136
10 -38.711864 289.288136
11 -72.711864 -38.711864
12 456.288136 -72.711864
13 -124.711864 456.288136
14 -187.711864 -124.711864
15 -154.711864 -187.711864
16 224.288136 -154.711864
17 -237.711864 224.288136
18 -32.711864 -237.711864
19 -35.711864 -32.711864
20 173.288136 -35.711864
21 310.288136 173.288136
22 262.288136 310.288136
23 402.288136 262.288136
24 455.288136 402.288136
25 -68.711864 455.288136
26 57.288136 -68.711864
27 160.288136 57.288136
28 244.288136 160.288136
29 156.288136 244.288136
30 -244.000000 156.288136
31 244.000000 -244.000000
32 237.288136 244.000000
33 311.288136 237.288136
34 -120.711864 311.288136
35 140.288136 -120.711864
36 -17.711864 140.288136
37 -47.711864 -17.711864
38 -131.711864 -47.711864
39 -9.711864 -131.711864
40 75.288136 -9.711864
41 -289.711864 75.288136
42 -101.711864 -289.711864
43 -1.711864 -101.711864
44 -84.711864 -1.711864
45 12.288136 -84.711864
46 -100.711864 12.288136
47 -205.711864 -100.711864
48 196.288136 -205.711864
49 -31.711864 196.288136
50 -267.711864 -31.711864
51 -361.711864 -267.711864
52 125.288136 -361.711864
53 -219.711864 125.288136
54 -231.711864 -219.711864
55 14.288136 -231.711864
56 54.288136 14.288136
57 -73.711864 54.288136
58 119.288136 -73.711864
59 -195.711864 119.288136
60 159.288136 -195.711864
> 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/7oauw1228160428.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/8fe291228160428.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/9m7nj1228160428.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/10i85c1228160428.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/11l2ty1228160428.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/12z74p1228160428.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/13m0fr1228160428.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/14quv31228160428.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/15c0f11228160428.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/167i1x1228160428.tab")
+ }
>
> system("convert tmp/1gj7i1228160428.ps tmp/1gj7i1228160428.png")
> system("convert tmp/2a11c1228160428.ps tmp/2a11c1228160428.png")
> system("convert tmp/3ldr21228160428.ps tmp/3ldr21228160428.png")
> system("convert tmp/42xos1228160428.ps tmp/42xos1228160428.png")
> system("convert tmp/55n9j1228160428.ps tmp/55n9j1228160428.png")
> system("convert tmp/6cjgn1228160428.ps tmp/6cjgn1228160428.png")
> system("convert tmp/7oauw1228160428.ps tmp/7oauw1228160428.png")
> system("convert tmp/8fe291228160428.ps tmp/8fe291228160428.png")
> system("convert tmp/9m7nj1228160428.ps tmp/9m7nj1228160428.png")
> system("convert tmp/10i85c1228160428.ps tmp/10i85c1228160428.png")
>
>
> proc.time()
user system elapsed
2.417 1.540 3.955