R version 2.7.0 (2008-04-22)
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(7.4,0,7.2,0,7.1,0,6.9,0,6.8,0,6.8,0,6.8,0,6.9,0,6.7,0,6.6,0,6.5,0,6.4,0,6.3,0,6.3,0,6.3,0,6.5,0,6.6,0,6.5,0,6.4,0,6.5,0,6.7,0,7.1,0,7.1,0,7.2,0,7.2,0,7.3,0,7.3,0,7.3,0,7.3,0,7.4,0,7.6,0,7.6,0,7.6,0,7.7,0,7.8,0,7.9,0,8.1,0,8.1,0,8.1,0,8.2,0,8.2,0,8.2,0,8.2,0,8.2,0,8.2,0,8.3,0,8.3,0,8.4,0,8.4,0,8.4,0,8.3,1,8,1,8,1,8.2,1,8.6,1,8.7,1,8.7,1,8.5,1,8.4,1,8.4,1,8.4,1,8.5,1,8.5,1,8.5,1,8.5,1,8.5,1,8.4,1,8.4,1,8.4,1,8.5,1,8.6,1,8.6,1,8.6,1,8.6,1,8.5,1,8.4,1,8.4,1,8.3,1,8.2,1,8.1,1,8.2,1,8.1,1,8,1,7.9,1,7.8,1,7.7,1,7.7,1,7.9,1,7.8,1,7.6,1,7.4,1,7.3,1,7.1,1,7.1,1,7,1,7,1,7,1,6.9,1,6.8,1,6.7,1,6.6,1,6.6,1),dim=c(2,102),dimnames=list(c('y','x'),1:102))
> y <- array(NA,dim=c(2,102),dimnames=list(c('y','x'),1:102))
> 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 7.4 0
2 7.2 0
3 7.1 0
4 6.9 0
5 6.8 0
6 6.8 0
7 6.8 0
8 6.9 0
9 6.7 0
10 6.6 0
11 6.5 0
12 6.4 0
13 6.3 0
14 6.3 0
15 6.3 0
16 6.5 0
17 6.6 0
18 6.5 0
19 6.4 0
20 6.5 0
21 6.7 0
22 7.1 0
23 7.1 0
24 7.2 0
25 7.2 0
26 7.3 0
27 7.3 0
28 7.3 0
29 7.3 0
30 7.4 0
31 7.6 0
32 7.6 0
33 7.6 0
34 7.7 0
35 7.8 0
36 7.9 0
37 8.1 0
38 8.1 0
39 8.1 0
40 8.2 0
41 8.2 0
42 8.2 0
43 8.2 0
44 8.2 0
45 8.2 0
46 8.3 0
47 8.3 0
48 8.4 0
49 8.4 0
50 8.4 0
51 8.3 1
52 8.0 1
53 8.0 1
54 8.2 1
55 8.6 1
56 8.7 1
57 8.7 1
58 8.5 1
59 8.4 1
60 8.4 1
61 8.4 1
62 8.5 1
63 8.5 1
64 8.5 1
65 8.5 1
66 8.5 1
67 8.4 1
68 8.4 1
69 8.4 1
70 8.5 1
71 8.6 1
72 8.6 1
73 8.6 1
74 8.6 1
75 8.5 1
76 8.4 1
77 8.4 1
78 8.3 1
79 8.2 1
80 8.1 1
81 8.2 1
82 8.1 1
83 8.0 1
84 7.9 1
85 7.8 1
86 7.7 1
87 7.7 1
88 7.9 1
89 7.8 1
90 7.6 1
91 7.4 1
92 7.3 1
93 7.1 1
94 7.1 1
95 7.0 1
96 7.0 1
97 7.0 1
98 6.9 1
99 6.8 1
100 6.7 1
101 6.6 1
102 6.6 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x
7.3380 0.6408
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.3788 -0.5380 0.0620 0.5212 1.0620
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.33800 0.09383 78.202 < 2e-16 ***
x 0.64085 0.13142 4.876 4.08e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6635 on 100 degrees of freedom
Multiple R-squared: 0.1921, Adjusted R-squared: 0.184
F-statistic: 23.78 on 1 and 100 DF, p-value: 4.078e-06
> postscript(file="/var/www/html/rcomp/tmp/1f92e1227550328.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/21utf1227550328.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/3qcb01227550328.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/41o181227550328.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/5z5m41227550328.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 = 102
Frequency = 1
1 2 3 4 5 6
0.06200000 -0.13800000 -0.23800000 -0.43800000 -0.53800000 -0.53800000
7 8 9 10 11 12
-0.53800000 -0.43800000 -0.63800000 -0.73800000 -0.83800000 -0.93800000
13 14 15 16 17 18
-1.03800000 -1.03800000 -1.03800000 -0.83800000 -0.73800000 -0.83800000
19 20 21 22 23 24
-0.93800000 -0.83800000 -0.63800000 -0.23800000 -0.23800000 -0.13800000
25 26 27 28 29 30
-0.13800000 -0.03800000 -0.03800000 -0.03800000 -0.03800000 0.06200000
31 32 33 34 35 36
0.26200000 0.26200000 0.26200000 0.36200000 0.46200000 0.56200000
37 38 39 40 41 42
0.76200000 0.76200000 0.76200000 0.86200000 0.86200000 0.86200000
43 44 45 46 47 48
0.86200000 0.86200000 0.86200000 0.96200000 0.96200000 1.06200000
49 50 51 52 53 54
1.06200000 1.06200000 0.32115385 0.02115385 0.02115385 0.22115385
55 56 57 58 59 60
0.62115385 0.72115385 0.72115385 0.52115385 0.42115385 0.42115385
61 62 63 64 65 66
0.42115385 0.52115385 0.52115385 0.52115385 0.52115385 0.52115385
67 68 69 70 71 72
0.42115385 0.42115385 0.42115385 0.52115385 0.62115385 0.62115385
73 74 75 76 77 78
0.62115385 0.62115385 0.52115385 0.42115385 0.42115385 0.32115385
79 80 81 82 83 84
0.22115385 0.12115385 0.22115385 0.12115385 0.02115385 -0.07884615
85 86 87 88 89 90
-0.17884615 -0.27884615 -0.27884615 -0.07884615 -0.17884615 -0.37884615
91 92 93 94 95 96
-0.57884615 -0.67884615 -0.87884615 -0.87884615 -0.97884615 -0.97884615
97 98 99 100 101 102
-0.97884615 -1.07884615 -1.17884615 -1.27884615 -1.37884615 -1.37884615
> postscript(file="/var/www/html/rcomp/tmp/62cdy1227550328.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 = 102
Frequency = 1
lag(myerror, k = 1) myerror
0 0.06200000 NA
1 -0.13800000 0.06200000
2 -0.23800000 -0.13800000
3 -0.43800000 -0.23800000
4 -0.53800000 -0.43800000
5 -0.53800000 -0.53800000
6 -0.53800000 -0.53800000
7 -0.43800000 -0.53800000
8 -0.63800000 -0.43800000
9 -0.73800000 -0.63800000
10 -0.83800000 -0.73800000
11 -0.93800000 -0.83800000
12 -1.03800000 -0.93800000
13 -1.03800000 -1.03800000
14 -1.03800000 -1.03800000
15 -0.83800000 -1.03800000
16 -0.73800000 -0.83800000
17 -0.83800000 -0.73800000
18 -0.93800000 -0.83800000
19 -0.83800000 -0.93800000
20 -0.63800000 -0.83800000
21 -0.23800000 -0.63800000
22 -0.23800000 -0.23800000
23 -0.13800000 -0.23800000
24 -0.13800000 -0.13800000
25 -0.03800000 -0.13800000
26 -0.03800000 -0.03800000
27 -0.03800000 -0.03800000
28 -0.03800000 -0.03800000
29 0.06200000 -0.03800000
30 0.26200000 0.06200000
31 0.26200000 0.26200000
32 0.26200000 0.26200000
33 0.36200000 0.26200000
34 0.46200000 0.36200000
35 0.56200000 0.46200000
36 0.76200000 0.56200000
37 0.76200000 0.76200000
38 0.76200000 0.76200000
39 0.86200000 0.76200000
40 0.86200000 0.86200000
41 0.86200000 0.86200000
42 0.86200000 0.86200000
43 0.86200000 0.86200000
44 0.86200000 0.86200000
45 0.96200000 0.86200000
46 0.96200000 0.96200000
47 1.06200000 0.96200000
48 1.06200000 1.06200000
49 1.06200000 1.06200000
50 0.32115385 1.06200000
51 0.02115385 0.32115385
52 0.02115385 0.02115385
53 0.22115385 0.02115385
54 0.62115385 0.22115385
55 0.72115385 0.62115385
56 0.72115385 0.72115385
57 0.52115385 0.72115385
58 0.42115385 0.52115385
59 0.42115385 0.42115385
60 0.42115385 0.42115385
61 0.52115385 0.42115385
62 0.52115385 0.52115385
63 0.52115385 0.52115385
64 0.52115385 0.52115385
65 0.52115385 0.52115385
66 0.42115385 0.52115385
67 0.42115385 0.42115385
68 0.42115385 0.42115385
69 0.52115385 0.42115385
70 0.62115385 0.52115385
71 0.62115385 0.62115385
72 0.62115385 0.62115385
73 0.62115385 0.62115385
74 0.52115385 0.62115385
75 0.42115385 0.52115385
76 0.42115385 0.42115385
77 0.32115385 0.42115385
78 0.22115385 0.32115385
79 0.12115385 0.22115385
80 0.22115385 0.12115385
81 0.12115385 0.22115385
82 0.02115385 0.12115385
83 -0.07884615 0.02115385
84 -0.17884615 -0.07884615
85 -0.27884615 -0.17884615
86 -0.27884615 -0.27884615
87 -0.07884615 -0.27884615
88 -0.17884615 -0.07884615
89 -0.37884615 -0.17884615
90 -0.57884615 -0.37884615
91 -0.67884615 -0.57884615
92 -0.87884615 -0.67884615
93 -0.87884615 -0.87884615
94 -0.97884615 -0.87884615
95 -0.97884615 -0.97884615
96 -0.97884615 -0.97884615
97 -1.07884615 -0.97884615
98 -1.17884615 -1.07884615
99 -1.27884615 -1.17884615
100 -1.37884615 -1.27884615
101 -1.37884615 -1.37884615
102 NA -1.37884615
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.13800000 0.06200000
[2,] -0.23800000 -0.13800000
[3,] -0.43800000 -0.23800000
[4,] -0.53800000 -0.43800000
[5,] -0.53800000 -0.53800000
[6,] -0.53800000 -0.53800000
[7,] -0.43800000 -0.53800000
[8,] -0.63800000 -0.43800000
[9,] -0.73800000 -0.63800000
[10,] -0.83800000 -0.73800000
[11,] -0.93800000 -0.83800000
[12,] -1.03800000 -0.93800000
[13,] -1.03800000 -1.03800000
[14,] -1.03800000 -1.03800000
[15,] -0.83800000 -1.03800000
[16,] -0.73800000 -0.83800000
[17,] -0.83800000 -0.73800000
[18,] -0.93800000 -0.83800000
[19,] -0.83800000 -0.93800000
[20,] -0.63800000 -0.83800000
[21,] -0.23800000 -0.63800000
[22,] -0.23800000 -0.23800000
[23,] -0.13800000 -0.23800000
[24,] -0.13800000 -0.13800000
[25,] -0.03800000 -0.13800000
[26,] -0.03800000 -0.03800000
[27,] -0.03800000 -0.03800000
[28,] -0.03800000 -0.03800000
[29,] 0.06200000 -0.03800000
[30,] 0.26200000 0.06200000
[31,] 0.26200000 0.26200000
[32,] 0.26200000 0.26200000
[33,] 0.36200000 0.26200000
[34,] 0.46200000 0.36200000
[35,] 0.56200000 0.46200000
[36,] 0.76200000 0.56200000
[37,] 0.76200000 0.76200000
[38,] 0.76200000 0.76200000
[39,] 0.86200000 0.76200000
[40,] 0.86200000 0.86200000
[41,] 0.86200000 0.86200000
[42,] 0.86200000 0.86200000
[43,] 0.86200000 0.86200000
[44,] 0.86200000 0.86200000
[45,] 0.96200000 0.86200000
[46,] 0.96200000 0.96200000
[47,] 1.06200000 0.96200000
[48,] 1.06200000 1.06200000
[49,] 1.06200000 1.06200000
[50,] 0.32115385 1.06200000
[51,] 0.02115385 0.32115385
[52,] 0.02115385 0.02115385
[53,] 0.22115385 0.02115385
[54,] 0.62115385 0.22115385
[55,] 0.72115385 0.62115385
[56,] 0.72115385 0.72115385
[57,] 0.52115385 0.72115385
[58,] 0.42115385 0.52115385
[59,] 0.42115385 0.42115385
[60,] 0.42115385 0.42115385
[61,] 0.52115385 0.42115385
[62,] 0.52115385 0.52115385
[63,] 0.52115385 0.52115385
[64,] 0.52115385 0.52115385
[65,] 0.52115385 0.52115385
[66,] 0.42115385 0.52115385
[67,] 0.42115385 0.42115385
[68,] 0.42115385 0.42115385
[69,] 0.52115385 0.42115385
[70,] 0.62115385 0.52115385
[71,] 0.62115385 0.62115385
[72,] 0.62115385 0.62115385
[73,] 0.62115385 0.62115385
[74,] 0.52115385 0.62115385
[75,] 0.42115385 0.52115385
[76,] 0.42115385 0.42115385
[77,] 0.32115385 0.42115385
[78,] 0.22115385 0.32115385
[79,] 0.12115385 0.22115385
[80,] 0.22115385 0.12115385
[81,] 0.12115385 0.22115385
[82,] 0.02115385 0.12115385
[83,] -0.07884615 0.02115385
[84,] -0.17884615 -0.07884615
[85,] -0.27884615 -0.17884615
[86,] -0.27884615 -0.27884615
[87,] -0.07884615 -0.27884615
[88,] -0.17884615 -0.07884615
[89,] -0.37884615 -0.17884615
[90,] -0.57884615 -0.37884615
[91,] -0.67884615 -0.57884615
[92,] -0.87884615 -0.67884615
[93,] -0.87884615 -0.87884615
[94,] -0.97884615 -0.87884615
[95,] -0.97884615 -0.97884615
[96,] -0.97884615 -0.97884615
[97,] -1.07884615 -0.97884615
[98,] -1.17884615 -1.07884615
[99,] -1.27884615 -1.17884615
[100,] -1.37884615 -1.27884615
[101,] -1.37884615 -1.37884615
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.13800000 0.06200000
2 -0.23800000 -0.13800000
3 -0.43800000 -0.23800000
4 -0.53800000 -0.43800000
5 -0.53800000 -0.53800000
6 -0.53800000 -0.53800000
7 -0.43800000 -0.53800000
8 -0.63800000 -0.43800000
9 -0.73800000 -0.63800000
10 -0.83800000 -0.73800000
11 -0.93800000 -0.83800000
12 -1.03800000 -0.93800000
13 -1.03800000 -1.03800000
14 -1.03800000 -1.03800000
15 -0.83800000 -1.03800000
16 -0.73800000 -0.83800000
17 -0.83800000 -0.73800000
18 -0.93800000 -0.83800000
19 -0.83800000 -0.93800000
20 -0.63800000 -0.83800000
21 -0.23800000 -0.63800000
22 -0.23800000 -0.23800000
23 -0.13800000 -0.23800000
24 -0.13800000 -0.13800000
25 -0.03800000 -0.13800000
26 -0.03800000 -0.03800000
27 -0.03800000 -0.03800000
28 -0.03800000 -0.03800000
29 0.06200000 -0.03800000
30 0.26200000 0.06200000
31 0.26200000 0.26200000
32 0.26200000 0.26200000
33 0.36200000 0.26200000
34 0.46200000 0.36200000
35 0.56200000 0.46200000
36 0.76200000 0.56200000
37 0.76200000 0.76200000
38 0.76200000 0.76200000
39 0.86200000 0.76200000
40 0.86200000 0.86200000
41 0.86200000 0.86200000
42 0.86200000 0.86200000
43 0.86200000 0.86200000
44 0.86200000 0.86200000
45 0.96200000 0.86200000
46 0.96200000 0.96200000
47 1.06200000 0.96200000
48 1.06200000 1.06200000
49 1.06200000 1.06200000
50 0.32115385 1.06200000
51 0.02115385 0.32115385
52 0.02115385 0.02115385
53 0.22115385 0.02115385
54 0.62115385 0.22115385
55 0.72115385 0.62115385
56 0.72115385 0.72115385
57 0.52115385 0.72115385
58 0.42115385 0.52115385
59 0.42115385 0.42115385
60 0.42115385 0.42115385
61 0.52115385 0.42115385
62 0.52115385 0.52115385
63 0.52115385 0.52115385
64 0.52115385 0.52115385
65 0.52115385 0.52115385
66 0.42115385 0.52115385
67 0.42115385 0.42115385
68 0.42115385 0.42115385
69 0.52115385 0.42115385
70 0.62115385 0.52115385
71 0.62115385 0.62115385
72 0.62115385 0.62115385
73 0.62115385 0.62115385
74 0.52115385 0.62115385
75 0.42115385 0.52115385
76 0.42115385 0.42115385
77 0.32115385 0.42115385
78 0.22115385 0.32115385
79 0.12115385 0.22115385
80 0.22115385 0.12115385
81 0.12115385 0.22115385
82 0.02115385 0.12115385
83 -0.07884615 0.02115385
84 -0.17884615 -0.07884615
85 -0.27884615 -0.17884615
86 -0.27884615 -0.27884615
87 -0.07884615 -0.27884615
88 -0.17884615 -0.07884615
89 -0.37884615 -0.17884615
90 -0.57884615 -0.37884615
91 -0.67884615 -0.57884615
92 -0.87884615 -0.67884615
93 -0.87884615 -0.87884615
94 -0.97884615 -0.87884615
95 -0.97884615 -0.97884615
96 -0.97884615 -0.97884615
97 -1.07884615 -0.97884615
98 -1.17884615 -1.07884615
99 -1.27884615 -1.17884615
100 -1.37884615 -1.27884615
101 -1.37884615 -1.37884615
> 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/7y3nu1227550328.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/8omod1227550328.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/9g7f61227550328.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/109p1a1227550328.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/11nrjs1227550328.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/12yie01227550328.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/13nmfq1227550328.tab")
>
> system("convert tmp/1f92e1227550328.ps tmp/1f92e1227550328.png")
> system("convert tmp/21utf1227550328.ps tmp/21utf1227550328.png")
> system("convert tmp/3qcb01227550328.ps tmp/3qcb01227550328.png")
> system("convert tmp/41o181227550328.ps tmp/41o181227550328.png")
> system("convert tmp/5z5m41227550328.ps tmp/5z5m41227550328.png")
> system("convert tmp/62cdy1227550328.ps tmp/62cdy1227550328.png")
> system("convert tmp/7y3nu1227550328.ps tmp/7y3nu1227550328.png")
> system("convert tmp/8omod1227550328.ps tmp/8omod1227550328.png")
> system("convert tmp/9g7f61227550328.ps tmp/9g7f61227550328.png")
>
>
> proc.time()
user system elapsed
7.222 4.335 10.506