R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(25,0,29,0,28,0,25,0,26,0,24,0,28,0,28,0,28,0,28,0,32,0,31,0,22,0,29,0,31,0,29,0,32,0,32,0,31,0,29,0,28,0,28,0,29,0,22,0,26,0,24,0,27,0,27,0,23,0,21,0,19,0,17,0,19,1,21,1,13,1,8,1,5,1,10,1,6,1,6,1,8,1,11,1,12,1,13,1,19,1,19,1,18,1,20,1,15,1,15,1,15,1,17,1,22,1,17,1,21,1,23,1,26,1,26,1,28,1,30,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 = '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
> 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 25 0
2 29 0
3 28 0
4 25 0
5 26 0
6 24 0
7 28 0
8 28 0
9 28 0
10 28 0
11 32 0
12 31 0
13 22 0
14 29 0
15 31 0
16 29 0
17 32 0
18 32 0
19 31 0
20 29 0
21 28 0
22 28 0
23 29 0
24 22 0
25 26 0
26 24 0
27 27 0
28 27 0
29 23 0
30 21 0
31 19 0
32 17 0
33 19 1
34 21 1
35 13 1
36 8 1
37 5 1
38 10 1
39 6 1
40 6 1
41 8 1
42 11 1
43 12 1
44 13 1
45 19 1
46 19 1
47 18 1
48 20 1
49 15 1
50 15 1
51 15 1
52 17 1
53 22 1
54 17 1
55 21 1
56 23 1
57 26 1
58 26 1
59 28 1
60 30 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
26.81 -10.28
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-11.536 -3.536 1.188 2.714 13.464
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 26.8125 0.9587 27.968 < 2e-16 ***
X -10.2768 1.4034 -7.323 8.4e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.423 on 58 degrees of freedom
Multiple R-squared: 0.4804, Adjusted R-squared: 0.4714
F-statistic: 53.62 on 1 and 58 DF, p-value: 8.403e-10
> 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,] 6.300542e-02 1.260108e-01 0.9369946
[2,] 3.576091e-02 7.152183e-02 0.9642391
[3,] 1.557576e-02 3.115152e-02 0.9844242
[4,] 6.242080e-03 1.248416e-02 0.9937579
[5,] 2.326237e-03 4.652475e-03 0.9976738
[6,] 8.120556e-04 1.624111e-03 0.9991879
[7,] 3.015170e-03 6.030341e-03 0.9969848
[8,] 2.843788e-03 5.687575e-03 0.9971562
[9,] 6.401020e-03 1.280204e-02 0.9935990
[10,] 3.305333e-03 6.610666e-03 0.9966947
[11,] 2.807885e-03 5.615770e-03 0.9971921
[12,] 1.376415e-03 2.752829e-03 0.9986236
[13,] 1.578476e-03 3.156953e-03 0.9984215
[14,] 1.653132e-03 3.306264e-03 0.9983469
[15,] 1.214273e-03 2.428546e-03 0.9987857
[16,] 6.138230e-04 1.227646e-03 0.9993862
[17,] 2.912188e-04 5.824377e-04 0.9997088
[18,] 1.368641e-04 2.737282e-04 0.9998631
[19,] 6.998220e-05 1.399644e-04 0.9999300
[20,] 1.821608e-04 3.643215e-04 0.9998178
[21,] 1.006759e-04 2.013518e-04 0.9998993
[22,] 8.405664e-05 1.681133e-04 0.9999159
[23,] 4.390443e-05 8.780886e-05 0.9999561
[24,] 2.490165e-05 4.980330e-05 0.9999751
[25,] 2.922089e-05 5.844178e-05 0.9999708
[26,] 6.426003e-05 1.285201e-04 0.9999357
[27,] 2.301555e-04 4.603110e-04 0.9997698
[28,] 1.034445e-03 2.068890e-03 0.9989656
[29,] 5.518666e-04 1.103733e-03 0.9994481
[30,] 3.332369e-04 6.664738e-04 0.9996668
[31,] 3.405028e-04 6.810056e-04 0.9996595
[32,] 1.014700e-03 2.029399e-03 0.9989853
[33,] 5.148980e-03 1.029796e-02 0.9948510
[34,] 4.958294e-03 9.916588e-03 0.9950417
[35,] 1.367171e-02 2.734342e-02 0.9863283
[36,] 4.033334e-02 8.066668e-02 0.9596667
[37,] 8.189638e-02 1.637928e-01 0.9181036
[38,] 1.101489e-01 2.202977e-01 0.8898511
[39,] 1.448988e-01 2.897976e-01 0.8551012
[40,] 1.861437e-01 3.722874e-01 0.8138563
[41,] 1.830363e-01 3.660725e-01 0.8169637
[42,] 1.688829e-01 3.377658e-01 0.8311171
[43,] 1.492738e-01 2.985475e-01 0.8507262
[44,] 1.279709e-01 2.559418e-01 0.8720291
[45,] 1.426085e-01 2.852170e-01 0.8573915
[46,] 1.822754e-01 3.645507e-01 0.8177246
[47,] 2.839960e-01 5.679920e-01 0.7160040
[48,] 3.802914e-01 7.605828e-01 0.6197086
[49,] 3.259231e-01 6.518462e-01 0.6740769
[50,] 6.072332e-01 7.855335e-01 0.3927668
[51,] 7.166468e-01 5.667065e-01 0.2833532
> postscript(file="/var/www/rcomp/tmp/1jkkq1293185944.ps",horizontal=F,onefile=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/rcomp/tmp/2jkkq1293185944.ps",horizontal=F,onefile=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/rcomp/tmp/3cbjb1293185944.ps",horizontal=F,onefile=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/rcomp/tmp/4cbjb1293185944.ps",horizontal=F,onefile=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/rcomp/tmp/5cbjb1293185944.ps",horizontal=F,onefile=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
-1.8125000 2.1875000 1.1875000 -1.8125000 -0.8125000 -2.8125000
7 8 9 10 11 12
1.1875000 1.1875000 1.1875000 1.1875000 5.1875000 4.1875000
13 14 15 16 17 18
-4.8125000 2.1875000 4.1875000 2.1875000 5.1875000 5.1875000
19 20 21 22 23 24
4.1875000 2.1875000 1.1875000 1.1875000 2.1875000 -4.8125000
25 26 27 28 29 30
-0.8125000 -2.8125000 0.1875000 0.1875000 -3.8125000 -5.8125000
31 32 33 34 35 36
-7.8125000 -9.8125000 2.4642857 4.4642857 -3.5357143 -8.5357143
37 38 39 40 41 42
-11.5357143 -6.5357143 -10.5357143 -10.5357143 -8.5357143 -5.5357143
43 44 45 46 47 48
-4.5357143 -3.5357143 2.4642857 2.4642857 1.4642857 3.4642857
49 50 51 52 53 54
-1.5357143 -1.5357143 -1.5357143 0.4642857 5.4642857 0.4642857
55 56 57 58 59 60
4.4642857 6.4642857 9.4642857 9.4642857 11.4642857 13.4642857
> postscript(file="/var/www/rcomp/tmp/6nkje1293185944.ps",horizontal=F,onefile=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 -1.8125000 NA
1 2.1875000 -1.8125000
2 1.1875000 2.1875000
3 -1.8125000 1.1875000
4 -0.8125000 -1.8125000
5 -2.8125000 -0.8125000
6 1.1875000 -2.8125000
7 1.1875000 1.1875000
8 1.1875000 1.1875000
9 1.1875000 1.1875000
10 5.1875000 1.1875000
11 4.1875000 5.1875000
12 -4.8125000 4.1875000
13 2.1875000 -4.8125000
14 4.1875000 2.1875000
15 2.1875000 4.1875000
16 5.1875000 2.1875000
17 5.1875000 5.1875000
18 4.1875000 5.1875000
19 2.1875000 4.1875000
20 1.1875000 2.1875000
21 1.1875000 1.1875000
22 2.1875000 1.1875000
23 -4.8125000 2.1875000
24 -0.8125000 -4.8125000
25 -2.8125000 -0.8125000
26 0.1875000 -2.8125000
27 0.1875000 0.1875000
28 -3.8125000 0.1875000
29 -5.8125000 -3.8125000
30 -7.8125000 -5.8125000
31 -9.8125000 -7.8125000
32 2.4642857 -9.8125000
33 4.4642857 2.4642857
34 -3.5357143 4.4642857
35 -8.5357143 -3.5357143
36 -11.5357143 -8.5357143
37 -6.5357143 -11.5357143
38 -10.5357143 -6.5357143
39 -10.5357143 -10.5357143
40 -8.5357143 -10.5357143
41 -5.5357143 -8.5357143
42 -4.5357143 -5.5357143
43 -3.5357143 -4.5357143
44 2.4642857 -3.5357143
45 2.4642857 2.4642857
46 1.4642857 2.4642857
47 3.4642857 1.4642857
48 -1.5357143 3.4642857
49 -1.5357143 -1.5357143
50 -1.5357143 -1.5357143
51 0.4642857 -1.5357143
52 5.4642857 0.4642857
53 0.4642857 5.4642857
54 4.4642857 0.4642857
55 6.4642857 4.4642857
56 9.4642857 6.4642857
57 9.4642857 9.4642857
58 11.4642857 9.4642857
59 13.4642857 11.4642857
60 NA 13.4642857
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.1875000 -1.8125000
[2,] 1.1875000 2.1875000
[3,] -1.8125000 1.1875000
[4,] -0.8125000 -1.8125000
[5,] -2.8125000 -0.8125000
[6,] 1.1875000 -2.8125000
[7,] 1.1875000 1.1875000
[8,] 1.1875000 1.1875000
[9,] 1.1875000 1.1875000
[10,] 5.1875000 1.1875000
[11,] 4.1875000 5.1875000
[12,] -4.8125000 4.1875000
[13,] 2.1875000 -4.8125000
[14,] 4.1875000 2.1875000
[15,] 2.1875000 4.1875000
[16,] 5.1875000 2.1875000
[17,] 5.1875000 5.1875000
[18,] 4.1875000 5.1875000
[19,] 2.1875000 4.1875000
[20,] 1.1875000 2.1875000
[21,] 1.1875000 1.1875000
[22,] 2.1875000 1.1875000
[23,] -4.8125000 2.1875000
[24,] -0.8125000 -4.8125000
[25,] -2.8125000 -0.8125000
[26,] 0.1875000 -2.8125000
[27,] 0.1875000 0.1875000
[28,] -3.8125000 0.1875000
[29,] -5.8125000 -3.8125000
[30,] -7.8125000 -5.8125000
[31,] -9.8125000 -7.8125000
[32,] 2.4642857 -9.8125000
[33,] 4.4642857 2.4642857
[34,] -3.5357143 4.4642857
[35,] -8.5357143 -3.5357143
[36,] -11.5357143 -8.5357143
[37,] -6.5357143 -11.5357143
[38,] -10.5357143 -6.5357143
[39,] -10.5357143 -10.5357143
[40,] -8.5357143 -10.5357143
[41,] -5.5357143 -8.5357143
[42,] -4.5357143 -5.5357143
[43,] -3.5357143 -4.5357143
[44,] 2.4642857 -3.5357143
[45,] 2.4642857 2.4642857
[46,] 1.4642857 2.4642857
[47,] 3.4642857 1.4642857
[48,] -1.5357143 3.4642857
[49,] -1.5357143 -1.5357143
[50,] -1.5357143 -1.5357143
[51,] 0.4642857 -1.5357143
[52,] 5.4642857 0.4642857
[53,] 0.4642857 5.4642857
[54,] 4.4642857 0.4642857
[55,] 6.4642857 4.4642857
[56,] 9.4642857 6.4642857
[57,] 9.4642857 9.4642857
[58,] 11.4642857 9.4642857
[59,] 13.4642857 11.4642857
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.1875000 -1.8125000
2 1.1875000 2.1875000
3 -1.8125000 1.1875000
4 -0.8125000 -1.8125000
5 -2.8125000 -0.8125000
6 1.1875000 -2.8125000
7 1.1875000 1.1875000
8 1.1875000 1.1875000
9 1.1875000 1.1875000
10 5.1875000 1.1875000
11 4.1875000 5.1875000
12 -4.8125000 4.1875000
13 2.1875000 -4.8125000
14 4.1875000 2.1875000
15 2.1875000 4.1875000
16 5.1875000 2.1875000
17 5.1875000 5.1875000
18 4.1875000 5.1875000
19 2.1875000 4.1875000
20 1.1875000 2.1875000
21 1.1875000 1.1875000
22 2.1875000 1.1875000
23 -4.8125000 2.1875000
24 -0.8125000 -4.8125000
25 -2.8125000 -0.8125000
26 0.1875000 -2.8125000
27 0.1875000 0.1875000
28 -3.8125000 0.1875000
29 -5.8125000 -3.8125000
30 -7.8125000 -5.8125000
31 -9.8125000 -7.8125000
32 2.4642857 -9.8125000
33 4.4642857 2.4642857
34 -3.5357143 4.4642857
35 -8.5357143 -3.5357143
36 -11.5357143 -8.5357143
37 -6.5357143 -11.5357143
38 -10.5357143 -6.5357143
39 -10.5357143 -10.5357143
40 -8.5357143 -10.5357143
41 -5.5357143 -8.5357143
42 -4.5357143 -5.5357143
43 -3.5357143 -4.5357143
44 2.4642857 -3.5357143
45 2.4642857 2.4642857
46 1.4642857 2.4642857
47 3.4642857 1.4642857
48 -1.5357143 3.4642857
49 -1.5357143 -1.5357143
50 -1.5357143 -1.5357143
51 0.4642857 -1.5357143
52 5.4642857 0.4642857
53 0.4642857 5.4642857
54 4.4642857 0.4642857
55 6.4642857 4.4642857
56 9.4642857 6.4642857
57 9.4642857 9.4642857
58 11.4642857 9.4642857
59 13.4642857 11.4642857
> 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/rcomp/tmp/7xt0z1293185944.ps",horizontal=F,onefile=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/rcomp/tmp/8xt0z1293185944.ps",horizontal=F,onefile=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/rcomp/tmp/9xt0z1293185944.ps",horizontal=F,onefile=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/rcomp/tmp/1082h21293185944.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11b3g71293185944.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/rcomp/tmp/127dzq1293185945.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/rcomp/tmp/13eeek1293185945.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/rcomp/tmp/14o6d51293185945.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/rcomp/tmp/15aoub1293185945.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/rcomp/tmp/16d7sh1293185945.tab")
+ }
>
> try(system("convert tmp/1jkkq1293185944.ps tmp/1jkkq1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/2jkkq1293185944.ps tmp/2jkkq1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/3cbjb1293185944.ps tmp/3cbjb1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/4cbjb1293185944.ps tmp/4cbjb1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cbjb1293185944.ps tmp/5cbjb1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/6nkje1293185944.ps tmp/6nkje1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xt0z1293185944.ps tmp/7xt0z1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/8xt0z1293185944.ps tmp/8xt0z1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/9xt0z1293185944.ps tmp/9xt0z1293185944.png",intern=TRUE))
character(0)
> try(system("convert tmp/1082h21293185944.ps tmp/1082h21293185944.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.990 1.720 4.696