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(5.014,0,6.153,0,6.441,0,5.584,0,6.427,0,6.062,0,5.589,0,6.216,0,5.809,0,4.989,0,6.706,0,7.174,0,6.122,0,8.075,0,6.292,0,6.337,0,8.576,0,6.077,0,5.931,0,6.288,0,7.167,0,6.054,0,6.468,0,6.401,0,6.927,0,7.914,0,7.728,0,8.699,0,8.522,0,6.481,0,7.502,0,7.778,0,7.424,0,6.941,0,8.574,0,9.169,0,7.701,0,9.035,0,7.158,0,8.195,0,8.124,1,7.073,1,7.017,1,7.390,1,7.776,1,6.197,1,6.889,1,7.087,1,6.485,1,7.654,1,6.501,1,6.313,1,7.826,1,6.589,1,6.729,1,5.684,1,8.105,1,6.391,1,5.901,1,6.758,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)
> 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 5.014 0 1 0 0 0 0 0 0 0 0 0 0
2 6.153 0 0 1 0 0 0 0 0 0 0 0 0
3 6.441 0 0 0 1 0 0 0 0 0 0 0 0
4 5.584 0 0 0 0 1 0 0 0 0 0 0 0
5 6.427 0 0 0 0 0 1 0 0 0 0 0 0
6 6.062 0 0 0 0 0 0 1 0 0 0 0 0
7 5.589 0 0 0 0 0 0 0 1 0 0 0 0
8 6.216 0 0 0 0 0 0 0 0 1 0 0 0
9 5.809 0 0 0 0 0 0 0 0 0 1 0 0
10 4.989 0 0 0 0 0 0 0 0 0 0 1 0
11 6.706 0 0 0 0 0 0 0 0 0 0 0 1
12 7.174 0 0 0 0 0 0 0 0 0 0 0 0
13 6.122 0 1 0 0 0 0 0 0 0 0 0 0
14 8.075 0 0 1 0 0 0 0 0 0 0 0 0
15 6.292 0 0 0 1 0 0 0 0 0 0 0 0
16 6.337 0 0 0 0 1 0 0 0 0 0 0 0
17 8.576 0 0 0 0 0 1 0 0 0 0 0 0
18 6.077 0 0 0 0 0 0 1 0 0 0 0 0
19 5.931 0 0 0 0 0 0 0 1 0 0 0 0
20 6.288 0 0 0 0 0 0 0 0 1 0 0 0
21 7.167 0 0 0 0 0 0 0 0 0 1 0 0
22 6.054 0 0 0 0 0 0 0 0 0 0 1 0
23 6.468 0 0 0 0 0 0 0 0 0 0 0 1
24 6.401 0 0 0 0 0 0 0 0 0 0 0 0
25 6.927 0 1 0 0 0 0 0 0 0 0 0 0
26 7.914 0 0 1 0 0 0 0 0 0 0 0 0
27 7.728 0 0 0 1 0 0 0 0 0 0 0 0
28 8.699 0 0 0 0 1 0 0 0 0 0 0 0
29 8.522 0 0 0 0 0 1 0 0 0 0 0 0
30 6.481 0 0 0 0 0 0 1 0 0 0 0 0
31 7.502 0 0 0 0 0 0 0 1 0 0 0 0
32 7.778 0 0 0 0 0 0 0 0 1 0 0 0
33 7.424 0 0 0 0 0 0 0 0 0 1 0 0
34 6.941 0 0 0 0 0 0 0 0 0 0 1 0
35 8.574 0 0 0 0 0 0 0 0 0 0 0 1
36 9.169 0 0 0 0 0 0 0 0 0 0 0 0
37 7.701 0 1 0 0 0 0 0 0 0 0 0 0
38 9.035 0 0 1 0 0 0 0 0 0 0 0 0
39 7.158 0 0 0 1 0 0 0 0 0 0 0 0
40 8.195 0 0 0 0 1 0 0 0 0 0 0 0
41 8.124 1 0 0 0 0 1 0 0 0 0 0 0
42 7.073 1 0 0 0 0 0 1 0 0 0 0 0
43 7.017 1 0 0 0 0 0 0 1 0 0 0 0
44 7.390 1 0 0 0 0 0 0 0 1 0 0 0
45 7.776 1 0 0 0 0 0 0 0 0 1 0 0
46 6.197 1 0 0 0 0 0 0 0 0 0 1 0
47 6.889 1 0 0 0 0 0 0 0 0 0 0 1
48 7.087 1 0 0 0 0 0 0 0 0 0 0 0
49 6.485 1 1 0 0 0 0 0 0 0 0 0 0
50 7.654 1 0 1 0 0 0 0 0 0 0 0 0
51 6.501 1 0 0 1 0 0 0 0 0 0 0 0
52 6.313 1 0 0 0 1 0 0 0 0 0 0 0
53 7.826 1 0 0 0 0 1 0 0 0 0 0 0
54 6.589 1 0 0 0 0 0 1 0 0 0 0 0
55 6.729 1 0 0 0 0 0 0 1 0 0 0 0
56 5.684 1 0 0 0 0 0 0 0 1 0 0 0
57 8.105 1 0 0 0 0 0 0 0 0 1 0 0
58 6.391 1 0 0 0 0 0 0 0 0 0 1 0
59 5.901 1 0 0 0 0 0 0 0 0 0 0 1
60 6.758 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.315331 0.006172 -0.866766 0.449634 -0.492566 -0.290966
M5 M6 M7 M8 M9 M10
0.577200 -0.861400 -0.764200 -0.646600 -0.061600 -1.203400
M11
-0.410200
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.61197 -0.47224 -0.04012 0.54030 1.85367
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.315331 0.425973 17.173 <2e-16 ***
x 0.006172 0.258284 0.024 0.9810
M1 -0.866766 0.586709 -1.477 0.1463
M2 0.449634 0.586709 0.766 0.4473
M3 -0.492566 0.586709 -0.840 0.4054
M4 -0.290966 0.586709 -0.496 0.6223
M5 0.577200 0.584431 0.988 0.3284
M6 -0.861400 0.584431 -1.474 0.1472
M7 -0.764200 0.584431 -1.308 0.1974
M8 -0.646600 0.584431 -1.106 0.2742
M9 -0.061600 0.584431 -0.105 0.9165
M10 -1.203400 0.584431 -2.059 0.0450 *
M11 -0.410200 0.584431 -0.702 0.4862
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9241 on 47 degrees of freedom
Multiple R-squared: 0.2874, Adjusted R-squared: 0.1054
F-statistic: 1.579 on 12 and 47 DF, p-value: 0.1307
> postscript(file="/var/www/html/rcomp/tmp/17n7v1228996745.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/2nvtn1228996745.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/3lu0c1228996745.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/4ucdg1228996745.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/5ksvz1228996745.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
-1.43456563 -1.61196563 -0.38176563 -1.44036563 -1.46553125 -0.39193125
7 8 9 10 11 12
-0.96213125 -0.45273125 -1.44473125 -1.12293125 -0.19913125 -0.14133125
13 14 15 16 17 18
-0.32656562 0.31003437 -0.53076563 -0.68736563 0.68346875 -0.37693125
19 20 21 22 23 24
-0.62013125 -0.38073125 -0.08673125 -0.05793125 -0.43713125 -0.91433125
25 26 27 28 29 30
0.47843438 0.14903437 0.90523438 1.67463438 0.62946875 0.02706875
31 32 33 34 35 36
0.95086875 1.10926875 0.17026875 0.82906875 1.66886875 1.85366875
37 38 39 40 41 42
1.25243438 1.27003438 0.33523438 1.17063437 0.22529688 0.61289688
43 44 45 46 47 48
0.45969688 0.71509688 0.51609687 0.07889687 -0.02230312 -0.23450312
49 50 51 52 53 54
0.03026250 -0.11713750 -0.32793750 -0.71753750 -0.07270313 0.12889688
55 56 57 58 59 60
0.17169687 -0.99090312 0.84509688 0.27289687 -1.01030313 -0.56350312
> postscript(file="/var/www/html/rcomp/tmp/6t43k1228996745.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 -1.43456563 NA
1 -1.61196563 -1.43456563
2 -0.38176563 -1.61196563
3 -1.44036563 -0.38176563
4 -1.46553125 -1.44036563
5 -0.39193125 -1.46553125
6 -0.96213125 -0.39193125
7 -0.45273125 -0.96213125
8 -1.44473125 -0.45273125
9 -1.12293125 -1.44473125
10 -0.19913125 -1.12293125
11 -0.14133125 -0.19913125
12 -0.32656562 -0.14133125
13 0.31003437 -0.32656562
14 -0.53076563 0.31003437
15 -0.68736563 -0.53076563
16 0.68346875 -0.68736563
17 -0.37693125 0.68346875
18 -0.62013125 -0.37693125
19 -0.38073125 -0.62013125
20 -0.08673125 -0.38073125
21 -0.05793125 -0.08673125
22 -0.43713125 -0.05793125
23 -0.91433125 -0.43713125
24 0.47843438 -0.91433125
25 0.14903437 0.47843438
26 0.90523438 0.14903437
27 1.67463438 0.90523438
28 0.62946875 1.67463438
29 0.02706875 0.62946875
30 0.95086875 0.02706875
31 1.10926875 0.95086875
32 0.17026875 1.10926875
33 0.82906875 0.17026875
34 1.66886875 0.82906875
35 1.85366875 1.66886875
36 1.25243438 1.85366875
37 1.27003438 1.25243438
38 0.33523438 1.27003438
39 1.17063437 0.33523438
40 0.22529688 1.17063437
41 0.61289688 0.22529688
42 0.45969688 0.61289688
43 0.71509688 0.45969688
44 0.51609687 0.71509688
45 0.07889687 0.51609687
46 -0.02230312 0.07889687
47 -0.23450312 -0.02230312
48 0.03026250 -0.23450312
49 -0.11713750 0.03026250
50 -0.32793750 -0.11713750
51 -0.71753750 -0.32793750
52 -0.07270313 -0.71753750
53 0.12889688 -0.07270313
54 0.17169687 0.12889688
55 -0.99090312 0.17169687
56 0.84509688 -0.99090312
57 0.27289687 0.84509688
58 -1.01030313 0.27289687
59 -0.56350312 -1.01030313
60 NA -0.56350312
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.61196563 -1.43456563
[2,] -0.38176563 -1.61196563
[3,] -1.44036563 -0.38176563
[4,] -1.46553125 -1.44036563
[5,] -0.39193125 -1.46553125
[6,] -0.96213125 -0.39193125
[7,] -0.45273125 -0.96213125
[8,] -1.44473125 -0.45273125
[9,] -1.12293125 -1.44473125
[10,] -0.19913125 -1.12293125
[11,] -0.14133125 -0.19913125
[12,] -0.32656562 -0.14133125
[13,] 0.31003437 -0.32656562
[14,] -0.53076563 0.31003437
[15,] -0.68736563 -0.53076563
[16,] 0.68346875 -0.68736563
[17,] -0.37693125 0.68346875
[18,] -0.62013125 -0.37693125
[19,] -0.38073125 -0.62013125
[20,] -0.08673125 -0.38073125
[21,] -0.05793125 -0.08673125
[22,] -0.43713125 -0.05793125
[23,] -0.91433125 -0.43713125
[24,] 0.47843438 -0.91433125
[25,] 0.14903437 0.47843438
[26,] 0.90523438 0.14903437
[27,] 1.67463438 0.90523438
[28,] 0.62946875 1.67463438
[29,] 0.02706875 0.62946875
[30,] 0.95086875 0.02706875
[31,] 1.10926875 0.95086875
[32,] 0.17026875 1.10926875
[33,] 0.82906875 0.17026875
[34,] 1.66886875 0.82906875
[35,] 1.85366875 1.66886875
[36,] 1.25243438 1.85366875
[37,] 1.27003438 1.25243438
[38,] 0.33523438 1.27003438
[39,] 1.17063437 0.33523438
[40,] 0.22529688 1.17063437
[41,] 0.61289688 0.22529688
[42,] 0.45969688 0.61289688
[43,] 0.71509688 0.45969688
[44,] 0.51609687 0.71509688
[45,] 0.07889687 0.51609687
[46,] -0.02230312 0.07889687
[47,] -0.23450312 -0.02230312
[48,] 0.03026250 -0.23450312
[49,] -0.11713750 0.03026250
[50,] -0.32793750 -0.11713750
[51,] -0.71753750 -0.32793750
[52,] -0.07270313 -0.71753750
[53,] 0.12889688 -0.07270313
[54,] 0.17169687 0.12889688
[55,] -0.99090312 0.17169687
[56,] 0.84509688 -0.99090312
[57,] 0.27289687 0.84509688
[58,] -1.01030313 0.27289687
[59,] -0.56350312 -1.01030313
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.61196563 -1.43456563
2 -0.38176563 -1.61196563
3 -1.44036563 -0.38176563
4 -1.46553125 -1.44036563
5 -0.39193125 -1.46553125
6 -0.96213125 -0.39193125
7 -0.45273125 -0.96213125
8 -1.44473125 -0.45273125
9 -1.12293125 -1.44473125
10 -0.19913125 -1.12293125
11 -0.14133125 -0.19913125
12 -0.32656562 -0.14133125
13 0.31003437 -0.32656562
14 -0.53076563 0.31003437
15 -0.68736563 -0.53076563
16 0.68346875 -0.68736563
17 -0.37693125 0.68346875
18 -0.62013125 -0.37693125
19 -0.38073125 -0.62013125
20 -0.08673125 -0.38073125
21 -0.05793125 -0.08673125
22 -0.43713125 -0.05793125
23 -0.91433125 -0.43713125
24 0.47843438 -0.91433125
25 0.14903437 0.47843438
26 0.90523438 0.14903437
27 1.67463438 0.90523438
28 0.62946875 1.67463438
29 0.02706875 0.62946875
30 0.95086875 0.02706875
31 1.10926875 0.95086875
32 0.17026875 1.10926875
33 0.82906875 0.17026875
34 1.66886875 0.82906875
35 1.85366875 1.66886875
36 1.25243438 1.85366875
37 1.27003438 1.25243438
38 0.33523438 1.27003438
39 1.17063437 0.33523438
40 0.22529688 1.17063437
41 0.61289688 0.22529688
42 0.45969688 0.61289688
43 0.71509688 0.45969688
44 0.51609687 0.71509688
45 0.07889687 0.51609687
46 -0.02230312 0.07889687
47 -0.23450312 -0.02230312
48 0.03026250 -0.23450312
49 -0.11713750 0.03026250
50 -0.32793750 -0.11713750
51 -0.71753750 -0.32793750
52 -0.07270313 -0.71753750
53 0.12889688 -0.07270313
54 0.17169687 0.12889688
55 -0.99090312 0.17169687
56 0.84509688 -0.99090312
57 0.27289687 0.84509688
58 -1.01030313 0.27289687
59 -0.56350312 -1.01030313
> 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/762hf1228996745.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/8wqrp1228996745.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/9u58g1228996745.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/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/10dfvh1228996745.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/11e8dk1228996746.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/12j19t1228996746.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/130o5d1228996746.tab")
>
> system("convert tmp/17n7v1228996745.ps tmp/17n7v1228996745.png")
> system("convert tmp/2nvtn1228996745.ps tmp/2nvtn1228996745.png")
> system("convert tmp/3lu0c1228996745.ps tmp/3lu0c1228996745.png")
> system("convert tmp/4ucdg1228996745.ps tmp/4ucdg1228996745.png")
> system("convert tmp/5ksvz1228996745.ps tmp/5ksvz1228996745.png")
> system("convert tmp/6t43k1228996745.ps tmp/6t43k1228996745.png")
> system("convert tmp/762hf1228996745.ps tmp/762hf1228996745.png")
> system("convert tmp/8wqrp1228996745.ps tmp/8wqrp1228996745.png")
> system("convert tmp/9u58g1228996745.ps tmp/9u58g1228996745.png")
>
>
> proc.time()
user system elapsed
1.956 1.436 2.545