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(91.2,0,99.2,0,108.2,0,101.5,0,106.9,0,104.4,0,77.9,0,60,0,99.5,0,95,0,105.6,0,102.5,0,93.3,0,97.3,0,127,0,111.7,0,96.4,0,133,0,72.2,0,95.8,0,124.1,0,127.6,0,110.7,0,104.6,0,112.7,0,115.3,0,139.4,0,119,0,97.4,0,154,0,81.5,0,88.8,0,127.7,0,105.1,0,114.9,0,106.4,0,104.5,1,121.6,1,141.4,1,99,1,126.7,1,134.1,1,81.3,1,88.6,1,132.7,1,132.9,1,134.4,1,103.7,1,119.7,1,115,1,132.9,1,108.5,1,113.9,1,142,1,97.7,1,92.2,1,128.8,1,134.9,1,128.2,1,114.8,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 91.2 0 1 0 0 0 0 0 0 0 0 0 0 1
2 99.2 0 0 1 0 0 0 0 0 0 0 0 0 2
3 108.2 0 0 0 1 0 0 0 0 0 0 0 0 3
4 101.5 0 0 0 0 1 0 0 0 0 0 0 0 4
5 106.9 0 0 0 0 0 1 0 0 0 0 0 0 5
6 104.4 0 0 0 0 0 0 1 0 0 0 0 0 6
7 77.9 0 0 0 0 0 0 0 1 0 0 0 0 7
8 60.0 0 0 0 0 0 0 0 0 1 0 0 0 8
9 99.5 0 0 0 0 0 0 0 0 0 1 0 0 9
10 95.0 0 0 0 0 0 0 0 0 0 0 1 0 10
11 105.6 0 0 0 0 0 0 0 0 0 0 0 1 11
12 102.5 0 0 0 0 0 0 0 0 0 0 0 0 12
13 93.3 0 1 0 0 0 0 0 0 0 0 0 0 13
14 97.3 0 0 1 0 0 0 0 0 0 0 0 0 14
15 127.0 0 0 0 1 0 0 0 0 0 0 0 0 15
16 111.7 0 0 0 0 1 0 0 0 0 0 0 0 16
17 96.4 0 0 0 0 0 1 0 0 0 0 0 0 17
18 133.0 0 0 0 0 0 0 1 0 0 0 0 0 18
19 72.2 0 0 0 0 0 0 0 1 0 0 0 0 19
20 95.8 0 0 0 0 0 0 0 0 1 0 0 0 20
21 124.1 0 0 0 0 0 0 0 0 0 1 0 0 21
22 127.6 0 0 0 0 0 0 0 0 0 0 1 0 22
23 110.7 0 0 0 0 0 0 0 0 0 0 0 1 23
24 104.6 0 0 0 0 0 0 0 0 0 0 0 0 24
25 112.7 0 1 0 0 0 0 0 0 0 0 0 0 25
26 115.3 0 0 1 0 0 0 0 0 0 0 0 0 26
27 139.4 0 0 0 1 0 0 0 0 0 0 0 0 27
28 119.0 0 0 0 0 1 0 0 0 0 0 0 0 28
29 97.4 0 0 0 0 0 1 0 0 0 0 0 0 29
30 154.0 0 0 0 0 0 0 1 0 0 0 0 0 30
31 81.5 0 0 0 0 0 0 0 1 0 0 0 0 31
32 88.8 0 0 0 0 0 0 0 0 1 0 0 0 32
33 127.7 0 0 0 0 0 0 0 0 0 1 0 0 33
34 105.1 0 0 0 0 0 0 0 0 0 0 1 0 34
35 114.9 0 0 0 0 0 0 0 0 0 0 0 1 35
36 106.4 0 0 0 0 0 0 0 0 0 0 0 0 36
37 104.5 1 1 0 0 0 0 0 0 0 0 0 0 37
38 121.6 1 0 1 0 0 0 0 0 0 0 0 0 38
39 141.4 1 0 0 1 0 0 0 0 0 0 0 0 39
40 99.0 1 0 0 0 1 0 0 0 0 0 0 0 40
41 126.7 1 0 0 0 0 1 0 0 0 0 0 0 41
42 134.1 1 0 0 0 0 0 1 0 0 0 0 0 42
43 81.3 1 0 0 0 0 0 0 1 0 0 0 0 43
44 88.6 1 0 0 0 0 0 0 0 1 0 0 0 44
45 132.7 1 0 0 0 0 0 0 0 0 1 0 0 45
46 132.9 1 0 0 0 0 0 0 0 0 0 1 0 46
47 134.4 1 0 0 0 0 0 0 0 0 0 0 1 47
48 103.7 1 0 0 0 0 0 0 0 0 0 0 0 48
49 119.7 1 1 0 0 0 0 0 0 0 0 0 0 49
50 115.0 1 0 1 0 0 0 0 0 0 0 0 0 50
51 132.9 1 0 0 1 0 0 0 0 0 0 0 0 51
52 108.5 1 0 0 0 1 0 0 0 0 0 0 0 52
53 113.9 1 0 0 0 0 1 0 0 0 0 0 0 53
54 142.0 1 0 0 0 0 0 1 0 0 0 0 0 54
55 97.7 1 0 0 0 0 0 0 1 0 0 0 0 55
56 92.2 1 0 0 0 0 0 0 0 1 0 0 0 56
57 128.8 1 0 0 0 0 0 0 0 0 1 0 0 57
58 134.9 1 0 0 0 0 0 0 0 0 0 1 0 58
59 128.2 1 0 0 0 0 0 0 0 0 0 0 1 59
60 114.8 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
86.6072 -6.5556 4.7290 9.5064 28.9838 6.5211
M5 M6 M7 M8 M9 M10
6.2185 30.8358 -21.1668 -18.8294 18.0279 13.9453
M11 t
12.9826 0.6226
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-16.7789 -5.8001 -0.7989 6.4425 17.8778
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 86.6072 5.5209 15.687 < 2e-16 ***
x -6.5556 4.9579 -1.322 0.19263
M1 4.7290 6.1543 0.768 0.44617
M2 9.5064 6.1192 1.554 0.12715
M3 28.9838 6.0874 4.761 1.95e-05 ***
M4 6.5211 6.0587 1.076 0.28739
M5 6.2185 6.0333 1.031 0.30807
M6 30.8358 6.0112 5.130 5.68e-06 ***
M7 -21.1668 5.9924 -3.532 0.00095 ***
M8 -18.8294 5.9770 -3.150 0.00287 **
M9 18.0279 5.9650 3.022 0.00409 **
M10 13.9453 5.9564 2.341 0.02361 *
M11 12.9826 5.9512 2.182 0.03429 *
t 0.6226 0.1431 4.350 7.48e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.407 on 46 degrees of freedom
Multiple R-squared: 0.8098, Adjusted R-squared: 0.756
F-statistic: 15.06 on 13 and 46 DF, p-value: 1.925e-12
> postscript(file="/var/www/html/rcomp/tmp/1hmt11227553006.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/25a161227553006.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/3e4jq1227553006.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/4b6ku1227553006.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/5gwrf1227553006.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
-0.75888889 1.84111111 -9.25888889 5.88111111 10.96111111 -16.77888889
7 8 9 10 11 12
8.10111111 -12.75888889 -10.73888889 -11.77888889 -0.83888889 8.42111111
13 14 15 16 17 18
-6.13055556 -7.53055556 2.06944444 8.60944444 -7.01055556 4.34944444
19 20 21 22 23 24
-5.07055556 15.56944444 6.38944444 13.34944444 -3.21055556 3.04944444
25 26 27 28 29 30
5.79777778 2.99777778 6.99777778 8.43777778 -13.48222222 17.87777778
31 32 33 34 35 36
-3.24222222 1.09777778 2.51777778 -16.62222222 -6.48222222 -2.62222222
37 38 39 40 41 42
-3.31833333 8.38166667 8.08166667 -12.47833333 14.90166667 -2.93833333
43 44 45 46 47 48
-4.35833333 -0.01833333 6.60166667 10.26166667 12.10166667 -6.23833333
49 50 51 52 53 54
4.41000000 -5.69000000 -7.89000000 -10.45000000 -5.37000000 -2.51000000
55 56 57 58 59 60
4.57000000 -3.89000000 -4.77000000 4.79000000 -1.57000000 -2.61000000
> postscript(file="/var/www/html/rcomp/tmp/6w33e1227553006.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 -0.75888889 NA
1 1.84111111 -0.75888889
2 -9.25888889 1.84111111
3 5.88111111 -9.25888889
4 10.96111111 5.88111111
5 -16.77888889 10.96111111
6 8.10111111 -16.77888889
7 -12.75888889 8.10111111
8 -10.73888889 -12.75888889
9 -11.77888889 -10.73888889
10 -0.83888889 -11.77888889
11 8.42111111 -0.83888889
12 -6.13055556 8.42111111
13 -7.53055556 -6.13055556
14 2.06944444 -7.53055556
15 8.60944444 2.06944444
16 -7.01055556 8.60944444
17 4.34944444 -7.01055556
18 -5.07055556 4.34944444
19 15.56944444 -5.07055556
20 6.38944444 15.56944444
21 13.34944444 6.38944444
22 -3.21055556 13.34944444
23 3.04944444 -3.21055556
24 5.79777778 3.04944444
25 2.99777778 5.79777778
26 6.99777778 2.99777778
27 8.43777778 6.99777778
28 -13.48222222 8.43777778
29 17.87777778 -13.48222222
30 -3.24222222 17.87777778
31 1.09777778 -3.24222222
32 2.51777778 1.09777778
33 -16.62222222 2.51777778
34 -6.48222222 -16.62222222
35 -2.62222222 -6.48222222
36 -3.31833333 -2.62222222
37 8.38166667 -3.31833333
38 8.08166667 8.38166667
39 -12.47833333 8.08166667
40 14.90166667 -12.47833333
41 -2.93833333 14.90166667
42 -4.35833333 -2.93833333
43 -0.01833333 -4.35833333
44 6.60166667 -0.01833333
45 10.26166667 6.60166667
46 12.10166667 10.26166667
47 -6.23833333 12.10166667
48 4.41000000 -6.23833333
49 -5.69000000 4.41000000
50 -7.89000000 -5.69000000
51 -10.45000000 -7.89000000
52 -5.37000000 -10.45000000
53 -2.51000000 -5.37000000
54 4.57000000 -2.51000000
55 -3.89000000 4.57000000
56 -4.77000000 -3.89000000
57 4.79000000 -4.77000000
58 -1.57000000 4.79000000
59 -2.61000000 -1.57000000
60 NA -2.61000000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.84111111 -0.75888889
[2,] -9.25888889 1.84111111
[3,] 5.88111111 -9.25888889
[4,] 10.96111111 5.88111111
[5,] -16.77888889 10.96111111
[6,] 8.10111111 -16.77888889
[7,] -12.75888889 8.10111111
[8,] -10.73888889 -12.75888889
[9,] -11.77888889 -10.73888889
[10,] -0.83888889 -11.77888889
[11,] 8.42111111 -0.83888889
[12,] -6.13055556 8.42111111
[13,] -7.53055556 -6.13055556
[14,] 2.06944444 -7.53055556
[15,] 8.60944444 2.06944444
[16,] -7.01055556 8.60944444
[17,] 4.34944444 -7.01055556
[18,] -5.07055556 4.34944444
[19,] 15.56944444 -5.07055556
[20,] 6.38944444 15.56944444
[21,] 13.34944444 6.38944444
[22,] -3.21055556 13.34944444
[23,] 3.04944444 -3.21055556
[24,] 5.79777778 3.04944444
[25,] 2.99777778 5.79777778
[26,] 6.99777778 2.99777778
[27,] 8.43777778 6.99777778
[28,] -13.48222222 8.43777778
[29,] 17.87777778 -13.48222222
[30,] -3.24222222 17.87777778
[31,] 1.09777778 -3.24222222
[32,] 2.51777778 1.09777778
[33,] -16.62222222 2.51777778
[34,] -6.48222222 -16.62222222
[35,] -2.62222222 -6.48222222
[36,] -3.31833333 -2.62222222
[37,] 8.38166667 -3.31833333
[38,] 8.08166667 8.38166667
[39,] -12.47833333 8.08166667
[40,] 14.90166667 -12.47833333
[41,] -2.93833333 14.90166667
[42,] -4.35833333 -2.93833333
[43,] -0.01833333 -4.35833333
[44,] 6.60166667 -0.01833333
[45,] 10.26166667 6.60166667
[46,] 12.10166667 10.26166667
[47,] -6.23833333 12.10166667
[48,] 4.41000000 -6.23833333
[49,] -5.69000000 4.41000000
[50,] -7.89000000 -5.69000000
[51,] -10.45000000 -7.89000000
[52,] -5.37000000 -10.45000000
[53,] -2.51000000 -5.37000000
[54,] 4.57000000 -2.51000000
[55,] -3.89000000 4.57000000
[56,] -4.77000000 -3.89000000
[57,] 4.79000000 -4.77000000
[58,] -1.57000000 4.79000000
[59,] -2.61000000 -1.57000000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.84111111 -0.75888889
2 -9.25888889 1.84111111
3 5.88111111 -9.25888889
4 10.96111111 5.88111111
5 -16.77888889 10.96111111
6 8.10111111 -16.77888889
7 -12.75888889 8.10111111
8 -10.73888889 -12.75888889
9 -11.77888889 -10.73888889
10 -0.83888889 -11.77888889
11 8.42111111 -0.83888889
12 -6.13055556 8.42111111
13 -7.53055556 -6.13055556
14 2.06944444 -7.53055556
15 8.60944444 2.06944444
16 -7.01055556 8.60944444
17 4.34944444 -7.01055556
18 -5.07055556 4.34944444
19 15.56944444 -5.07055556
20 6.38944444 15.56944444
21 13.34944444 6.38944444
22 -3.21055556 13.34944444
23 3.04944444 -3.21055556
24 5.79777778 3.04944444
25 2.99777778 5.79777778
26 6.99777778 2.99777778
27 8.43777778 6.99777778
28 -13.48222222 8.43777778
29 17.87777778 -13.48222222
30 -3.24222222 17.87777778
31 1.09777778 -3.24222222
32 2.51777778 1.09777778
33 -16.62222222 2.51777778
34 -6.48222222 -16.62222222
35 -2.62222222 -6.48222222
36 -3.31833333 -2.62222222
37 8.38166667 -3.31833333
38 8.08166667 8.38166667
39 -12.47833333 8.08166667
40 14.90166667 -12.47833333
41 -2.93833333 14.90166667
42 -4.35833333 -2.93833333
43 -0.01833333 -4.35833333
44 6.60166667 -0.01833333
45 10.26166667 6.60166667
46 12.10166667 10.26166667
47 -6.23833333 12.10166667
48 4.41000000 -6.23833333
49 -5.69000000 4.41000000
50 -7.89000000 -5.69000000
51 -10.45000000 -7.89000000
52 -5.37000000 -10.45000000
53 -2.51000000 -5.37000000
54 4.57000000 -2.51000000
55 -3.89000000 4.57000000
56 -4.77000000 -3.89000000
57 4.79000000 -4.77000000
58 -1.57000000 4.79000000
59 -2.61000000 -1.57000000
> 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/76pa11227553006.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/8do2k1227553006.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/9c0id1227553006.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/10e0za1227553006.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/117b1n1227553006.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/12nw9n1227553006.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/13pz4f1227553006.tab")
>
> system("convert tmp/1hmt11227553006.ps tmp/1hmt11227553006.png")
> system("convert tmp/25a161227553006.ps tmp/25a161227553006.png")
> system("convert tmp/3e4jq1227553006.ps tmp/3e4jq1227553006.png")
> system("convert tmp/4b6ku1227553006.ps tmp/4b6ku1227553006.png")
> system("convert tmp/5gwrf1227553006.ps tmp/5gwrf1227553006.png")
> system("convert tmp/6w33e1227553006.ps tmp/6w33e1227553006.png")
> system("convert tmp/76pa11227553006.ps tmp/76pa11227553006.png")
> system("convert tmp/8do2k1227553006.ps tmp/8do2k1227553006.png")
> system("convert tmp/9c0id1227553006.ps tmp/9c0id1227553006.png")
>
>
> proc.time()
user system elapsed
1.952 1.405 2.309