R version 2.6.0 (2007-10-03)
Copyright (C) 2007 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(108.4,106.7,117,100.6,103.8,101.2,100.8,93.1,110.6,84.2,104,85.8,112.6,91.8,107.3,92.4,98.9,80.3,109.8,79.7,104.9,62.5,102.2,57.1,123.9,100.8,124.9,100.7,112.7,86.2,121.9,83.2,100.6,71.7,104.3,77.5,120.4,89.8,107.5,80.3,102.9,78.7,125.6,93.8,107.5,57.6,108.8,60.6,128.4,91,121.1,85.3,119.5,77.4,128.7,77.3,108.7,68.3,105.5,69.9,119.8,81.7,111.3,75.1,110.6,69.9,120.1,84,97.5,54.3,107.7,60,127.3,89.9,117.2,77,119.8,85.3,116.2,77.6,111,69.2,112.4,75.5,130.6,85.7,109.1,72.2,118.8,79.9,123.9,85.3,101.6,52.2,112.8,61.2,128,82.4,129.6,85.4,125.8,78.2,119.5,70.2,115.7,70.2,113.6,69.3,129.7,77.5,112,66.1,116.8,69,126.3,75.3,112.9,58.2,115.9,59.7),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 = 'Include Monthly Dummies'
> par1 = '2'
> #'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)
> 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 106.7 108.4 1 0 0 0 0 0 0 0 0 0 0
2 100.6 117.0 0 1 0 0 0 0 0 0 0 0 0
3 101.2 103.8 0 0 1 0 0 0 0 0 0 0 0
4 93.1 100.8 0 0 0 1 0 0 0 0 0 0 0
5 84.2 110.6 0 0 0 0 1 0 0 0 0 0 0
6 85.8 104.0 0 0 0 0 0 1 0 0 0 0 0
7 91.8 112.6 0 0 0 0 0 0 1 0 0 0 0
8 92.4 107.3 0 0 0 0 0 0 0 1 0 0 0
9 80.3 98.9 0 0 0 0 0 0 0 0 1 0 0
10 79.7 109.8 0 0 0 0 0 0 0 0 0 1 0
11 62.5 104.9 0 0 0 0 0 0 0 0 0 0 1
12 57.1 102.2 0 0 0 0 0 0 0 0 0 0 0
13 100.8 123.9 1 0 0 0 0 0 0 0 0 0 0
14 100.7 124.9 0 1 0 0 0 0 0 0 0 0 0
15 86.2 112.7 0 0 1 0 0 0 0 0 0 0 0
16 83.2 121.9 0 0 0 1 0 0 0 0 0 0 0
17 71.7 100.6 0 0 0 0 1 0 0 0 0 0 0
18 77.5 104.3 0 0 0 0 0 1 0 0 0 0 0
19 89.8 120.4 0 0 0 0 0 0 1 0 0 0 0
20 80.3 107.5 0 0 0 0 0 0 0 1 0 0 0
21 78.7 102.9 0 0 0 0 0 0 0 0 1 0 0
22 93.8 125.6 0 0 0 0 0 0 0 0 0 1 0
23 57.6 107.5 0 0 0 0 0 0 0 0 0 0 1
24 60.6 108.8 0 0 0 0 0 0 0 0 0 0 0
25 91.0 128.4 1 0 0 0 0 0 0 0 0 0 0
26 85.3 121.1 0 1 0 0 0 0 0 0 0 0 0
27 77.4 119.5 0 0 1 0 0 0 0 0 0 0 0
28 77.3 128.7 0 0 0 1 0 0 0 0 0 0 0
29 68.3 108.7 0 0 0 0 1 0 0 0 0 0 0
30 69.9 105.5 0 0 0 0 0 1 0 0 0 0 0
31 81.7 119.8 0 0 0 0 0 0 1 0 0 0 0
32 75.1 111.3 0 0 0 0 0 0 0 1 0 0 0
33 69.9 110.6 0 0 0 0 0 0 0 0 1 0 0
34 84.0 120.1 0 0 0 0 0 0 0 0 0 1 0
35 54.3 97.5 0 0 0 0 0 0 0 0 0 0 1
36 60.0 107.7 0 0 0 0 0 0 0 0 0 0 0
37 89.9 127.3 1 0 0 0 0 0 0 0 0 0 0
38 77.0 117.2 0 1 0 0 0 0 0 0 0 0 0
39 85.3 119.8 0 0 1 0 0 0 0 0 0 0 0
40 77.6 116.2 0 0 0 1 0 0 0 0 0 0 0
41 69.2 111.0 0 0 0 0 1 0 0 0 0 0 0
42 75.5 112.4 0 0 0 0 0 1 0 0 0 0 0
43 85.7 130.6 0 0 0 0 0 0 1 0 0 0 0
44 72.2 109.1 0 0 0 0 0 0 0 1 0 0 0
45 79.9 118.8 0 0 0 0 0 0 0 0 1 0 0
46 85.3 123.9 0 0 0 0 0 0 0 0 0 1 0
47 52.2 101.6 0 0 0 0 0 0 0 0 0 0 1
48 61.2 112.8 0 0 0 0 0 0 0 0 0 0 0
49 82.4 128.0 1 0 0 0 0 0 0 0 0 0 0
50 85.4 129.6 0 1 0 0 0 0 0 0 0 0 0
51 78.2 125.8 0 0 1 0 0 0 0 0 0 0 0
52 70.2 119.5 0 0 0 1 0 0 0 0 0 0 0
53 70.2 115.7 0 0 0 0 1 0 0 0 0 0 0
54 69.3 113.6 0 0 0 0 0 1 0 0 0 0 0
55 77.5 129.7 0 0 0 0 0 0 1 0 0 0 0
56 66.1 112.0 0 0 0 0 0 0 0 1 0 0 0
57 69.0 116.8 0 0 0 0 0 0 0 0 1 0 0
58 75.3 126.3 0 0 0 0 0 0 0 0 0 1 0
59 58.2 112.9 0 0 0 0 0 0 0 0 0 0 1
60 59.7 115.9 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
108.5568 -0.4461 40.5602 35.6471 28.9912 24.1019
M5 M6 M7 M8 M9 M10
12.9286 15.2020 31.4415 17.4822 15.8935 29.1013
M11
-4.8120
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-14.92334 -4.86436 -0.05849 3.62221 14.22539
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 108.5568 16.2176 6.694 2.38e-08 ***
X -0.4461 0.1454 -3.068 0.003567 **
M1 40.5602 4.8331 8.392 6.66e-11 ***
M2 35.6471 4.7615 7.486 1.50e-09 ***
M3 28.9912 4.5132 6.424 6.13e-08 ***
M4 24.1019 4.5512 5.296 3.07e-06 ***
M5 12.9286 4.4024 2.937 0.005123 **
M6 15.2020 4.4079 3.449 0.001198 **
M7 31.4415 4.7989 6.552 3.92e-08 ***
M8 17.4822 4.4023 3.971 0.000244 ***
M9 15.8935 4.4024 3.610 0.000741 ***
M10 29.1013 4.7174 6.169 1.49e-07 ***
M11 -4.8120 4.4528 -1.081 0.285366
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.961 on 47 degrees of freedom
Multiple R-Squared: 0.7619, Adjusted R-squared: 0.7011
F-statistic: 12.53 on 12 and 47 DF, p-value: 6.69e-11
> postscript(file="/var/www/html/rcomp/tmp/1k1bl1195129173.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/2ufig1195129173.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/33a9j1195129173.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/4v4z91195129173.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/5hbds1195129173.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> 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
5.93802694 8.58744687 9.95508765 5.40616268 12.05098145 8.43352613
7 8 9 10 11 12
2.03028580 14.22539038 -0.03304809 -8.97853882 5.54892159 -5.86745702
13 14 15 16 17 18
6.95225548 12.21147303 -1.07480692 4.91843509 -4.90981116 0.26734990
19 20 21 22 23 24
3.50970404 2.21460623 0.15126895 12.16951350 1.80872766 0.57666610
25 26 27 28 29 30
-0.84038784 -4.88362816 -6.84146795 2.05177406 -4.69656914 -6.79735498
31 32 33 34 35 36
-4.85794352 -1.29029257 -5.21392074 -0.08392243 -5.95206495 -0.51402108
37 38 39 40 41 42
-2.43107503 -14.92333728 1.19235583 -3.22421670 -2.77058684 1.88059192
43 44 45 46 47 48
3.95971250 -5.17166695 8.44392920 2.91117876 -6.22313998 2.96098315
49 50 51 52 53 54
-9.61881955 -0.99195445 -3.23116861 -9.15215514 0.32598569 -3.78411297
55 56 57 58 59 60
-4.64175883 -9.97803709 -3.34822932 -6.01823101 4.81755567 2.84382886
> postscript(file="/var/www/html/rcomp/tmp/6z3fx1195129173.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 5.93802694 NA
1 8.58744687 5.93802694
2 9.95508765 8.58744687
3 5.40616268 9.95508765
4 12.05098145 5.40616268
5 8.43352613 12.05098145
6 2.03028580 8.43352613
7 14.22539038 2.03028580
8 -0.03304809 14.22539038
9 -8.97853882 -0.03304809
10 5.54892159 -8.97853882
11 -5.86745702 5.54892159
12 6.95225548 -5.86745702
13 12.21147303 6.95225548
14 -1.07480692 12.21147303
15 4.91843509 -1.07480692
16 -4.90981116 4.91843509
17 0.26734990 -4.90981116
18 3.50970404 0.26734990
19 2.21460623 3.50970404
20 0.15126895 2.21460623
21 12.16951350 0.15126895
22 1.80872766 12.16951350
23 0.57666610 1.80872766
24 -0.84038784 0.57666610
25 -4.88362816 -0.84038784
26 -6.84146795 -4.88362816
27 2.05177406 -6.84146795
28 -4.69656914 2.05177406
29 -6.79735498 -4.69656914
30 -4.85794352 -6.79735498
31 -1.29029257 -4.85794352
32 -5.21392074 -1.29029257
33 -0.08392243 -5.21392074
34 -5.95206495 -0.08392243
35 -0.51402108 -5.95206495
36 -2.43107503 -0.51402108
37 -14.92333728 -2.43107503
38 1.19235583 -14.92333728
39 -3.22421670 1.19235583
40 -2.77058684 -3.22421670
41 1.88059192 -2.77058684
42 3.95971250 1.88059192
43 -5.17166695 3.95971250
44 8.44392920 -5.17166695
45 2.91117876 8.44392920
46 -6.22313998 2.91117876
47 2.96098315 -6.22313998
48 -9.61881955 2.96098315
49 -0.99195445 -9.61881955
50 -3.23116861 -0.99195445
51 -9.15215514 -3.23116861
52 0.32598569 -9.15215514
53 -3.78411297 0.32598569
54 -4.64175883 -3.78411297
55 -9.97803709 -4.64175883
56 -3.34822932 -9.97803709
57 -6.01823101 -3.34822932
58 4.81755567 -6.01823101
59 2.84382886 4.81755567
60 NA 2.84382886
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 8.58744687 5.93802694
[2,] 9.95508765 8.58744687
[3,] 5.40616268 9.95508765
[4,] 12.05098145 5.40616268
[5,] 8.43352613 12.05098145
[6,] 2.03028580 8.43352613
[7,] 14.22539038 2.03028580
[8,] -0.03304809 14.22539038
[9,] -8.97853882 -0.03304809
[10,] 5.54892159 -8.97853882
[11,] -5.86745702 5.54892159
[12,] 6.95225548 -5.86745702
[13,] 12.21147303 6.95225548
[14,] -1.07480692 12.21147303
[15,] 4.91843509 -1.07480692
[16,] -4.90981116 4.91843509
[17,] 0.26734990 -4.90981116
[18,] 3.50970404 0.26734990
[19,] 2.21460623 3.50970404
[20,] 0.15126895 2.21460623
[21,] 12.16951350 0.15126895
[22,] 1.80872766 12.16951350
[23,] 0.57666610 1.80872766
[24,] -0.84038784 0.57666610
[25,] -4.88362816 -0.84038784
[26,] -6.84146795 -4.88362816
[27,] 2.05177406 -6.84146795
[28,] -4.69656914 2.05177406
[29,] -6.79735498 -4.69656914
[30,] -4.85794352 -6.79735498
[31,] -1.29029257 -4.85794352
[32,] -5.21392074 -1.29029257
[33,] -0.08392243 -5.21392074
[34,] -5.95206495 -0.08392243
[35,] -0.51402108 -5.95206495
[36,] -2.43107503 -0.51402108
[37,] -14.92333728 -2.43107503
[38,] 1.19235583 -14.92333728
[39,] -3.22421670 1.19235583
[40,] -2.77058684 -3.22421670
[41,] 1.88059192 -2.77058684
[42,] 3.95971250 1.88059192
[43,] -5.17166695 3.95971250
[44,] 8.44392920 -5.17166695
[45,] 2.91117876 8.44392920
[46,] -6.22313998 2.91117876
[47,] 2.96098315 -6.22313998
[48,] -9.61881955 2.96098315
[49,] -0.99195445 -9.61881955
[50,] -3.23116861 -0.99195445
[51,] -9.15215514 -3.23116861
[52,] 0.32598569 -9.15215514
[53,] -3.78411297 0.32598569
[54,] -4.64175883 -3.78411297
[55,] -9.97803709 -4.64175883
[56,] -3.34822932 -9.97803709
[57,] -6.01823101 -3.34822932
[58,] 4.81755567 -6.01823101
[59,] 2.84382886 4.81755567
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 8.58744687 5.93802694
2 9.95508765 8.58744687
3 5.40616268 9.95508765
4 12.05098145 5.40616268
5 8.43352613 12.05098145
6 2.03028580 8.43352613
7 14.22539038 2.03028580
8 -0.03304809 14.22539038
9 -8.97853882 -0.03304809
10 5.54892159 -8.97853882
11 -5.86745702 5.54892159
12 6.95225548 -5.86745702
13 12.21147303 6.95225548
14 -1.07480692 12.21147303
15 4.91843509 -1.07480692
16 -4.90981116 4.91843509
17 0.26734990 -4.90981116
18 3.50970404 0.26734990
19 2.21460623 3.50970404
20 0.15126895 2.21460623
21 12.16951350 0.15126895
22 1.80872766 12.16951350
23 0.57666610 1.80872766
24 -0.84038784 0.57666610
25 -4.88362816 -0.84038784
26 -6.84146795 -4.88362816
27 2.05177406 -6.84146795
28 -4.69656914 2.05177406
29 -6.79735498 -4.69656914
30 -4.85794352 -6.79735498
31 -1.29029257 -4.85794352
32 -5.21392074 -1.29029257
33 -0.08392243 -5.21392074
34 -5.95206495 -0.08392243
35 -0.51402108 -5.95206495
36 -2.43107503 -0.51402108
37 -14.92333728 -2.43107503
38 1.19235583 -14.92333728
39 -3.22421670 1.19235583
40 -2.77058684 -3.22421670
41 1.88059192 -2.77058684
42 3.95971250 1.88059192
43 -5.17166695 3.95971250
44 8.44392920 -5.17166695
45 2.91117876 8.44392920
46 -6.22313998 2.91117876
47 2.96098315 -6.22313998
48 -9.61881955 2.96098315
49 -0.99195445 -9.61881955
50 -3.23116861 -0.99195445
51 -9.15215514 -3.23116861
52 0.32598569 -9.15215514
53 -3.78411297 0.32598569
54 -4.64175883 -3.78411297
55 -9.97803709 -4.64175883
56 -3.34822932 -9.97803709
57 -6.01823101 -3.34822932
58 4.81755567 -6.01823101
59 2.84382886 4.81755567
> 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/7rbdj1195129173.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/84bhs1195129174.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/9c6xr1195129174.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
> 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/10figi1195129174.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/115alw1195129174.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/12rf1m1195129174.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/1316c31195129174.tab")
>
> system("convert tmp/1k1bl1195129173.ps tmp/1k1bl1195129173.png")
> system("convert tmp/2ufig1195129173.ps tmp/2ufig1195129173.png")
> system("convert tmp/33a9j1195129173.ps tmp/33a9j1195129173.png")
> system("convert tmp/4v4z91195129173.ps tmp/4v4z91195129173.png")
> system("convert tmp/5hbds1195129173.ps tmp/5hbds1195129173.png")
> system("convert tmp/6z3fx1195129173.ps tmp/6z3fx1195129173.png")
> system("convert tmp/7rbdj1195129173.ps tmp/7rbdj1195129173.png")
> system("convert tmp/84bhs1195129174.ps tmp/84bhs1195129174.png")
> system("convert tmp/9c6xr1195129174.ps tmp/9c6xr1195129174.png")
>
>
> proc.time()
user system elapsed
2.272 1.465 2.678