R version 2.9.0 (2009-04-17)
Copyright (C) 2009 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(105.4,102.7,105.4,102.5,105.6,102.2,105.7,102.9,105.8,103.1,105.8,103,105.8,102.8,105.9,102.5,106.1,101.9,106.4,101.9,106.4,101.8,106.3,102,106.2,102.6,106.2,102.5,106.3,102.5,106.4,101.6,106.5,101.4,106.6,100.8,106.6,101.1,106.6,101.3,106.8,101.2,107,101.3,107.2,101.1,107.3,101.3,107.5,101.2,107.6,101.6,107.6,101.7,107.7,101.5,107.7,100.9,107.7,101.5,107.7,101.4,107.6,101.6,107.7,101.7,107.9,101.4,107.9,101.8,107.9,101.7,107.8,101.4,107.6,101.2,107.4,101,107,101.7,107,102.4,107.2,102,107.5,102.1,107.8,102,107.8,101.8,107.7,102.7,107.6,102.3,107.6,101.9,107.5,102,107.5,102.3,107.6,102.8,107.6,102.4,107.9,102.3,107.6,102.7,107.5,102.7,107.5,102.9,107.6,103,107.7,102.2,107.8,102.3,107.9,102.8,107.9,102.8),dim=c(2,61),dimnames=list(c('Werkl','Inflatie'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Werkl','Inflatie'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> ylab = ''
> xlab = ''
> main = ''
> #'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)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> 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
Werkl Inflatie
1 105.4 102.7
2 105.4 102.5
3 105.6 102.2
4 105.7 102.9
5 105.8 103.1
6 105.8 103.0
7 105.8 102.8
8 105.9 102.5
9 106.1 101.9
10 106.4 101.9
11 106.4 101.8
12 106.3 102.0
13 106.2 102.6
14 106.2 102.5
15 106.3 102.5
16 106.4 101.6
17 106.5 101.4
18 106.6 100.8
19 106.6 101.1
20 106.6 101.3
21 106.8 101.2
22 107.0 101.3
23 107.2 101.1
24 107.3 101.3
25 107.5 101.2
26 107.6 101.6
27 107.6 101.7
28 107.7 101.5
29 107.7 100.9
30 107.7 101.5
31 107.7 101.4
32 107.6 101.6
33 107.7 101.7
34 107.9 101.4
35 107.9 101.8
36 107.9 101.7
37 107.8 101.4
38 107.6 101.2
39 107.4 101.0
40 107.0 101.7
41 107.0 102.4
42 107.2 102.0
43 107.5 102.1
44 107.8 102.0
45 107.8 101.8
46 107.7 102.7
47 107.6 102.3
48 107.6 101.9
49 107.5 102.0
50 107.5 102.3
51 107.6 102.8
52 107.6 102.4
53 107.9 102.3
54 107.6 102.7
55 107.5 102.7
56 107.5 102.9
57 107.6 103.0
58 107.7 102.2
59 107.8 102.3
60 107.9 102.8
61 107.9 102.8
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Inflatie
138.6283 -0.3092
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.5324 -0.7324 0.2728 0.6295 1.0604
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 138.6283 15.8378 8.753 2.95e-12 ***
Inflatie -0.3092 0.1553 -1.991 0.0511 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.7458 on 59 degrees of freedom
Multiple R-squared: 0.06299, Adjusted R-squared: 0.0471
F-statistic: 3.966 on 1 and 59 DF, p-value: 0.05107
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.025096447 5.019289e-02 9.749036e-01
[2,] 0.008088075 1.617615e-02 9.919119e-01
[3,] 0.003622818 7.245636e-03 9.963772e-01
[4,] 0.005751338 1.150268e-02 9.942487e-01
[5,] 0.014378817 2.875763e-02 9.856212e-01
[6,] 0.028870291 5.774058e-02 9.711297e-01
[7,] 0.025836142 5.167228e-02 9.741639e-01
[8,] 0.022276382 4.455276e-02 9.777236e-01
[9,] 0.039381686 7.876337e-02 9.606183e-01
[10,] 0.066800864 1.336017e-01 9.331991e-01
[11,] 0.148875668 2.977513e-01 8.511243e-01
[12,] 0.176396927 3.527939e-01 8.236031e-01
[13,] 0.203264154 4.065283e-01 7.967358e-01
[14,] 0.216057774 4.321155e-01 7.839422e-01
[15,] 0.267248008 5.344960e-01 7.327520e-01
[16,] 0.410929281 8.218586e-01 5.890707e-01
[17,] 0.573923001 8.521540e-01 4.260770e-01
[18,] 0.772852443 4.542951e-01 2.271476e-01
[19,] 0.875509536 2.489809e-01 1.244905e-01
[20,] 0.954212950 9.157410e-02 4.578705e-02
[21,] 0.982421327 3.515735e-02 1.757867e-02
[22,] 0.997491703 5.016595e-03 2.508297e-03
[23,] 0.999493671 1.012659e-03 5.063295e-04
[24,] 0.999799623 4.007547e-04 2.003773e-04
[25,] 0.999707961 5.840783e-04 2.920391e-04
[26,] 0.999809315 3.813695e-04 1.906847e-04
[27,] 0.999817235 3.655304e-04 1.827652e-04
[28,] 0.999815782 3.684352e-04 1.842176e-04
[29,] 0.999853066 2.938684e-04 1.469342e-04
[30,] 0.999903303 1.933934e-04 9.669668e-05
[31,] 0.999962289 7.542259e-05 3.771129e-05
[32,] 0.999981516 3.696713e-05 1.848356e-05
[33,] 0.999981627 3.674539e-05 1.837269e-05
[34,] 0.999963968 7.206486e-05 3.603243e-05
[35,] 0.999912832 1.743353e-04 8.716765e-05
[36,] 0.999964467 7.106582e-05 3.553291e-05
[37,] 0.999998647 2.705054e-06 1.352527e-06
[38,] 0.999999835 3.304591e-07 1.652295e-07
[39,] 0.999999777 4.461632e-07 2.230816e-07
[40,] 0.999999623 7.535493e-07 3.767746e-07
[41,] 0.999999295 1.409410e-06 7.047051e-07
[42,] 0.999998721 2.557483e-06 1.278741e-06
[43,] 0.999996178 7.643424e-06 3.821712e-06
[44,] 0.999986342 2.731680e-05 1.365840e-05
[45,] 0.999971626 5.674740e-05 2.837370e-05
[46,] 0.999957618 8.476412e-05 4.238206e-05
[47,] 0.999868816 2.623684e-04 1.311842e-04
[48,] 0.999647590 7.048193e-04 3.524096e-04
[49,] 0.999033139 1.933722e-03 9.668609e-04
[50,] 0.996646246 6.707508e-03 3.353754e-03
[51,] 0.992747937 1.450413e-02 7.252063e-03
[52,] 0.987681599 2.463680e-02 1.231840e-02
> postscript(file="/var/www/html/rcomp/tmp/182ey1258734577.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/24w5a1258734577.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/3ydar1258734577.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/4n5171258734577.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/5juzm1258734577.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 61
Frequency = 1
1 2 3 4 5 6
-1.470543925 -1.532389602 -1.425158118 -1.108698248 -0.946852570 -0.977775409
7 8 9 10 11 12
-1.039621086 -1.032389602 -1.017926633 -0.717926633 -0.748849472 -0.787003795
13 14 15 16 17 18
-0.701466763 -0.732389602 -0.632389602 -0.810695149 -0.772540826 -0.858077858
19 20 21 22 23 24
-0.765309342 -0.703463665 -0.534386504 -0.303463665 -0.165309342 -0.003463665
25 26 27 28 29 30
0.165613496 0.389304851 0.420227689 0.458382012 0.272844981 0.458382012
31 32 33 34 35 36
0.427459174 0.389304851 0.520227689 0.627459174 0.751150528 0.720227689
37 38 39 40 41 42
0.527459174 0.265613496 0.003767819 -0.179772311 0.036687560 0.112996205
43 44 45 46 47 48
0.443919044 0.712996205 0.651150528 0.829456075 0.605764721 0.482073367
49 50 51 52 53 54
0.412996205 0.505764721 0.760378914 0.636687560 0.905764721 0.729456075
55 56 57 58 59 60
0.629456075 0.691301752 0.822224591 0.674841882 0.805764721 1.060378914
61
1.060378914
> postscript(file="/var/www/html/rcomp/tmp/6h3kl1258734577.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.470543925 NA
1 -1.532389602 -1.470543925
2 -1.425158118 -1.532389602
3 -1.108698248 -1.425158118
4 -0.946852570 -1.108698248
5 -0.977775409 -0.946852570
6 -1.039621086 -0.977775409
7 -1.032389602 -1.039621086
8 -1.017926633 -1.032389602
9 -0.717926633 -1.017926633
10 -0.748849472 -0.717926633
11 -0.787003795 -0.748849472
12 -0.701466763 -0.787003795
13 -0.732389602 -0.701466763
14 -0.632389602 -0.732389602
15 -0.810695149 -0.632389602
16 -0.772540826 -0.810695149
17 -0.858077858 -0.772540826
18 -0.765309342 -0.858077858
19 -0.703463665 -0.765309342
20 -0.534386504 -0.703463665
21 -0.303463665 -0.534386504
22 -0.165309342 -0.303463665
23 -0.003463665 -0.165309342
24 0.165613496 -0.003463665
25 0.389304851 0.165613496
26 0.420227689 0.389304851
27 0.458382012 0.420227689
28 0.272844981 0.458382012
29 0.458382012 0.272844981
30 0.427459174 0.458382012
31 0.389304851 0.427459174
32 0.520227689 0.389304851
33 0.627459174 0.520227689
34 0.751150528 0.627459174
35 0.720227689 0.751150528
36 0.527459174 0.720227689
37 0.265613496 0.527459174
38 0.003767819 0.265613496
39 -0.179772311 0.003767819
40 0.036687560 -0.179772311
41 0.112996205 0.036687560
42 0.443919044 0.112996205
43 0.712996205 0.443919044
44 0.651150528 0.712996205
45 0.829456075 0.651150528
46 0.605764721 0.829456075
47 0.482073367 0.605764721
48 0.412996205 0.482073367
49 0.505764721 0.412996205
50 0.760378914 0.505764721
51 0.636687560 0.760378914
52 0.905764721 0.636687560
53 0.729456075 0.905764721
54 0.629456075 0.729456075
55 0.691301752 0.629456075
56 0.822224591 0.691301752
57 0.674841882 0.822224591
58 0.805764721 0.674841882
59 1.060378914 0.805764721
60 1.060378914 1.060378914
61 NA 1.060378914
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.532389602 -1.470543925
[2,] -1.425158118 -1.532389602
[3,] -1.108698248 -1.425158118
[4,] -0.946852570 -1.108698248
[5,] -0.977775409 -0.946852570
[6,] -1.039621086 -0.977775409
[7,] -1.032389602 -1.039621086
[8,] -1.017926633 -1.032389602
[9,] -0.717926633 -1.017926633
[10,] -0.748849472 -0.717926633
[11,] -0.787003795 -0.748849472
[12,] -0.701466763 -0.787003795
[13,] -0.732389602 -0.701466763
[14,] -0.632389602 -0.732389602
[15,] -0.810695149 -0.632389602
[16,] -0.772540826 -0.810695149
[17,] -0.858077858 -0.772540826
[18,] -0.765309342 -0.858077858
[19,] -0.703463665 -0.765309342
[20,] -0.534386504 -0.703463665
[21,] -0.303463665 -0.534386504
[22,] -0.165309342 -0.303463665
[23,] -0.003463665 -0.165309342
[24,] 0.165613496 -0.003463665
[25,] 0.389304851 0.165613496
[26,] 0.420227689 0.389304851
[27,] 0.458382012 0.420227689
[28,] 0.272844981 0.458382012
[29,] 0.458382012 0.272844981
[30,] 0.427459174 0.458382012
[31,] 0.389304851 0.427459174
[32,] 0.520227689 0.389304851
[33,] 0.627459174 0.520227689
[34,] 0.751150528 0.627459174
[35,] 0.720227689 0.751150528
[36,] 0.527459174 0.720227689
[37,] 0.265613496 0.527459174
[38,] 0.003767819 0.265613496
[39,] -0.179772311 0.003767819
[40,] 0.036687560 -0.179772311
[41,] 0.112996205 0.036687560
[42,] 0.443919044 0.112996205
[43,] 0.712996205 0.443919044
[44,] 0.651150528 0.712996205
[45,] 0.829456075 0.651150528
[46,] 0.605764721 0.829456075
[47,] 0.482073367 0.605764721
[48,] 0.412996205 0.482073367
[49,] 0.505764721 0.412996205
[50,] 0.760378914 0.505764721
[51,] 0.636687560 0.760378914
[52,] 0.905764721 0.636687560
[53,] 0.729456075 0.905764721
[54,] 0.629456075 0.729456075
[55,] 0.691301752 0.629456075
[56,] 0.822224591 0.691301752
[57,] 0.674841882 0.822224591
[58,] 0.805764721 0.674841882
[59,] 1.060378914 0.805764721
[60,] 1.060378914 1.060378914
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.532389602 -1.470543925
2 -1.425158118 -1.532389602
3 -1.108698248 -1.425158118
4 -0.946852570 -1.108698248
5 -0.977775409 -0.946852570
6 -1.039621086 -0.977775409
7 -1.032389602 -1.039621086
8 -1.017926633 -1.032389602
9 -0.717926633 -1.017926633
10 -0.748849472 -0.717926633
11 -0.787003795 -0.748849472
12 -0.701466763 -0.787003795
13 -0.732389602 -0.701466763
14 -0.632389602 -0.732389602
15 -0.810695149 -0.632389602
16 -0.772540826 -0.810695149
17 -0.858077858 -0.772540826
18 -0.765309342 -0.858077858
19 -0.703463665 -0.765309342
20 -0.534386504 -0.703463665
21 -0.303463665 -0.534386504
22 -0.165309342 -0.303463665
23 -0.003463665 -0.165309342
24 0.165613496 -0.003463665
25 0.389304851 0.165613496
26 0.420227689 0.389304851
27 0.458382012 0.420227689
28 0.272844981 0.458382012
29 0.458382012 0.272844981
30 0.427459174 0.458382012
31 0.389304851 0.427459174
32 0.520227689 0.389304851
33 0.627459174 0.520227689
34 0.751150528 0.627459174
35 0.720227689 0.751150528
36 0.527459174 0.720227689
37 0.265613496 0.527459174
38 0.003767819 0.265613496
39 -0.179772311 0.003767819
40 0.036687560 -0.179772311
41 0.112996205 0.036687560
42 0.443919044 0.112996205
43 0.712996205 0.443919044
44 0.651150528 0.712996205
45 0.829456075 0.651150528
46 0.605764721 0.829456075
47 0.482073367 0.605764721
48 0.412996205 0.482073367
49 0.505764721 0.412996205
50 0.760378914 0.505764721
51 0.636687560 0.760378914
52 0.905764721 0.636687560
53 0.729456075 0.905764721
54 0.629456075 0.729456075
55 0.691301752 0.629456075
56 0.822224591 0.691301752
57 0.674841882 0.822224591
58 0.805764721 0.674841882
59 1.060378914 0.805764721
60 1.060378914 1.060378914
> 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/7wzd91258734577.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/864ho1258734577.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/9atd01258734577.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
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10gm221258734577.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ 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/119fzx1258734577.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/12y5c11258734577.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/136iq01258734577.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/14rjnx1258734577.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15alch1258734577.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16gciu1258734577.tab")
+ }
>
> system("convert tmp/182ey1258734577.ps tmp/182ey1258734577.png")
> system("convert tmp/24w5a1258734577.ps tmp/24w5a1258734577.png")
> system("convert tmp/3ydar1258734577.ps tmp/3ydar1258734577.png")
> system("convert tmp/4n5171258734577.ps tmp/4n5171258734577.png")
> system("convert tmp/5juzm1258734577.ps tmp/5juzm1258734577.png")
> system("convert tmp/6h3kl1258734577.ps tmp/6h3kl1258734577.png")
> system("convert tmp/7wzd91258734577.ps tmp/7wzd91258734577.png")
> system("convert tmp/864ho1258734577.ps tmp/864ho1258734577.png")
> system("convert tmp/9atd01258734577.ps tmp/9atd01258734577.png")
> system("convert tmp/10gm221258734577.ps tmp/10gm221258734577.png")
>
>
> proc.time()
user system elapsed
2.449 1.571 2.843