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(519164,0,517009,0,509933,0,509127,0,500857,0,506971,0,569323,0,579714,0,577992,0,565464,0,547344,0,554788,0,562325,0,560854,0,555332,0,543599,0,536662,0,542722,0,593530,0,610763,0,612613,0,611324,0,594167,0,595454,0,590865,0,589379,0,584428,0,573100,0,567456,0,569028,0,620735,0,628884,0,628232,0,612117,0,595404,0,597141,0,593408,0,590072,0,579799,0,574205,0,572775,0,572942,0,619567,0,625809,0,619916,0,587625,0,565742,0,557274,0,560576,1,548854,1,531673,1,525919,1,511038,1,498662,1,555362,1,564591,1,541657,1,527070,1,509846,1,514258,1,516922,1,507561,1,492622,1,490243,1,469357,1,477580,1,528379,1,533590,1,517945,1,506174,1,501866,1),dim=c(2,71),dimnames=list(c('WerklozenTotaal','Kredietcrisis'),1:71))
> y <- array(NA,dim=c(2,71),dimnames=list(c('WerklozenTotaal','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
WerklozenTotaal Kredietcrisis M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 519164 0 1 0 0 0 0 0 0 0 0 0 0 1
2 517009 0 0 1 0 0 0 0 0 0 0 0 0 2
3 509933 0 0 0 1 0 0 0 0 0 0 0 0 3
4 509127 0 0 0 0 1 0 0 0 0 0 0 0 4
5 500857 0 0 0 0 0 1 0 0 0 0 0 0 5
6 506971 0 0 0 0 0 0 1 0 0 0 0 0 6
7 569323 0 0 0 0 0 0 0 1 0 0 0 0 7
8 579714 0 0 0 0 0 0 0 0 1 0 0 0 8
9 577992 0 0 0 0 0 0 0 0 0 1 0 0 9
10 565464 0 0 0 0 0 0 0 0 0 0 1 0 10
11 547344 0 0 0 0 0 0 0 0 0 0 0 1 11
12 554788 0 0 0 0 0 0 0 0 0 0 0 0 12
13 562325 0 1 0 0 0 0 0 0 0 0 0 0 13
14 560854 0 0 1 0 0 0 0 0 0 0 0 0 14
15 555332 0 0 0 1 0 0 0 0 0 0 0 0 15
16 543599 0 0 0 0 1 0 0 0 0 0 0 0 16
17 536662 0 0 0 0 0 1 0 0 0 0 0 0 17
18 542722 0 0 0 0 0 0 1 0 0 0 0 0 18
19 593530 0 0 0 0 0 0 0 1 0 0 0 0 19
20 610763 0 0 0 0 0 0 0 0 1 0 0 0 20
21 612613 0 0 0 0 0 0 0 0 0 1 0 0 21
22 611324 0 0 0 0 0 0 0 0 0 0 1 0 22
23 594167 0 0 0 0 0 0 0 0 0 0 0 1 23
24 595454 0 0 0 0 0 0 0 0 0 0 0 0 24
25 590865 0 1 0 0 0 0 0 0 0 0 0 0 25
26 589379 0 0 1 0 0 0 0 0 0 0 0 0 26
27 584428 0 0 0 1 0 0 0 0 0 0 0 0 27
28 573100 0 0 0 0 1 0 0 0 0 0 0 0 28
29 567456 0 0 0 0 0 1 0 0 0 0 0 0 29
30 569028 0 0 0 0 0 0 1 0 0 0 0 0 30
31 620735 0 0 0 0 0 0 0 1 0 0 0 0 31
32 628884 0 0 0 0 0 0 0 0 1 0 0 0 32
33 628232 0 0 0 0 0 0 0 0 0 1 0 0 33
34 612117 0 0 0 0 0 0 0 0 0 0 1 0 34
35 595404 0 0 0 0 0 0 0 0 0 0 0 1 35
36 597141 0 0 0 0 0 0 0 0 0 0 0 0 36
37 593408 0 1 0 0 0 0 0 0 0 0 0 0 37
38 590072 0 0 1 0 0 0 0 0 0 0 0 0 38
39 579799 0 0 0 1 0 0 0 0 0 0 0 0 39
40 574205 0 0 0 0 1 0 0 0 0 0 0 0 40
41 572775 0 0 0 0 0 1 0 0 0 0 0 0 41
42 572942 0 0 0 0 0 0 1 0 0 0 0 0 42
43 619567 0 0 0 0 0 0 0 1 0 0 0 0 43
44 625809 0 0 0 0 0 0 0 0 1 0 0 0 44
45 619916 0 0 0 0 0 0 0 0 0 1 0 0 45
46 587625 0 0 0 0 0 0 0 0 0 0 1 0 46
47 565742 0 0 0 0 0 0 0 0 0 0 0 1 47
48 557274 0 0 0 0 0 0 0 0 0 0 0 0 48
49 560576 1 1 0 0 0 0 0 0 0 0 0 0 49
50 548854 1 0 1 0 0 0 0 0 0 0 0 0 50
51 531673 1 0 0 1 0 0 0 0 0 0 0 0 51
52 525919 1 0 0 0 1 0 0 0 0 0 0 0 52
53 511038 1 0 0 0 0 1 0 0 0 0 0 0 53
54 498662 1 0 0 0 0 0 1 0 0 0 0 0 54
55 555362 1 0 0 0 0 0 0 1 0 0 0 0 55
56 564591 1 0 0 0 0 0 0 0 1 0 0 0 56
57 541657 1 0 0 0 0 0 0 0 0 1 0 0 57
58 527070 1 0 0 0 0 0 0 0 0 0 1 0 58
59 509846 1 0 0 0 0 0 0 0 0 0 0 1 59
60 514258 1 0 0 0 0 0 0 0 0 0 0 0 60
61 516922 1 1 0 0 0 0 0 0 0 0 0 0 61
62 507561 1 0 1 0 0 0 0 0 0 0 0 0 62
63 492622 1 0 0 1 0 0 0 0 0 0 0 0 63
64 490243 1 0 0 0 1 0 0 0 0 0 0 0 64
65 469357 1 0 0 0 0 1 0 0 0 0 0 0 65
66 477580 1 0 0 0 0 0 1 0 0 0 0 0 66
67 528379 1 0 0 0 0 0 0 1 0 0 0 0 67
68 533590 1 0 0 0 0 0 0 0 1 0 0 0 68
69 517945 1 0 0 0 0 0 0 0 0 1 0 0 69
70 506174 1 0 0 0 0 0 0 0 0 0 1 0 70
71 501866 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
543630 -94863 11510 5501 -5576
M4 M5 M6 M7 M8
-12929 -23690 -23150 28928 37250
M9 M10 M11 t
28664 12814 -4174 1087
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-38523.43 -14620.63 30.90 14435.46 47045.35
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 543630.2 11793.8 46.094 < 2e-16 ***
Kredietcrisis -94863.1 9766.4 -9.713 1.08e-13 ***
M1 11509.5 13447.7 0.856 0.39565
M2 5500.8 13412.9 0.410 0.68326
M3 -5576.3 13381.7 -0.417 0.67845
M4 -12928.8 13354.2 -0.968 0.33706
M5 -23690.3 13330.5 -1.777 0.08088 .
M6 -23150.4 13310.5 -1.739 0.08739 .
M7 28927.9 13294.3 2.176 0.03372 *
M8 37250.3 13281.9 2.805 0.00688 **
M9 28664.1 13273.3 2.160 0.03503 *
M10 12813.8 13268.5 0.966 0.33826
M11 -4173.8 13267.5 -0.315 0.75422
t 1086.8 224.9 4.832 1.06e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 21880 on 57 degrees of freedom
Multiple R-squared: 0.7674, Adjusted R-squared: 0.7144
F-statistic: 14.47 on 13 and 57 DF, p-value: 1.372e-13
> postscript(file="/var/www/html/rcomp/tmp/1gr851229865837.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/295lh1229865837.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/38i2z1229865837.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/4w87g1229865837.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/5amkz1229865837.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
-37062.50755 -34295.67421 -31381.34088 -25921.67421 -24517.00755 -20029.67421
7 8 9 10 11 12
-10842.84088 -9861.00755 -4083.67421 -1848.17421 -4067.34088 -1883.99941
13 14 15 16 17 18
-6943.31778 -3492.48445 975.84888 -4491.48445 -1753.81778 2679.51555
19 20 21 22 23 24
322.34888 8146.18222 17495.51555 30970.01555 29713.84888 25740.19035
25 26 27 28 29 30
8554.87198 11990.70531 17030.03865 11967.70531 15998.37198 15943.70531
31 32 33 34 35 36
14485.53865 13225.37198 20072.70531 18721.20531 17909.03865 14385.38012
37 38 39 40 41 42
-1943.93825 -358.10492 -640.77159 30.89508 8275.56175 6815.89508
43 44 45 46 47 48
275.72841 -2891.43825 -1285.10492 -18812.60492 -24794.77159 -38523.43012
49 50 51 52 53 54
47045.35092 40245.18425 33054.51759 33566.18425 28359.85092 14357.18425
55 56 57 58 59 60
17892.01759 17711.85092 2277.18425 2453.68425 1130.51759 281.85906
61 62 63 64 65 66
-9650.45932 -14089.62598 -19038.29265 -15151.62598 -26362.95932 -19766.62598
67 68 69 70 71
-22132.79265 -26330.95932 -34476.62598 -31484.12598 -19891.29265
> postscript(file="/var/www/html/rcomp/tmp/6okok1229865837.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 -37062.50755 NA
1 -34295.67421 -37062.50755
2 -31381.34088 -34295.67421
3 -25921.67421 -31381.34088
4 -24517.00755 -25921.67421
5 -20029.67421 -24517.00755
6 -10842.84088 -20029.67421
7 -9861.00755 -10842.84088
8 -4083.67421 -9861.00755
9 -1848.17421 -4083.67421
10 -4067.34088 -1848.17421
11 -1883.99941 -4067.34088
12 -6943.31778 -1883.99941
13 -3492.48445 -6943.31778
14 975.84888 -3492.48445
15 -4491.48445 975.84888
16 -1753.81778 -4491.48445
17 2679.51555 -1753.81778
18 322.34888 2679.51555
19 8146.18222 322.34888
20 17495.51555 8146.18222
21 30970.01555 17495.51555
22 29713.84888 30970.01555
23 25740.19035 29713.84888
24 8554.87198 25740.19035
25 11990.70531 8554.87198
26 17030.03865 11990.70531
27 11967.70531 17030.03865
28 15998.37198 11967.70531
29 15943.70531 15998.37198
30 14485.53865 15943.70531
31 13225.37198 14485.53865
32 20072.70531 13225.37198
33 18721.20531 20072.70531
34 17909.03865 18721.20531
35 14385.38012 17909.03865
36 -1943.93825 14385.38012
37 -358.10492 -1943.93825
38 -640.77159 -358.10492
39 30.89508 -640.77159
40 8275.56175 30.89508
41 6815.89508 8275.56175
42 275.72841 6815.89508
43 -2891.43825 275.72841
44 -1285.10492 -2891.43825
45 -18812.60492 -1285.10492
46 -24794.77159 -18812.60492
47 -38523.43012 -24794.77159
48 47045.35092 -38523.43012
49 40245.18425 47045.35092
50 33054.51759 40245.18425
51 33566.18425 33054.51759
52 28359.85092 33566.18425
53 14357.18425 28359.85092
54 17892.01759 14357.18425
55 17711.85092 17892.01759
56 2277.18425 17711.85092
57 2453.68425 2277.18425
58 1130.51759 2453.68425
59 281.85906 1130.51759
60 -9650.45932 281.85906
61 -14089.62598 -9650.45932
62 -19038.29265 -14089.62598
63 -15151.62598 -19038.29265
64 -26362.95932 -15151.62598
65 -19766.62598 -26362.95932
66 -22132.79265 -19766.62598
67 -26330.95932 -22132.79265
68 -34476.62598 -26330.95932
69 -31484.12598 -34476.62598
70 -19891.29265 -31484.12598
71 NA -19891.29265
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -34295.67421 -37062.50755
[2,] -31381.34088 -34295.67421
[3,] -25921.67421 -31381.34088
[4,] -24517.00755 -25921.67421
[5,] -20029.67421 -24517.00755
[6,] -10842.84088 -20029.67421
[7,] -9861.00755 -10842.84088
[8,] -4083.67421 -9861.00755
[9,] -1848.17421 -4083.67421
[10,] -4067.34088 -1848.17421
[11,] -1883.99941 -4067.34088
[12,] -6943.31778 -1883.99941
[13,] -3492.48445 -6943.31778
[14,] 975.84888 -3492.48445
[15,] -4491.48445 975.84888
[16,] -1753.81778 -4491.48445
[17,] 2679.51555 -1753.81778
[18,] 322.34888 2679.51555
[19,] 8146.18222 322.34888
[20,] 17495.51555 8146.18222
[21,] 30970.01555 17495.51555
[22,] 29713.84888 30970.01555
[23,] 25740.19035 29713.84888
[24,] 8554.87198 25740.19035
[25,] 11990.70531 8554.87198
[26,] 17030.03865 11990.70531
[27,] 11967.70531 17030.03865
[28,] 15998.37198 11967.70531
[29,] 15943.70531 15998.37198
[30,] 14485.53865 15943.70531
[31,] 13225.37198 14485.53865
[32,] 20072.70531 13225.37198
[33,] 18721.20531 20072.70531
[34,] 17909.03865 18721.20531
[35,] 14385.38012 17909.03865
[36,] -1943.93825 14385.38012
[37,] -358.10492 -1943.93825
[38,] -640.77159 -358.10492
[39,] 30.89508 -640.77159
[40,] 8275.56175 30.89508
[41,] 6815.89508 8275.56175
[42,] 275.72841 6815.89508
[43,] -2891.43825 275.72841
[44,] -1285.10492 -2891.43825
[45,] -18812.60492 -1285.10492
[46,] -24794.77159 -18812.60492
[47,] -38523.43012 -24794.77159
[48,] 47045.35092 -38523.43012
[49,] 40245.18425 47045.35092
[50,] 33054.51759 40245.18425
[51,] 33566.18425 33054.51759
[52,] 28359.85092 33566.18425
[53,] 14357.18425 28359.85092
[54,] 17892.01759 14357.18425
[55,] 17711.85092 17892.01759
[56,] 2277.18425 17711.85092
[57,] 2453.68425 2277.18425
[58,] 1130.51759 2453.68425
[59,] 281.85906 1130.51759
[60,] -9650.45932 281.85906
[61,] -14089.62598 -9650.45932
[62,] -19038.29265 -14089.62598
[63,] -15151.62598 -19038.29265
[64,] -26362.95932 -15151.62598
[65,] -19766.62598 -26362.95932
[66,] -22132.79265 -19766.62598
[67,] -26330.95932 -22132.79265
[68,] -34476.62598 -26330.95932
[69,] -31484.12598 -34476.62598
[70,] -19891.29265 -31484.12598
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -34295.67421 -37062.50755
2 -31381.34088 -34295.67421
3 -25921.67421 -31381.34088
4 -24517.00755 -25921.67421
5 -20029.67421 -24517.00755
6 -10842.84088 -20029.67421
7 -9861.00755 -10842.84088
8 -4083.67421 -9861.00755
9 -1848.17421 -4083.67421
10 -4067.34088 -1848.17421
11 -1883.99941 -4067.34088
12 -6943.31778 -1883.99941
13 -3492.48445 -6943.31778
14 975.84888 -3492.48445
15 -4491.48445 975.84888
16 -1753.81778 -4491.48445
17 2679.51555 -1753.81778
18 322.34888 2679.51555
19 8146.18222 322.34888
20 17495.51555 8146.18222
21 30970.01555 17495.51555
22 29713.84888 30970.01555
23 25740.19035 29713.84888
24 8554.87198 25740.19035
25 11990.70531 8554.87198
26 17030.03865 11990.70531
27 11967.70531 17030.03865
28 15998.37198 11967.70531
29 15943.70531 15998.37198
30 14485.53865 15943.70531
31 13225.37198 14485.53865
32 20072.70531 13225.37198
33 18721.20531 20072.70531
34 17909.03865 18721.20531
35 14385.38012 17909.03865
36 -1943.93825 14385.38012
37 -358.10492 -1943.93825
38 -640.77159 -358.10492
39 30.89508 -640.77159
40 8275.56175 30.89508
41 6815.89508 8275.56175
42 275.72841 6815.89508
43 -2891.43825 275.72841
44 -1285.10492 -2891.43825
45 -18812.60492 -1285.10492
46 -24794.77159 -18812.60492
47 -38523.43012 -24794.77159
48 47045.35092 -38523.43012
49 40245.18425 47045.35092
50 33054.51759 40245.18425
51 33566.18425 33054.51759
52 28359.85092 33566.18425
53 14357.18425 28359.85092
54 17892.01759 14357.18425
55 17711.85092 17892.01759
56 2277.18425 17711.85092
57 2453.68425 2277.18425
58 1130.51759 2453.68425
59 281.85906 1130.51759
60 -9650.45932 281.85906
61 -14089.62598 -9650.45932
62 -19038.29265 -14089.62598
63 -15151.62598 -19038.29265
64 -26362.95932 -15151.62598
65 -19766.62598 -26362.95932
66 -22132.79265 -19766.62598
67 -26330.95932 -22132.79265
68 -34476.62598 -26330.95932
69 -31484.12598 -34476.62598
70 -19891.29265 -31484.12598
> 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/79k0l1229865837.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/82igz1229865837.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/9sonw1229865837.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/10b9rb1229865837.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/11pm8p1229865838.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/12tnay1229865838.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/133fws1229865838.tab")
>
> system("convert tmp/1gr851229865837.ps tmp/1gr851229865837.png")
> system("convert tmp/295lh1229865837.ps tmp/295lh1229865837.png")
> system("convert tmp/38i2z1229865837.ps tmp/38i2z1229865837.png")
> system("convert tmp/4w87g1229865837.ps tmp/4w87g1229865837.png")
> system("convert tmp/5amkz1229865837.ps tmp/5amkz1229865837.png")
> system("convert tmp/6okok1229865837.ps tmp/6okok1229865837.png")
> system("convert tmp/79k0l1229865837.ps tmp/79k0l1229865837.png")
> system("convert tmp/82igz1229865837.ps tmp/82igz1229865837.png")
> system("convert tmp/9sonw1229865837.ps tmp/9sonw1229865837.png")
>
>
> proc.time()
user system elapsed
4.030 2.477 4.366