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(4.3,29,3.9,31,4,31,4.3,33,4.8,37,4.4,30,4.3,20,4.7,19,4.7,17,4.9,22,5,12,4.2,25,4.3,25,4.8,29,4.8,32,4.8,31,4.2,28,4.6,28,4.8,28,4.5,32,4.4,35,4.3,30,3.9,32,3.7,38,4,37,4.1,28,3.7,34,3.8,35,3.8,32,3.8,39,3.3,37,3.3,38,3.3,35,3.2,25,3.4,25,4.2,26,4.9,13,5.1,19,5.5,17,5.6,21,6.4,23,6.1,18,7.1,12,7.8,7,7.9,4,7.4,14,7.5,16,6.8,13,5.2,13,4.7,10,4.1,19,3.9,13,2.6,14,2.7,25,1.8,28,1,30,0.3,31,1.3,42,1,41,1.1,38),dim=c(2,60),dimnames=list(c('Consumentenprijsindex','Consumentenvertrouwen'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Consumentenprijsindex','Consumentenvertrouwen'),1:60))
> 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)
> 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
Consumentenprijsindex Consumentenvertrouwen
1 4.3 29
2 3.9 31
3 4.0 31
4 4.3 33
5 4.8 37
6 4.4 30
7 4.3 20
8 4.7 19
9 4.7 17
10 4.9 22
11 5.0 12
12 4.2 25
13 4.3 25
14 4.8 29
15 4.8 32
16 4.8 31
17 4.2 28
18 4.6 28
19 4.8 28
20 4.5 32
21 4.4 35
22 4.3 30
23 3.9 32
24 3.7 38
25 4.0 37
26 4.1 28
27 3.7 34
28 3.8 35
29 3.8 32
30 3.8 39
31 3.3 37
32 3.3 38
33 3.3 35
34 3.2 25
35 3.4 25
36 4.2 26
37 4.9 13
38 5.1 19
39 5.5 17
40 5.6 21
41 6.4 23
42 6.1 18
43 7.1 12
44 7.8 7
45 7.9 4
46 7.4 14
47 7.5 16
48 6.8 13
49 5.2 13
50 4.7 10
51 4.1 19
52 3.9 13
53 2.6 14
54 2.7 25
55 1.8 28
56 1.0 30
57 0.3 31
58 1.3 42
59 1.0 41
60 1.1 38
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Consumentenvertrouwen
7.1537 -0.1106
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.4264 -0.6860 0.2314 0.8604 2.1152
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.15369 0.46874 15.262 < 2e-16 ***
Consumentenvertrouwen -0.11056 0.01712 -6.458 2.37e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.228 on 58 degrees of freedom
Multiple R-squared: 0.4183, Adjusted R-squared: 0.4083
F-statistic: 41.71 on 1 and 58 DF, p-value: 2.368e-08
> 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,] 1.235595e-02 2.471189e-02 0.98764405
[2,] 4.043923e-03 8.087846e-03 0.99595608
[3,] 2.202671e-03 4.405342e-03 0.99779733
[4,] 1.239057e-03 2.478114e-03 0.99876094
[5,] 3.755740e-04 7.511480e-04 0.99962443
[6,] 1.874646e-04 3.749292e-04 0.99981254
[7,] 5.798713e-05 1.159743e-04 0.99994201
[8,] 1.903079e-05 3.806158e-05 0.99998097
[9,] 4.784082e-06 9.568163e-06 0.99999522
[10,] 2.593419e-06 5.186839e-06 0.99999741
[11,] 1.580775e-06 3.161549e-06 0.99999842
[12,] 7.576500e-07 1.515300e-06 0.99999924
[13,] 2.462779e-07 4.925558e-07 0.99999975
[14,] 6.237903e-08 1.247581e-07 0.99999994
[15,] 2.341923e-08 4.683846e-08 0.99999998
[16,] 5.993879e-09 1.198776e-08 0.99999999
[17,] 1.657003e-09 3.314006e-09 1.00000000
[18,] 4.266802e-10 8.533603e-10 1.00000000
[19,] 3.534478e-10 7.068956e-10 1.00000000
[20,] 3.785431e-10 7.570863e-10 1.00000000
[21,] 1.512667e-10 3.025333e-10 1.00000000
[22,] 5.520780e-11 1.104156e-10 1.00000000
[23,] 5.131520e-11 1.026304e-10 1.00000000
[24,] 2.856100e-11 5.712200e-11 1.00000000
[25,] 1.712771e-11 3.425542e-11 1.00000000
[26,] 1.189953e-11 2.379907e-11 1.00000000
[27,] 3.397301e-11 6.794602e-11 1.00000000
[28,] 7.677813e-11 1.535563e-10 1.00000000
[29,] 1.794364e-10 3.588728e-10 1.00000000
[30,] 2.165904e-09 4.331807e-09 1.00000000
[31,] 4.391356e-09 8.782711e-09 1.00000000
[32,] 1.637023e-09 3.274046e-09 1.00000000
[33,] 6.381989e-10 1.276398e-09 1.00000000
[34,] 3.004130e-10 6.008259e-10 1.00000000
[35,] 2.537094e-10 5.074189e-10 1.00000000
[36,] 6.434583e-10 1.286917e-09 1.00000000
[37,] 1.579485e-07 3.158970e-07 0.99999984
[38,] 4.430415e-07 8.860830e-07 0.99999956
[39,] 2.989063e-06 5.978126e-06 0.99999701
[40,] 1.392886e-05 2.785771e-05 0.99998607
[41,] 1.995456e-05 3.990912e-05 0.99998005
[42,] 2.694320e-04 5.388640e-04 0.99973057
[43,] 2.323578e-02 4.647156e-02 0.97676422
[44,] 2.068814e-01 4.137627e-01 0.79311864
[45,] 3.175482e-01 6.350963e-01 0.68245183
[46,] 3.630464e-01 7.260928e-01 0.63695359
[47,] 5.629184e-01 8.741633e-01 0.43708164
[48,] 7.033305e-01 5.933390e-01 0.29666950
[49,] 6.953401e-01 6.093199e-01 0.30465994
[50,] 8.659504e-01 2.680993e-01 0.13404963
[51,] 9.585462e-01 8.290755e-02 0.04145377
> postscript(file="/var/www/html/rcomp/tmp/1qf8d1259413067.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/2nu0a1259413067.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/3es7p1259413067.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/4ty7e1259413067.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/5fu4n1259413067.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 = 60
Frequency = 1
1 2 3 4 5 6
0.35246857 0.17358315 0.27358315 0.79469773 1.73692688 0.56302586
7 8 9 10 11 12
-0.64254703 -0.35310432 -0.57421890 0.17856754 -0.82700535 -0.18976059
13 14 15 16 17 18
-0.08976059 0.85246857 1.18414044 1.07358315 0.14191128 0.54191128
19 20 21 22 23 24
0.74191128 0.88414044 1.11581230 0.46302586 0.28414044 0.74748417
25 26 27 28 29 30
0.93692688 0.04191128 0.30525501 0.51581230 0.18414044 0.95804146
31 32 33 34 35 36
0.23692688 0.34748417 0.01581230 -1.18976059 -0.98976059 -0.07920330
37 38 39 40 41 42
-0.81644806 0.04689568 0.22578110 0.76801025 1.78912483 0.93633839
43 44 45 46 47 48
1.27299465 1.42020821 1.18853634 1.79410923 2.11522381 1.08355194
49 50 51 52 53 54
-0.51644806 -1.34811993 -0.95310432 -1.81644806 -3.00589077 -1.68976059
55 56 57 58 59 60
-2.25808872 -2.83697414 -3.42641685 -1.21028667 -1.62084396 -1.85251583
> postscript(file="/var/www/html/rcomp/tmp/6freo1259413067.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 0.35246857 NA
1 0.17358315 0.35246857
2 0.27358315 0.17358315
3 0.79469773 0.27358315
4 1.73692688 0.79469773
5 0.56302586 1.73692688
6 -0.64254703 0.56302586
7 -0.35310432 -0.64254703
8 -0.57421890 -0.35310432
9 0.17856754 -0.57421890
10 -0.82700535 0.17856754
11 -0.18976059 -0.82700535
12 -0.08976059 -0.18976059
13 0.85246857 -0.08976059
14 1.18414044 0.85246857
15 1.07358315 1.18414044
16 0.14191128 1.07358315
17 0.54191128 0.14191128
18 0.74191128 0.54191128
19 0.88414044 0.74191128
20 1.11581230 0.88414044
21 0.46302586 1.11581230
22 0.28414044 0.46302586
23 0.74748417 0.28414044
24 0.93692688 0.74748417
25 0.04191128 0.93692688
26 0.30525501 0.04191128
27 0.51581230 0.30525501
28 0.18414044 0.51581230
29 0.95804146 0.18414044
30 0.23692688 0.95804146
31 0.34748417 0.23692688
32 0.01581230 0.34748417
33 -1.18976059 0.01581230
34 -0.98976059 -1.18976059
35 -0.07920330 -0.98976059
36 -0.81644806 -0.07920330
37 0.04689568 -0.81644806
38 0.22578110 0.04689568
39 0.76801025 0.22578110
40 1.78912483 0.76801025
41 0.93633839 1.78912483
42 1.27299465 0.93633839
43 1.42020821 1.27299465
44 1.18853634 1.42020821
45 1.79410923 1.18853634
46 2.11522381 1.79410923
47 1.08355194 2.11522381
48 -0.51644806 1.08355194
49 -1.34811993 -0.51644806
50 -0.95310432 -1.34811993
51 -1.81644806 -0.95310432
52 -3.00589077 -1.81644806
53 -1.68976059 -3.00589077
54 -2.25808872 -1.68976059
55 -2.83697414 -2.25808872
56 -3.42641685 -2.83697414
57 -1.21028667 -3.42641685
58 -1.62084396 -1.21028667
59 -1.85251583 -1.62084396
60 NA -1.85251583
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.17358315 0.35246857
[2,] 0.27358315 0.17358315
[3,] 0.79469773 0.27358315
[4,] 1.73692688 0.79469773
[5,] 0.56302586 1.73692688
[6,] -0.64254703 0.56302586
[7,] -0.35310432 -0.64254703
[8,] -0.57421890 -0.35310432
[9,] 0.17856754 -0.57421890
[10,] -0.82700535 0.17856754
[11,] -0.18976059 -0.82700535
[12,] -0.08976059 -0.18976059
[13,] 0.85246857 -0.08976059
[14,] 1.18414044 0.85246857
[15,] 1.07358315 1.18414044
[16,] 0.14191128 1.07358315
[17,] 0.54191128 0.14191128
[18,] 0.74191128 0.54191128
[19,] 0.88414044 0.74191128
[20,] 1.11581230 0.88414044
[21,] 0.46302586 1.11581230
[22,] 0.28414044 0.46302586
[23,] 0.74748417 0.28414044
[24,] 0.93692688 0.74748417
[25,] 0.04191128 0.93692688
[26,] 0.30525501 0.04191128
[27,] 0.51581230 0.30525501
[28,] 0.18414044 0.51581230
[29,] 0.95804146 0.18414044
[30,] 0.23692688 0.95804146
[31,] 0.34748417 0.23692688
[32,] 0.01581230 0.34748417
[33,] -1.18976059 0.01581230
[34,] -0.98976059 -1.18976059
[35,] -0.07920330 -0.98976059
[36,] -0.81644806 -0.07920330
[37,] 0.04689568 -0.81644806
[38,] 0.22578110 0.04689568
[39,] 0.76801025 0.22578110
[40,] 1.78912483 0.76801025
[41,] 0.93633839 1.78912483
[42,] 1.27299465 0.93633839
[43,] 1.42020821 1.27299465
[44,] 1.18853634 1.42020821
[45,] 1.79410923 1.18853634
[46,] 2.11522381 1.79410923
[47,] 1.08355194 2.11522381
[48,] -0.51644806 1.08355194
[49,] -1.34811993 -0.51644806
[50,] -0.95310432 -1.34811993
[51,] -1.81644806 -0.95310432
[52,] -3.00589077 -1.81644806
[53,] -1.68976059 -3.00589077
[54,] -2.25808872 -1.68976059
[55,] -2.83697414 -2.25808872
[56,] -3.42641685 -2.83697414
[57,] -1.21028667 -3.42641685
[58,] -1.62084396 -1.21028667
[59,] -1.85251583 -1.62084396
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.17358315 0.35246857
2 0.27358315 0.17358315
3 0.79469773 0.27358315
4 1.73692688 0.79469773
5 0.56302586 1.73692688
6 -0.64254703 0.56302586
7 -0.35310432 -0.64254703
8 -0.57421890 -0.35310432
9 0.17856754 -0.57421890
10 -0.82700535 0.17856754
11 -0.18976059 -0.82700535
12 -0.08976059 -0.18976059
13 0.85246857 -0.08976059
14 1.18414044 0.85246857
15 1.07358315 1.18414044
16 0.14191128 1.07358315
17 0.54191128 0.14191128
18 0.74191128 0.54191128
19 0.88414044 0.74191128
20 1.11581230 0.88414044
21 0.46302586 1.11581230
22 0.28414044 0.46302586
23 0.74748417 0.28414044
24 0.93692688 0.74748417
25 0.04191128 0.93692688
26 0.30525501 0.04191128
27 0.51581230 0.30525501
28 0.18414044 0.51581230
29 0.95804146 0.18414044
30 0.23692688 0.95804146
31 0.34748417 0.23692688
32 0.01581230 0.34748417
33 -1.18976059 0.01581230
34 -0.98976059 -1.18976059
35 -0.07920330 -0.98976059
36 -0.81644806 -0.07920330
37 0.04689568 -0.81644806
38 0.22578110 0.04689568
39 0.76801025 0.22578110
40 1.78912483 0.76801025
41 0.93633839 1.78912483
42 1.27299465 0.93633839
43 1.42020821 1.27299465
44 1.18853634 1.42020821
45 1.79410923 1.18853634
46 2.11522381 1.79410923
47 1.08355194 2.11522381
48 -0.51644806 1.08355194
49 -1.34811993 -0.51644806
50 -0.95310432 -1.34811993
51 -1.81644806 -0.95310432
52 -3.00589077 -1.81644806
53 -1.68976059 -3.00589077
54 -2.25808872 -1.68976059
55 -2.83697414 -2.25808872
56 -3.42641685 -2.83697414
57 -1.21028667 -3.42641685
58 -1.62084396 -1.21028667
59 -1.85251583 -1.62084396
> 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/799131259413067.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/8y7tw1259413067.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/9bfrn1259413067.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/10apec1259413067.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/117r2l1259413067.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/12wags1259413067.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/13bh3b1259413067.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/14ra6q1259413067.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/15ioij1259413067.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/16trov1259413067.tab")
+ }
>
> system("convert tmp/1qf8d1259413067.ps tmp/1qf8d1259413067.png")
> system("convert tmp/2nu0a1259413067.ps tmp/2nu0a1259413067.png")
> system("convert tmp/3es7p1259413067.ps tmp/3es7p1259413067.png")
> system("convert tmp/4ty7e1259413067.ps tmp/4ty7e1259413067.png")
> system("convert tmp/5fu4n1259413067.ps tmp/5fu4n1259413067.png")
> system("convert tmp/6freo1259413067.ps tmp/6freo1259413067.png")
> system("convert tmp/799131259413067.ps tmp/799131259413067.png")
> system("convert tmp/8y7tw1259413067.ps tmp/8y7tw1259413067.png")
> system("convert tmp/9bfrn1259413067.ps tmp/9bfrn1259413067.png")
> system("convert tmp/10apec1259413067.ps tmp/10apec1259413067.png")
>
>
> proc.time()
user system elapsed
2.465 1.544 3.826