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(94.5,0,114.2,0,104.9,0,106.2,0,99.9,0,97.6,0,103.6,0,192.4,0,113.4,0,106.5,0,104.1,0,98.8,0,92.2,0,120.8,0,97.1,0,89.7,0,105,0,86.2,0,95.1,0,155,0,116.5,0,92.6,0,96,0,82.9,0,81.7,0,106.5,0,96.2,0,84.9,0,93,0,80.9,0,73.9,0,157.4,0,98.2,0,88.3,0,92.6,0,78.4,0,79.2,0,105.5,0,80.6,0,80.9,0,84.6,0,71.2,0,71.4,0,148,0,83.7,0,83.3,0,92.3,0,74.8,0,82.1,0,100,0,71.7,0,79.1,0,86.8,0,64.2,0,75.4,0,139.3,1,77.3,1,112.4,1,98.6,1,77.3,1,73.5,1,100.1,1,76.5,1,77.7,1,80.4,1,72.2,1,65.4,1,181.2,1,96.3,1,106.4,1,90.9,1,75.3,1,71.2,1,96.1,1,80.6,1,77.7,1,83,1,67.5,1,88.5,1,167.6,1,96.4,1,91,1,90.3,1,92.3,1,84.5,1,100.9,1,90,1,84.2,1,97.4,1,78.2,1,90,1,182.4,1,100.2,1,95.1,1,105,1,86.9,1,80.7,1),dim=c(2,97),dimnames=list(c('y','x'),1:97))
> y <- array(NA,dim=c(2,97),dimnames=list(c('y','x'),1:97))
> 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 = 'Do not include Seasonal 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
1 94.5 0
2 114.2 0
3 104.9 0
4 106.2 0
5 99.9 0
6 97.6 0
7 103.6 0
8 192.4 0
9 113.4 0
10 106.5 0
11 104.1 0
12 98.8 0
13 92.2 0
14 120.8 0
15 97.1 0
16 89.7 0
17 105.0 0
18 86.2 0
19 95.1 0
20 155.0 0
21 116.5 0
22 92.6 0
23 96.0 0
24 82.9 0
25 81.7 0
26 106.5 0
27 96.2 0
28 84.9 0
29 93.0 0
30 80.9 0
31 73.9 0
32 157.4 0
33 98.2 0
34 88.3 0
35 92.6 0
36 78.4 0
37 79.2 0
38 105.5 0
39 80.6 0
40 80.9 0
41 84.6 0
42 71.2 0
43 71.4 0
44 148.0 0
45 83.7 0
46 83.3 0
47 92.3 0
48 74.8 0
49 82.1 0
50 100.0 0
51 71.7 0
52 79.1 0
53 86.8 0
54 64.2 0
55 75.4 0
56 139.3 1
57 77.3 1
58 112.4 1
59 98.6 1
60 77.3 1
61 73.5 1
62 100.1 1
63 76.5 1
64 77.7 1
65 80.4 1
66 72.2 1
67 65.4 1
68 181.2 1
69 96.3 1
70 106.4 1
71 90.9 1
72 75.3 1
73 71.2 1
74 96.1 1
75 80.6 1
76 77.7 1
77 83.0 1
78 67.5 1
79 88.5 1
80 167.6 1
81 96.4 1
82 91.0 1
83 90.3 1
84 92.3 1
85 84.5 1
86 100.9 1
87 90.0 1
88 84.2 1
89 97.4 1
90 78.2 1
91 90.0 1
92 182.4 1
93 100.2 1
94 95.1 1
95 105.0 1
96 86.9 1
97 80.7 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x
96.582 -1.856
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-32.382 -15.682 -4.282 5.474 95.818
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 96.582 3.345 28.875 <2e-16 ***
x -1.856 5.083 -0.365 0.716
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 24.81 on 95 degrees of freedom
Multiple R-squared: 0.001401, Adjusted R-squared: -0.009111
F-statistic: 0.1333 on 1 and 95 DF, p-value: 0.7159
> postscript(file="/var/www/html/rcomp/tmp/1rxl11227566257.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/29adz1227566257.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/3vr521227566257.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/4i57z1227566257.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/58j5m1227566257.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 = 97
Frequency = 1
1 2 3 4 5 6
-2.0818182 17.6181818 8.3181818 9.6181818 3.3181818 1.0181818
7 8 9 10 11 12
7.0181818 95.8181818 16.8181818 9.9181818 7.5181818 2.2181818
13 14 15 16 17 18
-4.3818182 24.2181818 0.5181818 -6.8818182 8.4181818 -10.3818182
19 20 21 22 23 24
-1.4818182 58.4181818 19.9181818 -3.9818182 -0.5818182 -13.6818182
25 26 27 28 29 30
-14.8818182 9.9181818 -0.3818182 -11.6818182 -3.5818182 -15.6818182
31 32 33 34 35 36
-22.6818182 60.8181818 1.6181818 -8.2818182 -3.9818182 -18.1818182
37 38 39 40 41 42
-17.3818182 8.9181818 -15.9818182 -15.6818182 -11.9818182 -25.3818182
43 44 45 46 47 48
-25.1818182 51.4181818 -12.8818182 -13.2818182 -4.2818182 -21.7818182
49 50 51 52 53 54
-14.4818182 3.4181818 -24.8818182 -17.4818182 -9.7818182 -32.3818182
55 56 57 58 59 60
-21.1818182 44.5738095 -17.4261905 17.6738095 3.8738095 -17.4261905
61 62 63 64 65 66
-21.2261905 5.3738095 -18.2261905 -17.0261905 -14.3261905 -22.5261905
67 68 69 70 71 72
-29.3261905 86.4738095 1.5738095 11.6738095 -3.8261905 -19.4261905
73 74 75 76 77 78
-23.5261905 1.3738095 -14.1261905 -17.0261905 -11.7261905 -27.2261905
79 80 81 82 83 84
-6.2261905 72.8738095 1.6738095 -3.7261905 -4.4261905 -2.4261905
85 86 87 88 89 90
-10.2261905 6.1738095 -4.7261905 -10.5261905 2.6738095 -16.5261905
91 92 93 94 95 96
-4.7261905 87.6738095 5.4738095 0.3738095 10.2738095 -7.8261905
97
-14.0261905
> postscript(file="/var/www/html/rcomp/tmp/6x8j81227566257.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 = 97
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.0818182 NA
1 17.6181818 -2.0818182
2 8.3181818 17.6181818
3 9.6181818 8.3181818
4 3.3181818 9.6181818
5 1.0181818 3.3181818
6 7.0181818 1.0181818
7 95.8181818 7.0181818
8 16.8181818 95.8181818
9 9.9181818 16.8181818
10 7.5181818 9.9181818
11 2.2181818 7.5181818
12 -4.3818182 2.2181818
13 24.2181818 -4.3818182
14 0.5181818 24.2181818
15 -6.8818182 0.5181818
16 8.4181818 -6.8818182
17 -10.3818182 8.4181818
18 -1.4818182 -10.3818182
19 58.4181818 -1.4818182
20 19.9181818 58.4181818
21 -3.9818182 19.9181818
22 -0.5818182 -3.9818182
23 -13.6818182 -0.5818182
24 -14.8818182 -13.6818182
25 9.9181818 -14.8818182
26 -0.3818182 9.9181818
27 -11.6818182 -0.3818182
28 -3.5818182 -11.6818182
29 -15.6818182 -3.5818182
30 -22.6818182 -15.6818182
31 60.8181818 -22.6818182
32 1.6181818 60.8181818
33 -8.2818182 1.6181818
34 -3.9818182 -8.2818182
35 -18.1818182 -3.9818182
36 -17.3818182 -18.1818182
37 8.9181818 -17.3818182
38 -15.9818182 8.9181818
39 -15.6818182 -15.9818182
40 -11.9818182 -15.6818182
41 -25.3818182 -11.9818182
42 -25.1818182 -25.3818182
43 51.4181818 -25.1818182
44 -12.8818182 51.4181818
45 -13.2818182 -12.8818182
46 -4.2818182 -13.2818182
47 -21.7818182 -4.2818182
48 -14.4818182 -21.7818182
49 3.4181818 -14.4818182
50 -24.8818182 3.4181818
51 -17.4818182 -24.8818182
52 -9.7818182 -17.4818182
53 -32.3818182 -9.7818182
54 -21.1818182 -32.3818182
55 44.5738095 -21.1818182
56 -17.4261905 44.5738095
57 17.6738095 -17.4261905
58 3.8738095 17.6738095
59 -17.4261905 3.8738095
60 -21.2261905 -17.4261905
61 5.3738095 -21.2261905
62 -18.2261905 5.3738095
63 -17.0261905 -18.2261905
64 -14.3261905 -17.0261905
65 -22.5261905 -14.3261905
66 -29.3261905 -22.5261905
67 86.4738095 -29.3261905
68 1.5738095 86.4738095
69 11.6738095 1.5738095
70 -3.8261905 11.6738095
71 -19.4261905 -3.8261905
72 -23.5261905 -19.4261905
73 1.3738095 -23.5261905
74 -14.1261905 1.3738095
75 -17.0261905 -14.1261905
76 -11.7261905 -17.0261905
77 -27.2261905 -11.7261905
78 -6.2261905 -27.2261905
79 72.8738095 -6.2261905
80 1.6738095 72.8738095
81 -3.7261905 1.6738095
82 -4.4261905 -3.7261905
83 -2.4261905 -4.4261905
84 -10.2261905 -2.4261905
85 6.1738095 -10.2261905
86 -4.7261905 6.1738095
87 -10.5261905 -4.7261905
88 2.6738095 -10.5261905
89 -16.5261905 2.6738095
90 -4.7261905 -16.5261905
91 87.6738095 -4.7261905
92 5.4738095 87.6738095
93 0.3738095 5.4738095
94 10.2738095 0.3738095
95 -7.8261905 10.2738095
96 -14.0261905 -7.8261905
97 NA -14.0261905
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 17.6181818 -2.0818182
[2,] 8.3181818 17.6181818
[3,] 9.6181818 8.3181818
[4,] 3.3181818 9.6181818
[5,] 1.0181818 3.3181818
[6,] 7.0181818 1.0181818
[7,] 95.8181818 7.0181818
[8,] 16.8181818 95.8181818
[9,] 9.9181818 16.8181818
[10,] 7.5181818 9.9181818
[11,] 2.2181818 7.5181818
[12,] -4.3818182 2.2181818
[13,] 24.2181818 -4.3818182
[14,] 0.5181818 24.2181818
[15,] -6.8818182 0.5181818
[16,] 8.4181818 -6.8818182
[17,] -10.3818182 8.4181818
[18,] -1.4818182 -10.3818182
[19,] 58.4181818 -1.4818182
[20,] 19.9181818 58.4181818
[21,] -3.9818182 19.9181818
[22,] -0.5818182 -3.9818182
[23,] -13.6818182 -0.5818182
[24,] -14.8818182 -13.6818182
[25,] 9.9181818 -14.8818182
[26,] -0.3818182 9.9181818
[27,] -11.6818182 -0.3818182
[28,] -3.5818182 -11.6818182
[29,] -15.6818182 -3.5818182
[30,] -22.6818182 -15.6818182
[31,] 60.8181818 -22.6818182
[32,] 1.6181818 60.8181818
[33,] -8.2818182 1.6181818
[34,] -3.9818182 -8.2818182
[35,] -18.1818182 -3.9818182
[36,] -17.3818182 -18.1818182
[37,] 8.9181818 -17.3818182
[38,] -15.9818182 8.9181818
[39,] -15.6818182 -15.9818182
[40,] -11.9818182 -15.6818182
[41,] -25.3818182 -11.9818182
[42,] -25.1818182 -25.3818182
[43,] 51.4181818 -25.1818182
[44,] -12.8818182 51.4181818
[45,] -13.2818182 -12.8818182
[46,] -4.2818182 -13.2818182
[47,] -21.7818182 -4.2818182
[48,] -14.4818182 -21.7818182
[49,] 3.4181818 -14.4818182
[50,] -24.8818182 3.4181818
[51,] -17.4818182 -24.8818182
[52,] -9.7818182 -17.4818182
[53,] -32.3818182 -9.7818182
[54,] -21.1818182 -32.3818182
[55,] 44.5738095 -21.1818182
[56,] -17.4261905 44.5738095
[57,] 17.6738095 -17.4261905
[58,] 3.8738095 17.6738095
[59,] -17.4261905 3.8738095
[60,] -21.2261905 -17.4261905
[61,] 5.3738095 -21.2261905
[62,] -18.2261905 5.3738095
[63,] -17.0261905 -18.2261905
[64,] -14.3261905 -17.0261905
[65,] -22.5261905 -14.3261905
[66,] -29.3261905 -22.5261905
[67,] 86.4738095 -29.3261905
[68,] 1.5738095 86.4738095
[69,] 11.6738095 1.5738095
[70,] -3.8261905 11.6738095
[71,] -19.4261905 -3.8261905
[72,] -23.5261905 -19.4261905
[73,] 1.3738095 -23.5261905
[74,] -14.1261905 1.3738095
[75,] -17.0261905 -14.1261905
[76,] -11.7261905 -17.0261905
[77,] -27.2261905 -11.7261905
[78,] -6.2261905 -27.2261905
[79,] 72.8738095 -6.2261905
[80,] 1.6738095 72.8738095
[81,] -3.7261905 1.6738095
[82,] -4.4261905 -3.7261905
[83,] -2.4261905 -4.4261905
[84,] -10.2261905 -2.4261905
[85,] 6.1738095 -10.2261905
[86,] -4.7261905 6.1738095
[87,] -10.5261905 -4.7261905
[88,] 2.6738095 -10.5261905
[89,] -16.5261905 2.6738095
[90,] -4.7261905 -16.5261905
[91,] 87.6738095 -4.7261905
[92,] 5.4738095 87.6738095
[93,] 0.3738095 5.4738095
[94,] 10.2738095 0.3738095
[95,] -7.8261905 10.2738095
[96,] -14.0261905 -7.8261905
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 17.6181818 -2.0818182
2 8.3181818 17.6181818
3 9.6181818 8.3181818
4 3.3181818 9.6181818
5 1.0181818 3.3181818
6 7.0181818 1.0181818
7 95.8181818 7.0181818
8 16.8181818 95.8181818
9 9.9181818 16.8181818
10 7.5181818 9.9181818
11 2.2181818 7.5181818
12 -4.3818182 2.2181818
13 24.2181818 -4.3818182
14 0.5181818 24.2181818
15 -6.8818182 0.5181818
16 8.4181818 -6.8818182
17 -10.3818182 8.4181818
18 -1.4818182 -10.3818182
19 58.4181818 -1.4818182
20 19.9181818 58.4181818
21 -3.9818182 19.9181818
22 -0.5818182 -3.9818182
23 -13.6818182 -0.5818182
24 -14.8818182 -13.6818182
25 9.9181818 -14.8818182
26 -0.3818182 9.9181818
27 -11.6818182 -0.3818182
28 -3.5818182 -11.6818182
29 -15.6818182 -3.5818182
30 -22.6818182 -15.6818182
31 60.8181818 -22.6818182
32 1.6181818 60.8181818
33 -8.2818182 1.6181818
34 -3.9818182 -8.2818182
35 -18.1818182 -3.9818182
36 -17.3818182 -18.1818182
37 8.9181818 -17.3818182
38 -15.9818182 8.9181818
39 -15.6818182 -15.9818182
40 -11.9818182 -15.6818182
41 -25.3818182 -11.9818182
42 -25.1818182 -25.3818182
43 51.4181818 -25.1818182
44 -12.8818182 51.4181818
45 -13.2818182 -12.8818182
46 -4.2818182 -13.2818182
47 -21.7818182 -4.2818182
48 -14.4818182 -21.7818182
49 3.4181818 -14.4818182
50 -24.8818182 3.4181818
51 -17.4818182 -24.8818182
52 -9.7818182 -17.4818182
53 -32.3818182 -9.7818182
54 -21.1818182 -32.3818182
55 44.5738095 -21.1818182
56 -17.4261905 44.5738095
57 17.6738095 -17.4261905
58 3.8738095 17.6738095
59 -17.4261905 3.8738095
60 -21.2261905 -17.4261905
61 5.3738095 -21.2261905
62 -18.2261905 5.3738095
63 -17.0261905 -18.2261905
64 -14.3261905 -17.0261905
65 -22.5261905 -14.3261905
66 -29.3261905 -22.5261905
67 86.4738095 -29.3261905
68 1.5738095 86.4738095
69 11.6738095 1.5738095
70 -3.8261905 11.6738095
71 -19.4261905 -3.8261905
72 -23.5261905 -19.4261905
73 1.3738095 -23.5261905
74 -14.1261905 1.3738095
75 -17.0261905 -14.1261905
76 -11.7261905 -17.0261905
77 -27.2261905 -11.7261905
78 -6.2261905 -27.2261905
79 72.8738095 -6.2261905
80 1.6738095 72.8738095
81 -3.7261905 1.6738095
82 -4.4261905 -3.7261905
83 -2.4261905 -4.4261905
84 -10.2261905 -2.4261905
85 6.1738095 -10.2261905
86 -4.7261905 6.1738095
87 -10.5261905 -4.7261905
88 2.6738095 -10.5261905
89 -16.5261905 2.6738095
90 -4.7261905 -16.5261905
91 87.6738095 -4.7261905
92 5.4738095 87.6738095
93 0.3738095 5.4738095
94 10.2738095 0.3738095
95 -7.8261905 10.2738095
96 -14.0261905 -7.8261905
> 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/70flg1227566257.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/8cgzq1227566257.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/9trnt1227566257.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/10emwk1227566257.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/11y2at1227566258.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/12rc891227566258.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/13hyac1227566258.tab")
>
> system("convert tmp/1rxl11227566257.ps tmp/1rxl11227566257.png")
> system("convert tmp/29adz1227566257.ps tmp/29adz1227566257.png")
> system("convert tmp/3vr521227566257.ps tmp/3vr521227566257.png")
> system("convert tmp/4i57z1227566257.ps tmp/4i57z1227566257.png")
> system("convert tmp/58j5m1227566257.ps tmp/58j5m1227566257.png")
> system("convert tmp/6x8j81227566257.ps tmp/6x8j81227566257.png")
> system("convert tmp/70flg1227566257.ps tmp/70flg1227566257.png")
> system("convert tmp/8cgzq1227566257.ps tmp/8cgzq1227566257.png")
> system("convert tmp/9trnt1227566257.ps tmp/9trnt1227566257.png")
>
>
> proc.time()
user system elapsed
2.049 1.457 2.382