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(1202455,0,1201423,0,1505916,0,1513378,0,1977605,0,1873830,0,1424049,0,1322740,0,1584826,0,1680460,0,1648574,0,3095469,1,1307983,0,1367589,0,1572718,0,1611603,0,1641196,0,1845262,0,1464238,0,1402386,0,2077100,0,1691130,0,1729013,0,3347792,1,1365088,0,1545460,0,1844355,0,1775550,0,1721779,0,2128726,0,1664320,0,1769471,0,1904578,0,1872042,0,1802181,0,3222199,1,1491414,0,1658519,0,2079207,0,1748767,0,2084447,0,2067182,0,1718123,0,1782337,0,1958118,0,2028681,0,2076128,0,3383873,1,1870369,0,1654853,0,2074338,0,1888654,0,1991138,0,2168238,0,1867424,0,1842360,0,1927476,0,2065555,0,2455609,0,3336171,1),dim=c(2,60),dimnames=list(c('x','y'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('x','y'),1:60))
> 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
x y
1 1202455 0
2 1201423 0
3 1505916 0
4 1513378 0
5 1977605 0
6 1873830 0
7 1424049 0
8 1322740 0
9 1584826 0
10 1680460 0
11 1648574 0
12 3095469 1
13 1307983 0
14 1367589 0
15 1572718 0
16 1611603 0
17 1641196 0
18 1845262 0
19 1464238 0
20 1402386 0
21 2077100 0
22 1691130 0
23 1729013 0
24 3347792 1
25 1365088 0
26 1545460 0
27 1844355 0
28 1775550 0
29 1721779 0
30 2128726 0
31 1664320 0
32 1769471 0
33 1904578 0
34 1872042 0
35 1802181 0
36 3222199 1
37 1491414 0
38 1658519 0
39 2079207 0
40 1748767 0
41 2084447 0
42 2067182 0
43 1718123 0
44 1782337 0
45 1958118 0
46 2028681 0
47 2076128 0
48 3383873 1
49 1870369 0
50 1654853 0
51 2074338 0
52 1888654 0
53 1991138 0
54 2168238 0
55 1867424 0
56 1842360 0
57 1927476 0
58 2065555 0
59 2455609 0
60 3336171 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) y
1755236 1521865
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-553813 -173215 17275 155067 700373
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1755236 35172 49.90 <2e-16 ***
y 1521865 121841 12.49 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 260800 on 58 degrees of freedom
Multiple R-squared: 0.729, Adjusted R-squared: 0.7243
F-statistic: 156 on 1 and 58 DF, p-value: < 2.2e-16
> 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.9104070 0.1791860 0.08959301
[2,] 0.9208766 0.1582469 0.07912344
[3,] 0.8828452 0.2343096 0.11715479
[4,] 0.8724436 0.2551127 0.12755636
[5,] 0.8158348 0.3683305 0.18416523
[6,] 0.7633195 0.4733610 0.23668049
[7,] 0.6959650 0.6080701 0.30403504
[8,] 0.6136044 0.7727912 0.38639562
[9,] 0.6609489 0.6781022 0.33905112
[10,] 0.6730261 0.6539477 0.32697387
[11,] 0.6188966 0.7622068 0.38110342
[12,] 0.5652830 0.8694340 0.43471700
[13,] 0.5144579 0.9710843 0.48554213
[14,] 0.5438434 0.9123132 0.45615662
[15,] 0.5422257 0.9155486 0.45777431
[16,] 0.5998588 0.8002823 0.40014117
[17,] 0.7989752 0.4020497 0.20102484
[18,] 0.7661351 0.4677298 0.23386490
[19,] 0.7319771 0.5360458 0.26802291
[20,] 0.6892804 0.6214392 0.31071960
[21,] 0.8123786 0.3752429 0.18762144
[22,] 0.8317256 0.3365487 0.16827436
[23,] 0.8239099 0.3521803 0.17609015
[24,] 0.8031682 0.3936636 0.19683179
[25,] 0.7827981 0.4344038 0.21720188
[26,] 0.8828237 0.2343526 0.11717628
[27,] 0.8764508 0.2470983 0.12354915
[28,] 0.8557707 0.2884586 0.14422930
[29,] 0.8385028 0.3229943 0.16149715
[30,] 0.8117628 0.3764744 0.18823719
[31,] 0.7790188 0.4419624 0.22098119
[32,] 0.7273746 0.5452508 0.27262539
[33,] 0.8504932 0.2990137 0.14950685
[34,] 0.8758423 0.2483153 0.12415767
[35,] 0.8897475 0.2205051 0.11025253
[36,] 0.8863515 0.2272970 0.11364851
[37,] 0.8914035 0.2171930 0.10859650
[38,] 0.8861221 0.2277558 0.11387789
[39,] 0.8921452 0.2157095 0.10785476
[40,] 0.8837488 0.2325023 0.11625117
[41,] 0.8473511 0.3052979 0.15264893
[42,] 0.8099492 0.3801016 0.19005080
[43,] 0.7779677 0.4440646 0.22203231
[44,] 0.6999407 0.6001185 0.30005927
[45,] 0.6308112 0.7383775 0.36918877
[46,] 0.7476979 0.5046042 0.25230210
[47,] 0.6739877 0.6520247 0.32601233
[48,] 0.6035301 0.7929397 0.39646986
[49,] 0.4898663 0.9797327 0.51013366
[50,] 0.4093772 0.8187544 0.59062278
[51,] 0.3235194 0.6470388 0.67648062
> postscript(file="/var/www/html/rcomp/tmp/12svz1228162118.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/2ulkw1228162118.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/39f8n1228162118.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/4wi3r1228162118.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/5hcuq1228162118.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 = 60
Frequency = 1
1 2 3 4 5 6
-552780.655 -553812.655 -249319.655 -241857.655 222369.345 118594.345
7 8 9 10 11 12
-331186.655 -432495.655 -170409.655 -74775.655 -106661.655 -181631.800
13 14 15 16 17 18
-447252.655 -387646.655 -182517.655 -143632.655 -114039.655 90026.345
19 20 21 22 23 24
-290997.655 -352849.655 321864.345 -64105.655 -26222.655 70691.200
25 26 27 28 29 30
-390147.655 -209775.655 89119.345 20314.345 -33456.655 373490.345
31 32 33 34 35 36
-90915.655 14235.345 149342.345 116806.345 46945.345 -54901.800
37 38 39 40 41 42
-263821.655 -96716.655 323971.345 -6468.655 329211.345 311946.345
43 44 45 46 47 48
-37112.655 27101.345 202882.345 273445.345 320892.345 106772.200
49 50 51 52 53 54
115133.345 -100382.655 319102.345 133418.345 235902.345 413002.345
55 56 57 58 59 60
112188.345 87124.345 172240.345 310319.345 700373.345 59070.200
> postscript(file="/var/www/html/rcomp/tmp/6nqh01228162118.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -552780.655 NA
1 -553812.655 -552780.655
2 -249319.655 -553812.655
3 -241857.655 -249319.655
4 222369.345 -241857.655
5 118594.345 222369.345
6 -331186.655 118594.345
7 -432495.655 -331186.655
8 -170409.655 -432495.655
9 -74775.655 -170409.655
10 -106661.655 -74775.655
11 -181631.800 -106661.655
12 -447252.655 -181631.800
13 -387646.655 -447252.655
14 -182517.655 -387646.655
15 -143632.655 -182517.655
16 -114039.655 -143632.655
17 90026.345 -114039.655
18 -290997.655 90026.345
19 -352849.655 -290997.655
20 321864.345 -352849.655
21 -64105.655 321864.345
22 -26222.655 -64105.655
23 70691.200 -26222.655
24 -390147.655 70691.200
25 -209775.655 -390147.655
26 89119.345 -209775.655
27 20314.345 89119.345
28 -33456.655 20314.345
29 373490.345 -33456.655
30 -90915.655 373490.345
31 14235.345 -90915.655
32 149342.345 14235.345
33 116806.345 149342.345
34 46945.345 116806.345
35 -54901.800 46945.345
36 -263821.655 -54901.800
37 -96716.655 -263821.655
38 323971.345 -96716.655
39 -6468.655 323971.345
40 329211.345 -6468.655
41 311946.345 329211.345
42 -37112.655 311946.345
43 27101.345 -37112.655
44 202882.345 27101.345
45 273445.345 202882.345
46 320892.345 273445.345
47 106772.200 320892.345
48 115133.345 106772.200
49 -100382.655 115133.345
50 319102.345 -100382.655
51 133418.345 319102.345
52 235902.345 133418.345
53 413002.345 235902.345
54 112188.345 413002.345
55 87124.345 112188.345
56 172240.345 87124.345
57 310319.345 172240.345
58 700373.345 310319.345
59 59070.200 700373.345
60 NA 59070.200
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -553812.655 -552780.655
[2,] -249319.655 -553812.655
[3,] -241857.655 -249319.655
[4,] 222369.345 -241857.655
[5,] 118594.345 222369.345
[6,] -331186.655 118594.345
[7,] -432495.655 -331186.655
[8,] -170409.655 -432495.655
[9,] -74775.655 -170409.655
[10,] -106661.655 -74775.655
[11,] -181631.800 -106661.655
[12,] -447252.655 -181631.800
[13,] -387646.655 -447252.655
[14,] -182517.655 -387646.655
[15,] -143632.655 -182517.655
[16,] -114039.655 -143632.655
[17,] 90026.345 -114039.655
[18,] -290997.655 90026.345
[19,] -352849.655 -290997.655
[20,] 321864.345 -352849.655
[21,] -64105.655 321864.345
[22,] -26222.655 -64105.655
[23,] 70691.200 -26222.655
[24,] -390147.655 70691.200
[25,] -209775.655 -390147.655
[26,] 89119.345 -209775.655
[27,] 20314.345 89119.345
[28,] -33456.655 20314.345
[29,] 373490.345 -33456.655
[30,] -90915.655 373490.345
[31,] 14235.345 -90915.655
[32,] 149342.345 14235.345
[33,] 116806.345 149342.345
[34,] 46945.345 116806.345
[35,] -54901.800 46945.345
[36,] -263821.655 -54901.800
[37,] -96716.655 -263821.655
[38,] 323971.345 -96716.655
[39,] -6468.655 323971.345
[40,] 329211.345 -6468.655
[41,] 311946.345 329211.345
[42,] -37112.655 311946.345
[43,] 27101.345 -37112.655
[44,] 202882.345 27101.345
[45,] 273445.345 202882.345
[46,] 320892.345 273445.345
[47,] 106772.200 320892.345
[48,] 115133.345 106772.200
[49,] -100382.655 115133.345
[50,] 319102.345 -100382.655
[51,] 133418.345 319102.345
[52,] 235902.345 133418.345
[53,] 413002.345 235902.345
[54,] 112188.345 413002.345
[55,] 87124.345 112188.345
[56,] 172240.345 87124.345
[57,] 310319.345 172240.345
[58,] 700373.345 310319.345
[59,] 59070.200 700373.345
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -553812.655 -552780.655
2 -249319.655 -553812.655
3 -241857.655 -249319.655
4 222369.345 -241857.655
5 118594.345 222369.345
6 -331186.655 118594.345
7 -432495.655 -331186.655
8 -170409.655 -432495.655
9 -74775.655 -170409.655
10 -106661.655 -74775.655
11 -181631.800 -106661.655
12 -447252.655 -181631.800
13 -387646.655 -447252.655
14 -182517.655 -387646.655
15 -143632.655 -182517.655
16 -114039.655 -143632.655
17 90026.345 -114039.655
18 -290997.655 90026.345
19 -352849.655 -290997.655
20 321864.345 -352849.655
21 -64105.655 321864.345
22 -26222.655 -64105.655
23 70691.200 -26222.655
24 -390147.655 70691.200
25 -209775.655 -390147.655
26 89119.345 -209775.655
27 20314.345 89119.345
28 -33456.655 20314.345
29 373490.345 -33456.655
30 -90915.655 373490.345
31 14235.345 -90915.655
32 149342.345 14235.345
33 116806.345 149342.345
34 46945.345 116806.345
35 -54901.800 46945.345
36 -263821.655 -54901.800
37 -96716.655 -263821.655
38 323971.345 -96716.655
39 -6468.655 323971.345
40 329211.345 -6468.655
41 311946.345 329211.345
42 -37112.655 311946.345
43 27101.345 -37112.655
44 202882.345 27101.345
45 273445.345 202882.345
46 320892.345 273445.345
47 106772.200 320892.345
48 115133.345 106772.200
49 -100382.655 115133.345
50 319102.345 -100382.655
51 133418.345 319102.345
52 235902.345 133418.345
53 413002.345 235902.345
54 112188.345 413002.345
55 87124.345 112188.345
56 172240.345 87124.345
57 310319.345 172240.345
58 700373.345 310319.345
59 59070.200 700373.345
> 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/7p75q1228162118.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/8fcre1228162118.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/90osr1228162118.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/1016ij1228162118.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/11c3om1228162118.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/125dsy1228162118.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/13yvfn1228162118.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/14wn1o1228162118.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/15jmj21228162118.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/16ua1u1228162118.tab")
+ }
>
> system("convert tmp/12svz1228162118.ps tmp/12svz1228162118.png")
> system("convert tmp/2ulkw1228162118.ps tmp/2ulkw1228162118.png")
> system("convert tmp/39f8n1228162118.ps tmp/39f8n1228162118.png")
> system("convert tmp/4wi3r1228162118.ps tmp/4wi3r1228162118.png")
> system("convert tmp/5hcuq1228162118.ps tmp/5hcuq1228162118.png")
> system("convert tmp/6nqh01228162118.ps tmp/6nqh01228162118.png")
> system("convert tmp/7p75q1228162118.ps tmp/7p75q1228162118.png")
> system("convert tmp/8fcre1228162118.ps tmp/8fcre1228162118.png")
> system("convert tmp/90osr1228162118.ps tmp/90osr1228162118.png")
> system("convert tmp/1016ij1228162118.ps tmp/1016ij1228162118.png")
>
>
> proc.time()
user system elapsed
2.480 1.589 2.862