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(2236.0,0,2084.9,0,2409.5,0,2199.3,0,2203.5,0,2254.1,0,1975.8,0,1742.2,0,2520.6,0,2438.1,0,2126.3,0,2267.5,0,2201.1,0,2128.5,0,2596.0,0,2458.2,0,2210.5,0,2621.2,0,2231.4,0,2103.6,0,2685.8,0,2539.3,0,2462.4,0,2693.3,0,2307.7,0,2385.9,0,2737.6,0,2653.9,0,2545.4,0,2848.8,0,2359.5,1,2488.3,1,2861.1,1,2717.9,1,2844.0,1,2749.0,1,2652.9,1,2660.2,1,3187.1,1,2774.1,1,3158.2,1,3244.6,1,2665.5,1,2820.8,1,2983.4,1,3077.4,1,3024.8,1,2731.8,1,3046.2,1,2834.8,1,3292.8,1,2946.1,1,3196.9,1,3284.2,1,3003.0,1,2979.0,1,3137.4,1,3647.7,1,3283.0,1,2947.3,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 2236.0 0 1 0 0 0 0 0 0 0 0 0 0 1
2 2084.9 0 0 1 0 0 0 0 0 0 0 0 0 2
3 2409.5 0 0 0 1 0 0 0 0 0 0 0 0 3
4 2199.3 0 0 0 0 1 0 0 0 0 0 0 0 4
5 2203.5 0 0 0 0 0 1 0 0 0 0 0 0 5
6 2254.1 0 0 0 0 0 0 1 0 0 0 0 0 6
7 1975.8 0 0 0 0 0 0 0 1 0 0 0 0 7
8 1742.2 0 0 0 0 0 0 0 0 1 0 0 0 8
9 2520.6 0 0 0 0 0 0 0 0 0 1 0 0 9
10 2438.1 0 0 0 0 0 0 0 0 0 0 1 0 10
11 2126.3 0 0 0 0 0 0 0 0 0 0 0 1 11
12 2267.5 0 0 0 0 0 0 0 0 0 0 0 0 12
13 2201.1 0 1 0 0 0 0 0 0 0 0 0 0 13
14 2128.5 0 0 1 0 0 0 0 0 0 0 0 0 14
15 2596.0 0 0 0 1 0 0 0 0 0 0 0 0 15
16 2458.2 0 0 0 0 1 0 0 0 0 0 0 0 16
17 2210.5 0 0 0 0 0 1 0 0 0 0 0 0 17
18 2621.2 0 0 0 0 0 0 1 0 0 0 0 0 18
19 2231.4 0 0 0 0 0 0 0 1 0 0 0 0 19
20 2103.6 0 0 0 0 0 0 0 0 1 0 0 0 20
21 2685.8 0 0 0 0 0 0 0 0 0 1 0 0 21
22 2539.3 0 0 0 0 0 0 0 0 0 0 1 0 22
23 2462.4 0 0 0 0 0 0 0 0 0 0 0 1 23
24 2693.3 0 0 0 0 0 0 0 0 0 0 0 0 24
25 2307.7 0 1 0 0 0 0 0 0 0 0 0 0 25
26 2385.9 0 0 1 0 0 0 0 0 0 0 0 0 26
27 2737.6 0 0 0 1 0 0 0 0 0 0 0 0 27
28 2653.9 0 0 0 0 1 0 0 0 0 0 0 0 28
29 2545.4 0 0 0 0 0 1 0 0 0 0 0 0 29
30 2848.8 0 0 0 0 0 0 1 0 0 0 0 0 30
31 2359.5 1 0 0 0 0 0 0 1 0 0 0 0 31
32 2488.3 1 0 0 0 0 0 0 0 1 0 0 0 32
33 2861.1 1 0 0 0 0 0 0 0 0 1 0 0 33
34 2717.9 1 0 0 0 0 0 0 0 0 0 1 0 34
35 2844.0 1 0 0 0 0 0 0 0 0 0 0 1 35
36 2749.0 1 0 0 0 0 0 0 0 0 0 0 0 36
37 2652.9 1 1 0 0 0 0 0 0 0 0 0 0 37
38 2660.2 1 0 1 0 0 0 0 0 0 0 0 0 38
39 3187.1 1 0 0 1 0 0 0 0 0 0 0 0 39
40 2774.1 1 0 0 0 1 0 0 0 0 0 0 0 40
41 3158.2 1 0 0 0 0 1 0 0 0 0 0 0 41
42 3244.6 1 0 0 0 0 0 1 0 0 0 0 0 42
43 2665.5 1 0 0 0 0 0 0 1 0 0 0 0 43
44 2820.8 1 0 0 0 0 0 0 0 1 0 0 0 44
45 2983.4 1 0 0 0 0 0 0 0 0 1 0 0 45
46 3077.4 1 0 0 0 0 0 0 0 0 0 1 0 46
47 3024.8 1 0 0 0 0 0 0 0 0 0 0 1 47
48 2731.8 1 0 0 0 0 0 0 0 0 0 0 0 48
49 3046.2 1 1 0 0 0 0 0 0 0 0 0 0 49
50 2834.8 1 0 1 0 0 0 0 0 0 0 0 0 50
51 3292.8 1 0 0 1 0 0 0 0 0 0 0 0 51
52 2946.1 1 0 0 0 1 0 0 0 0 0 0 0 52
53 3196.9 1 0 0 0 0 1 0 0 0 0 0 0 53
54 3284.2 1 0 0 0 0 0 1 0 0 0 0 0 54
55 3003.0 1 0 0 0 0 0 0 1 0 0 0 0 55
56 2979.0 1 0 0 0 0 0 0 0 1 0 0 0 56
57 3137.4 1 0 0 0 0 0 0 0 0 1 0 0 57
58 3647.7 1 0 0 0 0 0 0 0 0 0 1 0 58
59 3283.0 1 0 0 0 0 0 0 0 0 0 0 1 59
60 2947.3 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
1993.79 80.94 21.34 -66.23 341.86 85.93
M5 M6 M7 M8 M9 M10
124.86 294.89 -142.49 -180.40 212.83 241.60
M11 t
87.97 17.65
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-212.402 -84.587 -1.997 79.172 307.630
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1993.795 73.110 27.271 < 2e-16 ***
x 80.942 70.350 1.151 0.255864
M1 21.344 85.320 0.250 0.803570
M2 -66.226 85.102 -0.778 0.440437
M3 341.863 84.932 4.025 0.000211 ***
M4 85.933 84.811 1.013 0.316249
M5 124.862 84.738 1.474 0.147422
M6 294.892 84.713 3.481 0.001105 **
M7 -142.487 85.029 -1.676 0.100573
M8 -180.398 84.811 -2.127 0.038809 *
M9 212.832 84.640 2.515 0.015479 *
M10 241.601 84.518 2.859 0.006374 **
M11 87.971 84.445 1.042 0.302972
t 17.651 2.031 8.691 2.89e-11 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 133.5 on 46 degrees of freedom
Multiple R-squared: 0.9117, Adjusted R-squared: 0.8868
F-statistic: 36.54 on 13 and 46 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/1e3mh1227448873.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/2vpx71227448873.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/3evjb1227448873.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/4uzod1227448873.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/5qezc1227448873.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
203.2100000 122.0300000 20.8900000 48.9700000 -3.4100000 -140.4900000
7 8 9 10 11 12
0.9383333 -212.4016667 155.1183333 26.1983333 -149.6216667 61.8983333
13 14 15 16 17 18
-43.4966667 -46.1766667 -4.4166667 96.0633333 -208.2166667 14.8033333
19 20 21 22 23 24
44.7316667 -62.8083333 108.5116667 -84.4083333 -25.3283333 275.8916667
25 26 27 28 29 30
-148.7033333 -0.5833333 -74.6233333 79.9566667 -85.1233333 30.5966667
31 32 33 34 35 36
-119.9166667 29.1433333 -8.9366667 -198.5566667 63.5233333 38.8433333
37 38 39 40 41 42
-96.2516667 -19.0316667 82.1283333 -92.5916667 234.9283333 133.6483333
43 44 45 46 47 48
-25.7233333 149.8366667 -98.4433333 -50.8633333 32.5166667 -190.1633333
49 50 51 52 53 54
85.2416667 -56.2383333 -23.9783333 -132.3983333 61.8216667 -38.5583333
55 56 57 58 59 60
99.9700000 96.2300000 -156.2500000 307.6300000 78.9100000 -186.4700000
> postscript(file="/var/www/html/rcomp/tmp/6fq901227448873.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 203.2100000 NA
1 122.0300000 203.2100000
2 20.8900000 122.0300000
3 48.9700000 20.8900000
4 -3.4100000 48.9700000
5 -140.4900000 -3.4100000
6 0.9383333 -140.4900000
7 -212.4016667 0.9383333
8 155.1183333 -212.4016667
9 26.1983333 155.1183333
10 -149.6216667 26.1983333
11 61.8983333 -149.6216667
12 -43.4966667 61.8983333
13 -46.1766667 -43.4966667
14 -4.4166667 -46.1766667
15 96.0633333 -4.4166667
16 -208.2166667 96.0633333
17 14.8033333 -208.2166667
18 44.7316667 14.8033333
19 -62.8083333 44.7316667
20 108.5116667 -62.8083333
21 -84.4083333 108.5116667
22 -25.3283333 -84.4083333
23 275.8916667 -25.3283333
24 -148.7033333 275.8916667
25 -0.5833333 -148.7033333
26 -74.6233333 -0.5833333
27 79.9566667 -74.6233333
28 -85.1233333 79.9566667
29 30.5966667 -85.1233333
30 -119.9166667 30.5966667
31 29.1433333 -119.9166667
32 -8.9366667 29.1433333
33 -198.5566667 -8.9366667
34 63.5233333 -198.5566667
35 38.8433333 63.5233333
36 -96.2516667 38.8433333
37 -19.0316667 -96.2516667
38 82.1283333 -19.0316667
39 -92.5916667 82.1283333
40 234.9283333 -92.5916667
41 133.6483333 234.9283333
42 -25.7233333 133.6483333
43 149.8366667 -25.7233333
44 -98.4433333 149.8366667
45 -50.8633333 -98.4433333
46 32.5166667 -50.8633333
47 -190.1633333 32.5166667
48 85.2416667 -190.1633333
49 -56.2383333 85.2416667
50 -23.9783333 -56.2383333
51 -132.3983333 -23.9783333
52 61.8216667 -132.3983333
53 -38.5583333 61.8216667
54 99.9700000 -38.5583333
55 96.2300000 99.9700000
56 -156.2500000 96.2300000
57 307.6300000 -156.2500000
58 78.9100000 307.6300000
59 -186.4700000 78.9100000
60 NA -186.4700000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 122.0300000 203.2100000
[2,] 20.8900000 122.0300000
[3,] 48.9700000 20.8900000
[4,] -3.4100000 48.9700000
[5,] -140.4900000 -3.4100000
[6,] 0.9383333 -140.4900000
[7,] -212.4016667 0.9383333
[8,] 155.1183333 -212.4016667
[9,] 26.1983333 155.1183333
[10,] -149.6216667 26.1983333
[11,] 61.8983333 -149.6216667
[12,] -43.4966667 61.8983333
[13,] -46.1766667 -43.4966667
[14,] -4.4166667 -46.1766667
[15,] 96.0633333 -4.4166667
[16,] -208.2166667 96.0633333
[17,] 14.8033333 -208.2166667
[18,] 44.7316667 14.8033333
[19,] -62.8083333 44.7316667
[20,] 108.5116667 -62.8083333
[21,] -84.4083333 108.5116667
[22,] -25.3283333 -84.4083333
[23,] 275.8916667 -25.3283333
[24,] -148.7033333 275.8916667
[25,] -0.5833333 -148.7033333
[26,] -74.6233333 -0.5833333
[27,] 79.9566667 -74.6233333
[28,] -85.1233333 79.9566667
[29,] 30.5966667 -85.1233333
[30,] -119.9166667 30.5966667
[31,] 29.1433333 -119.9166667
[32,] -8.9366667 29.1433333
[33,] -198.5566667 -8.9366667
[34,] 63.5233333 -198.5566667
[35,] 38.8433333 63.5233333
[36,] -96.2516667 38.8433333
[37,] -19.0316667 -96.2516667
[38,] 82.1283333 -19.0316667
[39,] -92.5916667 82.1283333
[40,] 234.9283333 -92.5916667
[41,] 133.6483333 234.9283333
[42,] -25.7233333 133.6483333
[43,] 149.8366667 -25.7233333
[44,] -98.4433333 149.8366667
[45,] -50.8633333 -98.4433333
[46,] 32.5166667 -50.8633333
[47,] -190.1633333 32.5166667
[48,] 85.2416667 -190.1633333
[49,] -56.2383333 85.2416667
[50,] -23.9783333 -56.2383333
[51,] -132.3983333 -23.9783333
[52,] 61.8216667 -132.3983333
[53,] -38.5583333 61.8216667
[54,] 99.9700000 -38.5583333
[55,] 96.2300000 99.9700000
[56,] -156.2500000 96.2300000
[57,] 307.6300000 -156.2500000
[58,] 78.9100000 307.6300000
[59,] -186.4700000 78.9100000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 122.0300000 203.2100000
2 20.8900000 122.0300000
3 48.9700000 20.8900000
4 -3.4100000 48.9700000
5 -140.4900000 -3.4100000
6 0.9383333 -140.4900000
7 -212.4016667 0.9383333
8 155.1183333 -212.4016667
9 26.1983333 155.1183333
10 -149.6216667 26.1983333
11 61.8983333 -149.6216667
12 -43.4966667 61.8983333
13 -46.1766667 -43.4966667
14 -4.4166667 -46.1766667
15 96.0633333 -4.4166667
16 -208.2166667 96.0633333
17 14.8033333 -208.2166667
18 44.7316667 14.8033333
19 -62.8083333 44.7316667
20 108.5116667 -62.8083333
21 -84.4083333 108.5116667
22 -25.3283333 -84.4083333
23 275.8916667 -25.3283333
24 -148.7033333 275.8916667
25 -0.5833333 -148.7033333
26 -74.6233333 -0.5833333
27 79.9566667 -74.6233333
28 -85.1233333 79.9566667
29 30.5966667 -85.1233333
30 -119.9166667 30.5966667
31 29.1433333 -119.9166667
32 -8.9366667 29.1433333
33 -198.5566667 -8.9366667
34 63.5233333 -198.5566667
35 38.8433333 63.5233333
36 -96.2516667 38.8433333
37 -19.0316667 -96.2516667
38 82.1283333 -19.0316667
39 -92.5916667 82.1283333
40 234.9283333 -92.5916667
41 133.6483333 234.9283333
42 -25.7233333 133.6483333
43 149.8366667 -25.7233333
44 -98.4433333 149.8366667
45 -50.8633333 -98.4433333
46 32.5166667 -50.8633333
47 -190.1633333 32.5166667
48 85.2416667 -190.1633333
49 -56.2383333 85.2416667
50 -23.9783333 -56.2383333
51 -132.3983333 -23.9783333
52 61.8216667 -132.3983333
53 -38.5583333 61.8216667
54 99.9700000 -38.5583333
55 96.2300000 99.9700000
56 -156.2500000 96.2300000
57 307.6300000 -156.2500000
58 78.9100000 307.6300000
59 -186.4700000 78.9100000
> 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/7qpxa1227448873.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/8jz821227448873.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/93cce1227448873.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/10f6981227448874.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/11tj3q1227448874.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/12z0l21227448874.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/13ap2z1227448874.tab")
>
> system("convert tmp/1e3mh1227448873.ps tmp/1e3mh1227448873.png")
> system("convert tmp/2vpx71227448873.ps tmp/2vpx71227448873.png")
> system("convert tmp/3evjb1227448873.ps tmp/3evjb1227448873.png")
> system("convert tmp/4uzod1227448873.ps tmp/4uzod1227448873.png")
> system("convert tmp/5qezc1227448873.ps tmp/5qezc1227448873.png")
> system("convert tmp/6fq901227448873.ps tmp/6fq901227448873.png")
> system("convert tmp/7qpxa1227448873.ps tmp/7qpxa1227448873.png")
> system("convert tmp/8jz821227448873.ps tmp/8jz821227448873.png")
> system("convert tmp/93cce1227448873.ps tmp/93cce1227448873.png")
>
>
> proc.time()
user system elapsed
2.025 1.428 2.672