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(79.8,109.87,83.4,95.74,113.6,123.06,112.9,123.39,104,120.28,109.9,115.33,99,110.4,106.3,114.49,128.9,132.03,111.1,123.16,102.9,118.82,130,128.32,87,112.24,87.5,104.53,117.6,132.57,103.4,122.52,110.8,131.8,112.6,124.55,102.5,120.96,112.4,122.6,135.6,145.52,105.1,118.57,127.7,134.25,137,136.7,91,121.37,90.5,111.63,122.4,134.42,123.3,137.65,124.3,137.86,120,119.77,118.1,130.69,119,128.28,142.7,147.45,123.6,128.42,129.6,136.9,151.6,143.95,110.4,135.64,99.2,122.48,130.5,136.83,136.2,153.04,129.7,142.71,128,123.46,121.6,144.37,135.8,146.15,143.8,147.61,147.5,158.51,136.2,147.4,156.6,165.05,123.3,154.64,104.5,126.2,139.8,157.36,136.5,154.15,112.1,123.21,118.5,113.07,94.4,110.45,102.3,113.57,111.4,122.44,99.2,114.93,87.8,111.85,115.8,126.04),dim=c(2,60),dimnames=list(c('Investgoed','Uitvoer'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Investgoed','Uitvoer'),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
Investgoed Uitvoer
1 79.8 109.87
2 83.4 95.74
3 113.6 123.06
4 112.9 123.39
5 104.0 120.28
6 109.9 115.33
7 99.0 110.40
8 106.3 114.49
9 128.9 132.03
10 111.1 123.16
11 102.9 118.82
12 130.0 128.32
13 87.0 112.24
14 87.5 104.53
15 117.6 132.57
16 103.4 122.52
17 110.8 131.80
18 112.6 124.55
19 102.5 120.96
20 112.4 122.60
21 135.6 145.52
22 105.1 118.57
23 127.7 134.25
24 137.0 136.70
25 91.0 121.37
26 90.5 111.63
27 122.4 134.42
28 123.3 137.65
29 124.3 137.86
30 120.0 119.77
31 118.1 130.69
32 119.0 128.28
33 142.7 147.45
34 123.6 128.42
35 129.6 136.90
36 151.6 143.95
37 110.4 135.64
38 99.2 122.48
39 130.5 136.83
40 136.2 153.04
41 129.7 142.71
42 128.0 123.46
43 121.6 144.37
44 135.8 146.15
45 143.8 147.61
46 147.5 158.51
47 136.2 147.40
48 156.6 165.05
49 123.3 154.64
50 104.5 126.20
51 139.8 157.36
52 136.5 154.15
53 112.1 123.21
54 118.5 113.07
55 94.4 110.45
56 102.3 113.57
57 111.4 122.44
58 99.2 114.93
59 87.8 111.85
60 115.8 126.04
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Uitvoer
-19.546 1.054
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-20.1674 -5.4929 0.5909 3.7753 19.4015
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -19.54604 9.60176 -2.036 0.0464 *
Uitvoer 1.05415 0.07384 14.276 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 8.465 on 58 degrees of freedom
Multiple R-squared: 0.7785, Adjusted R-squared: 0.7746
F-statistic: 203.8 on 1 and 58 DF, p-value: < 2.2e-16
> 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.68988528 0.62022944 0.31011472
[2,] 0.68128059 0.63743882 0.31871941
[3,] 0.55785351 0.88429299 0.44214649
[4,] 0.46768593 0.93537185 0.53231407
[5,] 0.39984002 0.79968005 0.60015998
[6,] 0.29642228 0.59284455 0.70357772
[7,] 0.22908299 0.45816598 0.77091701
[8,] 0.29002599 0.58005197 0.70997401
[9,] 0.37595431 0.75190862 0.62404569
[10,] 0.29032964 0.58065929 0.70967036
[11,] 0.27902503 0.55805007 0.72097497
[12,] 0.26662359 0.53324718 0.73337641
[13,] 0.31746888 0.63493775 0.68253112
[14,] 0.24361523 0.48723046 0.75638477
[15,] 0.20727222 0.41454444 0.79272778
[16,] 0.15651178 0.31302357 0.84348822
[17,] 0.11318797 0.22637594 0.88681203
[18,] 0.07827494 0.15654988 0.92172506
[19,] 0.05912845 0.11825689 0.94087155
[20,] 0.07621416 0.15242831 0.92378584
[21,] 0.23874942 0.47749885 0.76125058
[22,] 0.22510710 0.45021420 0.77489290
[23,] 0.17318961 0.34637923 0.82681039
[24,] 0.13913244 0.27826487 0.86086756
[25,] 0.10583880 0.21167761 0.89416120
[26,] 0.16783369 0.33566738 0.83216631
[27,] 0.12469777 0.24939553 0.87530223
[28,] 0.09230484 0.18460968 0.90769516
[29,] 0.07534058 0.15068116 0.92465942
[30,] 0.06720755 0.13441509 0.93279245
[31,] 0.04967984 0.09935967 0.95032016
[32,] 0.17470362 0.34940724 0.82529638
[33,] 0.28314516 0.56629031 0.71685484
[34,] 0.33091369 0.66182739 0.66908631
[35,] 0.29079928 0.58159857 0.70920072
[36,] 0.27442991 0.54885982 0.72557009
[37,] 0.21646878 0.43293757 0.78353122
[38,] 0.44174475 0.88348950 0.55825525
[39,] 0.48542909 0.97085818 0.51457091
[40,] 0.41054133 0.82108266 0.58945867
[41,] 0.43643992 0.87287984 0.56356008
[42,] 0.38129785 0.76259571 0.61870215
[43,] 0.31934588 0.63869176 0.68065412
[44,] 0.38792872 0.77585743 0.61207128
[45,] 0.56987634 0.86024732 0.43012366
[46,] 0.56584917 0.86830166 0.43415083
[47,] 0.46229363 0.92458727 0.53770637
[48,] 0.38773773 0.77547547 0.61226227
[49,] 0.27154441 0.54308882 0.72845559
[50,] 0.91020144 0.17959711 0.08979856
[51,] 0.82039027 0.35921946 0.17960973
> postscript(file="/var/www/html/rcomp/tmp/16fo21258712711.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/2qsda1258712711.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/3vudb1258712711.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/4tywx1258712711.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/5y0861258712711.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
-16.47316856 2.02193837 3.42262334 2.37475460 -3.24684607 7.87118502
7 8 9 10 11 12
2.16813316 5.15666908 9.26691851 0.81720857 -2.80779044 14.27780646
13 14 15 16 17 18
-11.77149860 -3.14401987 -2.60232125 -6.20813691 -8.59062752 0.85194327
19 20 21 22 23 24
-5.46366650 2.70753128 1.74646610 -0.34425351 5.72671063 12.44404877
25 26 27 28 29 30
-17.39586706 -7.62846851 0.24750552 -2.25739154 -1.47876255 13.29076925
31 32 33 34 35 36
-0.12052358 3.31997237 6.81196105 7.77239169 4.83321923 19.40147798
37 38 39 40 41 42
-13.03855467 -10.36597100 5.80700957 -5.58072457 -1.19137888 17.40096426
43 44 45 46 47 48
-11.04126405 1.28235305 7.74329742 -0.04691246 0.36466843 2.15896161
49 50 51 52 53 54
-20.16736088 -8.98740043 -6.53464261 -6.45082851 1.76450118 18.85355881
55 56 57 58 59 60
-2.48457423 2.12648496 1.87619491 -2.40715590 -10.56038100 2.48126320
> postscript(file="/var/www/html/rcomp/tmp/6dtgu1258712711.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 -16.47316856 NA
1 2.02193837 -16.47316856
2 3.42262334 2.02193837
3 2.37475460 3.42262334
4 -3.24684607 2.37475460
5 7.87118502 -3.24684607
6 2.16813316 7.87118502
7 5.15666908 2.16813316
8 9.26691851 5.15666908
9 0.81720857 9.26691851
10 -2.80779044 0.81720857
11 14.27780646 -2.80779044
12 -11.77149860 14.27780646
13 -3.14401987 -11.77149860
14 -2.60232125 -3.14401987
15 -6.20813691 -2.60232125
16 -8.59062752 -6.20813691
17 0.85194327 -8.59062752
18 -5.46366650 0.85194327
19 2.70753128 -5.46366650
20 1.74646610 2.70753128
21 -0.34425351 1.74646610
22 5.72671063 -0.34425351
23 12.44404877 5.72671063
24 -17.39586706 12.44404877
25 -7.62846851 -17.39586706
26 0.24750552 -7.62846851
27 -2.25739154 0.24750552
28 -1.47876255 -2.25739154
29 13.29076925 -1.47876255
30 -0.12052358 13.29076925
31 3.31997237 -0.12052358
32 6.81196105 3.31997237
33 7.77239169 6.81196105
34 4.83321923 7.77239169
35 19.40147798 4.83321923
36 -13.03855467 19.40147798
37 -10.36597100 -13.03855467
38 5.80700957 -10.36597100
39 -5.58072457 5.80700957
40 -1.19137888 -5.58072457
41 17.40096426 -1.19137888
42 -11.04126405 17.40096426
43 1.28235305 -11.04126405
44 7.74329742 1.28235305
45 -0.04691246 7.74329742
46 0.36466843 -0.04691246
47 2.15896161 0.36466843
48 -20.16736088 2.15896161
49 -8.98740043 -20.16736088
50 -6.53464261 -8.98740043
51 -6.45082851 -6.53464261
52 1.76450118 -6.45082851
53 18.85355881 1.76450118
54 -2.48457423 18.85355881
55 2.12648496 -2.48457423
56 1.87619491 2.12648496
57 -2.40715590 1.87619491
58 -10.56038100 -2.40715590
59 2.48126320 -10.56038100
60 NA 2.48126320
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.02193837 -16.47316856
[2,] 3.42262334 2.02193837
[3,] 2.37475460 3.42262334
[4,] -3.24684607 2.37475460
[5,] 7.87118502 -3.24684607
[6,] 2.16813316 7.87118502
[7,] 5.15666908 2.16813316
[8,] 9.26691851 5.15666908
[9,] 0.81720857 9.26691851
[10,] -2.80779044 0.81720857
[11,] 14.27780646 -2.80779044
[12,] -11.77149860 14.27780646
[13,] -3.14401987 -11.77149860
[14,] -2.60232125 -3.14401987
[15,] -6.20813691 -2.60232125
[16,] -8.59062752 -6.20813691
[17,] 0.85194327 -8.59062752
[18,] -5.46366650 0.85194327
[19,] 2.70753128 -5.46366650
[20,] 1.74646610 2.70753128
[21,] -0.34425351 1.74646610
[22,] 5.72671063 -0.34425351
[23,] 12.44404877 5.72671063
[24,] -17.39586706 12.44404877
[25,] -7.62846851 -17.39586706
[26,] 0.24750552 -7.62846851
[27,] -2.25739154 0.24750552
[28,] -1.47876255 -2.25739154
[29,] 13.29076925 -1.47876255
[30,] -0.12052358 13.29076925
[31,] 3.31997237 -0.12052358
[32,] 6.81196105 3.31997237
[33,] 7.77239169 6.81196105
[34,] 4.83321923 7.77239169
[35,] 19.40147798 4.83321923
[36,] -13.03855467 19.40147798
[37,] -10.36597100 -13.03855467
[38,] 5.80700957 -10.36597100
[39,] -5.58072457 5.80700957
[40,] -1.19137888 -5.58072457
[41,] 17.40096426 -1.19137888
[42,] -11.04126405 17.40096426
[43,] 1.28235305 -11.04126405
[44,] 7.74329742 1.28235305
[45,] -0.04691246 7.74329742
[46,] 0.36466843 -0.04691246
[47,] 2.15896161 0.36466843
[48,] -20.16736088 2.15896161
[49,] -8.98740043 -20.16736088
[50,] -6.53464261 -8.98740043
[51,] -6.45082851 -6.53464261
[52,] 1.76450118 -6.45082851
[53,] 18.85355881 1.76450118
[54,] -2.48457423 18.85355881
[55,] 2.12648496 -2.48457423
[56,] 1.87619491 2.12648496
[57,] -2.40715590 1.87619491
[58,] -10.56038100 -2.40715590
[59,] 2.48126320 -10.56038100
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.02193837 -16.47316856
2 3.42262334 2.02193837
3 2.37475460 3.42262334
4 -3.24684607 2.37475460
5 7.87118502 -3.24684607
6 2.16813316 7.87118502
7 5.15666908 2.16813316
8 9.26691851 5.15666908
9 0.81720857 9.26691851
10 -2.80779044 0.81720857
11 14.27780646 -2.80779044
12 -11.77149860 14.27780646
13 -3.14401987 -11.77149860
14 -2.60232125 -3.14401987
15 -6.20813691 -2.60232125
16 -8.59062752 -6.20813691
17 0.85194327 -8.59062752
18 -5.46366650 0.85194327
19 2.70753128 -5.46366650
20 1.74646610 2.70753128
21 -0.34425351 1.74646610
22 5.72671063 -0.34425351
23 12.44404877 5.72671063
24 -17.39586706 12.44404877
25 -7.62846851 -17.39586706
26 0.24750552 -7.62846851
27 -2.25739154 0.24750552
28 -1.47876255 -2.25739154
29 13.29076925 -1.47876255
30 -0.12052358 13.29076925
31 3.31997237 -0.12052358
32 6.81196105 3.31997237
33 7.77239169 6.81196105
34 4.83321923 7.77239169
35 19.40147798 4.83321923
36 -13.03855467 19.40147798
37 -10.36597100 -13.03855467
38 5.80700957 -10.36597100
39 -5.58072457 5.80700957
40 -1.19137888 -5.58072457
41 17.40096426 -1.19137888
42 -11.04126405 17.40096426
43 1.28235305 -11.04126405
44 7.74329742 1.28235305
45 -0.04691246 7.74329742
46 0.36466843 -0.04691246
47 2.15896161 0.36466843
48 -20.16736088 2.15896161
49 -8.98740043 -20.16736088
50 -6.53464261 -8.98740043
51 -6.45082851 -6.53464261
52 1.76450118 -6.45082851
53 18.85355881 1.76450118
54 -2.48457423 18.85355881
55 2.12648496 -2.48457423
56 1.87619491 2.12648496
57 -2.40715590 1.87619491
58 -10.56038100 -2.40715590
59 2.48126320 -10.56038100
> 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/7v47x1258712711.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/8jd2q1258712711.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/9uwyg1258712711.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/10hpk71258712711.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/11j0hg1258712711.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/126i1z1258712711.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/13g3aa1258712711.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/14y48s1258712711.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/15q4ci1258712711.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/161o681258712711.tab")
+ }
>
> system("convert tmp/16fo21258712711.ps tmp/16fo21258712711.png")
> system("convert tmp/2qsda1258712711.ps tmp/2qsda1258712711.png")
> system("convert tmp/3vudb1258712711.ps tmp/3vudb1258712711.png")
> system("convert tmp/4tywx1258712711.ps tmp/4tywx1258712711.png")
> system("convert tmp/5y0861258712711.ps tmp/5y0861258712711.png")
> system("convert tmp/6dtgu1258712711.ps tmp/6dtgu1258712711.png")
> system("convert tmp/7v47x1258712711.ps tmp/7v47x1258712711.png")
> system("convert tmp/8jd2q1258712711.ps tmp/8jd2q1258712711.png")
> system("convert tmp/9uwyg1258712711.ps tmp/9uwyg1258712711.png")
> system("convert tmp/10hpk71258712711.ps tmp/10hpk71258712711.png")
>
>
> proc.time()
user system elapsed
2.429 1.536 2.939