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(13698.3,0,12477.6,0,13139.7,0,14532.2,0,15167,0,16071.1,0,14827.5,0,15082,0,14772.7,0,16083,0,14272.5,0,15223.3,0,14897.3,0,13062.6,0,12603.8,0,13629.8,0,14421.1,0,13978.3,0,12927.9,0,13429.9,0,13470.1,0,14785.8,0,14292,0,14308.8,0,14013,0,13240.9,0,12153.4,0,14289.7,0,15669.2,0,14169.5,0,14569.8,0,14469.1,0,14264.9,0,15320.9,0,14433.5,0,13691.5,0,14194.1,0,13519.2,0,11857.9,0,14616,0,15643.4,0,14077.2,0,14887.5,0,14159.9,0,14643,0,17192.5,1,15386.1,1,14287.1,1,17526.6,1,14497,1,14398.3,1,16629.6,1,16670.7,1,16614.8,1,16869.2,1,15663.9,1,16359.9,1,18447.7,1,16889,1,16505,1,18320.9,1,15052.1,1,15699.8,1,18135.3,1,16768.7,1,18883,1,19021,1,18101.9,1,17776.1,1,21489.9,1,17065.3,1,18690,1,18953.1,1,16398.9,1,16895.7,1,18553,1,19270,1,19422.1,1,17579.4,1,18637.3,1,18076.7,1,20438.6,1,18075.2,1,19563,1,19899.2,1,19227.5,1,17789.6,1,19220.8,1,22058.6,1,21230.8,1,19504.4,1,23913.1,1,23165.7,1,23574.3,1,25002,1,22603.9,1,23408.6,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 13698.3 0
2 12477.6 0
3 13139.7 0
4 14532.2 0
5 15167.0 0
6 16071.1 0
7 14827.5 0
8 15082.0 0
9 14772.7 0
10 16083.0 0
11 14272.5 0
12 15223.3 0
13 14897.3 0
14 13062.6 0
15 12603.8 0
16 13629.8 0
17 14421.1 0
18 13978.3 0
19 12927.9 0
20 13429.9 0
21 13470.1 0
22 14785.8 0
23 14292.0 0
24 14308.8 0
25 14013.0 0
26 13240.9 0
27 12153.4 0
28 14289.7 0
29 15669.2 0
30 14169.5 0
31 14569.8 0
32 14469.1 0
33 14264.9 0
34 15320.9 0
35 14433.5 0
36 13691.5 0
37 14194.1 0
38 13519.2 0
39 11857.9 0
40 14616.0 0
41 15643.4 0
42 14077.2 0
43 14887.5 0
44 14159.9 0
45 14643.0 0
46 17192.5 1
47 15386.1 1
48 14287.1 1
49 17526.6 1
50 14497.0 1
51 14398.3 1
52 16629.6 1
53 16670.7 1
54 16614.8 1
55 16869.2 1
56 15663.9 1
57 16359.9 1
58 18447.7 1
59 16889.0 1
60 16505.0 1
61 18320.9 1
62 15052.1 1
63 15699.8 1
64 18135.3 1
65 16768.7 1
66 18883.0 1
67 19021.0 1
68 18101.9 1
69 17776.1 1
70 21489.9 1
71 17065.3 1
72 18690.0 1
73 18953.1 1
74 16398.9 1
75 16895.7 1
76 18553.0 1
77 19270.0 1
78 19422.1 1
79 17579.4 1
80 18637.3 1
81 18076.7 1
82 20438.6 1
83 18075.2 1
84 19563.0 1
85 19899.2 1
86 19227.5 1
87 17789.6 1
88 19220.8 1
89 22058.6 1
90 21230.8 1
91 19504.4 1
92 23913.1 1
93 23165.7 1
94 23574.3 1
95 25002.0 1
96 22603.9 1
97 23408.6 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x
14201 4288
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4201.417 -1138.242 -6.742 732.283 6513.483
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14200.8 294.4 48.24 <2e-16 ***
x 4287.7 402.1 10.66 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1975 on 95 degrees of freedom
Multiple R-squared: 0.5448, Adjusted R-squared: 0.5401
F-statistic: 113.7 on 1 and 95 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/1umsm1227453795.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/2h03g1227453795.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/3t61a1227453795.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/4hmze1227453795.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/5xy9d1227453796.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
-502.542222 -1723.242222 -1061.142222 331.357778 966.157778 1870.257778
7 8 9 10 11 12
626.657778 881.157778 571.857778 1882.157778 71.657778 1022.457778
13 14 15 16 17 18
696.457778 -1138.242222 -1597.042222 -571.042222 220.257778 -222.542222
19 20 21 22 23 24
-1272.942222 -770.942222 -730.742222 584.957778 91.157778 107.957778
25 26 27 28 29 30
-187.842222 -959.942222 -2047.442222 88.857778 1468.357778 -31.342222
31 32 33 34 35 36
368.957778 268.257778 64.057778 1120.057778 232.657778 -509.342222
37 38 39 40 41 42
-6.742222 -681.642222 -2342.942222 415.157778 1442.557778 -123.642222
43 44 45 46 47 48
686.657778 -40.942222 442.157778 -1296.017308 -3102.417308 -4201.417308
49 50 51 52 53 54
-961.917308 -3991.517308 -4090.217308 -1858.917308 -1817.817308 -1873.717308
55 56 57 58 59 60
-1619.317308 -2824.617308 -2128.617308 -40.817308 -1599.517308 -1983.517308
61 62 63 64 65 66
-167.617308 -3436.417308 -2788.717308 -353.217308 -1719.817308 394.482692
67 68 69 70 71 72
532.482692 -386.617308 -712.417308 3001.382692 -1423.217308 201.482692
73 74 75 76 77 78
464.582692 -2089.617308 -1592.817308 64.482692 781.482692 933.582692
79 80 81 82 83 84
-909.117308 148.782692 -411.817308 1950.082692 -413.317308 1074.482692
85 86 87 88 89 90
1410.682692 738.982692 -698.917308 732.282692 3570.082692 2742.282692
91 92 93 94 95 96
1015.882692 5424.582692 4677.182692 5085.782692 6513.482692 4115.382692
97
4920.082692
> postscript(file="/var/www/html/rcomp/tmp/6wi591227453796.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 -502.542222 NA
1 -1723.242222 -502.542222
2 -1061.142222 -1723.242222
3 331.357778 -1061.142222
4 966.157778 331.357778
5 1870.257778 966.157778
6 626.657778 1870.257778
7 881.157778 626.657778
8 571.857778 881.157778
9 1882.157778 571.857778
10 71.657778 1882.157778
11 1022.457778 71.657778
12 696.457778 1022.457778
13 -1138.242222 696.457778
14 -1597.042222 -1138.242222
15 -571.042222 -1597.042222
16 220.257778 -571.042222
17 -222.542222 220.257778
18 -1272.942222 -222.542222
19 -770.942222 -1272.942222
20 -730.742222 -770.942222
21 584.957778 -730.742222
22 91.157778 584.957778
23 107.957778 91.157778
24 -187.842222 107.957778
25 -959.942222 -187.842222
26 -2047.442222 -959.942222
27 88.857778 -2047.442222
28 1468.357778 88.857778
29 -31.342222 1468.357778
30 368.957778 -31.342222
31 268.257778 368.957778
32 64.057778 268.257778
33 1120.057778 64.057778
34 232.657778 1120.057778
35 -509.342222 232.657778
36 -6.742222 -509.342222
37 -681.642222 -6.742222
38 -2342.942222 -681.642222
39 415.157778 -2342.942222
40 1442.557778 415.157778
41 -123.642222 1442.557778
42 686.657778 -123.642222
43 -40.942222 686.657778
44 442.157778 -40.942222
45 -1296.017308 442.157778
46 -3102.417308 -1296.017308
47 -4201.417308 -3102.417308
48 -961.917308 -4201.417308
49 -3991.517308 -961.917308
50 -4090.217308 -3991.517308
51 -1858.917308 -4090.217308
52 -1817.817308 -1858.917308
53 -1873.717308 -1817.817308
54 -1619.317308 -1873.717308
55 -2824.617308 -1619.317308
56 -2128.617308 -2824.617308
57 -40.817308 -2128.617308
58 -1599.517308 -40.817308
59 -1983.517308 -1599.517308
60 -167.617308 -1983.517308
61 -3436.417308 -167.617308
62 -2788.717308 -3436.417308
63 -353.217308 -2788.717308
64 -1719.817308 -353.217308
65 394.482692 -1719.817308
66 532.482692 394.482692
67 -386.617308 532.482692
68 -712.417308 -386.617308
69 3001.382692 -712.417308
70 -1423.217308 3001.382692
71 201.482692 -1423.217308
72 464.582692 201.482692
73 -2089.617308 464.582692
74 -1592.817308 -2089.617308
75 64.482692 -1592.817308
76 781.482692 64.482692
77 933.582692 781.482692
78 -909.117308 933.582692
79 148.782692 -909.117308
80 -411.817308 148.782692
81 1950.082692 -411.817308
82 -413.317308 1950.082692
83 1074.482692 -413.317308
84 1410.682692 1074.482692
85 738.982692 1410.682692
86 -698.917308 738.982692
87 732.282692 -698.917308
88 3570.082692 732.282692
89 2742.282692 3570.082692
90 1015.882692 2742.282692
91 5424.582692 1015.882692
92 4677.182692 5424.582692
93 5085.782692 4677.182692
94 6513.482692 5085.782692
95 4115.382692 6513.482692
96 4920.082692 4115.382692
97 NA 4920.082692
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1723.242222 -502.542222
[2,] -1061.142222 -1723.242222
[3,] 331.357778 -1061.142222
[4,] 966.157778 331.357778
[5,] 1870.257778 966.157778
[6,] 626.657778 1870.257778
[7,] 881.157778 626.657778
[8,] 571.857778 881.157778
[9,] 1882.157778 571.857778
[10,] 71.657778 1882.157778
[11,] 1022.457778 71.657778
[12,] 696.457778 1022.457778
[13,] -1138.242222 696.457778
[14,] -1597.042222 -1138.242222
[15,] -571.042222 -1597.042222
[16,] 220.257778 -571.042222
[17,] -222.542222 220.257778
[18,] -1272.942222 -222.542222
[19,] -770.942222 -1272.942222
[20,] -730.742222 -770.942222
[21,] 584.957778 -730.742222
[22,] 91.157778 584.957778
[23,] 107.957778 91.157778
[24,] -187.842222 107.957778
[25,] -959.942222 -187.842222
[26,] -2047.442222 -959.942222
[27,] 88.857778 -2047.442222
[28,] 1468.357778 88.857778
[29,] -31.342222 1468.357778
[30,] 368.957778 -31.342222
[31,] 268.257778 368.957778
[32,] 64.057778 268.257778
[33,] 1120.057778 64.057778
[34,] 232.657778 1120.057778
[35,] -509.342222 232.657778
[36,] -6.742222 -509.342222
[37,] -681.642222 -6.742222
[38,] -2342.942222 -681.642222
[39,] 415.157778 -2342.942222
[40,] 1442.557778 415.157778
[41,] -123.642222 1442.557778
[42,] 686.657778 -123.642222
[43,] -40.942222 686.657778
[44,] 442.157778 -40.942222
[45,] -1296.017308 442.157778
[46,] -3102.417308 -1296.017308
[47,] -4201.417308 -3102.417308
[48,] -961.917308 -4201.417308
[49,] -3991.517308 -961.917308
[50,] -4090.217308 -3991.517308
[51,] -1858.917308 -4090.217308
[52,] -1817.817308 -1858.917308
[53,] -1873.717308 -1817.817308
[54,] -1619.317308 -1873.717308
[55,] -2824.617308 -1619.317308
[56,] -2128.617308 -2824.617308
[57,] -40.817308 -2128.617308
[58,] -1599.517308 -40.817308
[59,] -1983.517308 -1599.517308
[60,] -167.617308 -1983.517308
[61,] -3436.417308 -167.617308
[62,] -2788.717308 -3436.417308
[63,] -353.217308 -2788.717308
[64,] -1719.817308 -353.217308
[65,] 394.482692 -1719.817308
[66,] 532.482692 394.482692
[67,] -386.617308 532.482692
[68,] -712.417308 -386.617308
[69,] 3001.382692 -712.417308
[70,] -1423.217308 3001.382692
[71,] 201.482692 -1423.217308
[72,] 464.582692 201.482692
[73,] -2089.617308 464.582692
[74,] -1592.817308 -2089.617308
[75,] 64.482692 -1592.817308
[76,] 781.482692 64.482692
[77,] 933.582692 781.482692
[78,] -909.117308 933.582692
[79,] 148.782692 -909.117308
[80,] -411.817308 148.782692
[81,] 1950.082692 -411.817308
[82,] -413.317308 1950.082692
[83,] 1074.482692 -413.317308
[84,] 1410.682692 1074.482692
[85,] 738.982692 1410.682692
[86,] -698.917308 738.982692
[87,] 732.282692 -698.917308
[88,] 3570.082692 732.282692
[89,] 2742.282692 3570.082692
[90,] 1015.882692 2742.282692
[91,] 5424.582692 1015.882692
[92,] 4677.182692 5424.582692
[93,] 5085.782692 4677.182692
[94,] 6513.482692 5085.782692
[95,] 4115.382692 6513.482692
[96,] 4920.082692 4115.382692
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1723.242222 -502.542222
2 -1061.142222 -1723.242222
3 331.357778 -1061.142222
4 966.157778 331.357778
5 1870.257778 966.157778
6 626.657778 1870.257778
7 881.157778 626.657778
8 571.857778 881.157778
9 1882.157778 571.857778
10 71.657778 1882.157778
11 1022.457778 71.657778
12 696.457778 1022.457778
13 -1138.242222 696.457778
14 -1597.042222 -1138.242222
15 -571.042222 -1597.042222
16 220.257778 -571.042222
17 -222.542222 220.257778
18 -1272.942222 -222.542222
19 -770.942222 -1272.942222
20 -730.742222 -770.942222
21 584.957778 -730.742222
22 91.157778 584.957778
23 107.957778 91.157778
24 -187.842222 107.957778
25 -959.942222 -187.842222
26 -2047.442222 -959.942222
27 88.857778 -2047.442222
28 1468.357778 88.857778
29 -31.342222 1468.357778
30 368.957778 -31.342222
31 268.257778 368.957778
32 64.057778 268.257778
33 1120.057778 64.057778
34 232.657778 1120.057778
35 -509.342222 232.657778
36 -6.742222 -509.342222
37 -681.642222 -6.742222
38 -2342.942222 -681.642222
39 415.157778 -2342.942222
40 1442.557778 415.157778
41 -123.642222 1442.557778
42 686.657778 -123.642222
43 -40.942222 686.657778
44 442.157778 -40.942222
45 -1296.017308 442.157778
46 -3102.417308 -1296.017308
47 -4201.417308 -3102.417308
48 -961.917308 -4201.417308
49 -3991.517308 -961.917308
50 -4090.217308 -3991.517308
51 -1858.917308 -4090.217308
52 -1817.817308 -1858.917308
53 -1873.717308 -1817.817308
54 -1619.317308 -1873.717308
55 -2824.617308 -1619.317308
56 -2128.617308 -2824.617308
57 -40.817308 -2128.617308
58 -1599.517308 -40.817308
59 -1983.517308 -1599.517308
60 -167.617308 -1983.517308
61 -3436.417308 -167.617308
62 -2788.717308 -3436.417308
63 -353.217308 -2788.717308
64 -1719.817308 -353.217308
65 394.482692 -1719.817308
66 532.482692 394.482692
67 -386.617308 532.482692
68 -712.417308 -386.617308
69 3001.382692 -712.417308
70 -1423.217308 3001.382692
71 201.482692 -1423.217308
72 464.582692 201.482692
73 -2089.617308 464.582692
74 -1592.817308 -2089.617308
75 64.482692 -1592.817308
76 781.482692 64.482692
77 933.582692 781.482692
78 -909.117308 933.582692
79 148.782692 -909.117308
80 -411.817308 148.782692
81 1950.082692 -411.817308
82 -413.317308 1950.082692
83 1074.482692 -413.317308
84 1410.682692 1074.482692
85 738.982692 1410.682692
86 -698.917308 738.982692
87 732.282692 -698.917308
88 3570.082692 732.282692
89 2742.282692 3570.082692
90 1015.882692 2742.282692
91 5424.582692 1015.882692
92 4677.182692 5424.582692
93 5085.782692 4677.182692
94 6513.482692 5085.782692
95 4115.382692 6513.482692
96 4920.082692 4115.382692
> 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/73si51227453796.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/8zdp31227453796.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/9cz9n1227453796.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/10hned1227453796.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/11wnj61227453796.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/12096n1227453796.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/13fzwy1227453796.tab")
>
> system("convert tmp/1umsm1227453795.ps tmp/1umsm1227453795.png")
> system("convert tmp/2h03g1227453795.ps tmp/2h03g1227453795.png")
> system("convert tmp/3t61a1227453795.ps tmp/3t61a1227453795.png")
> system("convert tmp/4hmze1227453795.ps tmp/4hmze1227453795.png")
> system("convert tmp/5xy9d1227453796.ps tmp/5xy9d1227453796.png")
> system("convert tmp/6wi591227453796.ps tmp/6wi591227453796.png")
> system("convert tmp/73si51227453796.ps tmp/73si51227453796.png")
> system("convert tmp/8zdp31227453796.ps tmp/8zdp31227453796.png")
> system("convert tmp/9cz9n1227453796.ps tmp/9cz9n1227453796.png")
>
>
> proc.time()
user system elapsed
2.021 1.459 2.402