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(12398.4,0,13882.3,0,15861.5,0,13286.1,0,15634.9,0,14211,0,13646.8,0,12224.6,0,15916.4,0,16535.9,0,15796,0,14418.6,0,15044.5,0,14944.2,0,16754.8,0,14254,0,15454.9,0,15644.8,0,14568.3,0,12520.2,0,14803,0,15873.2,0,14755.3,0,12875.1,0,14291.1,1,14205.3,1,15859.4,1,15258.9,1,15498.6,1,14106.5,1,15023.6,1,12083,1,15761.3,1,16943,1,15070.3,1,13659.6,1,14768.9,1,14725.1,1,15998.1,1,15370.6,1,14956.9,1,15469.7,1,15101.8,1,11703.7,1,16283.6,1,16726.5,1,14968.9,1,14861,1,14583.3,1,15305.8,1,17903.9,1,16379.4,1,15420.3,1,17870.5,1,15912.8,1,13866.5,1,17823.2,1,17872,1,17420.4,1,16704.4,1,15991.2,1,16583.6,1,19123.5,1,17838.7,1,17209.4,1),dim=c(2,65),dimnames=list(c('y','x'),1:65))
> y <- array(NA,dim=c(2,65),dimnames=list(c('y','x'),1:65))
> 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 12398.4 0 1 0 0 0 0 0 0 0 0 0 0
2 13882.3 0 0 1 0 0 0 0 0 0 0 0 0
3 15861.5 0 0 0 1 0 0 0 0 0 0 0 0
4 13286.1 0 0 0 0 1 0 0 0 0 0 0 0
5 15634.9 0 0 0 0 0 1 0 0 0 0 0 0
6 14211.0 0 0 0 0 0 0 1 0 0 0 0 0
7 13646.8 0 0 0 0 0 0 0 1 0 0 0 0
8 12224.6 0 0 0 0 0 0 0 0 1 0 0 0
9 15916.4 0 0 0 0 0 0 0 0 0 1 0 0
10 16535.9 0 0 0 0 0 0 0 0 0 0 1 0
11 15796.0 0 0 0 0 0 0 0 0 0 0 0 1
12 14418.6 0 0 0 0 0 0 0 0 0 0 0 0
13 15044.5 0 1 0 0 0 0 0 0 0 0 0 0
14 14944.2 0 0 1 0 0 0 0 0 0 0 0 0
15 16754.8 0 0 0 1 0 0 0 0 0 0 0 0
16 14254.0 0 0 0 0 1 0 0 0 0 0 0 0
17 15454.9 0 0 0 0 0 1 0 0 0 0 0 0
18 15644.8 0 0 0 0 0 0 1 0 0 0 0 0
19 14568.3 0 0 0 0 0 0 0 1 0 0 0 0
20 12520.2 0 0 0 0 0 0 0 0 1 0 0 0
21 14803.0 0 0 0 0 0 0 0 0 0 1 0 0
22 15873.2 0 0 0 0 0 0 0 0 0 0 1 0
23 14755.3 0 0 0 0 0 0 0 0 0 0 0 1
24 12875.1 0 0 0 0 0 0 0 0 0 0 0 0
25 14291.1 1 1 0 0 0 0 0 0 0 0 0 0
26 14205.3 1 0 1 0 0 0 0 0 0 0 0 0
27 15859.4 1 0 0 1 0 0 0 0 0 0 0 0
28 15258.9 1 0 0 0 1 0 0 0 0 0 0 0
29 15498.6 1 0 0 0 0 1 0 0 0 0 0 0
30 14106.5 1 0 0 0 0 0 1 0 0 0 0 0
31 15023.6 1 0 0 0 0 0 0 1 0 0 0 0
32 12083.0 1 0 0 0 0 0 0 0 1 0 0 0
33 15761.3 1 0 0 0 0 0 0 0 0 1 0 0
34 16943.0 1 0 0 0 0 0 0 0 0 0 1 0
35 15070.3 1 0 0 0 0 0 0 0 0 0 0 1
36 13659.6 1 0 0 0 0 0 0 0 0 0 0 0
37 14768.9 1 1 0 0 0 0 0 0 0 0 0 0
38 14725.1 1 0 1 0 0 0 0 0 0 0 0 0
39 15998.1 1 0 0 1 0 0 0 0 0 0 0 0
40 15370.6 1 0 0 0 1 0 0 0 0 0 0 0
41 14956.9 1 0 0 0 0 1 0 0 0 0 0 0
42 15469.7 1 0 0 0 0 0 1 0 0 0 0 0
43 15101.8 1 0 0 0 0 0 0 1 0 0 0 0
44 11703.7 1 0 0 0 0 0 0 0 1 0 0 0
45 16283.6 1 0 0 0 0 0 0 0 0 1 0 0
46 16726.5 1 0 0 0 0 0 0 0 0 0 1 0
47 14968.9 1 0 0 0 0 0 0 0 0 0 0 1
48 14861.0 1 0 0 0 0 0 0 0 0 0 0 0
49 14583.3 1 1 0 0 0 0 0 0 0 0 0 0
50 15305.8 1 0 1 0 0 0 0 0 0 0 0 0
51 17903.9 1 0 0 1 0 0 0 0 0 0 0 0
52 16379.4 1 0 0 0 1 0 0 0 0 0 0 0
53 15420.3 1 0 0 0 0 1 0 0 0 0 0 0
54 17870.5 1 0 0 0 0 0 1 0 0 0 0 0
55 15912.8 1 0 0 0 0 0 0 1 0 0 0 0
56 13866.5 1 0 0 0 0 0 0 0 1 0 0 0
57 17823.2 1 0 0 0 0 0 0 0 0 1 0 0
58 17872.0 1 0 0 0 0 0 0 0 0 0 1 0
59 17420.4 1 0 0 0 0 0 0 0 0 0 0 1
60 16704.4 1 0 0 0 0 0 0 0 0 0 0 0
61 15991.2 1 1 0 0 0 0 0 0 0 0 0 0
62 16583.6 1 0 1 0 0 0 0 0 0 0 0 0
63 19123.5 1 0 0 1 0 0 0 0 0 0 0 0
64 17838.7 1 0 0 0 1 0 0 0 0 0 0 0
65 17209.4 1 0 0 0 0 1 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
13897.12 1011.04 -58.24 369.91 2345.72 826.81
M5 M6 M7 M8 M9 M10
1124.69 956.76 346.92 -2024.14 1613.76 2286.38
M11
1098.44
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1758.4 -612.5 -238.3 650.0 2103.7
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13897.12 489.39 28.397 < 2e-16 ***
x 1011.04 266.46 3.794 0.000388 ***
M1 -58.24 626.53 -0.093 0.926293
M2 369.91 626.53 0.590 0.557478
M3 2345.72 626.53 3.744 0.000454 ***
M4 826.81 626.53 1.320 0.192732
M5 1124.69 626.53 1.795 0.078451 .
M6 956.76 654.13 1.463 0.149583
M7 346.92 654.13 0.530 0.598125
M8 -2024.14 654.13 -3.094 0.003172 **
M9 1613.76 654.13 2.467 0.016955 *
M10 2286.38 654.13 3.495 0.000977 ***
M11 1098.44 654.13 1.679 0.099106 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1034 on 52 degrees of freedom
Multiple R-Squared: 0.632, Adjusted R-squared: 0.5471
F-statistic: 7.444 on 12 and 52 DF, p-value: 9.835e-08
> postscript(file="/var/www/html/rcomp/tmp/12j791197456143.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/2aw1o1197456143.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/3k5lu1197456143.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/43pm81197456143.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/5ydne1197456143.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 = 65
Frequency = 1
1 2 3 4 5 6
-1440.47345 -384.72345 -381.34012 -1437.82345 613.09322 -642.87611
7 8 9 10 11 12
-597.23611 351.62389 405.52389 352.40389 800.44389 521.48389
13 14 15 16 17 18
1205.62655 677.17655 511.95988 -469.92345 433.09322 790.92389
19 20 21 22 23 24
324.26389 647.22389 -707.87611 -310.29611 -240.25611 -1022.01611
25 26 27 28 29 30
-558.81327 -1072.76327 -1394.47994 -476.06327 -534.24661 -1758.41593
31 32 33 34 35 36
-231.47593 -801.01593 -760.61593 -251.53593 -936.29593 -1248.55593
37 38 39 40 41 42
-81.01327 -552.96327 -1255.77994 -364.36327 -1075.94661 -395.21593
43 44 45 46 47 48
-153.27593 -1180.31593 -238.31593 -468.03593 -1037.69593 -47.15593
49 50 51 52 53 54
-266.61327 27.73673 650.02006 644.43673 -612.54661 2005.58407
55 56 57 58 59 60
657.72407 982.48407 1301.28407 677.46407 1413.80407 1796.24407
61 62 63 64 65
1141.28673 1305.53673 1869.62006 2103.73673 1176.55339
> postscript(file="/var/www/html/rcomp/tmp/6cnz71197456143.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 = 65
Frequency = 1
lag(myerror, k = 1) myerror
0 -1440.47345 NA
1 -384.72345 -1440.47345
2 -381.34012 -384.72345
3 -1437.82345 -381.34012
4 613.09322 -1437.82345
5 -642.87611 613.09322
6 -597.23611 -642.87611
7 351.62389 -597.23611
8 405.52389 351.62389
9 352.40389 405.52389
10 800.44389 352.40389
11 521.48389 800.44389
12 1205.62655 521.48389
13 677.17655 1205.62655
14 511.95988 677.17655
15 -469.92345 511.95988
16 433.09322 -469.92345
17 790.92389 433.09322
18 324.26389 790.92389
19 647.22389 324.26389
20 -707.87611 647.22389
21 -310.29611 -707.87611
22 -240.25611 -310.29611
23 -1022.01611 -240.25611
24 -558.81327 -1022.01611
25 -1072.76327 -558.81327
26 -1394.47994 -1072.76327
27 -476.06327 -1394.47994
28 -534.24661 -476.06327
29 -1758.41593 -534.24661
30 -231.47593 -1758.41593
31 -801.01593 -231.47593
32 -760.61593 -801.01593
33 -251.53593 -760.61593
34 -936.29593 -251.53593
35 -1248.55593 -936.29593
36 -81.01327 -1248.55593
37 -552.96327 -81.01327
38 -1255.77994 -552.96327
39 -364.36327 -1255.77994
40 -1075.94661 -364.36327
41 -395.21593 -1075.94661
42 -153.27593 -395.21593
43 -1180.31593 -153.27593
44 -238.31593 -1180.31593
45 -468.03593 -238.31593
46 -1037.69593 -468.03593
47 -47.15593 -1037.69593
48 -266.61327 -47.15593
49 27.73673 -266.61327
50 650.02006 27.73673
51 644.43673 650.02006
52 -612.54661 644.43673
53 2005.58407 -612.54661
54 657.72407 2005.58407
55 982.48407 657.72407
56 1301.28407 982.48407
57 677.46407 1301.28407
58 1413.80407 677.46407
59 1796.24407 1413.80407
60 1141.28673 1796.24407
61 1305.53673 1141.28673
62 1869.62006 1305.53673
63 2103.73673 1869.62006
64 1176.55339 2103.73673
65 NA 1176.55339
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -384.72345 -1440.47345
[2,] -381.34012 -384.72345
[3,] -1437.82345 -381.34012
[4,] 613.09322 -1437.82345
[5,] -642.87611 613.09322
[6,] -597.23611 -642.87611
[7,] 351.62389 -597.23611
[8,] 405.52389 351.62389
[9,] 352.40389 405.52389
[10,] 800.44389 352.40389
[11,] 521.48389 800.44389
[12,] 1205.62655 521.48389
[13,] 677.17655 1205.62655
[14,] 511.95988 677.17655
[15,] -469.92345 511.95988
[16,] 433.09322 -469.92345
[17,] 790.92389 433.09322
[18,] 324.26389 790.92389
[19,] 647.22389 324.26389
[20,] -707.87611 647.22389
[21,] -310.29611 -707.87611
[22,] -240.25611 -310.29611
[23,] -1022.01611 -240.25611
[24,] -558.81327 -1022.01611
[25,] -1072.76327 -558.81327
[26,] -1394.47994 -1072.76327
[27,] -476.06327 -1394.47994
[28,] -534.24661 -476.06327
[29,] -1758.41593 -534.24661
[30,] -231.47593 -1758.41593
[31,] -801.01593 -231.47593
[32,] -760.61593 -801.01593
[33,] -251.53593 -760.61593
[34,] -936.29593 -251.53593
[35,] -1248.55593 -936.29593
[36,] -81.01327 -1248.55593
[37,] -552.96327 -81.01327
[38,] -1255.77994 -552.96327
[39,] -364.36327 -1255.77994
[40,] -1075.94661 -364.36327
[41,] -395.21593 -1075.94661
[42,] -153.27593 -395.21593
[43,] -1180.31593 -153.27593
[44,] -238.31593 -1180.31593
[45,] -468.03593 -238.31593
[46,] -1037.69593 -468.03593
[47,] -47.15593 -1037.69593
[48,] -266.61327 -47.15593
[49,] 27.73673 -266.61327
[50,] 650.02006 27.73673
[51,] 644.43673 650.02006
[52,] -612.54661 644.43673
[53,] 2005.58407 -612.54661
[54,] 657.72407 2005.58407
[55,] 982.48407 657.72407
[56,] 1301.28407 982.48407
[57,] 677.46407 1301.28407
[58,] 1413.80407 677.46407
[59,] 1796.24407 1413.80407
[60,] 1141.28673 1796.24407
[61,] 1305.53673 1141.28673
[62,] 1869.62006 1305.53673
[63,] 2103.73673 1869.62006
[64,] 1176.55339 2103.73673
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -384.72345 -1440.47345
2 -381.34012 -384.72345
3 -1437.82345 -381.34012
4 613.09322 -1437.82345
5 -642.87611 613.09322
6 -597.23611 -642.87611
7 351.62389 -597.23611
8 405.52389 351.62389
9 352.40389 405.52389
10 800.44389 352.40389
11 521.48389 800.44389
12 1205.62655 521.48389
13 677.17655 1205.62655
14 511.95988 677.17655
15 -469.92345 511.95988
16 433.09322 -469.92345
17 790.92389 433.09322
18 324.26389 790.92389
19 647.22389 324.26389
20 -707.87611 647.22389
21 -310.29611 -707.87611
22 -240.25611 -310.29611
23 -1022.01611 -240.25611
24 -558.81327 -1022.01611
25 -1072.76327 -558.81327
26 -1394.47994 -1072.76327
27 -476.06327 -1394.47994
28 -534.24661 -476.06327
29 -1758.41593 -534.24661
30 -231.47593 -1758.41593
31 -801.01593 -231.47593
32 -760.61593 -801.01593
33 -251.53593 -760.61593
34 -936.29593 -251.53593
35 -1248.55593 -936.29593
36 -81.01327 -1248.55593
37 -552.96327 -81.01327
38 -1255.77994 -552.96327
39 -364.36327 -1255.77994
40 -1075.94661 -364.36327
41 -395.21593 -1075.94661
42 -153.27593 -395.21593
43 -1180.31593 -153.27593
44 -238.31593 -1180.31593
45 -468.03593 -238.31593
46 -1037.69593 -468.03593
47 -47.15593 -1037.69593
48 -266.61327 -47.15593
49 27.73673 -266.61327
50 650.02006 27.73673
51 644.43673 650.02006
52 -612.54661 644.43673
53 2005.58407 -612.54661
54 657.72407 2005.58407
55 982.48407 657.72407
56 1301.28407 982.48407
57 677.46407 1301.28407
58 1413.80407 677.46407
59 1796.24407 1413.80407
60 1141.28673 1796.24407
61 1305.53673 1141.28673
62 1869.62006 1305.53673
63 2103.73673 1869.62006
64 1176.55339 2103.73673
> 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/71mbk1197456143.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/8286g1197456143.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/9ck4b1197456143.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/10e3281197456143.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/11xqjf1197456143.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/12byl01197456144.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/13yzmz1197456144.tab")
>
> system("convert tmp/12j791197456143.ps tmp/12j791197456143.png")
> system("convert tmp/2aw1o1197456143.ps tmp/2aw1o1197456143.png")
> system("convert tmp/3k5lu1197456143.ps tmp/3k5lu1197456143.png")
> system("convert tmp/43pm81197456143.ps tmp/43pm81197456143.png")
> system("convert tmp/5ydne1197456143.ps tmp/5ydne1197456143.png")
> system("convert tmp/6cnz71197456143.ps tmp/6cnz71197456143.png")
> system("convert tmp/71mbk1197456143.ps tmp/71mbk1197456143.png")
> system("convert tmp/8286g1197456143.ps tmp/8286g1197456143.png")
> system("convert tmp/9ck4b1197456143.ps tmp/9ck4b1197456143.png")
>
>
> proc.time()
user system elapsed
2.637 1.684 6.262