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(8.7,0,8.5,0,8.2,0,8.3,0,8,0,8.1,0,8.7,0,9.3,0,8.9,0,8.8,0,8.4,0,8.4,0,7.3,0,7.2,0,7,0,7,0,6.9,0,6.9,0,7.1,0,7.5,0,7.4,0,8.9,0,8.3,1,8.3,0,9,0,8.9,0,8.8,0,7.8,0,7.8,0,7.8,0,9.2,0,9.3,0,9.2,0,8.6,0,8.5,0,8.5,0,9,0,9,0,8.8,0,8,0,7.9,0,8.1,0,9.3,0,9.4,0,9.4,0,9.3,1,9,0,9.1,0,9.7,0,9.7,0,9.6,0,8.3,0,8.2,0,8.4,0,10.6,0,10.9,0,10.9,0,9.6,0,9.3,0,9.3,0,9.6,0,9.5,0,9.5,0,9,0,8.9,0,9,0,10.1,0,10.2,0,10.2,0,9.5,0,9.3,0,9.3,0,9.4,0,9.3,0,9.1,0,9,0,8.9,0,9,0,9.8,0,10,0,9.8,0,9.4,0,9,1,8.9,0,9.3,0,9.1,0,8.8,0,8.9,1,8.7,0,8.6,0,9.1,0,9.3,0,8.9,0),dim=c(2,93),dimnames=list(c('Vrouw','x'),1:93))
> y <- array(NA,dim=c(2,93),dimnames=list(c('Vrouw','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 = '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
Vrouw x M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 8.7 0 1 0 0 0 0 0 0 0 0 0 0 1
2 8.5 0 0 1 0 0 0 0 0 0 0 0 0 2
3 8.2 0 0 0 1 0 0 0 0 0 0 0 0 3
4 8.3 0 0 0 0 1 0 0 0 0 0 0 0 4
5 8.0 0 0 0 0 0 1 0 0 0 0 0 0 5
6 8.1 0 0 0 0 0 0 1 0 0 0 0 0 6
7 8.7 0 0 0 0 0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 0 0 0 0 0 0 1 71
72 9.3 0 0 0 0 0 0 0 0 0 0 0 0 72
73 9.4 0 1 0 0 0 0 0 0 0 0 0 0 73
74 9.3 0 0 1 0 0 0 0 0 0 0 0 0 74
75 9.1 0 0 0 1 0 0 0 0 0 0 0 0 75
76 9.0 0 0 0 0 1 0 0 0 0 0 0 0 76
77 8.9 0 0 0 0 0 1 0 0 0 0 0 0 77
78 9.0 0 0 0 0 0 0 1 0 0 0 0 0 78
79 9.8 0 0 0 0 0 0 0 1 0 0 0 0 79
80 10.0 0 0 0 0 0 0 0 0 1 0 0 0 80
81 9.8 0 0 0 0 0 0 0 0 0 1 0 0 81
82 9.4 0 0 0 0 0 0 0 0 0 0 1 0 82
83 9.0 1 0 0 0 0 0 0 0 0 0 0 1 83
84 8.9 0 0 0 0 0 0 0 0 0 0 0 0 84
85 9.3 0 1 0 0 0 0 0 0 0 0 0 0 85
86 9.1 0 0 1 0 0 0 0 0 0 0 0 0 86
87 8.8 0 0 0 1 0 0 0 0 0 0 0 0 87
88 8.9 1 0 0 0 1 0 0 0 0 0 0 0 88
89 8.7 0 0 0 0 0 1 0 0 0 0 0 0 89
90 8.6 0 0 0 0 0 0 1 0 0 0 0 0 90
91 9.1 0 0 0 0 0 0 0 1 0 0 0 0 91
92 9.3 0 0 0 0 0 0 0 0 1 0 0 0 92
93 8.9 0 0 0 0 0 0 0 0 0 1 0 0 93
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x M1 M2 M3 M4
8.01791 -0.16255 0.25587 0.13898 -0.05291 -0.48697
M5 M6 M7 M8 M9 M10
-0.64918 -0.59107 0.39204 0.62515 0.45826 0.38557
M11 t
0.06333 0.01689
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.6308 -0.1718 0.1165 0.2960 1.4612
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.017909 0.257842 31.096 < 2e-16 ***
x -0.162552 0.346189 -0.470 0.6400
M1 0.255873 0.316544 0.808 0.4213
M2 0.138984 0.316463 0.439 0.6617
M3 -0.052905 0.316400 -0.167 0.8676
M4 -0.486975 0.319377 -1.525 0.1313
M5 -0.649183 0.316328 -2.052 0.0435 *
M6 -0.591071 0.316319 -1.869 0.0654 .
M7 0.392040 0.316328 1.239 0.2189
M8 0.625151 0.316355 1.976 0.0516 .
M9 0.458262 0.316400 1.448 0.1515
M10 0.385571 0.330533 1.167 0.2469
M11 0.063332 0.341428 0.185 0.8533
t 0.016889 0.002386 7.078 5.3e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6112 on 79 degrees of freedom
Multiple R-Squared: 0.5455, Adjusted R-squared: 0.4707
F-statistic: 7.294 on 13 and 79 DF, p-value: 3.843e-09
> postscript(file="/var/www/html/rcomp/tmp/1k2hj1195135156.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/20wfe1195135156.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/3u9vl1195135156.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/4lkn21195135156.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/541cm1195135156.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
0.409329427 0.309329427 0.184329427 0.701510417 0.546829427 0.571829427
7 8 9 10 11 12
0.171829427 0.521829427 0.271829427 0.227632068 0.132981771 0.179425223
13 14 15 16 17 18
-1.193336124 -1.193336124 -1.218336124 -0.801155134 -0.755836124 -0.830836124
19 20 21 22 23 24
-1.630836124 -1.480836124 -1.430836124 0.124966518 -0.007131696 -0.123240327
25 26 27 28 29 30
0.303998326 0.303998326 0.378998326 -0.203820685 -0.058501674 -0.133501674
31 32 33 34 35 36
0.266498326 0.116498326 0.166498326 -0.377699033 -0.172349330 -0.125905878
37 38 39 40 41 42
0.101332775 0.201332775 0.176332775 -0.206486235 -0.161167225 -0.036167225
43 44 45 46 47 48
0.163832775 0.013832775 0.163832775 0.282187500 0.124985119 0.271428571
49 50 51 52 53 54
0.598667225 0.698667225 0.773667225 -0.109151786 -0.063832775 0.061167225
55 56 57 58 59 60
1.261167225 1.311167225 1.461167225 0.216969866 0.222319568 0.268763021
61 62 63 64 65 66
0.296001674 0.296001674 0.471001674 0.388182664 0.433501674 0.458501674
67 68 69 70 71 72
0.558501674 0.408501674 0.558501674 -0.085695685 0.019654018 0.066097470
73 74 75 76 77 78
-0.106663876 -0.106663876 -0.131663876 0.185517113 0.230836124 0.255836124
79 80 81 82 83 84
0.055836124 0.005836124 -0.044163876 -0.388361235 -0.320459449 -0.536568080
85 86 87 88 89 90
-0.409329427 -0.509329427 -0.634329427 0.045403646 -0.171829427 -0.346829427
91 92 93
-0.846829427 -0.896829427 -1.146829427
> postscript(file="/var/www/html/rcomp/tmp/6dago1195135156.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 0.409329427 NA
1 0.309329427 0.409329427
2 0.184329427 0.309329427
3 0.701510417 0.184329427
4 0.546829427 0.701510417
5 0.571829427 0.546829427
6 0.171829427 0.571829427
7 0.521829427 0.171829427
8 0.271829427 0.521829427
9 0.227632068 0.271829427
10 0.132981771 0.227632068
11 0.179425223 0.132981771
12 -1.193336124 0.179425223
13 -1.193336124 -1.193336124
14 -1.218336124 -1.193336124
15 -0.801155134 -1.218336124
16 -0.755836124 -0.801155134
17 -0.830836124 -0.755836124
18 -1.630836124 -0.830836124
19 -1.480836124 -1.630836124
20 -1.430836124 -1.480836124
21 0.124966518 -1.430836124
22 -0.007131696 0.124966518
23 -0.123240327 -0.007131696
24 0.303998326 -0.123240327
25 0.303998326 0.303998326
26 0.378998326 0.303998326
27 -0.203820685 0.378998326
28 -0.058501674 -0.203820685
29 -0.133501674 -0.058501674
30 0.266498326 -0.133501674
31 0.116498326 0.266498326
32 0.166498326 0.116498326
33 -0.377699033 0.166498326
34 -0.172349330 -0.377699033
35 -0.125905878 -0.172349330
36 0.101332775 -0.125905878
37 0.201332775 0.101332775
38 0.176332775 0.201332775
39 -0.206486235 0.176332775
40 -0.161167225 -0.206486235
41 -0.036167225 -0.161167225
42 0.163832775 -0.036167225
43 0.013832775 0.163832775
44 0.163832775 0.013832775
45 0.282187500 0.163832775
46 0.124985119 0.282187500
47 0.271428571 0.124985119
48 0.598667225 0.271428571
49 0.698667225 0.598667225
50 0.773667225 0.698667225
51 -0.109151786 0.773667225
52 -0.063832775 -0.109151786
53 0.061167225 -0.063832775
54 1.261167225 0.061167225
55 1.311167225 1.261167225
56 1.461167225 1.311167225
57 0.216969866 1.461167225
58 0.222319568 0.216969866
59 0.268763021 0.222319568
60 0.296001674 0.268763021
61 0.296001674 0.296001674
62 0.471001674 0.296001674
63 0.388182664 0.471001674
64 0.433501674 0.388182664
65 0.458501674 0.433501674
66 0.558501674 0.458501674
67 0.408501674 0.558501674
68 0.558501674 0.408501674
69 -0.085695685 0.558501674
70 0.019654018 -0.085695685
71 0.066097470 0.019654018
72 -0.106663876 0.066097470
73 -0.106663876 -0.106663876
74 -0.131663876 -0.106663876
75 0.185517113 -0.131663876
76 0.230836124 0.185517113
77 0.255836124 0.230836124
78 0.055836124 0.255836124
79 0.005836124 0.055836124
80 -0.044163876 0.005836124
81 -0.388361235 -0.044163876
82 -0.320459449 -0.388361235
83 -0.536568080 -0.320459449
84 -0.409329427 -0.536568080
85 -0.509329427 -0.409329427
86 -0.634329427 -0.509329427
87 0.045403646 -0.634329427
88 -0.171829427 0.045403646
89 -0.346829427 -0.171829427
90 -0.846829427 -0.346829427
91 -0.896829427 -0.846829427
92 -1.146829427 -0.896829427
93 NA -1.146829427
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.309329427 0.409329427
[2,] 0.184329427 0.309329427
[3,] 0.701510417 0.184329427
[4,] 0.546829427 0.701510417
[5,] 0.571829427 0.546829427
[6,] 0.171829427 0.571829427
[7,] 0.521829427 0.171829427
[8,] 0.271829427 0.521829427
[9,] 0.227632068 0.271829427
[10,] 0.132981771 0.227632068
[11,] 0.179425223 0.132981771
[12,] -1.193336124 0.179425223
[13,] -1.193336124 -1.193336124
[14,] -1.218336124 -1.193336124
[15,] -0.801155134 -1.218336124
[16,] -0.755836124 -0.801155134
[17,] -0.830836124 -0.755836124
[18,] -1.630836124 -0.830836124
[19,] -1.480836124 -1.630836124
[20,] -1.430836124 -1.480836124
[21,] 0.124966518 -1.430836124
[22,] -0.007131696 0.124966518
[23,] -0.123240327 -0.007131696
[24,] 0.303998326 -0.123240327
[25,] 0.303998326 0.303998326
[26,] 0.378998326 0.303998326
[27,] -0.203820685 0.378998326
[28,] -0.058501674 -0.203820685
[29,] -0.133501674 -0.058501674
[30,] 0.266498326 -0.133501674
[31,] 0.116498326 0.266498326
[32,] 0.166498326 0.116498326
[33,] -0.377699033 0.166498326
[34,] -0.172349330 -0.377699033
[35,] -0.125905878 -0.172349330
[36,] 0.101332775 -0.125905878
[37,] 0.201332775 0.101332775
[38,] 0.176332775 0.201332775
[39,] -0.206486235 0.176332775
[40,] -0.161167225 -0.206486235
[41,] -0.036167225 -0.161167225
[42,] 0.163832775 -0.036167225
[43,] 0.013832775 0.163832775
[44,] 0.163832775 0.013832775
[45,] 0.282187500 0.163832775
[46,] 0.124985119 0.282187500
[47,] 0.271428571 0.124985119
[48,] 0.598667225 0.271428571
[49,] 0.698667225 0.598667225
[50,] 0.773667225 0.698667225
[51,] -0.109151786 0.773667225
[52,] -0.063832775 -0.109151786
[53,] 0.061167225 -0.063832775
[54,] 1.261167225 0.061167225
[55,] 1.311167225 1.261167225
[56,] 1.461167225 1.311167225
[57,] 0.216969866 1.461167225
[58,] 0.222319568 0.216969866
[59,] 0.268763021 0.222319568
[60,] 0.296001674 0.268763021
[61,] 0.296001674 0.296001674
[62,] 0.471001674 0.296001674
[63,] 0.388182664 0.471001674
[64,] 0.433501674 0.388182664
[65,] 0.458501674 0.433501674
[66,] 0.558501674 0.458501674
[67,] 0.408501674 0.558501674
[68,] 0.558501674 0.408501674
[69,] -0.085695685 0.558501674
[70,] 0.019654018 -0.085695685
[71,] 0.066097470 0.019654018
[72,] -0.106663876 0.066097470
[73,] -0.106663876 -0.106663876
[74,] -0.131663876 -0.106663876
[75,] 0.185517113 -0.131663876
[76,] 0.230836124 0.185517113
[77,] 0.255836124 0.230836124
[78,] 0.055836124 0.255836124
[79,] 0.005836124 0.055836124
[80,] -0.044163876 0.005836124
[81,] -0.388361235 -0.044163876
[82,] -0.320459449 -0.388361235
[83,] -0.536568080 -0.320459449
[84,] -0.409329427 -0.536568080
[85,] -0.509329427 -0.409329427
[86,] -0.634329427 -0.509329427
[87,] 0.045403646 -0.634329427
[88,] -0.171829427 0.045403646
[89,] -0.346829427 -0.171829427
[90,] -0.846829427 -0.346829427
[91,] -0.896829427 -0.846829427
[92,] -1.146829427 -0.896829427
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.309329427 0.409329427
2 0.184329427 0.309329427
3 0.701510417 0.184329427
4 0.546829427 0.701510417
5 0.571829427 0.546829427
6 0.171829427 0.571829427
7 0.521829427 0.171829427
8 0.271829427 0.521829427
9 0.227632068 0.271829427
10 0.132981771 0.227632068
11 0.179425223 0.132981771
12 -1.193336124 0.179425223
13 -1.193336124 -1.193336124
14 -1.218336124 -1.193336124
15 -0.801155134 -1.218336124
16 -0.755836124 -0.801155134
17 -0.830836124 -0.755836124
18 -1.630836124 -0.830836124
19 -1.480836124 -1.630836124
20 -1.430836124 -1.480836124
21 0.124966518 -1.430836124
22 -0.007131696 0.124966518
23 -0.123240327 -0.007131696
24 0.303998326 -0.123240327
25 0.303998326 0.303998326
26 0.378998326 0.303998326
27 -0.203820685 0.378998326
28 -0.058501674 -0.203820685
29 -0.133501674 -0.058501674
30 0.266498326 -0.133501674
31 0.116498326 0.266498326
32 0.166498326 0.116498326
33 -0.377699033 0.166498326
34 -0.172349330 -0.377699033
35 -0.125905878 -0.172349330
36 0.101332775 -0.125905878
37 0.201332775 0.101332775
38 0.176332775 0.201332775
39 -0.206486235 0.176332775
40 -0.161167225 -0.206486235
41 -0.036167225 -0.161167225
42 0.163832775 -0.036167225
43 0.013832775 0.163832775
44 0.163832775 0.013832775
45 0.282187500 0.163832775
46 0.124985119 0.282187500
47 0.271428571 0.124985119
48 0.598667225 0.271428571
49 0.698667225 0.598667225
50 0.773667225 0.698667225
51 -0.109151786 0.773667225
52 -0.063832775 -0.109151786
53 0.061167225 -0.063832775
54 1.261167225 0.061167225
55 1.311167225 1.261167225
56 1.461167225 1.311167225
57 0.216969866 1.461167225
58 0.222319568 0.216969866
59 0.268763021 0.222319568
60 0.296001674 0.268763021
61 0.296001674 0.296001674
62 0.471001674 0.296001674
63 0.388182664 0.471001674
64 0.433501674 0.388182664
65 0.458501674 0.433501674
66 0.558501674 0.458501674
67 0.408501674 0.558501674
68 0.558501674 0.408501674
69 -0.085695685 0.558501674
70 0.019654018 -0.085695685
71 0.066097470 0.019654018
72 -0.106663876 0.066097470
73 -0.106663876 -0.106663876
74 -0.131663876 -0.106663876
75 0.185517113 -0.131663876
76 0.230836124 0.185517113
77 0.255836124 0.230836124
78 0.055836124 0.255836124
79 0.005836124 0.055836124
80 -0.044163876 0.005836124
81 -0.388361235 -0.044163876
82 -0.320459449 -0.388361235
83 -0.536568080 -0.320459449
84 -0.409329427 -0.536568080
85 -0.509329427 -0.409329427
86 -0.634329427 -0.509329427
87 0.045403646 -0.634329427
88 -0.171829427 0.045403646
89 -0.346829427 -0.171829427
90 -0.846829427 -0.346829427
91 -0.896829427 -0.846829427
92 -1.146829427 -0.896829427
> 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/7i4461195135157.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/8nka61195135157.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/9t8ky1195135157.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/101ipa1195135157.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/11blfe1195135157.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/122hyb1195135157.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/13ufw71195135157.tab")
>
> system("convert tmp/1k2hj1195135156.ps tmp/1k2hj1195135156.png")
> system("convert tmp/20wfe1195135156.ps tmp/20wfe1195135156.png")
> system("convert tmp/3u9vl1195135156.ps tmp/3u9vl1195135156.png")
> system("convert tmp/4lkn21195135156.ps tmp/4lkn21195135156.png")
> system("convert tmp/541cm1195135156.ps tmp/541cm1195135156.png")
> system("convert tmp/6dago1195135156.ps tmp/6dago1195135156.png")
> system("convert tmp/7i4461195135157.ps tmp/7i4461195135157.png")
> system("convert tmp/8nka61195135157.ps tmp/8nka61195135157.png")
> system("convert tmp/9t8ky1195135157.ps tmp/9t8ky1195135157.png")
>
>
> proc.time()
user system elapsed
2.409 1.491 2.796