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(103.6500,0,103.8700,0,103.9400,0,105.3200,0,105.5400,0,106.0800,0,106.2100,0,105.5300,0,105.5600,0,105.1400,0,105.9700,0,105.4500,0,106.2200,0,106.3100,0,107.3800,0,109.3100,0,110.8200,0,111.2200,0,110.6600,0,110.7600,0,110.6900,0,111.0800,0,110.9700,0,110.2400,0,112.5100,1,111.5200,1,112.1300,1,112.2300,1,112.9200,1,111.8900,1,111.9900,1,111.5100,1,112.3300,1,112.0400,1,112.0900,1,111.4100,1,112.6100,1,113.1400,1,113.6500,1,114.2600,1,114.4000,1,114.9300,1,114.8600,1,114.9500,1,116.1700,1,114.6000,1,114.6200,1,113.8200,1,115.0200,1,115.1800,1,115.5900,1,116.6000,1,117.0700,1,116.9600,1,116.6600,1,116.0700,1,116.0400,1,115.8100,1,116.2200,1,115.8500,1,116.4300,1,117.3900,1,119.1700,1,119.2400,1,120.0300,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 103.65 0 1 0 0 0 0 0 0 0 0 0 0
2 103.87 0 0 1 0 0 0 0 0 0 0 0 0
3 103.94 0 0 0 1 0 0 0 0 0 0 0 0
4 105.32 0 0 0 0 1 0 0 0 0 0 0 0
5 105.54 0 0 0 0 0 1 0 0 0 0 0 0
6 106.08 0 0 0 0 0 0 1 0 0 0 0 0
7 106.21 0 0 0 0 0 0 0 1 0 0 0 0
8 105.53 0 0 0 0 0 0 0 0 1 0 0 0
9 105.56 0 0 0 0 0 0 0 0 0 1 0 0
10 105.14 0 0 0 0 0 0 0 0 0 0 1 0
11 105.97 0 0 0 0 0 0 0 0 0 0 0 1
12 105.45 0 0 0 0 0 0 0 0 0 0 0 0
13 106.22 0 1 0 0 0 0 0 0 0 0 0 0
14 106.31 0 0 1 0 0 0 0 0 0 0 0 0
15 107.38 0 0 0 1 0 0 0 0 0 0 0 0
16 109.31 0 0 0 0 1 0 0 0 0 0 0 0
17 110.82 0 0 0 0 0 1 0 0 0 0 0 0
18 111.22 0 0 0 0 0 0 1 0 0 0 0 0
19 110.66 0 0 0 0 0 0 0 1 0 0 0 0
20 110.76 0 0 0 0 0 0 0 0 1 0 0 0
21 110.69 0 0 0 0 0 0 0 0 0 1 0 0
22 111.08 0 0 0 0 0 0 0 0 0 0 1 0
23 110.97 0 0 0 0 0 0 0 0 0 0 0 1
24 110.24 0 0 0 0 0 0 0 0 0 0 0 0
25 112.51 1 1 0 0 0 0 0 0 0 0 0 0
26 111.52 1 0 1 0 0 0 0 0 0 0 0 0
27 112.13 1 0 0 1 0 0 0 0 0 0 0 0
28 112.23 1 0 0 0 1 0 0 0 0 0 0 0
29 112.92 1 0 0 0 0 1 0 0 0 0 0 0
30 111.89 1 0 0 0 0 0 1 0 0 0 0 0
31 111.99 1 0 0 0 0 0 0 1 0 0 0 0
32 111.51 1 0 0 0 0 0 0 0 1 0 0 0
33 112.33 1 0 0 0 0 0 0 0 0 1 0 0
34 112.04 1 0 0 0 0 0 0 0 0 0 1 0
35 112.09 1 0 0 0 0 0 0 0 0 0 0 1
36 111.41 1 0 0 0 0 0 0 0 0 0 0 0
37 112.61 1 1 0 0 0 0 0 0 0 0 0 0
38 113.14 1 0 1 0 0 0 0 0 0 0 0 0
39 113.65 1 0 0 1 0 0 0 0 0 0 0 0
40 114.26 1 0 0 0 1 0 0 0 0 0 0 0
41 114.40 1 0 0 0 0 1 0 0 0 0 0 0
42 114.93 1 0 0 0 0 0 1 0 0 0 0 0
43 114.86 1 0 0 0 0 0 0 1 0 0 0 0
44 114.95 1 0 0 0 0 0 0 0 1 0 0 0
45 116.17 1 0 0 0 0 0 0 0 0 1 0 0
46 114.60 1 0 0 0 0 0 0 0 0 0 1 0
47 114.62 1 0 0 0 0 0 0 0 0 0 0 1
48 113.82 1 0 0 0 0 0 0 0 0 0 0 0
49 115.02 1 1 0 0 0 0 0 0 0 0 0 0
50 115.18 1 0 1 0 0 0 0 0 0 0 0 0
51 115.59 1 0 0 1 0 0 0 0 0 0 0 0
52 116.60 1 0 0 0 1 0 0 0 0 0 0 0
53 117.07 1 0 0 0 0 1 0 0 0 0 0 0
54 116.96 1 0 0 0 0 0 1 0 0 0 0 0
55 116.66 1 0 0 0 0 0 0 1 0 0 0 0
56 116.07 1 0 0 0 0 0 0 0 1 0 0 0
57 116.04 1 0 0 0 0 0 0 0 0 1 0 0
58 115.81 1 0 0 0 0 0 0 0 0 0 1 0
59 116.22 1 0 0 0 0 0 0 0 0 0 0 1
60 115.85 1 0 0 0 0 0 0 0 0 0 0 0
61 116.43 1 1 0 0 0 0 0 0 0 0 0 0
62 117.39 1 0 1 0 0 0 0 0 0 0 0 0
63 119.17 1 0 0 1 0 0 0 0 0 0 0 0
64 119.24 1 0 0 0 1 0 0 0 0 0 0 0
65 120.03 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
106.9822 7.2864 -0.7664 -0.6048 0.1369 0.9869
M5 M6 M7 M8 M9 M10
1.6236 0.8620 0.7220 0.4100 0.8040 0.3800
M11
0.6200
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.2406 -2.2222 -0.1306 1.5179 4.7645
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 106.9822 1.2146 88.079 < 2e-16 ***
x 7.2864 0.6613 11.018 3.29e-15 ***
M1 -0.7664 1.5550 -0.493 0.624
M2 -0.6048 1.5550 -0.389 0.699
M3 0.1369 1.5550 0.088 0.930
M4 0.9869 1.5550 0.635 0.528
M5 1.6236 1.5550 1.044 0.301
M6 0.8620 1.6235 0.531 0.598
M7 0.7220 1.6235 0.445 0.658
M8 0.4100 1.6235 0.253 0.802
M9 0.8040 1.6235 0.495 0.623
M10 0.3800 1.6235 0.234 0.816
M11 0.6200 1.6235 0.382 0.704
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.567 on 52 degrees of freedom
Multiple R-Squared: 0.7075, Adjusted R-squared: 0.64
F-statistic: 10.48 on 12 and 52 DF, p-value: 4.299e-10
> postscript(file="/var/www/html/rcomp/tmp/156j01195493326.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/26xq21195493326.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/38crb1195493326.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/4svxj1195493326.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/5tfsg1195493326.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
-2.565722714 -2.507389381 -3.179056047 -2.649056047 -3.065722714 -1.764150442
7 8 9 10 11 12
-1.494150442 -1.862150442 -2.226150442 -2.222150442 -1.632150442 -1.532150442
13 14 15 16 17 18
0.004277286 -0.067389381 0.260943953 1.340943953 2.214277286 3.375849558
19 20 21 22 23 24
2.955849558 3.367849558 2.903849558 3.717849558 3.367849558 3.257849558
25 26 27 28 29 30
-0.992138643 -2.143805310 -2.275471976 -3.025471976 -2.972138643 -3.240566372
31 32 33 34 35 36
-3.000566372 -3.168566372 -2.742566372 -2.608566372 -2.798566372 -2.858566372
37 38 39 40 41 42
-0.892138643 -0.523805310 -0.755471976 -0.995471976 -1.492138643 -0.200566372
43 44 45 46 47 48
-0.130566372 0.271433628 1.097433628 -0.048566372 -0.268566372 -0.448566372
49 50 51 52 53 54
1.517861357 1.516194690 1.184528024 1.344528024 1.177861357 1.829433628
55 56 57 58 59 60
1.669433628 1.391433628 0.967433628 1.161433628 1.331433628 1.581433628
61 62 63 64 65
2.927861357 3.726194690 4.764528024 3.984528024 4.137861357
> postscript(file="/var/www/html/rcomp/tmp/6mdcs1195493326.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 -2.565722714 NA
1 -2.507389381 -2.565722714
2 -3.179056047 -2.507389381
3 -2.649056047 -3.179056047
4 -3.065722714 -2.649056047
5 -1.764150442 -3.065722714
6 -1.494150442 -1.764150442
7 -1.862150442 -1.494150442
8 -2.226150442 -1.862150442
9 -2.222150442 -2.226150442
10 -1.632150442 -2.222150442
11 -1.532150442 -1.632150442
12 0.004277286 -1.532150442
13 -0.067389381 0.004277286
14 0.260943953 -0.067389381
15 1.340943953 0.260943953
16 2.214277286 1.340943953
17 3.375849558 2.214277286
18 2.955849558 3.375849558
19 3.367849558 2.955849558
20 2.903849558 3.367849558
21 3.717849558 2.903849558
22 3.367849558 3.717849558
23 3.257849558 3.367849558
24 -0.992138643 3.257849558
25 -2.143805310 -0.992138643
26 -2.275471976 -2.143805310
27 -3.025471976 -2.275471976
28 -2.972138643 -3.025471976
29 -3.240566372 -2.972138643
30 -3.000566372 -3.240566372
31 -3.168566372 -3.000566372
32 -2.742566372 -3.168566372
33 -2.608566372 -2.742566372
34 -2.798566372 -2.608566372
35 -2.858566372 -2.798566372
36 -0.892138643 -2.858566372
37 -0.523805310 -0.892138643
38 -0.755471976 -0.523805310
39 -0.995471976 -0.755471976
40 -1.492138643 -0.995471976
41 -0.200566372 -1.492138643
42 -0.130566372 -0.200566372
43 0.271433628 -0.130566372
44 1.097433628 0.271433628
45 -0.048566372 1.097433628
46 -0.268566372 -0.048566372
47 -0.448566372 -0.268566372
48 1.517861357 -0.448566372
49 1.516194690 1.517861357
50 1.184528024 1.516194690
51 1.344528024 1.184528024
52 1.177861357 1.344528024
53 1.829433628 1.177861357
54 1.669433628 1.829433628
55 1.391433628 1.669433628
56 0.967433628 1.391433628
57 1.161433628 0.967433628
58 1.331433628 1.161433628
59 1.581433628 1.331433628
60 2.927861357 1.581433628
61 3.726194690 2.927861357
62 4.764528024 3.726194690
63 3.984528024 4.764528024
64 4.137861357 3.984528024
65 NA 4.137861357
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.507389381 -2.565722714
[2,] -3.179056047 -2.507389381
[3,] -2.649056047 -3.179056047
[4,] -3.065722714 -2.649056047
[5,] -1.764150442 -3.065722714
[6,] -1.494150442 -1.764150442
[7,] -1.862150442 -1.494150442
[8,] -2.226150442 -1.862150442
[9,] -2.222150442 -2.226150442
[10,] -1.632150442 -2.222150442
[11,] -1.532150442 -1.632150442
[12,] 0.004277286 -1.532150442
[13,] -0.067389381 0.004277286
[14,] 0.260943953 -0.067389381
[15,] 1.340943953 0.260943953
[16,] 2.214277286 1.340943953
[17,] 3.375849558 2.214277286
[18,] 2.955849558 3.375849558
[19,] 3.367849558 2.955849558
[20,] 2.903849558 3.367849558
[21,] 3.717849558 2.903849558
[22,] 3.367849558 3.717849558
[23,] 3.257849558 3.367849558
[24,] -0.992138643 3.257849558
[25,] -2.143805310 -0.992138643
[26,] -2.275471976 -2.143805310
[27,] -3.025471976 -2.275471976
[28,] -2.972138643 -3.025471976
[29,] -3.240566372 -2.972138643
[30,] -3.000566372 -3.240566372
[31,] -3.168566372 -3.000566372
[32,] -2.742566372 -3.168566372
[33,] -2.608566372 -2.742566372
[34,] -2.798566372 -2.608566372
[35,] -2.858566372 -2.798566372
[36,] -0.892138643 -2.858566372
[37,] -0.523805310 -0.892138643
[38,] -0.755471976 -0.523805310
[39,] -0.995471976 -0.755471976
[40,] -1.492138643 -0.995471976
[41,] -0.200566372 -1.492138643
[42,] -0.130566372 -0.200566372
[43,] 0.271433628 -0.130566372
[44,] 1.097433628 0.271433628
[45,] -0.048566372 1.097433628
[46,] -0.268566372 -0.048566372
[47,] -0.448566372 -0.268566372
[48,] 1.517861357 -0.448566372
[49,] 1.516194690 1.517861357
[50,] 1.184528024 1.516194690
[51,] 1.344528024 1.184528024
[52,] 1.177861357 1.344528024
[53,] 1.829433628 1.177861357
[54,] 1.669433628 1.829433628
[55,] 1.391433628 1.669433628
[56,] 0.967433628 1.391433628
[57,] 1.161433628 0.967433628
[58,] 1.331433628 1.161433628
[59,] 1.581433628 1.331433628
[60,] 2.927861357 1.581433628
[61,] 3.726194690 2.927861357
[62,] 4.764528024 3.726194690
[63,] 3.984528024 4.764528024
[64,] 4.137861357 3.984528024
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.507389381 -2.565722714
2 -3.179056047 -2.507389381
3 -2.649056047 -3.179056047
4 -3.065722714 -2.649056047
5 -1.764150442 -3.065722714
6 -1.494150442 -1.764150442
7 -1.862150442 -1.494150442
8 -2.226150442 -1.862150442
9 -2.222150442 -2.226150442
10 -1.632150442 -2.222150442
11 -1.532150442 -1.632150442
12 0.004277286 -1.532150442
13 -0.067389381 0.004277286
14 0.260943953 -0.067389381
15 1.340943953 0.260943953
16 2.214277286 1.340943953
17 3.375849558 2.214277286
18 2.955849558 3.375849558
19 3.367849558 2.955849558
20 2.903849558 3.367849558
21 3.717849558 2.903849558
22 3.367849558 3.717849558
23 3.257849558 3.367849558
24 -0.992138643 3.257849558
25 -2.143805310 -0.992138643
26 -2.275471976 -2.143805310
27 -3.025471976 -2.275471976
28 -2.972138643 -3.025471976
29 -3.240566372 -2.972138643
30 -3.000566372 -3.240566372
31 -3.168566372 -3.000566372
32 -2.742566372 -3.168566372
33 -2.608566372 -2.742566372
34 -2.798566372 -2.608566372
35 -2.858566372 -2.798566372
36 -0.892138643 -2.858566372
37 -0.523805310 -0.892138643
38 -0.755471976 -0.523805310
39 -0.995471976 -0.755471976
40 -1.492138643 -0.995471976
41 -0.200566372 -1.492138643
42 -0.130566372 -0.200566372
43 0.271433628 -0.130566372
44 1.097433628 0.271433628
45 -0.048566372 1.097433628
46 -0.268566372 -0.048566372
47 -0.448566372 -0.268566372
48 1.517861357 -0.448566372
49 1.516194690 1.517861357
50 1.184528024 1.516194690
51 1.344528024 1.184528024
52 1.177861357 1.344528024
53 1.829433628 1.177861357
54 1.669433628 1.829433628
55 1.391433628 1.669433628
56 0.967433628 1.391433628
57 1.161433628 0.967433628
58 1.331433628 1.161433628
59 1.581433628 1.331433628
60 2.927861357 1.581433628
61 3.726194690 2.927861357
62 4.764528024 3.726194690
63 3.984528024 4.764528024
64 4.137861357 3.984528024
> 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/7oy631195493326.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/811ha1195493326.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/9zbr01195493326.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/10314l1195493326.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/11ekkd1195493326.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/12zlf91195493327.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/136jkf1195493327.tab")
>
> system("convert tmp/156j01195493326.ps tmp/156j01195493326.png")
> system("convert tmp/26xq21195493326.ps tmp/26xq21195493326.png")
> system("convert tmp/38crb1195493326.ps tmp/38crb1195493326.png")
> system("convert tmp/4svxj1195493326.ps tmp/4svxj1195493326.png")
> system("convert tmp/5tfsg1195493326.ps tmp/5tfsg1195493326.png")
> system("convert tmp/6mdcs1195493326.ps tmp/6mdcs1195493326.png")
> system("convert tmp/7oy631195493326.ps tmp/7oy631195493326.png")
> system("convert tmp/811ha1195493326.ps tmp/811ha1195493326.png")
> system("convert tmp/9zbr01195493326.ps tmp/9zbr01195493326.png")
>
>
> proc.time()
user system elapsed
2.314 1.456 2.818