R version 2.9.0 (2009-04-17)
Copyright (C) 2009 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(115.6,0,111.3,0,114.6,0,137.5,0,83.7,0,106.0,0,123.4,0,126.5,0,120.0,0,141.6,0,90.5,0,96.5,0,113.5,0,120.1,0,123.9,0,144.4,0,90.8,0,114.2,0,138.1,0,135.0,0,131.3,0,144.6,0,101.7,0,108.7,0,135.3,0,124.3,0,138.3,0,158.2,0,93.5,0,124.8,0,154.4,0,152.8,0,148.9,0,170.3,0,124.8,0,134.4,0,154.0,0,147.9,0,168.1,0,175.7,0,116.7,0,140.8,0,164.2,0,173.8,0,167.8,0,166.6,0,135.1,1,158.1,1,151.8,1,166.7,1,165.3,1,187.0,1,125.2,1,144.4,1,181.7,1,175.9,1,166.3,1,181.5,1,121.8,1,134.8,1,162.9,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),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
Y X
1 115.6 0
2 111.3 0
3 114.6 0
4 137.5 0
5 83.7 0
6 106.0 0
7 123.4 0
8 126.5 0
9 120.0 0
10 141.6 0
11 90.5 0
12 96.5 0
13 113.5 0
14 120.1 0
15 123.9 0
16 144.4 0
17 90.8 0
18 114.2 0
19 138.1 0
20 135.0 0
21 131.3 0
22 144.6 0
23 101.7 0
24 108.7 0
25 135.3 0
26 124.3 0
27 138.3 0
28 158.2 0
29 93.5 0
30 124.8 0
31 154.4 0
32 152.8 0
33 148.9 0
34 170.3 0
35 124.8 0
36 134.4 0
37 154.0 0
38 147.9 0
39 168.1 0
40 175.7 0
41 116.7 0
42 140.8 0
43 164.2 0
44 173.8 0
45 167.8 0
46 166.6 0
47 135.1 1
48 158.1 1
49 151.8 1
50 166.7 1
51 165.3 1
52 187.0 1
53 125.2 1
54 144.4 1
55 181.7 1
56 175.9 1
57 166.3 1
58 181.5 1
59 121.8 1
60 134.8 1
61 162.9 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
131.94 25.30
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-48.237 -17.337 2.463 16.963 43.763
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 131.937 3.461 38.123 < 2e-16 ***
X 25.296 6.979 3.625 0.000604 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 23.47 on 59 degrees of freedom
Multiple R-squared: 0.1821, Adjusted R-squared: 0.1683
F-statistic: 13.14 on 1 and 59 DF, p-value: 0.0006042
> 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.5599695 0.8800610 0.4400305
[2,] 0.4111388 0.8222776 0.5888612
[3,] 0.3039784 0.6079567 0.6960216
[4,] 0.2275333 0.4550667 0.7724667
[5,] 0.1463719 0.2927438 0.8536281
[6,] 0.1780020 0.3560040 0.8219980
[7,] 0.2524498 0.5048997 0.7475502
[8,] 0.2631747 0.5263494 0.7368253
[9,] 0.1994608 0.3989215 0.8005392
[10,] 0.1477989 0.2955978 0.8522011
[11,] 0.1106935 0.2213869 0.8893065
[12,] 0.1477774 0.2955549 0.8522226
[13,] 0.2315565 0.4631129 0.7684435
[14,] 0.1931022 0.3862044 0.8068978
[15,] 0.1925306 0.3850612 0.8074694
[16,] 0.1733696 0.3467393 0.8266304
[17,] 0.1446411 0.2892822 0.8553589
[18,] 0.1552902 0.3105804 0.8447098
[19,] 0.1931263 0.3862527 0.8068737
[20,] 0.2055639 0.4111277 0.7944361
[21,] 0.1848039 0.3696079 0.8151961
[22,] 0.1614095 0.3228190 0.8385905
[23,] 0.1486104 0.2972208 0.8513896
[24,] 0.2163443 0.4326886 0.7836557
[25,] 0.4491562 0.8983124 0.5508438
[26,] 0.4501215 0.9002429 0.5498785
[27,] 0.4875655 0.9751311 0.5124345
[28,] 0.4992634 0.9985267 0.5007366
[29,] 0.4840344 0.9680688 0.5159656
[30,] 0.5984155 0.8031691 0.4015845
[31,] 0.6100959 0.7798083 0.3899041
[32,] 0.5934115 0.8131770 0.4065885
[33,] 0.5727493 0.8545015 0.4272507
[34,] 0.5379795 0.9240410 0.4620205
[35,] 0.5689543 0.8620914 0.4310457
[36,] 0.6449076 0.7101849 0.3550924
[37,] 0.7679264 0.4641472 0.2320736
[38,] 0.7737282 0.4525435 0.2262718
[39,] 0.7507583 0.4984835 0.2492417
[40,] 0.7442892 0.5114217 0.2557108
[41,] 0.7102907 0.5794187 0.2897093
[42,] 0.6648998 0.6702005 0.3351002
[43,] 0.6462294 0.7075411 0.3537706
[44,] 0.5604663 0.8790674 0.4395337
[45,] 0.4691964 0.9383928 0.5308036
[46,] 0.3835464 0.7670929 0.6164536
[47,] 0.2952504 0.5905009 0.7047496
[48,] 0.3376738 0.6753475 0.6623262
[49,] 0.4071754 0.8143509 0.5928246
[50,] 0.3262335 0.6524669 0.6737665
[51,] 0.2996724 0.5993447 0.7003276
[52,] 0.2429531 0.4859061 0.7570469
> postscript(file="/var/www/html/rcomp/tmp/1f4x01258572583.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/218io1258572583.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/30ab61258572583.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/4xdzy1258572583.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/55oep1258572583.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
-16.3369565 -20.6369565 -17.3369565 5.5630435 -48.2369565 -25.9369565
7 8 9 10 11 12
-8.5369565 -5.4369565 -11.9369565 9.6630435 -41.4369565 -35.4369565
13 14 15 16 17 18
-18.4369565 -11.8369565 -8.0369565 12.4630435 -41.1369565 -17.7369565
19 20 21 22 23 24
6.1630435 3.0630435 -0.6369565 12.6630435 -30.2369565 -23.2369565
25 26 27 28 29 30
3.3630435 -7.6369565 6.3630435 26.2630435 -38.4369565 -7.1369565
31 32 33 34 35 36
22.4630435 20.8630435 16.9630435 38.3630435 -7.1369565 2.4630435
37 38 39 40 41 42
22.0630435 15.9630435 36.1630435 43.7630435 -15.2369565 8.8630435
43 44 45 46 47 48
32.2630435 41.8630435 35.8630435 34.6630435 -22.1333333 0.8666667
49 50 51 52 53 54
-5.4333333 9.4666667 8.0666667 29.7666667 -32.0333333 -12.8333333
55 56 57 58 59 60
24.4666667 18.6666667 9.0666667 24.2666667 -35.4333333 -22.4333333
61
5.6666667
> postscript(file="/var/www/html/rcomp/tmp/66f2c1258572583.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 -16.3369565 NA
1 -20.6369565 -16.3369565
2 -17.3369565 -20.6369565
3 5.5630435 -17.3369565
4 -48.2369565 5.5630435
5 -25.9369565 -48.2369565
6 -8.5369565 -25.9369565
7 -5.4369565 -8.5369565
8 -11.9369565 -5.4369565
9 9.6630435 -11.9369565
10 -41.4369565 9.6630435
11 -35.4369565 -41.4369565
12 -18.4369565 -35.4369565
13 -11.8369565 -18.4369565
14 -8.0369565 -11.8369565
15 12.4630435 -8.0369565
16 -41.1369565 12.4630435
17 -17.7369565 -41.1369565
18 6.1630435 -17.7369565
19 3.0630435 6.1630435
20 -0.6369565 3.0630435
21 12.6630435 -0.6369565
22 -30.2369565 12.6630435
23 -23.2369565 -30.2369565
24 3.3630435 -23.2369565
25 -7.6369565 3.3630435
26 6.3630435 -7.6369565
27 26.2630435 6.3630435
28 -38.4369565 26.2630435
29 -7.1369565 -38.4369565
30 22.4630435 -7.1369565
31 20.8630435 22.4630435
32 16.9630435 20.8630435
33 38.3630435 16.9630435
34 -7.1369565 38.3630435
35 2.4630435 -7.1369565
36 22.0630435 2.4630435
37 15.9630435 22.0630435
38 36.1630435 15.9630435
39 43.7630435 36.1630435
40 -15.2369565 43.7630435
41 8.8630435 -15.2369565
42 32.2630435 8.8630435
43 41.8630435 32.2630435
44 35.8630435 41.8630435
45 34.6630435 35.8630435
46 -22.1333333 34.6630435
47 0.8666667 -22.1333333
48 -5.4333333 0.8666667
49 9.4666667 -5.4333333
50 8.0666667 9.4666667
51 29.7666667 8.0666667
52 -32.0333333 29.7666667
53 -12.8333333 -32.0333333
54 24.4666667 -12.8333333
55 18.6666667 24.4666667
56 9.0666667 18.6666667
57 24.2666667 9.0666667
58 -35.4333333 24.2666667
59 -22.4333333 -35.4333333
60 5.6666667 -22.4333333
61 NA 5.6666667
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -20.6369565 -16.3369565
[2,] -17.3369565 -20.6369565
[3,] 5.5630435 -17.3369565
[4,] -48.2369565 5.5630435
[5,] -25.9369565 -48.2369565
[6,] -8.5369565 -25.9369565
[7,] -5.4369565 -8.5369565
[8,] -11.9369565 -5.4369565
[9,] 9.6630435 -11.9369565
[10,] -41.4369565 9.6630435
[11,] -35.4369565 -41.4369565
[12,] -18.4369565 -35.4369565
[13,] -11.8369565 -18.4369565
[14,] -8.0369565 -11.8369565
[15,] 12.4630435 -8.0369565
[16,] -41.1369565 12.4630435
[17,] -17.7369565 -41.1369565
[18,] 6.1630435 -17.7369565
[19,] 3.0630435 6.1630435
[20,] -0.6369565 3.0630435
[21,] 12.6630435 -0.6369565
[22,] -30.2369565 12.6630435
[23,] -23.2369565 -30.2369565
[24,] 3.3630435 -23.2369565
[25,] -7.6369565 3.3630435
[26,] 6.3630435 -7.6369565
[27,] 26.2630435 6.3630435
[28,] -38.4369565 26.2630435
[29,] -7.1369565 -38.4369565
[30,] 22.4630435 -7.1369565
[31,] 20.8630435 22.4630435
[32,] 16.9630435 20.8630435
[33,] 38.3630435 16.9630435
[34,] -7.1369565 38.3630435
[35,] 2.4630435 -7.1369565
[36,] 22.0630435 2.4630435
[37,] 15.9630435 22.0630435
[38,] 36.1630435 15.9630435
[39,] 43.7630435 36.1630435
[40,] -15.2369565 43.7630435
[41,] 8.8630435 -15.2369565
[42,] 32.2630435 8.8630435
[43,] 41.8630435 32.2630435
[44,] 35.8630435 41.8630435
[45,] 34.6630435 35.8630435
[46,] -22.1333333 34.6630435
[47,] 0.8666667 -22.1333333
[48,] -5.4333333 0.8666667
[49,] 9.4666667 -5.4333333
[50,] 8.0666667 9.4666667
[51,] 29.7666667 8.0666667
[52,] -32.0333333 29.7666667
[53,] -12.8333333 -32.0333333
[54,] 24.4666667 -12.8333333
[55,] 18.6666667 24.4666667
[56,] 9.0666667 18.6666667
[57,] 24.2666667 9.0666667
[58,] -35.4333333 24.2666667
[59,] -22.4333333 -35.4333333
[60,] 5.6666667 -22.4333333
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -20.6369565 -16.3369565
2 -17.3369565 -20.6369565
3 5.5630435 -17.3369565
4 -48.2369565 5.5630435
5 -25.9369565 -48.2369565
6 -8.5369565 -25.9369565
7 -5.4369565 -8.5369565
8 -11.9369565 -5.4369565
9 9.6630435 -11.9369565
10 -41.4369565 9.6630435
11 -35.4369565 -41.4369565
12 -18.4369565 -35.4369565
13 -11.8369565 -18.4369565
14 -8.0369565 -11.8369565
15 12.4630435 -8.0369565
16 -41.1369565 12.4630435
17 -17.7369565 -41.1369565
18 6.1630435 -17.7369565
19 3.0630435 6.1630435
20 -0.6369565 3.0630435
21 12.6630435 -0.6369565
22 -30.2369565 12.6630435
23 -23.2369565 -30.2369565
24 3.3630435 -23.2369565
25 -7.6369565 3.3630435
26 6.3630435 -7.6369565
27 26.2630435 6.3630435
28 -38.4369565 26.2630435
29 -7.1369565 -38.4369565
30 22.4630435 -7.1369565
31 20.8630435 22.4630435
32 16.9630435 20.8630435
33 38.3630435 16.9630435
34 -7.1369565 38.3630435
35 2.4630435 -7.1369565
36 22.0630435 2.4630435
37 15.9630435 22.0630435
38 36.1630435 15.9630435
39 43.7630435 36.1630435
40 -15.2369565 43.7630435
41 8.8630435 -15.2369565
42 32.2630435 8.8630435
43 41.8630435 32.2630435
44 35.8630435 41.8630435
45 34.6630435 35.8630435
46 -22.1333333 34.6630435
47 0.8666667 -22.1333333
48 -5.4333333 0.8666667
49 9.4666667 -5.4333333
50 8.0666667 9.4666667
51 29.7666667 8.0666667
52 -32.0333333 29.7666667
53 -12.8333333 -32.0333333
54 24.4666667 -12.8333333
55 18.6666667 24.4666667
56 9.0666667 18.6666667
57 24.2666667 9.0666667
58 -35.4333333 24.2666667
59 -22.4333333 -35.4333333
60 5.6666667 -22.4333333
> 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/70qgf1258572583.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/86zdi1258572583.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/9gay11258572583.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/10d14c1258572583.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/11ewtk1258572583.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/12ovjv1258572583.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/13trff1258572583.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/14rwhz1258572583.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/158i181258572583.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/16qfqf1258572583.tab")
+ }
>
> system("convert tmp/1f4x01258572583.ps tmp/1f4x01258572583.png")
> system("convert tmp/218io1258572583.ps tmp/218io1258572583.png")
> system("convert tmp/30ab61258572583.ps tmp/30ab61258572583.png")
> system("convert tmp/4xdzy1258572583.ps tmp/4xdzy1258572583.png")
> system("convert tmp/55oep1258572583.ps tmp/55oep1258572583.png")
> system("convert tmp/66f2c1258572583.ps tmp/66f2c1258572583.png")
> system("convert tmp/70qgf1258572583.ps tmp/70qgf1258572583.png")
> system("convert tmp/86zdi1258572583.ps tmp/86zdi1258572583.png")
> system("convert tmp/9gay11258572583.ps tmp/9gay11258572583.png")
> system("convert tmp/10d14c1258572583.ps tmp/10d14c1258572583.png")
>
>
> proc.time()
user system elapsed
2.490 1.576 2.882