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(8.7,0,8.2,0,8.3,0,8.5,0,8.6,0,8.5,0,8.2,0,8.1,0,7.9,0,8.6,0,8.7,0,8.7,0,8.5,0,8.4,0,8.5,0,8.7,0,8.7,0,8.6,0,8.5,0,8.3,0,8,0,8.2,0,8.1,0,8.1,0,8,0,7.9,0,7.9,0,8,0,8,0,7.9,0,8,0,7.7,0,7.2,0,7.5,0,7.3,0,7,0,7,0,7,0,7.2,0,7.3,0,7.1,0,6.8,0,6.4,0,6.1,0,6.5,0,7.7,0,7.9,0,7.5,0,6.9,1,6.6,1,6.9,1,7.7,1,8,1,8,1,7.7,1,7.3,1,7.4,1,8.1,1,8.3,1,8.2,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','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
Y X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 8.7 0 1 0 0 0 0 0 0 0 0 0 0
2 8.2 0 0 1 0 0 0 0 0 0 0 0 0
3 8.3 0 0 0 1 0 0 0 0 0 0 0 0
4 8.5 0 0 0 0 1 0 0 0 0 0 0 0
5 8.6 0 0 0 0 0 1 0 0 0 0 0 0
6 8.5 0 0 0 0 0 0 1 0 0 0 0 0
7 8.2 0 0 0 0 0 0 0 1 0 0 0 0
8 8.1 0 0 0 0 0 0 0 0 1 0 0 0
9 7.9 0 0 0 0 0 0 0 0 0 1 0 0
10 8.6 0 0 0 0 0 0 0 0 0 0 1 0
11 8.7 0 0 0 0 0 0 0 0 0 0 0 1
12 8.7 0 0 0 0 0 0 0 0 0 0 0 0
13 8.5 0 1 0 0 0 0 0 0 0 0 0 0
14 8.4 0 0 1 0 0 0 0 0 0 0 0 0
15 8.5 0 0 0 1 0 0 0 0 0 0 0 0
16 8.7 0 0 0 0 1 0 0 0 0 0 0 0
17 8.7 0 0 0 0 0 1 0 0 0 0 0 0
18 8.6 0 0 0 0 0 0 1 0 0 0 0 0
19 8.5 0 0 0 0 0 0 0 1 0 0 0 0
20 8.3 0 0 0 0 0 0 0 0 1 0 0 0
21 8.0 0 0 0 0 0 0 0 0 0 1 0 0
22 8.2 0 0 0 0 0 0 0 0 0 0 1 0
23 8.1 0 0 0 0 0 0 0 0 0 0 0 1
24 8.1 0 0 0 0 0 0 0 0 0 0 0 0
25 8.0 0 1 0 0 0 0 0 0 0 0 0 0
26 7.9 0 0 1 0 0 0 0 0 0 0 0 0
27 7.9 0 0 0 1 0 0 0 0 0 0 0 0
28 8.0 0 0 0 0 1 0 0 0 0 0 0 0
29 8.0 0 0 0 0 0 1 0 0 0 0 0 0
30 7.9 0 0 0 0 0 0 1 0 0 0 0 0
31 8.0 0 0 0 0 0 0 0 1 0 0 0 0
32 7.7 0 0 0 0 0 0 0 0 1 0 0 0
33 7.2 0 0 0 0 0 0 0 0 0 1 0 0
34 7.5 0 0 0 0 0 0 0 0 0 0 1 0
35 7.3 0 0 0 0 0 0 0 0 0 0 0 1
36 7.0 0 0 0 0 0 0 0 0 0 0 0 0
37 7.0 0 1 0 0 0 0 0 0 0 0 0 0
38 7.0 0 0 1 0 0 0 0 0 0 0 0 0
39 7.2 0 0 0 1 0 0 0 0 0 0 0 0
40 7.3 0 0 0 0 1 0 0 0 0 0 0 0
41 7.1 0 0 0 0 0 1 0 0 0 0 0 0
42 6.8 0 0 0 0 0 0 1 0 0 0 0 0
43 6.4 0 0 0 0 0 0 0 1 0 0 0 0
44 6.1 0 0 0 0 0 0 0 0 1 0 0 0
45 6.5 0 0 0 0 0 0 0 0 0 1 0 0
46 7.7 0 0 0 0 0 0 0 0 0 0 1 0
47 7.9 0 0 0 0 0 0 0 0 0 0 0 1
48 7.5 0 0 0 0 0 0 0 0 0 0 0 0
49 6.9 1 1 0 0 0 0 0 0 0 0 0 0
50 6.6 1 0 1 0 0 0 0 0 0 0 0 0
51 6.9 1 0 0 1 0 0 0 0 0 0 0 0
52 7.7 1 0 0 0 1 0 0 0 0 0 0 0
53 8.0 1 0 0 0 0 1 0 0 0 0 0 0
54 8.0 1 0 0 0 0 0 1 0 0 0 0 0
55 7.7 1 0 0 0 0 0 0 1 0 0 0 0
56 7.3 1 0 0 0 0 0 0 0 1 0 0 0
57 7.4 1 0 0 0 0 0 0 0 0 1 0 0
58 8.1 1 0 0 0 0 0 0 0 0 0 1 0
59 8.3 1 0 0 0 0 0 0 0 0 0 0 1
60 8.2 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
7.9587 -0.2937 -0.0800 -0.2800 -0.1400 0.1400
M5 M6 M7 M8 M9 M10
0.1800 0.0600 -0.1400 -0.4000 -0.5000 0.1200
M11
0.1600
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.4587 -0.4887 0.1481 0.5212 0.8212
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.9588 0.3093 25.731 <2e-16 ***
X -0.2938 0.2209 -1.330 0.190
M1 -0.0800 0.4329 -0.185 0.854
M2 -0.2800 0.4329 -0.647 0.521
M3 -0.1400 0.4329 -0.323 0.748
M4 0.1400 0.4329 0.323 0.748
M5 0.1800 0.4329 0.416 0.679
M6 0.0600 0.4329 0.139 0.890
M7 -0.1400 0.4329 -0.323 0.748
M8 -0.4000 0.4329 -0.924 0.360
M9 -0.5000 0.4329 -1.155 0.254
M10 0.1200 0.4329 0.277 0.783
M11 0.1600 0.4329 0.370 0.713
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6845 on 47 degrees of freedom
Multiple R-squared: 0.1423, Adjusted R-squared: -0.0767
F-statistic: 0.6498 on 12 and 47 DF, p-value: 0.7887
> 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.0205197581 0.0410395162 0.97948024
[2,] 0.0050715748 0.0101431496 0.99492843
[3,] 0.0012745706 0.0025491412 0.99872543
[4,] 0.0009485293 0.0018970586 0.99905147
[5,] 0.0004784593 0.0009569185 0.99952154
[6,] 0.0001643124 0.0003286247 0.99983569
[7,] 0.0002129110 0.0004258221 0.99978709
[8,] 0.0006834568 0.0013669137 0.99931654
[9,] 0.0013103971 0.0026207942 0.99868960
[10,] 0.0040642700 0.0081285400 0.99593573
[11,] 0.0062594667 0.0125189333 0.99374053
[12,] 0.0107931501 0.0215863003 0.98920685
[13,] 0.0173982859 0.0347965718 0.98260171
[14,] 0.0278591436 0.0557182872 0.97214086
[15,] 0.0427001056 0.0854002113 0.95729989
[16,] 0.0775543339 0.1551086678 0.92244567
[17,] 0.2183653985 0.4367307969 0.78163460
[18,] 0.2970529972 0.5941059945 0.70294700
[19,] 0.3472130125 0.6944260250 0.65278699
[20,] 0.4838418722 0.9676837444 0.51615813
[21,] 0.6713525438 0.6572949124 0.32864746
[22,] 0.7986166564 0.4027666873 0.20138334
[23,] 0.9236418309 0.1527163383 0.07635817
[24,] 0.9871291905 0.0257416189 0.01287081
[25,] 0.9873462727 0.0253074546 0.01265373
[26,] 0.9770631723 0.0458736554 0.02293683
[27,] 0.9702663810 0.0594672380 0.02973362
[28,] 0.9754864781 0.0490270438 0.02451352
[29,] 0.9839615459 0.0320769081 0.01603845
> postscript(file="/var/www/html/rcomp/tmp/1s9z81260889069.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/206ba1260889069.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/3wbit1260889069.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/4i5gq1260889069.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/5cnru1260889069.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
0.82125 0.52125 0.48125 0.40125 0.46125 0.48125 0.38125 0.54125
9 10 11 12 13 14 15 16
0.44125 0.52125 0.58125 0.74125 0.62125 0.72125 0.68125 0.60125
17 18 19 20 21 22 23 24
0.56125 0.58125 0.68125 0.74125 0.54125 0.12125 -0.01875 0.14125
25 26 27 28 29 30 31 32
0.12125 0.22125 0.08125 -0.09875 -0.13875 -0.11875 0.18125 0.14125
33 34 35 36 37 38 39 40
-0.25875 -0.57875 -0.81875 -0.95875 -0.87875 -0.67875 -0.61875 -0.79875
41 42 43 44 45 46 47 48
-1.03875 -1.21875 -1.41875 -1.45875 -0.95875 -0.37875 -0.21875 -0.45875
49 50 51 52 53 54 55 56
-0.68500 -0.78500 -0.62500 -0.10500 0.15500 0.27500 0.17500 0.03500
57 58 59 60
0.23500 0.31500 0.47500 0.53500
> postscript(file="/var/www/html/rcomp/tmp/66xul1260889069.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 0.82125 NA
1 0.52125 0.82125
2 0.48125 0.52125
3 0.40125 0.48125
4 0.46125 0.40125
5 0.48125 0.46125
6 0.38125 0.48125
7 0.54125 0.38125
8 0.44125 0.54125
9 0.52125 0.44125
10 0.58125 0.52125
11 0.74125 0.58125
12 0.62125 0.74125
13 0.72125 0.62125
14 0.68125 0.72125
15 0.60125 0.68125
16 0.56125 0.60125
17 0.58125 0.56125
18 0.68125 0.58125
19 0.74125 0.68125
20 0.54125 0.74125
21 0.12125 0.54125
22 -0.01875 0.12125
23 0.14125 -0.01875
24 0.12125 0.14125
25 0.22125 0.12125
26 0.08125 0.22125
27 -0.09875 0.08125
28 -0.13875 -0.09875
29 -0.11875 -0.13875
30 0.18125 -0.11875
31 0.14125 0.18125
32 -0.25875 0.14125
33 -0.57875 -0.25875
34 -0.81875 -0.57875
35 -0.95875 -0.81875
36 -0.87875 -0.95875
37 -0.67875 -0.87875
38 -0.61875 -0.67875
39 -0.79875 -0.61875
40 -1.03875 -0.79875
41 -1.21875 -1.03875
42 -1.41875 -1.21875
43 -1.45875 -1.41875
44 -0.95875 -1.45875
45 -0.37875 -0.95875
46 -0.21875 -0.37875
47 -0.45875 -0.21875
48 -0.68500 -0.45875
49 -0.78500 -0.68500
50 -0.62500 -0.78500
51 -0.10500 -0.62500
52 0.15500 -0.10500
53 0.27500 0.15500
54 0.17500 0.27500
55 0.03500 0.17500
56 0.23500 0.03500
57 0.31500 0.23500
58 0.47500 0.31500
59 0.53500 0.47500
60 NA 0.53500
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.52125 0.82125
[2,] 0.48125 0.52125
[3,] 0.40125 0.48125
[4,] 0.46125 0.40125
[5,] 0.48125 0.46125
[6,] 0.38125 0.48125
[7,] 0.54125 0.38125
[8,] 0.44125 0.54125
[9,] 0.52125 0.44125
[10,] 0.58125 0.52125
[11,] 0.74125 0.58125
[12,] 0.62125 0.74125
[13,] 0.72125 0.62125
[14,] 0.68125 0.72125
[15,] 0.60125 0.68125
[16,] 0.56125 0.60125
[17,] 0.58125 0.56125
[18,] 0.68125 0.58125
[19,] 0.74125 0.68125
[20,] 0.54125 0.74125
[21,] 0.12125 0.54125
[22,] -0.01875 0.12125
[23,] 0.14125 -0.01875
[24,] 0.12125 0.14125
[25,] 0.22125 0.12125
[26,] 0.08125 0.22125
[27,] -0.09875 0.08125
[28,] -0.13875 -0.09875
[29,] -0.11875 -0.13875
[30,] 0.18125 -0.11875
[31,] 0.14125 0.18125
[32,] -0.25875 0.14125
[33,] -0.57875 -0.25875
[34,] -0.81875 -0.57875
[35,] -0.95875 -0.81875
[36,] -0.87875 -0.95875
[37,] -0.67875 -0.87875
[38,] -0.61875 -0.67875
[39,] -0.79875 -0.61875
[40,] -1.03875 -0.79875
[41,] -1.21875 -1.03875
[42,] -1.41875 -1.21875
[43,] -1.45875 -1.41875
[44,] -0.95875 -1.45875
[45,] -0.37875 -0.95875
[46,] -0.21875 -0.37875
[47,] -0.45875 -0.21875
[48,] -0.68500 -0.45875
[49,] -0.78500 -0.68500
[50,] -0.62500 -0.78500
[51,] -0.10500 -0.62500
[52,] 0.15500 -0.10500
[53,] 0.27500 0.15500
[54,] 0.17500 0.27500
[55,] 0.03500 0.17500
[56,] 0.23500 0.03500
[57,] 0.31500 0.23500
[58,] 0.47500 0.31500
[59,] 0.53500 0.47500
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.52125 0.82125
2 0.48125 0.52125
3 0.40125 0.48125
4 0.46125 0.40125
5 0.48125 0.46125
6 0.38125 0.48125
7 0.54125 0.38125
8 0.44125 0.54125
9 0.52125 0.44125
10 0.58125 0.52125
11 0.74125 0.58125
12 0.62125 0.74125
13 0.72125 0.62125
14 0.68125 0.72125
15 0.60125 0.68125
16 0.56125 0.60125
17 0.58125 0.56125
18 0.68125 0.58125
19 0.74125 0.68125
20 0.54125 0.74125
21 0.12125 0.54125
22 -0.01875 0.12125
23 0.14125 -0.01875
24 0.12125 0.14125
25 0.22125 0.12125
26 0.08125 0.22125
27 -0.09875 0.08125
28 -0.13875 -0.09875
29 -0.11875 -0.13875
30 0.18125 -0.11875
31 0.14125 0.18125
32 -0.25875 0.14125
33 -0.57875 -0.25875
34 -0.81875 -0.57875
35 -0.95875 -0.81875
36 -0.87875 -0.95875
37 -0.67875 -0.87875
38 -0.61875 -0.67875
39 -0.79875 -0.61875
40 -1.03875 -0.79875
41 -1.21875 -1.03875
42 -1.41875 -1.21875
43 -1.45875 -1.41875
44 -0.95875 -1.45875
45 -0.37875 -0.95875
46 -0.21875 -0.37875
47 -0.45875 -0.21875
48 -0.68500 -0.45875
49 -0.78500 -0.68500
50 -0.62500 -0.78500
51 -0.10500 -0.62500
52 0.15500 -0.10500
53 0.27500 0.15500
54 0.17500 0.27500
55 0.03500 0.17500
56 0.23500 0.03500
57 0.31500 0.23500
58 0.47500 0.31500
59 0.53500 0.47500
> 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/7ve3z1260889069.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/8we1y1260889069.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/90b931260889069.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/103d3i1260889069.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/113n3m1260889069.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/12xacb1260889069.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/13rwb71260889069.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/144a611260889069.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/1545tz1260889069.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/16bvcp1260889069.tab")
+ }
>
> try(system("convert tmp/1s9z81260889069.ps tmp/1s9z81260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/206ba1260889069.ps tmp/206ba1260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wbit1260889069.ps tmp/3wbit1260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/4i5gq1260889069.ps tmp/4i5gq1260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cnru1260889069.ps tmp/5cnru1260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/66xul1260889069.ps tmp/66xul1260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ve3z1260889069.ps tmp/7ve3z1260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/8we1y1260889069.ps tmp/8we1y1260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/90b931260889069.ps tmp/90b931260889069.png",intern=TRUE))
character(0)
> try(system("convert tmp/103d3i1260889069.ps tmp/103d3i1260889069.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.395 1.590 3.794