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(102.7,0,103.2,0,105.6,0,103.9,0,107.2,0,100.7,0,92.1,0,90.3,0,93.4,0,98.5,0,100.8,0,102.3,0,104.7,0,101.1,0,101.4,0,99.5,0,98.4,0,96.3,0,100.7,0,101.2,0,100.3,0,97.8,0,97.4,0,98.6,0,99.7,0,99,0,98.1,0,97,0,98.5,0,103.8,0,114.4,0,124.5,0,134.2,0,131.8,0,125.6,0,119.9,0,114.9,0,115.5,0,112.5,0,111.4,0,115.3,0,110.8,0,103.7,0,111.1,0,113,0,111.2,0,117.6,0,121.7,0,127.3,0,129.8,0,137.1,0,141.4,0,137.4,0,130.7,0,117.2,0,110.8,0,111.4,0,108.2,0,108.8,0,110.2,0,109.5,0,109.5,0,116,0,111.2,0,112.1,0,114,0,119.1,0,114.1,0,115.1,0,115.4,0,110.8,0,116,0,119.2,0,126.5,0,127.8,0,131.3,0,140.3,0,137.3,0,143,0,134.5,0,139.9,1,159.3,1,170.4,1,175,1,175.8,1,180.9,1,180.3,1,169.6,1,172.3,1,184.8,1,177.7,1,184.6,1,211.4,1),dim=c(2,93),dimnames=list(c('Graan','X'),1:93))
> y <- array(NA,dim=c(2,93),dimnames=list(c('Graan','X'),1:93))
> 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 = '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
Graan X t
1 102.7 0 1
2 103.2 0 2
3 105.6 0 3
4 103.9 0 4
5 107.2 0 5
6 100.7 0 6
7 92.1 0 7
8 90.3 0 8
9 93.4 0 9
10 98.5 0 10
11 100.8 0 11
12 102.3 0 12
13 104.7 0 13
14 101.1 0 14
15 101.4 0 15
16 99.5 0 16
17 98.4 0 17
18 96.3 0 18
19 100.7 0 19
20 101.2 0 20
21 100.3 0 21
22 97.8 0 22
23 97.4 0 23
24 98.6 0 24
25 99.7 0 25
26 99.0 0 26
27 98.1 0 27
28 97.0 0 28
29 98.5 0 29
30 103.8 0 30
31 114.4 0 31
32 124.5 0 32
33 134.2 0 33
34 131.8 0 34
35 125.6 0 35
36 119.9 0 36
37 114.9 0 37
38 115.5 0 38
39 112.5 0 39
40 111.4 0 40
41 115.3 0 41
42 110.8 0 42
43 103.7 0 43
44 111.1 0 44
45 113.0 0 45
46 111.2 0 46
47 117.6 0 47
48 121.7 0 48
49 127.3 0 49
50 129.8 0 50
51 137.1 0 51
52 141.4 0 52
53 137.4 0 53
54 130.7 0 54
55 117.2 0 55
56 110.8 0 56
57 111.4 0 57
58 108.2 0 58
59 108.8 0 59
60 110.2 0 60
61 109.5 0 61
62 109.5 0 62
63 116.0 0 63
64 111.2 0 64
65 112.1 0 65
66 114.0 0 66
67 119.1 0 67
68 114.1 0 68
69 115.1 0 69
70 115.4 0 70
71 110.8 0 71
72 116.0 0 72
73 119.2 0 73
74 126.5 0 74
75 127.8 0 75
76 131.3 0 76
77 140.3 0 77
78 137.3 0 78
79 143.0 0 79
80 134.5 0 80
81 139.9 1 81
82 159.3 1 82
83 170.4 1 83
84 175.0 1 84
85 175.8 1 85
86 180.9 1 86
87 180.3 1 87
88 169.6 1 88
89 172.3 1 89
90 184.8 1 90
91 177.7 1 91
92 184.6 1 92
93 211.4 1 93
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X t
96.3960 44.6480 0.3965
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-33.260 -7.596 -1.238 5.908 33.483
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 96.39598 2.34886 41.039 < 2e-16 ***
X 44.64801 3.89838 11.453 < 2e-16 ***
t 0.39649 0.05036 7.874 7.42e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 10.42 on 90 degrees of freedom
Multiple R-Squared: 0.8398, Adjusted R-squared: 0.8362
F-statistic: 235.8 on 2 and 90 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/1qq0i1197825603.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/2g95x1197825604.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/34w0f1197825604.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/4bti21197825604.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/5sfzd1197825604.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 = 93
Frequency = 1
1 2 3 4 5 6
5.90753624 6.01104798 8.01455972 5.91807146 8.82158320 1.92509494
7 8 9 10 11 12
-7.07139332 -9.26788158 -6.56436984 -1.86085809 0.04265365 1.14616539
13 14 15 16 17 18
3.14967713 -0.84681113 -0.94329939 -3.23978765 -4.73627591 -7.23276417
19 20 21 22 23 24
-3.22925243 -3.12574069 -4.42222895 -7.31871721 -8.11520546 -7.31169372
25 26 27 28 29 30
-6.60818198 -7.70467024 -9.00115850 -10.49764676 -9.39413502 -4.49062328
31 32 33 34 35 36
5.71288846 15.41640020 24.71991194 21.92342368 15.32693543 9.23044717
37 38 39 40 41 42
3.83395891 4.03747065 0.64098239 -0.85550587 2.64800587 -2.24848239
43 44 45 46 47 48
-9.74497065 -2.74145891 -1.23794717 -3.43443543 2.56907632 6.27258806
49 50 51 52 53 54
11.47609980 13.57961154 20.48312328 24.38663502 19.99014676 12.89365850
55 56 57 58 59 60
-1.00282976 -7.79931802 -7.59580628 -11.19229454 -10.98878279 -9.98527105
61 62 63 64 65 66
-11.08175931 -11.47824757 -5.37473583 -10.57122409 -10.06771235 -8.56420061
67 68 69 70 71 72
-3.86068887 -9.25717713 -8.65366539 -8.75015365 -13.74664191 -8.94313016
73 74 75 76 77 78
-6.13961842 0.76389332 1.66740506 4.77091680 13.37442854 9.97794028
79 80 81 82 83 84
15.28145202 6.38496376 -33.25953198 -14.25602024 -3.55250850 0.65100324
85 86 87 88 89 90
1.05451498 5.75802672 4.76153846 -6.33494980 -4.03143806 8.07207368
91 92 93
0.57558542 7.07909717 33.48260891
> postscript(file="/var/www/html/rcomp/tmp/6ovq61197825604.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 = 93
Frequency = 1
lag(myerror, k = 1) myerror
0 5.90753624 NA
1 6.01104798 5.90753624
2 8.01455972 6.01104798
3 5.91807146 8.01455972
4 8.82158320 5.91807146
5 1.92509494 8.82158320
6 -7.07139332 1.92509494
7 -9.26788158 -7.07139332
8 -6.56436984 -9.26788158
9 -1.86085809 -6.56436984
10 0.04265365 -1.86085809
11 1.14616539 0.04265365
12 3.14967713 1.14616539
13 -0.84681113 3.14967713
14 -0.94329939 -0.84681113
15 -3.23978765 -0.94329939
16 -4.73627591 -3.23978765
17 -7.23276417 -4.73627591
18 -3.22925243 -7.23276417
19 -3.12574069 -3.22925243
20 -4.42222895 -3.12574069
21 -7.31871721 -4.42222895
22 -8.11520546 -7.31871721
23 -7.31169372 -8.11520546
24 -6.60818198 -7.31169372
25 -7.70467024 -6.60818198
26 -9.00115850 -7.70467024
27 -10.49764676 -9.00115850
28 -9.39413502 -10.49764676
29 -4.49062328 -9.39413502
30 5.71288846 -4.49062328
31 15.41640020 5.71288846
32 24.71991194 15.41640020
33 21.92342368 24.71991194
34 15.32693543 21.92342368
35 9.23044717 15.32693543
36 3.83395891 9.23044717
37 4.03747065 3.83395891
38 0.64098239 4.03747065
39 -0.85550587 0.64098239
40 2.64800587 -0.85550587
41 -2.24848239 2.64800587
42 -9.74497065 -2.24848239
43 -2.74145891 -9.74497065
44 -1.23794717 -2.74145891
45 -3.43443543 -1.23794717
46 2.56907632 -3.43443543
47 6.27258806 2.56907632
48 11.47609980 6.27258806
49 13.57961154 11.47609980
50 20.48312328 13.57961154
51 24.38663502 20.48312328
52 19.99014676 24.38663502
53 12.89365850 19.99014676
54 -1.00282976 12.89365850
55 -7.79931802 -1.00282976
56 -7.59580628 -7.79931802
57 -11.19229454 -7.59580628
58 -10.98878279 -11.19229454
59 -9.98527105 -10.98878279
60 -11.08175931 -9.98527105
61 -11.47824757 -11.08175931
62 -5.37473583 -11.47824757
63 -10.57122409 -5.37473583
64 -10.06771235 -10.57122409
65 -8.56420061 -10.06771235
66 -3.86068887 -8.56420061
67 -9.25717713 -3.86068887
68 -8.65366539 -9.25717713
69 -8.75015365 -8.65366539
70 -13.74664191 -8.75015365
71 -8.94313016 -13.74664191
72 -6.13961842 -8.94313016
73 0.76389332 -6.13961842
74 1.66740506 0.76389332
75 4.77091680 1.66740506
76 13.37442854 4.77091680
77 9.97794028 13.37442854
78 15.28145202 9.97794028
79 6.38496376 15.28145202
80 -33.25953198 6.38496376
81 -14.25602024 -33.25953198
82 -3.55250850 -14.25602024
83 0.65100324 -3.55250850
84 1.05451498 0.65100324
85 5.75802672 1.05451498
86 4.76153846 5.75802672
87 -6.33494980 4.76153846
88 -4.03143806 -6.33494980
89 8.07207368 -4.03143806
90 0.57558542 8.07207368
91 7.07909717 0.57558542
92 33.48260891 7.07909717
93 NA 33.48260891
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 6.01104798 5.90753624
[2,] 8.01455972 6.01104798
[3,] 5.91807146 8.01455972
[4,] 8.82158320 5.91807146
[5,] 1.92509494 8.82158320
[6,] -7.07139332 1.92509494
[7,] -9.26788158 -7.07139332
[8,] -6.56436984 -9.26788158
[9,] -1.86085809 -6.56436984
[10,] 0.04265365 -1.86085809
[11,] 1.14616539 0.04265365
[12,] 3.14967713 1.14616539
[13,] -0.84681113 3.14967713
[14,] -0.94329939 -0.84681113
[15,] -3.23978765 -0.94329939
[16,] -4.73627591 -3.23978765
[17,] -7.23276417 -4.73627591
[18,] -3.22925243 -7.23276417
[19,] -3.12574069 -3.22925243
[20,] -4.42222895 -3.12574069
[21,] -7.31871721 -4.42222895
[22,] -8.11520546 -7.31871721
[23,] -7.31169372 -8.11520546
[24,] -6.60818198 -7.31169372
[25,] -7.70467024 -6.60818198
[26,] -9.00115850 -7.70467024
[27,] -10.49764676 -9.00115850
[28,] -9.39413502 -10.49764676
[29,] -4.49062328 -9.39413502
[30,] 5.71288846 -4.49062328
[31,] 15.41640020 5.71288846
[32,] 24.71991194 15.41640020
[33,] 21.92342368 24.71991194
[34,] 15.32693543 21.92342368
[35,] 9.23044717 15.32693543
[36,] 3.83395891 9.23044717
[37,] 4.03747065 3.83395891
[38,] 0.64098239 4.03747065
[39,] -0.85550587 0.64098239
[40,] 2.64800587 -0.85550587
[41,] -2.24848239 2.64800587
[42,] -9.74497065 -2.24848239
[43,] -2.74145891 -9.74497065
[44,] -1.23794717 -2.74145891
[45,] -3.43443543 -1.23794717
[46,] 2.56907632 -3.43443543
[47,] 6.27258806 2.56907632
[48,] 11.47609980 6.27258806
[49,] 13.57961154 11.47609980
[50,] 20.48312328 13.57961154
[51,] 24.38663502 20.48312328
[52,] 19.99014676 24.38663502
[53,] 12.89365850 19.99014676
[54,] -1.00282976 12.89365850
[55,] -7.79931802 -1.00282976
[56,] -7.59580628 -7.79931802
[57,] -11.19229454 -7.59580628
[58,] -10.98878279 -11.19229454
[59,] -9.98527105 -10.98878279
[60,] -11.08175931 -9.98527105
[61,] -11.47824757 -11.08175931
[62,] -5.37473583 -11.47824757
[63,] -10.57122409 -5.37473583
[64,] -10.06771235 -10.57122409
[65,] -8.56420061 -10.06771235
[66,] -3.86068887 -8.56420061
[67,] -9.25717713 -3.86068887
[68,] -8.65366539 -9.25717713
[69,] -8.75015365 -8.65366539
[70,] -13.74664191 -8.75015365
[71,] -8.94313016 -13.74664191
[72,] -6.13961842 -8.94313016
[73,] 0.76389332 -6.13961842
[74,] 1.66740506 0.76389332
[75,] 4.77091680 1.66740506
[76,] 13.37442854 4.77091680
[77,] 9.97794028 13.37442854
[78,] 15.28145202 9.97794028
[79,] 6.38496376 15.28145202
[80,] -33.25953198 6.38496376
[81,] -14.25602024 -33.25953198
[82,] -3.55250850 -14.25602024
[83,] 0.65100324 -3.55250850
[84,] 1.05451498 0.65100324
[85,] 5.75802672 1.05451498
[86,] 4.76153846 5.75802672
[87,] -6.33494980 4.76153846
[88,] -4.03143806 -6.33494980
[89,] 8.07207368 -4.03143806
[90,] 0.57558542 8.07207368
[91,] 7.07909717 0.57558542
[92,] 33.48260891 7.07909717
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 6.01104798 5.90753624
2 8.01455972 6.01104798
3 5.91807146 8.01455972
4 8.82158320 5.91807146
5 1.92509494 8.82158320
6 -7.07139332 1.92509494
7 -9.26788158 -7.07139332
8 -6.56436984 -9.26788158
9 -1.86085809 -6.56436984
10 0.04265365 -1.86085809
11 1.14616539 0.04265365
12 3.14967713 1.14616539
13 -0.84681113 3.14967713
14 -0.94329939 -0.84681113
15 -3.23978765 -0.94329939
16 -4.73627591 -3.23978765
17 -7.23276417 -4.73627591
18 -3.22925243 -7.23276417
19 -3.12574069 -3.22925243
20 -4.42222895 -3.12574069
21 -7.31871721 -4.42222895
22 -8.11520546 -7.31871721
23 -7.31169372 -8.11520546
24 -6.60818198 -7.31169372
25 -7.70467024 -6.60818198
26 -9.00115850 -7.70467024
27 -10.49764676 -9.00115850
28 -9.39413502 -10.49764676
29 -4.49062328 -9.39413502
30 5.71288846 -4.49062328
31 15.41640020 5.71288846
32 24.71991194 15.41640020
33 21.92342368 24.71991194
34 15.32693543 21.92342368
35 9.23044717 15.32693543
36 3.83395891 9.23044717
37 4.03747065 3.83395891
38 0.64098239 4.03747065
39 -0.85550587 0.64098239
40 2.64800587 -0.85550587
41 -2.24848239 2.64800587
42 -9.74497065 -2.24848239
43 -2.74145891 -9.74497065
44 -1.23794717 -2.74145891
45 -3.43443543 -1.23794717
46 2.56907632 -3.43443543
47 6.27258806 2.56907632
48 11.47609980 6.27258806
49 13.57961154 11.47609980
50 20.48312328 13.57961154
51 24.38663502 20.48312328
52 19.99014676 24.38663502
53 12.89365850 19.99014676
54 -1.00282976 12.89365850
55 -7.79931802 -1.00282976
56 -7.59580628 -7.79931802
57 -11.19229454 -7.59580628
58 -10.98878279 -11.19229454
59 -9.98527105 -10.98878279
60 -11.08175931 -9.98527105
61 -11.47824757 -11.08175931
62 -5.37473583 -11.47824757
63 -10.57122409 -5.37473583
64 -10.06771235 -10.57122409
65 -8.56420061 -10.06771235
66 -3.86068887 -8.56420061
67 -9.25717713 -3.86068887
68 -8.65366539 -9.25717713
69 -8.75015365 -8.65366539
70 -13.74664191 -8.75015365
71 -8.94313016 -13.74664191
72 -6.13961842 -8.94313016
73 0.76389332 -6.13961842
74 1.66740506 0.76389332
75 4.77091680 1.66740506
76 13.37442854 4.77091680
77 9.97794028 13.37442854
78 15.28145202 9.97794028
79 6.38496376 15.28145202
80 -33.25953198 6.38496376
81 -14.25602024 -33.25953198
82 -3.55250850 -14.25602024
83 0.65100324 -3.55250850
84 1.05451498 0.65100324
85 5.75802672 1.05451498
86 4.76153846 5.75802672
87 -6.33494980 4.76153846
88 -4.03143806 -6.33494980
89 8.07207368 -4.03143806
90 0.57558542 8.07207368
91 7.07909717 0.57558542
92 33.48260891 7.07909717
> 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/77um21197825604.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/8ow3c1197825604.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/929en1197825604.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/108k941197825604.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/11tvpv1197825604.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/1269231197825604.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/13fcmn1197825605.tab")
>
> system("convert tmp/1qq0i1197825603.ps tmp/1qq0i1197825603.png")
> system("convert tmp/2g95x1197825604.ps tmp/2g95x1197825604.png")
> system("convert tmp/34w0f1197825604.ps tmp/34w0f1197825604.png")
> system("convert tmp/4bti21197825604.ps tmp/4bti21197825604.png")
> system("convert tmp/5sfzd1197825604.ps tmp/5sfzd1197825604.png")
> system("convert tmp/6ovq61197825604.ps tmp/6ovq61197825604.png")
> system("convert tmp/77um21197825604.ps tmp/77um21197825604.png")
> system("convert tmp/8ow3c1197825604.ps tmp/8ow3c1197825604.png")
> system("convert tmp/929en1197825604.ps tmp/929en1197825604.png")
>
>
> proc.time()
user system elapsed
2.386 1.479 3.158