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(99984,0,99981,0,99972,0,99989,0,99996,0,99991,0,99988,0,99990,0,99998,0,99987,0,100000,0,100000,0,100004,0,100007,0,100005,0,100002,0,99998,0,100006,0,99997,0,100001,0,100000,0,99993,0,99994,0,99996,0,99996,0,99998,0,100002,0,99995,0,99985,0,99984,0,99982,0,99987,0,99977,0,99990,0,99990,0,99994,0,99997,0,99996,0,99993,0,99993,0,99993,0,99997,0,100000,0,99995,0,99997,0,100003,0,100002,0,99993,0,99999,1,100000,1,99997,1,100004,1,100002,1,100003,1,100000,1,99990,1,99990,1,99991,1,99978,1,99984,1,99982,1,99986,1,99988,1,99983,1,99977,1,99972,1,99969,1,99979,1,99981,1,99978,1,99978,1),dim=c(2,71),dimnames=list(c('Economie','Kredietcrisis'),1:71))
> y <- array(NA,dim=c(2,71),dimnames=list(c('Economie','Kredietcrisis'),1:71))
> 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
Economie Kredietcrisis M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 99984 0 1 0 0 0 0 0 0 0 0 0 0 1
2 99981 0 0 1 0 0 0 0 0 0 0 0 0 2
3 99972 0 0 0 1 0 0 0 0 0 0 0 0 3
4 99989 0 0 0 0 1 0 0 0 0 0 0 0 4
5 99996 0 0 0 0 0 1 0 0 0 0 0 0 5
6 99991 0 0 0 0 0 0 1 0 0 0 0 0 6
7 99988 0 0 0 0 0 0 0 1 0 0 0 0 7
8 99990 0 0 0 0 0 0 0 0 1 0 0 0 8
9 99998 0 0 0 0 0 0 0 0 0 1 0 0 9
10 99987 0 0 0 0 0 0 0 0 0 0 1 0 10
11 100000 0 0 0 0 0 0 0 0 0 0 0 1 11
12 100000 0 0 0 0 0 0 0 0 0 0 0 0 12
13 100004 0 1 0 0 0 0 0 0 0 0 0 0 13
14 100007 0 0 1 0 0 0 0 0 0 0 0 0 14
15 100005 0 0 0 1 0 0 0 0 0 0 0 0 15
16 100002 0 0 0 0 1 0 0 0 0 0 0 0 16
17 99998 0 0 0 0 0 1 0 0 0 0 0 0 17
18 100006 0 0 0 0 0 0 1 0 0 0 0 0 18
19 99997 0 0 0 0 0 0 0 1 0 0 0 0 19
20 100001 0 0 0 0 0 0 0 0 1 0 0 0 20
21 100000 0 0 0 0 0 0 0 0 0 1 0 0 21
22 99993 0 0 0 0 0 0 0 0 0 0 1 0 22
23 99994 0 0 0 0 0 0 0 0 0 0 0 1 23
24 99996 0 0 0 0 0 0 0 0 0 0 0 0 24
25 99996 0 1 0 0 0 0 0 0 0 0 0 0 25
26 99998 0 0 1 0 0 0 0 0 0 0 0 0 26
27 100002 0 0 0 1 0 0 0 0 0 0 0 0 27
28 99995 0 0 0 0 1 0 0 0 0 0 0 0 28
29 99985 0 0 0 0 0 1 0 0 0 0 0 0 29
30 99984 0 0 0 0 0 0 1 0 0 0 0 0 30
31 99982 0 0 0 0 0 0 0 1 0 0 0 0 31
32 99987 0 0 0 0 0 0 0 0 1 0 0 0 32
33 99977 0 0 0 0 0 0 0 0 0 1 0 0 33
34 99990 0 0 0 0 0 0 0 0 0 0 1 0 34
35 99990 0 0 0 0 0 0 0 0 0 0 0 1 35
36 99994 0 0 0 0 0 0 0 0 0 0 0 0 36
37 99997 0 1 0 0 0 0 0 0 0 0 0 0 37
38 99996 0 0 1 0 0 0 0 0 0 0 0 0 38
39 99993 0 0 0 1 0 0 0 0 0 0 0 0 39
40 99993 0 0 0 0 1 0 0 0 0 0 0 0 40
41 99993 0 0 0 0 0 1 0 0 0 0 0 0 41
42 99997 0 0 0 0 0 0 1 0 0 0 0 0 42
43 100000 0 0 0 0 0 0 0 1 0 0 0 0 43
44 99995 0 0 0 0 0 0 0 0 1 0 0 0 44
45 99997 0 0 0 0 0 0 0 0 0 1 0 0 45
46 100003 0 0 0 0 0 0 0 0 0 0 1 0 46
47 100002 0 0 0 0 0 0 0 0 0 0 0 1 47
48 99993 0 0 0 0 0 0 0 0 0 0 0 0 48
49 99999 1 1 0 0 0 0 0 0 0 0 0 0 49
50 100000 1 0 1 0 0 0 0 0 0 0 0 0 50
51 99997 1 0 0 1 0 0 0 0 0 0 0 0 51
52 100004 1 0 0 0 1 0 0 0 0 0 0 0 52
53 100002 1 0 0 0 0 1 0 0 0 0 0 0 53
54 100003 1 0 0 0 0 0 1 0 0 0 0 0 54
55 100000 1 0 0 0 0 0 0 1 0 0 0 0 55
56 99990 1 0 0 0 0 0 0 0 1 0 0 0 56
57 99990 1 0 0 0 0 0 0 0 0 1 0 0 57
58 99991 1 0 0 0 0 0 0 0 0 0 1 0 58
59 99978 1 0 0 0 0 0 0 0 0 0 0 1 59
60 99984 1 0 0 0 0 0 0 0 0 0 0 0 60
61 99982 1 1 0 0 0 0 0 0 0 0 0 0 61
62 99986 1 0 1 0 0 0 0 0 0 0 0 0 62
63 99988 1 0 0 1 0 0 0 0 0 0 0 0 63
64 99983 1 0 0 0 1 0 0 0 0 0 0 0 64
65 99977 1 0 0 0 0 1 0 0 0 0 0 0 65
66 99972 1 0 0 0 0 0 1 0 0 0 0 0 66
67 99969 1 0 0 0 0 0 0 1 0 0 0 0 67
68 99979 1 0 0 0 0 0 0 0 1 0 0 0 68
69 99981 1 0 0 0 0 0 0 0 0 1 0 0 69
70 99978 1 0 0 0 0 0 0 0 0 0 1 0 70
71 99978 1 0 0 0 0 0 0 0 0 0 0 1 71
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Kredietcrisis M1 M2 M3
1.000e+05 -5.511e+00 8.399e-01 1.872e+00 7.119e-02
M4 M5 M6 M7 M8
1.603e+00 -8.642e-01 -4.986e-01 -3.300e+00 -2.267e+00
M9 M10 M11 t
-2.068e+00 -2.203e+00 -2.170e+00 -3.231e-02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-23.6394 -5.7518 0.2482 6.0544 15.0887
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.000e+05 5.000e+00 20001.100 <2e-16 ***
Kredietcrisis -5.511e+00 4.140e+00 -1.331 0.188
M1 8.399e-01 5.701e+00 0.147 0.883
M2 1.872e+00 5.686e+00 0.329 0.743
M3 7.119e-02 5.673e+00 0.013 0.990
M4 1.603e+00 5.661e+00 0.283 0.778
M5 -8.642e-01 5.651e+00 -0.153 0.879
M6 -4.986e-01 5.642e+00 -0.088 0.930
M7 -3.300e+00 5.636e+00 -0.585 0.561
M8 -2.267e+00 5.630e+00 -0.403 0.689
M9 -2.068e+00 5.627e+00 -0.368 0.715
M10 -2.203e+00 5.625e+00 -0.392 0.697
M11 -2.170e+00 5.624e+00 -0.386 0.701
t -3.231e-02 9.535e-02 -0.339 0.736
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.273 on 57 degrees of freedom
Multiple R-squared: 0.1564, Adjusted R-squared: -0.03596
F-statistic: 0.8131 on 13 and 57 DF, p-value: 0.6443
> postscript(file="/var/www/html/freestat/rcomp/tmp/1fnzp1229866720.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/freestat/rcomp/tmp/2881h1229866720.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/freestat/rcomp/tmp/36as81229866720.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/freestat/rcomp/tmp/4u4wh1229866720.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/freestat/rcomp/tmp/5h4b31229866720.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 = 71
Frequency = 1
1 2 3 4 5 6
-12.4727690 -16.4727690 -23.6394357 -8.1394357 1.3605643 -3.9727690
7 8 9 10 11 12
-4.1394357 -3.1394357 4.6938976 -6.1394357 6.8605643 4.7225066
13 14 15 16 17 18
7.9148950 9.9148950 9.7482283 5.2482283 3.7482283 11.4148950
19 20 21 22 23 24
5.2482283 8.2482283 7.0815617 0.2482283 1.2482283 1.1101706
25 26 27 28 29 30
0.3025591 1.3025591 7.1358924 -1.3641076 -8.8641076 -10.1974409
31 32 33 34 35 36
-9.3641076 -5.3641076 -15.5307743 -2.3641076 -2.3641076 -0.5021654
37 38 39 40 41 42
1.6902231 -0.3097769 -1.4764436 -2.9764436 -0.4764436 3.1902231
43 44 45 46 47 48
9.0235564 3.0235564 4.8568898 11.0235564 10.0235564 -1.1145013
49 50 51 52 53 54
9.5887139 9.5887139 8.4220472 13.9220472 14.4220472 15.0887139
55 56 57 58 59 60
14.9220472 3.9220472 3.7553806 4.9220472 -8.0779528 -4.2160105
61 62 63 64 65 66
-7.0236220 -4.0236220 -0.1902887 -6.6902887 -10.1902887 -15.5236220
67 68 69 70 71
-15.6902887 -6.6902887 -4.8569554 -7.6902887 -7.6902887
> postscript(file="/var/www/html/freestat/rcomp/tmp/61hh01229866720.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 = 71
Frequency = 1
lag(myerror, k = 1) myerror
0 -12.4727690 NA
1 -16.4727690 -12.4727690
2 -23.6394357 -16.4727690
3 -8.1394357 -23.6394357
4 1.3605643 -8.1394357
5 -3.9727690 1.3605643
6 -4.1394357 -3.9727690
7 -3.1394357 -4.1394357
8 4.6938976 -3.1394357
9 -6.1394357 4.6938976
10 6.8605643 -6.1394357
11 4.7225066 6.8605643
12 7.9148950 4.7225066
13 9.9148950 7.9148950
14 9.7482283 9.9148950
15 5.2482283 9.7482283
16 3.7482283 5.2482283
17 11.4148950 3.7482283
18 5.2482283 11.4148950
19 8.2482283 5.2482283
20 7.0815617 8.2482283
21 0.2482283 7.0815617
22 1.2482283 0.2482283
23 1.1101706 1.2482283
24 0.3025591 1.1101706
25 1.3025591 0.3025591
26 7.1358924 1.3025591
27 -1.3641076 7.1358924
28 -8.8641076 -1.3641076
29 -10.1974409 -8.8641076
30 -9.3641076 -10.1974409
31 -5.3641076 -9.3641076
32 -15.5307743 -5.3641076
33 -2.3641076 -15.5307743
34 -2.3641076 -2.3641076
35 -0.5021654 -2.3641076
36 1.6902231 -0.5021654
37 -0.3097769 1.6902231
38 -1.4764436 -0.3097769
39 -2.9764436 -1.4764436
40 -0.4764436 -2.9764436
41 3.1902231 -0.4764436
42 9.0235564 3.1902231
43 3.0235564 9.0235564
44 4.8568898 3.0235564
45 11.0235564 4.8568898
46 10.0235564 11.0235564
47 -1.1145013 10.0235564
48 9.5887139 -1.1145013
49 9.5887139 9.5887139
50 8.4220472 9.5887139
51 13.9220472 8.4220472
52 14.4220472 13.9220472
53 15.0887139 14.4220472
54 14.9220472 15.0887139
55 3.9220472 14.9220472
56 3.7553806 3.9220472
57 4.9220472 3.7553806
58 -8.0779528 4.9220472
59 -4.2160105 -8.0779528
60 -7.0236220 -4.2160105
61 -4.0236220 -7.0236220
62 -0.1902887 -4.0236220
63 -6.6902887 -0.1902887
64 -10.1902887 -6.6902887
65 -15.5236220 -10.1902887
66 -15.6902887 -15.5236220
67 -6.6902887 -15.6902887
68 -4.8569554 -6.6902887
69 -7.6902887 -4.8569554
70 -7.6902887 -7.6902887
71 NA -7.6902887
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -16.4727690 -12.4727690
[2,] -23.6394357 -16.4727690
[3,] -8.1394357 -23.6394357
[4,] 1.3605643 -8.1394357
[5,] -3.9727690 1.3605643
[6,] -4.1394357 -3.9727690
[7,] -3.1394357 -4.1394357
[8,] 4.6938976 -3.1394357
[9,] -6.1394357 4.6938976
[10,] 6.8605643 -6.1394357
[11,] 4.7225066 6.8605643
[12,] 7.9148950 4.7225066
[13,] 9.9148950 7.9148950
[14,] 9.7482283 9.9148950
[15,] 5.2482283 9.7482283
[16,] 3.7482283 5.2482283
[17,] 11.4148950 3.7482283
[18,] 5.2482283 11.4148950
[19,] 8.2482283 5.2482283
[20,] 7.0815617 8.2482283
[21,] 0.2482283 7.0815617
[22,] 1.2482283 0.2482283
[23,] 1.1101706 1.2482283
[24,] 0.3025591 1.1101706
[25,] 1.3025591 0.3025591
[26,] 7.1358924 1.3025591
[27,] -1.3641076 7.1358924
[28,] -8.8641076 -1.3641076
[29,] -10.1974409 -8.8641076
[30,] -9.3641076 -10.1974409
[31,] -5.3641076 -9.3641076
[32,] -15.5307743 -5.3641076
[33,] -2.3641076 -15.5307743
[34,] -2.3641076 -2.3641076
[35,] -0.5021654 -2.3641076
[36,] 1.6902231 -0.5021654
[37,] -0.3097769 1.6902231
[38,] -1.4764436 -0.3097769
[39,] -2.9764436 -1.4764436
[40,] -0.4764436 -2.9764436
[41,] 3.1902231 -0.4764436
[42,] 9.0235564 3.1902231
[43,] 3.0235564 9.0235564
[44,] 4.8568898 3.0235564
[45,] 11.0235564 4.8568898
[46,] 10.0235564 11.0235564
[47,] -1.1145013 10.0235564
[48,] 9.5887139 -1.1145013
[49,] 9.5887139 9.5887139
[50,] 8.4220472 9.5887139
[51,] 13.9220472 8.4220472
[52,] 14.4220472 13.9220472
[53,] 15.0887139 14.4220472
[54,] 14.9220472 15.0887139
[55,] 3.9220472 14.9220472
[56,] 3.7553806 3.9220472
[57,] 4.9220472 3.7553806
[58,] -8.0779528 4.9220472
[59,] -4.2160105 -8.0779528
[60,] -7.0236220 -4.2160105
[61,] -4.0236220 -7.0236220
[62,] -0.1902887 -4.0236220
[63,] -6.6902887 -0.1902887
[64,] -10.1902887 -6.6902887
[65,] -15.5236220 -10.1902887
[66,] -15.6902887 -15.5236220
[67,] -6.6902887 -15.6902887
[68,] -4.8569554 -6.6902887
[69,] -7.6902887 -4.8569554
[70,] -7.6902887 -7.6902887
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -16.4727690 -12.4727690
2 -23.6394357 -16.4727690
3 -8.1394357 -23.6394357
4 1.3605643 -8.1394357
5 -3.9727690 1.3605643
6 -4.1394357 -3.9727690
7 -3.1394357 -4.1394357
8 4.6938976 -3.1394357
9 -6.1394357 4.6938976
10 6.8605643 -6.1394357
11 4.7225066 6.8605643
12 7.9148950 4.7225066
13 9.9148950 7.9148950
14 9.7482283 9.9148950
15 5.2482283 9.7482283
16 3.7482283 5.2482283
17 11.4148950 3.7482283
18 5.2482283 11.4148950
19 8.2482283 5.2482283
20 7.0815617 8.2482283
21 0.2482283 7.0815617
22 1.2482283 0.2482283
23 1.1101706 1.2482283
24 0.3025591 1.1101706
25 1.3025591 0.3025591
26 7.1358924 1.3025591
27 -1.3641076 7.1358924
28 -8.8641076 -1.3641076
29 -10.1974409 -8.8641076
30 -9.3641076 -10.1974409
31 -5.3641076 -9.3641076
32 -15.5307743 -5.3641076
33 -2.3641076 -15.5307743
34 -2.3641076 -2.3641076
35 -0.5021654 -2.3641076
36 1.6902231 -0.5021654
37 -0.3097769 1.6902231
38 -1.4764436 -0.3097769
39 -2.9764436 -1.4764436
40 -0.4764436 -2.9764436
41 3.1902231 -0.4764436
42 9.0235564 3.1902231
43 3.0235564 9.0235564
44 4.8568898 3.0235564
45 11.0235564 4.8568898
46 10.0235564 11.0235564
47 -1.1145013 10.0235564
48 9.5887139 -1.1145013
49 9.5887139 9.5887139
50 8.4220472 9.5887139
51 13.9220472 8.4220472
52 14.4220472 13.9220472
53 15.0887139 14.4220472
54 14.9220472 15.0887139
55 3.9220472 14.9220472
56 3.7553806 3.9220472
57 4.9220472 3.7553806
58 -8.0779528 4.9220472
59 -4.2160105 -8.0779528
60 -7.0236220 -4.2160105
61 -4.0236220 -7.0236220
62 -0.1902887 -4.0236220
63 -6.6902887 -0.1902887
64 -10.1902887 -6.6902887
65 -15.5236220 -10.1902887
66 -15.6902887 -15.5236220
67 -6.6902887 -15.6902887
68 -4.8569554 -6.6902887
69 -7.6902887 -4.8569554
70 -7.6902887 -7.6902887
> 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/freestat/rcomp/tmp/71of51229866720.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/freestat/rcomp/tmp/841j01229866720.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/freestat/rcomp/tmp/9gk241229866720.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/104dbd1229866720.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/freestat/rcomp/tmp/11tv4t1229866720.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/freestat/rcomp/tmp/12csfv1229866720.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/freestat/rcomp/tmp/13ar0k1229866720.tab")
>
> system("convert tmp/1fnzp1229866720.ps tmp/1fnzp1229866720.png")
> system("convert tmp/2881h1229866720.ps tmp/2881h1229866720.png")
> system("convert tmp/36as81229866720.ps tmp/36as81229866720.png")
> system("convert tmp/4u4wh1229866720.ps tmp/4u4wh1229866720.png")
> system("convert tmp/5h4b31229866720.ps tmp/5h4b31229866720.png")
> system("convert tmp/61hh01229866720.ps tmp/61hh01229866720.png")
> system("convert tmp/71of51229866720.ps tmp/71of51229866720.png")
> system("convert tmp/841j01229866720.ps tmp/841j01229866720.png")
> system("convert tmp/9gk241229866720.ps tmp/9gk241229866720.png")
>
>
> proc.time()
user system elapsed
2.996 2.233 3.449