R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(10511,0,10812,0,10738,0,10171,0,9721,0,9897,0,9828,0,9924,0,10371,0,10846,0,10413,0,10709,0,10662,0,10570,0,10297,0,10635,0,10872,0,10296,0,10383,0,10431,0,10574,0,10653,0,10805,0,10872,0,10625,0,10407,0,10463,0,10556,0,10646,0,10702,0,11353,1,11346,1,11451,1,11964,1,12574,1,13031,1,13812,1,14544,1,14931,1,14886,1,16005,1,17064,1,15168,1,16050,1,15839,1,15137,1,14954,1,15648,1,15305,1,15579,1,16348,1,15928,1,16171,1,15937,1,15713,1,15594,1,15683,1,16438,1,17032,1,17696,1,17745,1),dim=c(2,61),dimnames=list(c('y','x'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('y','x'),1:61))
> 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 10511 0 1 0 0 0 0 0 0 0 0 0 0 1
2 10812 0 0 1 0 0 0 0 0 0 0 0 0 2
3 10738 0 0 0 1 0 0 0 0 0 0 0 0 3
4 10171 0 0 0 0 1 0 0 0 0 0 0 0 4
5 9721 0 0 0 0 0 1 0 0 0 0 0 0 5
6 9897 0 0 0 0 0 0 1 0 0 0 0 0 6
7 9828 0 0 0 0 0 0 0 1 0 0 0 0 7
8 9924 0 0 0 0 0 0 0 0 1 0 0 0 8
9 10371 0 0 0 0 0 0 0 0 0 1 0 0 9
10 10846 0 0 0 0 0 0 0 0 0 0 1 0 10
11 10413 0 0 0 0 0 0 0 0 0 0 0 1 11
12 10709 0 0 0 0 0 0 0 0 0 0 0 0 12
13 10662 0 1 0 0 0 0 0 0 0 0 0 0 13
14 10570 0 0 1 0 0 0 0 0 0 0 0 0 14
15 10297 0 0 0 1 0 0 0 0 0 0 0 0 15
16 10635 0 0 0 0 1 0 0 0 0 0 0 0 16
17 10872 0 0 0 0 0 1 0 0 0 0 0 0 17
18 10296 0 0 0 0 0 0 1 0 0 0 0 0 18
19 10383 0 0 0 0 0 0 0 1 0 0 0 0 19
20 10431 0 0 0 0 0 0 0 0 1 0 0 0 20
21 10574 0 0 0 0 0 0 0 0 0 1 0 0 21
22 10653 0 0 0 0 0 0 0 0 0 0 1 0 22
23 10805 0 0 0 0 0 0 0 0 0 0 0 1 23
24 10872 0 0 0 0 0 0 0 0 0 0 0 0 24
25 10625 0 1 0 0 0 0 0 0 0 0 0 0 25
26 10407 0 0 1 0 0 0 0 0 0 0 0 0 26
27 10463 0 0 0 1 0 0 0 0 0 0 0 0 27
28 10556 0 0 0 0 1 0 0 0 0 0 0 0 28
29 10646 0 0 0 0 0 1 0 0 0 0 0 0 29
30 10702 0 0 0 0 0 0 1 0 0 0 0 0 30
31 11353 1 0 0 0 0 0 0 1 0 0 0 0 31
32 11346 1 0 0 0 0 0 0 0 1 0 0 0 32
33 11451 1 0 0 0 0 0 0 0 0 1 0 0 33
34 11964 1 0 0 0 0 0 0 0 0 0 1 0 34
35 12574 1 0 0 0 0 0 0 0 0 0 0 1 35
36 13031 1 0 0 0 0 0 0 0 0 0 0 0 36
37 13812 1 1 0 0 0 0 0 0 0 0 0 0 37
38 14544 1 0 1 0 0 0 0 0 0 0 0 0 38
39 14931 1 0 0 1 0 0 0 0 0 0 0 0 39
40 14886 1 0 0 0 1 0 0 0 0 0 0 0 40
41 16005 1 0 0 0 0 1 0 0 0 0 0 0 41
42 17064 1 0 0 0 0 0 1 0 0 0 0 0 42
43 15168 1 0 0 0 0 0 0 1 0 0 0 0 43
44 16050 1 0 0 0 0 0 0 0 1 0 0 0 44
45 15839 1 0 0 0 0 0 0 0 0 1 0 0 45
46 15137 1 0 0 0 0 0 0 0 0 0 1 0 46
47 14954 1 0 0 0 0 0 0 0 0 0 0 1 47
48 15648 1 0 0 0 0 0 0 0 0 0 0 0 48
49 15305 1 1 0 0 0 0 0 0 0 0 0 0 49
50 15579 1 0 1 0 0 0 0 0 0 0 0 0 50
51 16348 1 0 0 1 0 0 0 0 0 0 0 0 51
52 15928 1 0 0 0 1 0 0 0 0 0 0 0 52
53 16171 1 0 0 0 0 1 0 0 0 0 0 0 53
54 15937 1 0 0 0 0 0 1 0 0 0 0 0 54
55 15713 1 0 0 0 0 0 0 1 0 0 0 0 55
56 15594 1 0 0 0 0 0 0 0 1 0 0 0 56
57 15683 1 0 0 0 0 0 0 0 0 1 0 0 57
58 16438 1 0 0 0 0 0 0 0 0 0 1 0 58
59 17032 1 0 0 0 0 0 0 0 0 0 0 1 59
60 17696 1 0 0 0 0 0 0 0 0 0 0 0 60
61 17745 1 1 0 0 0 0 0 0 0 0 0 0 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x M1 M2 M3 M4
9200.60 1938.21 160.91 75.42 158.76 -51.10
M5 M6 M7 M8 M9 M10
107.05 113.59 -653.91 -563.57 -538.63 -404.28
M11 t
-345.94 89.66
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2107.88 -407.23 44.87 572.11 2045.98
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9200.60 567.15 16.223 < 2e-16 ***
x 1938.21 547.53 3.540 0.000914 ***
M1 160.91 636.50 0.253 0.801523
M2 75.42 668.40 0.113 0.910643
M3 158.76 667.19 0.238 0.812951
M4 -51.10 666.33 -0.077 0.939200
M5 107.05 665.84 0.161 0.872965
M6 113.59 665.70 0.171 0.865248
M7 -653.91 667.95 -0.979 0.332603
M8 -563.57 666.33 -0.846 0.401963
M9 -538.63 665.07 -0.810 0.422092
M10 -404.28 664.17 -0.609 0.545649
M11 -345.94 663.63 -0.521 0.604612
t 89.66 15.49 5.787 5.65e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1049 on 47 degrees of freedom
Multiple R-squared: 0.8763, Adjusted R-squared: 0.842
F-statistic: 25.6 on 13 and 47 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/freestat/rcomp/tmp/1qygo1228125639.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/freestat/rcomp/tmp/2e6171228125639.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/freestat/rcomp/tmp/3ti3l1228125639.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/freestat/rcomp/tmp/4erai1228125639.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/freestat/rcomp/tmp/5nh6y1228125639.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 = 61
Frequency = 1
1 2 3 4 5
1059.8333333 1356.6666667 1109.6666667 662.8666667 -34.9333333
6 7 8 9 10
44.8666667 653.7083333 569.7083333 902.1083333 1153.1083333
11 12 13 14 15
572.1083333 432.5083333 134.9416667 38.7750000 -407.2250000
16 17 18 19 20
50.9750000 40.1750000 -632.0250000 132.8166667 0.8166667
21 22 23 24 25
29.2166667 -115.7833333 -111.7833333 -480.3833333 -977.9500000
26 27 28 29 30
-1200.1166667 -1317.1166667 -1103.9166667 -1261.7166667 -1301.9166667
31 32 33 34 35
-1911.2833333 -2098.2833333 -2107.8833333 -1818.8833333 -1356.8833333
36 37 38 39 40
-1335.4833333 -805.0500000 -77.2166667 136.7833333 211.9833333
41 42 43 44 45
1083.1833333 2045.9833333 827.8250000 1529.8250000 1204.2250000
46 47 48 49 50
278.2250000 -52.7750000 205.6250000 -387.9416667 -118.1083333
51 52 53 54 55
477.8916667 178.0916667 173.2916667 -156.9083333 296.9333333
56 57 58 59 60
-2.0666667 -27.6666667 503.3333333 949.3333333 1177.7333333
61
976.1666667
> postscript(file="/var/www/html/freestat/rcomp/tmp/633ra1228125639.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 1059.8333333 NA
1 1356.6666667 1059.8333333
2 1109.6666667 1356.6666667
3 662.8666667 1109.6666667
4 -34.9333333 662.8666667
5 44.8666667 -34.9333333
6 653.7083333 44.8666667
7 569.7083333 653.7083333
8 902.1083333 569.7083333
9 1153.1083333 902.1083333
10 572.1083333 1153.1083333
11 432.5083333 572.1083333
12 134.9416667 432.5083333
13 38.7750000 134.9416667
14 -407.2250000 38.7750000
15 50.9750000 -407.2250000
16 40.1750000 50.9750000
17 -632.0250000 40.1750000
18 132.8166667 -632.0250000
19 0.8166667 132.8166667
20 29.2166667 0.8166667
21 -115.7833333 29.2166667
22 -111.7833333 -115.7833333
23 -480.3833333 -111.7833333
24 -977.9500000 -480.3833333
25 -1200.1166667 -977.9500000
26 -1317.1166667 -1200.1166667
27 -1103.9166667 -1317.1166667
28 -1261.7166667 -1103.9166667
29 -1301.9166667 -1261.7166667
30 -1911.2833333 -1301.9166667
31 -2098.2833333 -1911.2833333
32 -2107.8833333 -2098.2833333
33 -1818.8833333 -2107.8833333
34 -1356.8833333 -1818.8833333
35 -1335.4833333 -1356.8833333
36 -805.0500000 -1335.4833333
37 -77.2166667 -805.0500000
38 136.7833333 -77.2166667
39 211.9833333 136.7833333
40 1083.1833333 211.9833333
41 2045.9833333 1083.1833333
42 827.8250000 2045.9833333
43 1529.8250000 827.8250000
44 1204.2250000 1529.8250000
45 278.2250000 1204.2250000
46 -52.7750000 278.2250000
47 205.6250000 -52.7750000
48 -387.9416667 205.6250000
49 -118.1083333 -387.9416667
50 477.8916667 -118.1083333
51 178.0916667 477.8916667
52 173.2916667 178.0916667
53 -156.9083333 173.2916667
54 296.9333333 -156.9083333
55 -2.0666667 296.9333333
56 -27.6666667 -2.0666667
57 503.3333333 -27.6666667
58 949.3333333 503.3333333
59 1177.7333333 949.3333333
60 976.1666667 1177.7333333
61 NA 976.1666667
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1356.6666667 1059.8333333
[2,] 1109.6666667 1356.6666667
[3,] 662.8666667 1109.6666667
[4,] -34.9333333 662.8666667
[5,] 44.8666667 -34.9333333
[6,] 653.7083333 44.8666667
[7,] 569.7083333 653.7083333
[8,] 902.1083333 569.7083333
[9,] 1153.1083333 902.1083333
[10,] 572.1083333 1153.1083333
[11,] 432.5083333 572.1083333
[12,] 134.9416667 432.5083333
[13,] 38.7750000 134.9416667
[14,] -407.2250000 38.7750000
[15,] 50.9750000 -407.2250000
[16,] 40.1750000 50.9750000
[17,] -632.0250000 40.1750000
[18,] 132.8166667 -632.0250000
[19,] 0.8166667 132.8166667
[20,] 29.2166667 0.8166667
[21,] -115.7833333 29.2166667
[22,] -111.7833333 -115.7833333
[23,] -480.3833333 -111.7833333
[24,] -977.9500000 -480.3833333
[25,] -1200.1166667 -977.9500000
[26,] -1317.1166667 -1200.1166667
[27,] -1103.9166667 -1317.1166667
[28,] -1261.7166667 -1103.9166667
[29,] -1301.9166667 -1261.7166667
[30,] -1911.2833333 -1301.9166667
[31,] -2098.2833333 -1911.2833333
[32,] -2107.8833333 -2098.2833333
[33,] -1818.8833333 -2107.8833333
[34,] -1356.8833333 -1818.8833333
[35,] -1335.4833333 -1356.8833333
[36,] -805.0500000 -1335.4833333
[37,] -77.2166667 -805.0500000
[38,] 136.7833333 -77.2166667
[39,] 211.9833333 136.7833333
[40,] 1083.1833333 211.9833333
[41,] 2045.9833333 1083.1833333
[42,] 827.8250000 2045.9833333
[43,] 1529.8250000 827.8250000
[44,] 1204.2250000 1529.8250000
[45,] 278.2250000 1204.2250000
[46,] -52.7750000 278.2250000
[47,] 205.6250000 -52.7750000
[48,] -387.9416667 205.6250000
[49,] -118.1083333 -387.9416667
[50,] 477.8916667 -118.1083333
[51,] 178.0916667 477.8916667
[52,] 173.2916667 178.0916667
[53,] -156.9083333 173.2916667
[54,] 296.9333333 -156.9083333
[55,] -2.0666667 296.9333333
[56,] -27.6666667 -2.0666667
[57,] 503.3333333 -27.6666667
[58,] 949.3333333 503.3333333
[59,] 1177.7333333 949.3333333
[60,] 976.1666667 1177.7333333
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1356.6666667 1059.8333333
2 1109.6666667 1356.6666667
3 662.8666667 1109.6666667
4 -34.9333333 662.8666667
5 44.8666667 -34.9333333
6 653.7083333 44.8666667
7 569.7083333 653.7083333
8 902.1083333 569.7083333
9 1153.1083333 902.1083333
10 572.1083333 1153.1083333
11 432.5083333 572.1083333
12 134.9416667 432.5083333
13 38.7750000 134.9416667
14 -407.2250000 38.7750000
15 50.9750000 -407.2250000
16 40.1750000 50.9750000
17 -632.0250000 40.1750000
18 132.8166667 -632.0250000
19 0.8166667 132.8166667
20 29.2166667 0.8166667
21 -115.7833333 29.2166667
22 -111.7833333 -115.7833333
23 -480.3833333 -111.7833333
24 -977.9500000 -480.3833333
25 -1200.1166667 -977.9500000
26 -1317.1166667 -1200.1166667
27 -1103.9166667 -1317.1166667
28 -1261.7166667 -1103.9166667
29 -1301.9166667 -1261.7166667
30 -1911.2833333 -1301.9166667
31 -2098.2833333 -1911.2833333
32 -2107.8833333 -2098.2833333
33 -1818.8833333 -2107.8833333
34 -1356.8833333 -1818.8833333
35 -1335.4833333 -1356.8833333
36 -805.0500000 -1335.4833333
37 -77.2166667 -805.0500000
38 136.7833333 -77.2166667
39 211.9833333 136.7833333
40 1083.1833333 211.9833333
41 2045.9833333 1083.1833333
42 827.8250000 2045.9833333
43 1529.8250000 827.8250000
44 1204.2250000 1529.8250000
45 278.2250000 1204.2250000
46 -52.7750000 278.2250000
47 205.6250000 -52.7750000
48 -387.9416667 205.6250000
49 -118.1083333 -387.9416667
50 477.8916667 -118.1083333
51 178.0916667 477.8916667
52 173.2916667 178.0916667
53 -156.9083333 173.2916667
54 296.9333333 -156.9083333
55 -2.0666667 296.9333333
56 -27.6666667 -2.0666667
57 503.3333333 -27.6666667
58 949.3333333 503.3333333
59 1177.7333333 949.3333333
60 976.1666667 1177.7333333
> 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/freestat/rcomp/tmp/7w7ke1228125639.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/freestat/rcomp/tmp/88i1f1228125639.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/freestat/rcomp/tmp/9noft1228125639.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
>
> #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/10b7321228125639.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/freestat/rcomp/tmp/11jv4h1228125639.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/freestat/rcomp/tmp/12mkag1228125639.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/freestat/rcomp/tmp/13z7ju1228125639.tab")
>
> system("convert tmp/1qygo1228125639.ps tmp/1qygo1228125639.png")
> system("convert tmp/2e6171228125639.ps tmp/2e6171228125639.png")
> system("convert tmp/3ti3l1228125639.ps tmp/3ti3l1228125639.png")
> system("convert tmp/4erai1228125639.ps tmp/4erai1228125639.png")
> system("convert tmp/5nh6y1228125639.ps tmp/5nh6y1228125639.png")
> system("convert tmp/633ra1228125639.ps tmp/633ra1228125639.png")
> system("convert tmp/7w7ke1228125639.ps tmp/7w7ke1228125639.png")
> system("convert tmp/88i1f1228125639.ps tmp/88i1f1228125639.png")
> system("convert tmp/9noft1228125639.ps tmp/9noft1228125639.png")
>
>
> proc.time()
user system elapsed
2.964 2.202 3.372