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(149,0,139,0,135,0,130,0,127,0,122,0,117,0,112,0,113,0,149,0,157,0,157,0,147,0,137,0,132,0,125,0,123,0,117,0,114,0,111,0,112,0,144,0,150,0,149,0,134,0,123,0,116,0,117,0,111,0,105,0,102,0,95,0,93,0,124,0,130,0,124,0,115,0,106,0,105,0,105,0,101,0,95,0,93,0,84,0,87,0,116,0,120,0,117,1,109,1,105,1,107,1,109,1,109,1,108,1,107,1,99,1,103,1,131,1,137,1,135,1),dim=c(2,60),dimnames=list(c('WLH','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('WLH','X'),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 = 'Include Monthly 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
WLH X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 149 0 1 0 0 0 0 0 0 0 0 0 0
2 139 0 0 1 0 0 0 0 0 0 0 0 0
3 135 0 0 0 1 0 0 0 0 0 0 0 0
4 130 0 0 0 0 1 0 0 0 0 0 0 0
5 127 0 0 0 0 0 1 0 0 0 0 0 0
6 122 0 0 0 0 0 0 1 0 0 0 0 0
7 117 0 0 0 0 0 0 0 1 0 0 0 0
8 112 0 0 0 0 0 0 0 0 1 0 0 0
9 113 0 0 0 0 0 0 0 0 0 1 0 0
10 149 0 0 0 0 0 0 0 0 0 0 1 0
11 157 0 0 0 0 0 0 0 0 0 0 0 1
12 157 0 0 0 0 0 0 0 0 0 0 0 0
13 147 0 1 0 0 0 0 0 0 0 0 0 0
14 137 0 0 1 0 0 0 0 0 0 0 0 0
15 132 0 0 0 1 0 0 0 0 0 0 0 0
16 125 0 0 0 0 1 0 0 0 0 0 0 0
17 123 0 0 0 0 0 1 0 0 0 0 0 0
18 117 0 0 0 0 0 0 1 0 0 0 0 0
19 114 0 0 0 0 0 0 0 1 0 0 0 0
20 111 0 0 0 0 0 0 0 0 1 0 0 0
21 112 0 0 0 0 0 0 0 0 0 1 0 0
22 144 0 0 0 0 0 0 0 0 0 0 1 0
23 150 0 0 0 0 0 0 0 0 0 0 0 1
24 149 0 0 0 0 0 0 0 0 0 0 0 0
25 134 0 1 0 0 0 0 0 0 0 0 0 0
26 123 0 0 1 0 0 0 0 0 0 0 0 0
27 116 0 0 0 1 0 0 0 0 0 0 0 0
28 117 0 0 0 0 1 0 0 0 0 0 0 0
29 111 0 0 0 0 0 1 0 0 0 0 0 0
30 105 0 0 0 0 0 0 1 0 0 0 0 0
31 102 0 0 0 0 0 0 0 1 0 0 0 0
32 95 0 0 0 0 0 0 0 0 1 0 0 0
33 93 0 0 0 0 0 0 0 0 0 1 0 0
34 124 0 0 0 0 0 0 0 0 0 0 1 0
35 130 0 0 0 0 0 0 0 0 0 0 0 1
36 124 0 0 0 0 0 0 0 0 0 0 0 0
37 115 0 1 0 0 0 0 0 0 0 0 0 0
38 106 0 0 1 0 0 0 0 0 0 0 0 0
39 105 0 0 0 1 0 0 0 0 0 0 0 0
40 105 0 0 0 0 1 0 0 0 0 0 0 0
41 101 0 0 0 0 0 1 0 0 0 0 0 0
42 95 0 0 0 0 0 0 1 0 0 0 0 0
43 93 0 0 0 0 0 0 0 1 0 0 0 0
44 84 0 0 0 0 0 0 0 0 1 0 0 0
45 87 0 0 0 0 0 0 0 0 0 1 0 0
46 116 0 0 0 0 0 0 0 0 0 0 1 0
47 120 0 0 0 0 0 0 0 0 0 0 0 1
48 117 1 0 0 0 0 0 0 0 0 0 0 0
49 109 1 1 0 0 0 0 0 0 0 0 0 0
50 105 1 0 1 0 0 0 0 0 0 0 0 0
51 107 1 0 0 1 0 0 0 0 0 0 0 0
52 109 1 0 0 0 1 0 0 0 0 0 0 0
53 109 1 0 0 0 0 1 0 0 0 0 0 0
54 108 1 0 0 0 0 0 1 0 0 0 0 0
55 107 1 0 0 0 0 0 0 1 0 0 0 0
56 99 1 0 0 0 0 0 0 0 1 0 0 0
57 103 1 0 0 0 0 0 0 0 0 1 0 0
58 131 1 0 0 0 0 0 0 0 0 0 1 0
59 137 1 0 0 0 0 0 0 0 0 0 0 1
60 135 1 0 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X M1 M2 M3 M4
139.976 -8.940 -7.388 -16.188 -19.188 -20.988
M5 M6 M7 M8 M9 M10
-23.988 -28.788 -31.588 -37.988 -36.588 -5.388
M11
0.612
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-20.588 -10.588 4.658 9.412 17.024
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 139.976 6.026 23.227 < 2e-16 ***
X -8.940 4.100 -2.180 0.034280 *
M1 -7.388 8.242 -0.896 0.374602
M2 -16.188 8.242 -1.964 0.055443 .
M3 -19.188 8.242 -2.328 0.024259 *
M4 -20.988 8.242 -2.547 0.014215 *
M5 -23.988 8.242 -2.911 0.005499 **
M6 -28.788 8.242 -3.493 0.001052 **
M7 -31.588 8.242 -3.833 0.000376 ***
M8 -37.988 8.242 -4.609 3.11e-05 ***
M9 -36.588 8.242 -4.439 5.44e-05 ***
M10 -5.388 8.242 -0.654 0.516463
M11 0.612 8.242 0.074 0.941122
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 12.97 on 47 degrees of freedom
Multiple R-squared: 0.5731, Adjusted R-squared: 0.4641
F-statistic: 5.258 on 12 and 47 DF, p-value: 1.609e-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.0196908183 0.0393816365 0.980309182
[2,] 0.0078106622 0.0156213245 0.992189338
[3,] 0.0042092629 0.0084185259 0.995790737
[4,] 0.0014439563 0.0028879127 0.998556044
[5,] 0.0004414975 0.0008829950 0.999558502
[6,] 0.0001374361 0.0002748722 0.999862564
[7,] 0.0001336572 0.0002673144 0.999866343
[8,] 0.0003114118 0.0006228236 0.999688588
[9,] 0.0014656923 0.0029313846 0.998534308
[10,] 0.0476547649 0.0953095298 0.952345235
[11,] 0.2702685183 0.5405370366 0.729731482
[12,] 0.5779484563 0.8441030874 0.422051544
[13,] 0.6863740494 0.6272519012 0.313625951
[14,] 0.7795235390 0.4409529221 0.220476461
[15,] 0.8286797803 0.3426404393 0.171320220
[16,] 0.8433402832 0.3133194335 0.156659717
[17,] 0.8814687496 0.2370625009 0.118531250
[18,] 0.9004343572 0.1991312857 0.099565643
[19,] 0.9246855172 0.1506289656 0.075314483
[20,] 0.9402040354 0.1195919293 0.059795965
[21,] 0.9597438258 0.0805123484 0.040256174
[22,] 0.9861490004 0.0277019993 0.013851000
[23,] 0.9917855199 0.0164289602 0.008214480
[24,] 0.9924333521 0.0151332958 0.007566648
[25,] 0.9912542175 0.0174915650 0.008745782
[26,] 0.9851055110 0.0297889780 0.014894489
[27,] 0.9657458642 0.0685082716 0.034254136
[28,] 0.9208394734 0.1583210532 0.079160527
[29,] 0.8301508040 0.3396983920 0.169849196
> postscript(file="/var/www/html/rcomp/tmp/1d7de1258619932.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/2vf441258619932.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/37u531258619932.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/4brsy1258619932.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/57zxr1258619932.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 7 8 9 10
16.412 15.212 14.212 11.012 11.012 10.812 8.612 10.012 9.612 14.412
11 12 13 14 15 16 17 18 19 20
16.412 17.024 14.412 13.212 11.212 6.012 7.012 5.812 5.612 9.012
21 22 23 24 25 26 27 28 29 30
8.612 9.412 9.412 9.024 1.412 -0.788 -4.788 -1.988 -4.988 -6.188
31 32 33 34 35 36 37 38 39 40
-6.388 -6.988 -10.388 -10.588 -10.588 -15.976 -17.588 -17.788 -15.788 -13.988
41 42 43 44 45 46 47 48 49 50
-14.988 -16.188 -15.388 -17.988 -16.388 -18.588 -20.588 -14.036 -14.648 -9.848
51 52 53 54 55 56 57 58 59 60
-4.848 -1.048 1.952 5.752 7.552 5.952 8.552 5.352 5.352 3.964
> postscript(file="/var/www/html/rcomp/tmp/63qwf1258619933.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 16.412 NA
1 15.212 16.412
2 14.212 15.212
3 11.012 14.212
4 11.012 11.012
5 10.812 11.012
6 8.612 10.812
7 10.012 8.612
8 9.612 10.012
9 14.412 9.612
10 16.412 14.412
11 17.024 16.412
12 14.412 17.024
13 13.212 14.412
14 11.212 13.212
15 6.012 11.212
16 7.012 6.012
17 5.812 7.012
18 5.612 5.812
19 9.012 5.612
20 8.612 9.012
21 9.412 8.612
22 9.412 9.412
23 9.024 9.412
24 1.412 9.024
25 -0.788 1.412
26 -4.788 -0.788
27 -1.988 -4.788
28 -4.988 -1.988
29 -6.188 -4.988
30 -6.388 -6.188
31 -6.988 -6.388
32 -10.388 -6.988
33 -10.588 -10.388
34 -10.588 -10.588
35 -15.976 -10.588
36 -17.588 -15.976
37 -17.788 -17.588
38 -15.788 -17.788
39 -13.988 -15.788
40 -14.988 -13.988
41 -16.188 -14.988
42 -15.388 -16.188
43 -17.988 -15.388
44 -16.388 -17.988
45 -18.588 -16.388
46 -20.588 -18.588
47 -14.036 -20.588
48 -14.648 -14.036
49 -9.848 -14.648
50 -4.848 -9.848
51 -1.048 -4.848
52 1.952 -1.048
53 5.752 1.952
54 7.552 5.752
55 5.952 7.552
56 8.552 5.952
57 5.352 8.552
58 5.352 5.352
59 3.964 5.352
60 NA 3.964
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 15.212 16.412
[2,] 14.212 15.212
[3,] 11.012 14.212
[4,] 11.012 11.012
[5,] 10.812 11.012
[6,] 8.612 10.812
[7,] 10.012 8.612
[8,] 9.612 10.012
[9,] 14.412 9.612
[10,] 16.412 14.412
[11,] 17.024 16.412
[12,] 14.412 17.024
[13,] 13.212 14.412
[14,] 11.212 13.212
[15,] 6.012 11.212
[16,] 7.012 6.012
[17,] 5.812 7.012
[18,] 5.612 5.812
[19,] 9.012 5.612
[20,] 8.612 9.012
[21,] 9.412 8.612
[22,] 9.412 9.412
[23,] 9.024 9.412
[24,] 1.412 9.024
[25,] -0.788 1.412
[26,] -4.788 -0.788
[27,] -1.988 -4.788
[28,] -4.988 -1.988
[29,] -6.188 -4.988
[30,] -6.388 -6.188
[31,] -6.988 -6.388
[32,] -10.388 -6.988
[33,] -10.588 -10.388
[34,] -10.588 -10.588
[35,] -15.976 -10.588
[36,] -17.588 -15.976
[37,] -17.788 -17.588
[38,] -15.788 -17.788
[39,] -13.988 -15.788
[40,] -14.988 -13.988
[41,] -16.188 -14.988
[42,] -15.388 -16.188
[43,] -17.988 -15.388
[44,] -16.388 -17.988
[45,] -18.588 -16.388
[46,] -20.588 -18.588
[47,] -14.036 -20.588
[48,] -14.648 -14.036
[49,] -9.848 -14.648
[50,] -4.848 -9.848
[51,] -1.048 -4.848
[52,] 1.952 -1.048
[53,] 5.752 1.952
[54,] 7.552 5.752
[55,] 5.952 7.552
[56,] 8.552 5.952
[57,] 5.352 8.552
[58,] 5.352 5.352
[59,] 3.964 5.352
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 15.212 16.412
2 14.212 15.212
3 11.012 14.212
4 11.012 11.012
5 10.812 11.012
6 8.612 10.812
7 10.012 8.612
8 9.612 10.012
9 14.412 9.612
10 16.412 14.412
11 17.024 16.412
12 14.412 17.024
13 13.212 14.412
14 11.212 13.212
15 6.012 11.212
16 7.012 6.012
17 5.812 7.012
18 5.612 5.812
19 9.012 5.612
20 8.612 9.012
21 9.412 8.612
22 9.412 9.412
23 9.024 9.412
24 1.412 9.024
25 -0.788 1.412
26 -4.788 -0.788
27 -1.988 -4.788
28 -4.988 -1.988
29 -6.188 -4.988
30 -6.388 -6.188
31 -6.988 -6.388
32 -10.388 -6.988
33 -10.588 -10.388
34 -10.588 -10.588
35 -15.976 -10.588
36 -17.588 -15.976
37 -17.788 -17.588
38 -15.788 -17.788
39 -13.988 -15.788
40 -14.988 -13.988
41 -16.188 -14.988
42 -15.388 -16.188
43 -17.988 -15.388
44 -16.388 -17.988
45 -18.588 -16.388
46 -20.588 -18.588
47 -14.036 -20.588
48 -14.648 -14.036
49 -9.848 -14.648
50 -4.848 -9.848
51 -1.048 -4.848
52 1.952 -1.048
53 5.752 1.952
54 7.552 5.752
55 5.952 7.552
56 8.552 5.952
57 5.352 8.552
58 5.352 5.352
59 3.964 5.352
> 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/7x57d1258619933.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/8rzss1258619933.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/9m67a1258619933.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/10wkip1258619933.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/117hkw1258619933.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/120vz61258619933.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/13zuoi1258619933.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/14u7j61258619933.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/15cmhy1258619933.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/16170a1258619933.tab")
+ }
>
> system("convert tmp/1d7de1258619932.ps tmp/1d7de1258619932.png")
> system("convert tmp/2vf441258619932.ps tmp/2vf441258619932.png")
> system("convert tmp/37u531258619932.ps tmp/37u531258619932.png")
> system("convert tmp/4brsy1258619932.ps tmp/4brsy1258619932.png")
> system("convert tmp/57zxr1258619932.ps tmp/57zxr1258619932.png")
> system("convert tmp/63qwf1258619933.ps tmp/63qwf1258619933.png")
> system("convert tmp/7x57d1258619933.ps tmp/7x57d1258619933.png")
> system("convert tmp/8rzss1258619933.ps tmp/8rzss1258619933.png")
> system("convert tmp/9m67a1258619933.ps tmp/9m67a1258619933.png")
> system("convert tmp/10wkip1258619933.ps tmp/10wkip1258619933.png")
>
>
> proc.time()
user system elapsed
2.338 1.516 3.392