R version 2.7.0 (2008-04-22)
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(15859.4,0,15258.9,0,15498.6,0,15106.5,0,15023.6,0,12083.0,0,15761.3,0,16942.6,0,15070.3,0,13659.6,0,14768.9,0,14725.1,0,15998.1,0,15370.6,0,14956.9,0,15469.7,0,15101.8,0,11703.7,0,16283.6,0,16726.5,0,14968.9,0,14861.0,0,14583.3,0,15305.8,0,17903.9,0,16379.4,0,15420.3,0,17870.5,0,15912.8,0,13866.5,0,17823.2,0,17872.0,0,17422.0,0,16704.5,0,15991.2,0,16583.6,0,19123.5,0,17838.7,0,17209.4,0,18586.5,0,16258.1,0,15141.6,1,19202.1,1,17746.5,1,19090.1,1,18040.3,1,17515.5,1,17751.8,1,21072.4,1,17170.0,1,19439.5,1,19795.4,1,17574.9,1,16165.4,1,19464.6,1,19932.1,1,19961.2,1,17343.4,1,18924.2,1,18574.1,1,21350.6,1),dim=c(2,61),dimnames=list(c('x','y
'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('x','y
'),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
x y\r M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 15859.4 0 1 0 0 0 0 0 0 0 0 0 0 1
2 15258.9 0 0 1 0 0 0 0 0 0 0 0 0 2
3 15498.6 0 0 0 1 0 0 0 0 0 0 0 0 3
4 15106.5 0 0 0 0 1 0 0 0 0 0 0 0 4
5 15023.6 0 0 0 0 0 1 0 0 0 0 0 0 5
6 12083.0 0 0 0 0 0 0 1 0 0 0 0 0 6
7 15761.3 0 0 0 0 0 0 0 1 0 0 0 0 7
8 16942.6 0 0 0 0 0 0 0 0 1 0 0 0 8
9 15070.3 0 0 0 0 0 0 0 0 0 1 0 0 9
10 13659.6 0 0 0 0 0 0 0 0 0 0 1 0 10
11 14768.9 0 0 0 0 0 0 0 0 0 0 0 1 11
12 14725.1 0 0 0 0 0 0 0 0 0 0 0 0 12
13 15998.1 0 1 0 0 0 0 0 0 0 0 0 0 13
14 15370.6 0 0 1 0 0 0 0 0 0 0 0 0 14
15 14956.9 0 0 0 1 0 0 0 0 0 0 0 0 15
16 15469.7 0 0 0 0 1 0 0 0 0 0 0 0 16
17 15101.8 0 0 0 0 0 1 0 0 0 0 0 0 17
18 11703.7 0 0 0 0 0 0 1 0 0 0 0 0 18
19 16283.6 0 0 0 0 0 0 0 1 0 0 0 0 19
20 16726.5 0 0 0 0 0 0 0 0 1 0 0 0 20
21 14968.9 0 0 0 0 0 0 0 0 0 1 0 0 21
22 14861.0 0 0 0 0 0 0 0 0 0 0 1 0 22
23 14583.3 0 0 0 0 0 0 0 0 0 0 0 1 23
24 15305.8 0 0 0 0 0 0 0 0 0 0 0 0 24
25 17903.9 0 1 0 0 0 0 0 0 0 0 0 0 25
26 16379.4 0 0 1 0 0 0 0 0 0 0 0 0 26
27 15420.3 0 0 0 1 0 0 0 0 0 0 0 0 27
28 17870.5 0 0 0 0 1 0 0 0 0 0 0 0 28
29 15912.8 0 0 0 0 0 1 0 0 0 0 0 0 29
30 13866.5 0 0 0 0 0 0 1 0 0 0 0 0 30
31 17823.2 0 0 0 0 0 0 0 1 0 0 0 0 31
32 17872.0 0 0 0 0 0 0 0 0 1 0 0 0 32
33 17422.0 0 0 0 0 0 0 0 0 0 1 0 0 33
34 16704.5 0 0 0 0 0 0 0 0 0 0 1 0 34
35 15991.2 0 0 0 0 0 0 0 0 0 0 0 1 35
36 16583.6 0 0 0 0 0 0 0 0 0 0 0 0 36
37 19123.5 0 1 0 0 0 0 0 0 0 0 0 0 37
38 17838.7 0 0 1 0 0 0 0 0 0 0 0 0 38
39 17209.4 0 0 0 1 0 0 0 0 0 0 0 0 39
40 18586.5 0 0 0 0 1 0 0 0 0 0 0 0 40
41 16258.1 0 0 0 0 0 1 0 0 0 0 0 0 41
42 15141.6 1 0 0 0 0 0 1 0 0 0 0 0 42
43 19202.1 1 0 0 0 0 0 0 1 0 0 0 0 43
44 17746.5 1 0 0 0 0 0 0 0 1 0 0 0 44
45 19090.1 1 0 0 0 0 0 0 0 0 1 0 0 45
46 18040.3 1 0 0 0 0 0 0 0 0 0 1 0 46
47 17515.5 1 0 0 0 0 0 0 0 0 0 0 1 47
48 17751.8 1 0 0 0 0 0 0 0 0 0 0 0 48
49 21072.4 1 1 0 0 0 0 0 0 0 0 0 0 49
50 17170.0 1 0 1 0 0 0 0 0 0 0 0 0 50
51 19439.5 1 0 0 1 0 0 0 0 0 0 0 0 51
52 19795.4 1 0 0 0 1 0 0 0 0 0 0 0 52
53 17574.9 1 0 0 0 0 1 0 0 0 0 0 0 53
54 16165.4 1 0 0 0 0 0 1 0 0 0 0 0 54
55 19464.6 1 0 0 0 0 0 0 1 0 0 0 0 55
56 19932.1 1 0 0 0 0 0 0 0 1 0 0 0 56
57 19961.2 1 0 0 0 0 0 0 0 0 1 0 0 57
58 17343.4 1 0 0 0 0 0 0 0 0 0 1 0 58
59 18924.2 1 0 0 0 0 0 0 0 0 0 0 1 59
60 18574.1 1 0 0 0 0 0 0 0 0 0 0 0 60
61 21350.6 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) `y\r` M1 M2 M3 M4
13685.71 533.77 2372.27 669.10 695.83 1481.92
M5 M6 M7 M8 M9 M10
15.75 -2347.90 1492.33 1554.62 938.49 -316.94
M11 t
-156.77 74.69
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1453.11 -313.57 60.42 333.01 1104.74
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13685.714 365.567 37.437 < 2e-16 ***
`y\r` 533.768 316.963 1.684 0.098812 .
M1 2372.274 403.196 5.884 4.04e-07 ***
M2 669.099 423.004 1.582 0.120407
M3 695.828 422.439 1.647 0.106194
M4 1481.918 422.041 3.511 0.000996 ***
M5 15.747 421.810 0.037 0.970378
M6 -2347.897 423.146 -5.549 1.29e-06 ***
M7 1492.333 422.225 3.534 0.000929 ***
M8 1554.622 421.470 3.689 0.000584 ***
M9 938.492 420.882 2.230 0.030574 *
M10 -316.939 420.461 -0.754 0.454736
M11 -156.769 420.208 -0.373 0.710770
t 74.691 8.413 8.878 1.29e-11 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 664.3 on 47 degrees of freedom
Multiple R-squared: 0.9144, Adjusted R-squared: 0.8908
F-statistic: 38.64 on 13 and 47 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/1sbb11227360166.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/2l37o1227360166.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/3icj31227360166.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/4l3ql1227360166.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/5oom61227360166.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 6
-273.278095 754.706345 892.986345 -359.893655 948.686345 297.039881
7 8 9 10 11 12
60.419881 1104.739881 -226.120119 -456.080119 418.359881 143.099881
13 14 15 16 17 18
-1030.864500 -29.880060 -545.000060 -892.980060 130.599940 -978.546524
19 20 21 22 23 24
-313.566524 -7.646524 -1223.806524 -150.966524 -663.526524 -172.486524
25 26 27 28 29 30
-21.350905 82.633536 -977.886464 611.533536 45.313536 287.967071
31 32 33 34 35 36
329.747071 241.567071 333.007071 796.247071 -151.912929 209.027071
37 38 39 40 41 42
301.962690 645.647131 -85.072869 431.247131 -505.672869 133.012988
43 44 45 46 47 48
278.592988 -1313.987012 571.052988 701.992988 -57.667012 -52.827012
49 50 51 52 53 54
820.808607 -1453.106952 714.973048 210.093048 -618.926952 260.526583
55 56 57 58 59 60
-355.193417 -24.673417 545.866583 -891.193417 454.746583 -126.813417
61
202.722202
> postscript(file="/var/www/html/rcomp/tmp/6sfq31227360166.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 -273.278095 NA
1 754.706345 -273.278095
2 892.986345 754.706345
3 -359.893655 892.986345
4 948.686345 -359.893655
5 297.039881 948.686345
6 60.419881 297.039881
7 1104.739881 60.419881
8 -226.120119 1104.739881
9 -456.080119 -226.120119
10 418.359881 -456.080119
11 143.099881 418.359881
12 -1030.864500 143.099881
13 -29.880060 -1030.864500
14 -545.000060 -29.880060
15 -892.980060 -545.000060
16 130.599940 -892.980060
17 -978.546524 130.599940
18 -313.566524 -978.546524
19 -7.646524 -313.566524
20 -1223.806524 -7.646524
21 -150.966524 -1223.806524
22 -663.526524 -150.966524
23 -172.486524 -663.526524
24 -21.350905 -172.486524
25 82.633536 -21.350905
26 -977.886464 82.633536
27 611.533536 -977.886464
28 45.313536 611.533536
29 287.967071 45.313536
30 329.747071 287.967071
31 241.567071 329.747071
32 333.007071 241.567071
33 796.247071 333.007071
34 -151.912929 796.247071
35 209.027071 -151.912929
36 301.962690 209.027071
37 645.647131 301.962690
38 -85.072869 645.647131
39 431.247131 -85.072869
40 -505.672869 431.247131
41 133.012988 -505.672869
42 278.592988 133.012988
43 -1313.987012 278.592988
44 571.052988 -1313.987012
45 701.992988 571.052988
46 -57.667012 701.992988
47 -52.827012 -57.667012
48 820.808607 -52.827012
49 -1453.106952 820.808607
50 714.973048 -1453.106952
51 210.093048 714.973048
52 -618.926952 210.093048
53 260.526583 -618.926952
54 -355.193417 260.526583
55 -24.673417 -355.193417
56 545.866583 -24.673417
57 -891.193417 545.866583
58 454.746583 -891.193417
59 -126.813417 454.746583
60 202.722202 -126.813417
61 NA 202.722202
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 754.706345 -273.278095
[2,] 892.986345 754.706345
[3,] -359.893655 892.986345
[4,] 948.686345 -359.893655
[5,] 297.039881 948.686345
[6,] 60.419881 297.039881
[7,] 1104.739881 60.419881
[8,] -226.120119 1104.739881
[9,] -456.080119 -226.120119
[10,] 418.359881 -456.080119
[11,] 143.099881 418.359881
[12,] -1030.864500 143.099881
[13,] -29.880060 -1030.864500
[14,] -545.000060 -29.880060
[15,] -892.980060 -545.000060
[16,] 130.599940 -892.980060
[17,] -978.546524 130.599940
[18,] -313.566524 -978.546524
[19,] -7.646524 -313.566524
[20,] -1223.806524 -7.646524
[21,] -150.966524 -1223.806524
[22,] -663.526524 -150.966524
[23,] -172.486524 -663.526524
[24,] -21.350905 -172.486524
[25,] 82.633536 -21.350905
[26,] -977.886464 82.633536
[27,] 611.533536 -977.886464
[28,] 45.313536 611.533536
[29,] 287.967071 45.313536
[30,] 329.747071 287.967071
[31,] 241.567071 329.747071
[32,] 333.007071 241.567071
[33,] 796.247071 333.007071
[34,] -151.912929 796.247071
[35,] 209.027071 -151.912929
[36,] 301.962690 209.027071
[37,] 645.647131 301.962690
[38,] -85.072869 645.647131
[39,] 431.247131 -85.072869
[40,] -505.672869 431.247131
[41,] 133.012988 -505.672869
[42,] 278.592988 133.012988
[43,] -1313.987012 278.592988
[44,] 571.052988 -1313.987012
[45,] 701.992988 571.052988
[46,] -57.667012 701.992988
[47,] -52.827012 -57.667012
[48,] 820.808607 -52.827012
[49,] -1453.106952 820.808607
[50,] 714.973048 -1453.106952
[51,] 210.093048 714.973048
[52,] -618.926952 210.093048
[53,] 260.526583 -618.926952
[54,] -355.193417 260.526583
[55,] -24.673417 -355.193417
[56,] 545.866583 -24.673417
[57,] -891.193417 545.866583
[58,] 454.746583 -891.193417
[59,] -126.813417 454.746583
[60,] 202.722202 -126.813417
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 754.706345 -273.278095
2 892.986345 754.706345
3 -359.893655 892.986345
4 948.686345 -359.893655
5 297.039881 948.686345
6 60.419881 297.039881
7 1104.739881 60.419881
8 -226.120119 1104.739881
9 -456.080119 -226.120119
10 418.359881 -456.080119
11 143.099881 418.359881
12 -1030.864500 143.099881
13 -29.880060 -1030.864500
14 -545.000060 -29.880060
15 -892.980060 -545.000060
16 130.599940 -892.980060
17 -978.546524 130.599940
18 -313.566524 -978.546524
19 -7.646524 -313.566524
20 -1223.806524 -7.646524
21 -150.966524 -1223.806524
22 -663.526524 -150.966524
23 -172.486524 -663.526524
24 -21.350905 -172.486524
25 82.633536 -21.350905
26 -977.886464 82.633536
27 611.533536 -977.886464
28 45.313536 611.533536
29 287.967071 45.313536
30 329.747071 287.967071
31 241.567071 329.747071
32 333.007071 241.567071
33 796.247071 333.007071
34 -151.912929 796.247071
35 209.027071 -151.912929
36 301.962690 209.027071
37 645.647131 301.962690
38 -85.072869 645.647131
39 431.247131 -85.072869
40 -505.672869 431.247131
41 133.012988 -505.672869
42 278.592988 133.012988
43 -1313.987012 278.592988
44 571.052988 -1313.987012
45 701.992988 571.052988
46 -57.667012 701.992988
47 -52.827012 -57.667012
48 820.808607 -52.827012
49 -1453.106952 820.808607
50 714.973048 -1453.106952
51 210.093048 714.973048
52 -618.926952 210.093048
53 260.526583 -618.926952
54 -355.193417 260.526583
55 -24.673417 -355.193417
56 545.866583 -24.673417
57 -891.193417 545.866583
58 454.746583 -891.193417
59 -126.813417 454.746583
60 202.722202 -126.813417
> 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/7h39y1227360166.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/8hn0w1227360166.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/9my951227360166.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/1050g01227360167.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/11f0ot1227360167.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/1247271227360167.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/132ihf1227360167.tab")
>
> system("convert tmp/1sbb11227360166.ps tmp/1sbb11227360166.png")
> system("convert tmp/2l37o1227360166.ps tmp/2l37o1227360166.png")
> system("convert tmp/3icj31227360166.ps tmp/3icj31227360166.png")
> system("convert tmp/4l3ql1227360166.ps tmp/4l3ql1227360166.png")
> system("convert tmp/5oom61227360166.ps tmp/5oom61227360166.png")
> system("convert tmp/6sfq31227360166.ps tmp/6sfq31227360166.png")
> system("convert tmp/7h39y1227360166.ps tmp/7h39y1227360166.png")
> system("convert tmp/8hn0w1227360166.ps tmp/8hn0w1227360166.png")
> system("convert tmp/9my951227360166.ps tmp/9my951227360166.png")
>
>
> proc.time()
user system elapsed
4.011 2.467 4.350