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(544.5,0,619.8,0,777.6,0,640.4,0,633.0,0,722.0,0,860.1,0,495.1,0,692.8,0,766.7,0,648.5,0,640.0,0,681.6,0,752.5,0,1031.7,0,685.5,0,887.6,0,655.4,0,944.2,0,626.6,0,1221.8,0,939.6,0,886.6,0,811.3,0,774.7,0,910.6,0,911.6,0,697.7,0,829.8,0,824.3,0,885.6,0,538.9,0,686.0,1,878.7,1,812.7,1,640.4,1,773.9,1,795.9,1,836.3,1,876.1,1,851.7,1,692.4,1,877.3,1,536.8,1,705.9,1,951.0,1,755.7,1,695.5,1,744.8,1,672.1,1,666.6,1,760.8,1,756.0,1,604.4,1,883.9,1,527.9,1,756.2,1,812.9,1,655.6,1,707.6,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 = '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)
> 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 t
1 544.5 0 1 0 0 0 0 0 0 0 0 0 0 1
2 619.8 0 0 1 0 0 0 0 0 0 0 0 0 2
3 777.6 0 0 0 1 0 0 0 0 0 0 0 0 3
4 640.4 0 0 0 0 1 0 0 0 0 0 0 0 4
5 633.0 0 0 0 0 0 1 0 0 0 0 0 0 5
6 722.0 0 0 0 0 0 0 1 0 0 0 0 0 6
7 860.1 0 0 0 0 0 0 0 1 0 0 0 0 7
8 495.1 0 0 0 0 0 0 0 0 1 0 0 0 8
9 692.8 0 0 0 0 0 0 0 0 0 1 0 0 9
10 766.7 0 0 0 0 0 0 0 0 0 0 1 0 10
11 648.5 0 0 0 0 0 0 0 0 0 0 0 1 11
12 640.0 0 0 0 0 0 0 0 0 0 0 0 0 12
13 681.6 0 1 0 0 0 0 0 0 0 0 0 0 13
14 752.5 0 0 1 0 0 0 0 0 0 0 0 0 14
15 1031.7 0 0 0 1 0 0 0 0 0 0 0 0 15
16 685.5 0 0 0 0 1 0 0 0 0 0 0 0 16
17 887.6 0 0 0 0 0 1 0 0 0 0 0 0 17
18 655.4 0 0 0 0 0 0 1 0 0 0 0 0 18
19 944.2 0 0 0 0 0 0 0 1 0 0 0 0 19
20 626.6 0 0 0 0 0 0 0 0 1 0 0 0 20
21 1221.8 0 0 0 0 0 0 0 0 0 1 0 0 21
22 939.6 0 0 0 0 0 0 0 0 0 0 1 0 22
23 886.6 0 0 0 0 0 0 0 0 0 0 0 1 23
24 811.3 0 0 0 0 0 0 0 0 0 0 0 0 24
25 774.7 0 1 0 0 0 0 0 0 0 0 0 0 25
26 910.6 0 0 1 0 0 0 0 0 0 0 0 0 26
27 911.6 0 0 0 1 0 0 0 0 0 0 0 0 27
28 697.7 0 0 0 0 1 0 0 0 0 0 0 0 28
29 829.8 0 0 0 0 0 1 0 0 0 0 0 0 29
30 824.3 0 0 0 0 0 0 1 0 0 0 0 0 30
31 885.6 0 0 0 0 0 0 0 1 0 0 0 0 31
32 538.9 0 0 0 0 0 0 0 0 1 0 0 0 32
33 686.0 1 0 0 0 0 0 0 0 0 1 0 0 33
34 878.7 1 0 0 0 0 0 0 0 0 0 1 0 34
35 812.7 1 0 0 0 0 0 0 0 0 0 0 1 35
36 640.4 1 0 0 0 0 0 0 0 0 0 0 0 36
37 773.9 1 1 0 0 0 0 0 0 0 0 0 0 37
38 795.9 1 0 1 0 0 0 0 0 0 0 0 0 38
39 836.3 1 0 0 1 0 0 0 0 0 0 0 0 39
40 876.1 1 0 0 0 1 0 0 0 0 0 0 0 40
41 851.7 1 0 0 0 0 1 0 0 0 0 0 0 41
42 692.4 1 0 0 0 0 0 1 0 0 0 0 0 42
43 877.3 1 0 0 0 0 0 0 1 0 0 0 0 43
44 536.8 1 0 0 0 0 0 0 0 1 0 0 0 44
45 705.9 1 0 0 0 0 0 0 0 0 1 0 0 45
46 951.0 1 0 0 0 0 0 0 0 0 0 1 0 46
47 755.7 1 0 0 0 0 0 0 0 0 0 0 1 47
48 695.5 1 0 0 0 0 0 0 0 0 0 0 0 48
49 744.8 1 1 0 0 0 0 0 0 0 0 0 0 49
50 672.1 1 0 1 0 0 0 0 0 0 0 0 0 50
51 666.6 1 0 0 1 0 0 0 0 0 0 0 0 51
52 760.8 1 0 0 0 1 0 0 0 0 0 0 0 52
53 756.0 1 0 0 0 0 1 0 0 0 0 0 0 53
54 604.4 1 0 0 0 0 0 1 0 0 0 0 0 54
55 883.9 1 0 0 0 0 0 0 1 0 0 0 0 55
56 527.9 1 0 0 0 0 0 0 0 1 0 0 0 56
57 756.2 1 0 0 0 0 0 0 0 0 1 0 0 57
58 812.9 1 0 0 0 0 0 0 0 0 0 1 0 58
59 655.6 1 0 0 0 0 0 0 0 0 0 0 1 59
60 707.6 1 0 0 0 0 0 0 0 0 0 0 0 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x M1 M2 M3 M4
653.652 -130.969 16.601 59.440 150.579 34.477
M5 M6 M7 M8 M9 M10
90.556 -4.806 182.273 -166.328 123.904 177.703
M11 t
56.301 3.441
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-182.172 -64.659 -7.472 54.706 371.975
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 653.652 58.005 11.269 7.96e-15 ***
x -130.969 55.815 -2.346 0.0233 *
M1 16.601 67.692 0.245 0.8074
M2 59.440 67.519 0.880 0.3832
M3 150.579 67.384 2.235 0.0303 *
M4 34.477 67.288 0.512 0.6108
M5 90.556 67.230 1.347 0.1846
M6 -4.806 67.211 -0.072 0.9433
M7 182.273 67.230 2.711 0.0094 **
M8 -166.328 67.288 -2.472 0.0172 *
M9 123.904 67.153 1.845 0.0715 .
M10 177.703 67.056 2.650 0.0110 *
M11 56.301 66.998 0.840 0.4051
t 3.441 1.611 2.136 0.0380 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 105.9 on 46 degrees of freedom
Multiple R-Squared: 0.5159, Adjusted R-squared: 0.3791
F-statistic: 3.772 on 13 and 46 DF, p-value: 0.0004100
> postscript(file="/var/www/html/rcomp/tmp/1cug51197028065.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/23pxt1197028065.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/3i2fj1197028065.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/4z2ml1197028065.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/50ef81197028065.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
-129.19444444 -100.17444444 -36.95444444 -61.49444444 -128.41444444
6 7 8 9 10
52.50555556 0.08555556 -19.75444444 -115.72833333 -99.06833333
11 12 13 14 15
-99.30833333 -54.94833333 -33.39111111 -8.77111111 175.84888889
16 17 18 19 20
-57.69111111 84.88888889 -55.39111111 42.88888889 70.44888889
21 22 23 24 25
371.97500000 32.53500000 97.49500000 75.05500000 18.41222222
26 27 28 29 30
108.03222222 14.45222222 -86.78777778 -14.20777778 72.21222222
31 32 33 34 35
-57.00777778 -58.54777778 -74.15222222 61.30777778 113.26777778
36 37 38 39 40
-6.17222222 107.28500000 83.00500000 28.82500000 181.28500000
41 42 43 44 45
97.36500000 29.98500000 24.36500000 29.02500000 -95.54888889
46 47 48 49 50
92.31111111 14.97111111 7.63111111 36.88833333 -82.09166667
51 52 53 54 55
-182.17166667 24.68833333 -39.63166667 -99.31166667 -10.33166667
56 57 58 59 60
-21.17166667 -86.54555556 -87.08555556 -126.42555556 -21.56555556
> postscript(file="/var/www/html/rcomp/tmp/6v16s1197028065.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 -129.19444444 NA
1 -100.17444444 -129.19444444
2 -36.95444444 -100.17444444
3 -61.49444444 -36.95444444
4 -128.41444444 -61.49444444
5 52.50555556 -128.41444444
6 0.08555556 52.50555556
7 -19.75444444 0.08555556
8 -115.72833333 -19.75444444
9 -99.06833333 -115.72833333
10 -99.30833333 -99.06833333
11 -54.94833333 -99.30833333
12 -33.39111111 -54.94833333
13 -8.77111111 -33.39111111
14 175.84888889 -8.77111111
15 -57.69111111 175.84888889
16 84.88888889 -57.69111111
17 -55.39111111 84.88888889
18 42.88888889 -55.39111111
19 70.44888889 42.88888889
20 371.97500000 70.44888889
21 32.53500000 371.97500000
22 97.49500000 32.53500000
23 75.05500000 97.49500000
24 18.41222222 75.05500000
25 108.03222222 18.41222222
26 14.45222222 108.03222222
27 -86.78777778 14.45222222
28 -14.20777778 -86.78777778
29 72.21222222 -14.20777778
30 -57.00777778 72.21222222
31 -58.54777778 -57.00777778
32 -74.15222222 -58.54777778
33 61.30777778 -74.15222222
34 113.26777778 61.30777778
35 -6.17222222 113.26777778
36 107.28500000 -6.17222222
37 83.00500000 107.28500000
38 28.82500000 83.00500000
39 181.28500000 28.82500000
40 97.36500000 181.28500000
41 29.98500000 97.36500000
42 24.36500000 29.98500000
43 29.02500000 24.36500000
44 -95.54888889 29.02500000
45 92.31111111 -95.54888889
46 14.97111111 92.31111111
47 7.63111111 14.97111111
48 36.88833333 7.63111111
49 -82.09166667 36.88833333
50 -182.17166667 -82.09166667
51 24.68833333 -182.17166667
52 -39.63166667 24.68833333
53 -99.31166667 -39.63166667
54 -10.33166667 -99.31166667
55 -21.17166667 -10.33166667
56 -86.54555556 -21.17166667
57 -87.08555556 -86.54555556
58 -126.42555556 -87.08555556
59 -21.56555556 -126.42555556
60 NA -21.56555556
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -100.17444444 -129.19444444
[2,] -36.95444444 -100.17444444
[3,] -61.49444444 -36.95444444
[4,] -128.41444444 -61.49444444
[5,] 52.50555556 -128.41444444
[6,] 0.08555556 52.50555556
[7,] -19.75444444 0.08555556
[8,] -115.72833333 -19.75444444
[9,] -99.06833333 -115.72833333
[10,] -99.30833333 -99.06833333
[11,] -54.94833333 -99.30833333
[12,] -33.39111111 -54.94833333
[13,] -8.77111111 -33.39111111
[14,] 175.84888889 -8.77111111
[15,] -57.69111111 175.84888889
[16,] 84.88888889 -57.69111111
[17,] -55.39111111 84.88888889
[18,] 42.88888889 -55.39111111
[19,] 70.44888889 42.88888889
[20,] 371.97500000 70.44888889
[21,] 32.53500000 371.97500000
[22,] 97.49500000 32.53500000
[23,] 75.05500000 97.49500000
[24,] 18.41222222 75.05500000
[25,] 108.03222222 18.41222222
[26,] 14.45222222 108.03222222
[27,] -86.78777778 14.45222222
[28,] -14.20777778 -86.78777778
[29,] 72.21222222 -14.20777778
[30,] -57.00777778 72.21222222
[31,] -58.54777778 -57.00777778
[32,] -74.15222222 -58.54777778
[33,] 61.30777778 -74.15222222
[34,] 113.26777778 61.30777778
[35,] -6.17222222 113.26777778
[36,] 107.28500000 -6.17222222
[37,] 83.00500000 107.28500000
[38,] 28.82500000 83.00500000
[39,] 181.28500000 28.82500000
[40,] 97.36500000 181.28500000
[41,] 29.98500000 97.36500000
[42,] 24.36500000 29.98500000
[43,] 29.02500000 24.36500000
[44,] -95.54888889 29.02500000
[45,] 92.31111111 -95.54888889
[46,] 14.97111111 92.31111111
[47,] 7.63111111 14.97111111
[48,] 36.88833333 7.63111111
[49,] -82.09166667 36.88833333
[50,] -182.17166667 -82.09166667
[51,] 24.68833333 -182.17166667
[52,] -39.63166667 24.68833333
[53,] -99.31166667 -39.63166667
[54,] -10.33166667 -99.31166667
[55,] -21.17166667 -10.33166667
[56,] -86.54555556 -21.17166667
[57,] -87.08555556 -86.54555556
[58,] -126.42555556 -87.08555556
[59,] -21.56555556 -126.42555556
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -100.17444444 -129.19444444
2 -36.95444444 -100.17444444
3 -61.49444444 -36.95444444
4 -128.41444444 -61.49444444
5 52.50555556 -128.41444444
6 0.08555556 52.50555556
7 -19.75444444 0.08555556
8 -115.72833333 -19.75444444
9 -99.06833333 -115.72833333
10 -99.30833333 -99.06833333
11 -54.94833333 -99.30833333
12 -33.39111111 -54.94833333
13 -8.77111111 -33.39111111
14 175.84888889 -8.77111111
15 -57.69111111 175.84888889
16 84.88888889 -57.69111111
17 -55.39111111 84.88888889
18 42.88888889 -55.39111111
19 70.44888889 42.88888889
20 371.97500000 70.44888889
21 32.53500000 371.97500000
22 97.49500000 32.53500000
23 75.05500000 97.49500000
24 18.41222222 75.05500000
25 108.03222222 18.41222222
26 14.45222222 108.03222222
27 -86.78777778 14.45222222
28 -14.20777778 -86.78777778
29 72.21222222 -14.20777778
30 -57.00777778 72.21222222
31 -58.54777778 -57.00777778
32 -74.15222222 -58.54777778
33 61.30777778 -74.15222222
34 113.26777778 61.30777778
35 -6.17222222 113.26777778
36 107.28500000 -6.17222222
37 83.00500000 107.28500000
38 28.82500000 83.00500000
39 181.28500000 28.82500000
40 97.36500000 181.28500000
41 29.98500000 97.36500000
42 24.36500000 29.98500000
43 29.02500000 24.36500000
44 -95.54888889 29.02500000
45 92.31111111 -95.54888889
46 14.97111111 92.31111111
47 7.63111111 14.97111111
48 36.88833333 7.63111111
49 -82.09166667 36.88833333
50 -182.17166667 -82.09166667
51 24.68833333 -182.17166667
52 -39.63166667 24.68833333
53 -99.31166667 -39.63166667
54 -10.33166667 -99.31166667
55 -21.17166667 -10.33166667
56 -86.54555556 -21.17166667
57 -87.08555556 -86.54555556
58 -126.42555556 -87.08555556
59 -21.56555556 -126.42555556
> 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/7sznv1197028066.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/855tq1197028066.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/9d0yx1197028066.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/10xvr71197028066.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/11g15t1197028066.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/12dly81197028066.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/138a1w1197028066.tab")
>
> system("convert tmp/1cug51197028065.ps tmp/1cug51197028065.png")
> system("convert tmp/23pxt1197028065.ps tmp/23pxt1197028065.png")
> system("convert tmp/3i2fj1197028065.ps tmp/3i2fj1197028065.png")
> system("convert tmp/4z2ml1197028065.ps tmp/4z2ml1197028065.png")
> system("convert tmp/50ef81197028065.ps tmp/50ef81197028065.png")
> system("convert tmp/6v16s1197028065.ps tmp/6v16s1197028065.png")
> system("convert tmp/7sznv1197028066.ps tmp/7sznv1197028066.png")
> system("convert tmp/855tq1197028066.ps tmp/855tq1197028066.png")
> system("convert tmp/9d0yx1197028066.ps tmp/9d0yx1197028066.png")
>
>
> proc.time()
user system elapsed
2.269 1.462 2.671