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(99.9,98.8,98.6,100.5,107.2,110.4,95.7,96.4,93.7,101.9,106.7,106.2,86.7,81,95.3,94.7,99.3,101,101.8,109.4,96,102.3,91.7,90.7,95.3,96.2,96.6,96.1,107.2,106,108,103.1,98.4,102,103.1,104.7,81.1,86,96.6,92.1,103.7,106.9,106.6,112.6,97.6,101.7,87.6,92,99.4,97.4,98.5,97,105.2,105.4,104.6,102.7,97.5,98.1,108.9,104.5,86.8,87.4,88.9,89.9,110.3,109.8,114.8,111.7,94.6,98.6,92,96.9,93.8,95.1,93.8,97,107.6,112.7,101,102.9,95.4,97.4,96.5,111.4,89.2,87.4,87.1,96.8,110.5,114.1,110.8,110.3,104.2,103.9,88.9,101.6,89.8,94.6,90,95.9,93.9,104.7,91.3,102.8,87.8,98.1,99.7,113.9,73.5,80.9,79.2,95.7,96.9,113.2,95.2,105.9,95.6,108.8,89.7,102.3),dim=c(2,60),dimnames=list(c('TotProd','ProdMetal'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('TotProd','ProdMetal'),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
TotProd ProdMetal
1 99.9 98.8
2 98.6 100.5
3 107.2 110.4
4 95.7 96.4
5 93.7 101.9
6 106.7 106.2
7 86.7 81.0
8 95.3 94.7
9 99.3 101.0
10 101.8 109.4
11 96.0 102.3
12 91.7 90.7
13 95.3 96.2
14 96.6 96.1
15 107.2 106.0
16 108.0 103.1
17 98.4 102.0
18 103.1 104.7
19 81.1 86.0
20 96.6 92.1
21 103.7 106.9
22 106.6 112.6
23 97.6 101.7
24 87.6 92.0
25 99.4 97.4
26 98.5 97.0
27 105.2 105.4
28 104.6 102.7
29 97.5 98.1
30 108.9 104.5
31 86.8 87.4
32 88.9 89.9
33 110.3 109.8
34 114.8 111.7
35 94.6 98.6
36 92.0 96.9
37 93.8 95.1
38 93.8 97.0
39 107.6 112.7
40 101.0 102.9
41 95.4 97.4
42 96.5 111.4
43 89.2 87.4
44 87.1 96.8
45 110.5 114.1
46 110.8 110.3
47 104.2 103.9
48 88.9 101.6
49 89.8 94.6
50 90.0 95.9
51 93.9 104.7
52 91.3 102.8
53 87.8 98.1
54 99.7 113.9
55 73.5 80.9
56 79.2 95.7
57 96.9 113.2
58 95.2 105.9
59 95.6 108.8
60 89.7 102.3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) ProdMetal
16.3383 0.8009
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-13.784 -3.387 1.176 3.580 9.089
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.33832 8.96028 1.823 0.0734 .
ProdMetal 0.80089 0.08875 9.024 1.21e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.4 on 58 degrees of freedom
Multiple R-squared: 0.5841, Adjusted R-squared: 0.5769
F-statistic: 81.44 on 1 and 58 DF, p-value: 1.208e-12
> 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.288207543 0.576415086 0.71179246
[2,] 0.226556915 0.453113830 0.77344308
[3,] 0.150701835 0.301403669 0.84929817
[4,] 0.080004773 0.160009546 0.91999523
[5,] 0.039418715 0.078837431 0.96058128
[6,] 0.028641803 0.057283607 0.97135820
[7,] 0.024837322 0.049674643 0.97516268
[8,] 0.012314431 0.024628863 0.98768557
[9,] 0.005722071 0.011444142 0.99427793
[10,] 0.002757248 0.005514497 0.99724275
[11,] 0.004631529 0.009263058 0.99536847
[12,] 0.018947339 0.037894677 0.98105266
[13,] 0.011471691 0.022943383 0.98852831
[14,] 0.006511387 0.013022774 0.99348861
[15,] 0.013792412 0.027584824 0.98620759
[16,] 0.015363499 0.030726999 0.98463650
[17,] 0.008976583 0.017953165 0.99102342
[18,] 0.005339592 0.010679184 0.99466041
[19,] 0.003284180 0.006568359 0.99671582
[20,] 0.003086483 0.006172966 0.99691352
[21,] 0.002624956 0.005249912 0.99737504
[22,] 0.002002026 0.004004052 0.99799797
[23,] 0.001511410 0.003022819 0.99848859
[24,] 0.001728433 0.003456866 0.99827157
[25,] 0.001069358 0.002138716 0.99893064
[26,] 0.003908105 0.007816210 0.99609189
[27,] 0.002620761 0.005241521 0.99737924
[28,] 0.001759269 0.003518537 0.99824073
[29,] 0.002214640 0.004429281 0.99778536
[30,] 0.009465020 0.018930041 0.99053498
[31,] 0.007427649 0.014855298 0.99257235
[32,] 0.006201674 0.012403349 0.99379833
[33,] 0.004900285 0.009800571 0.99509971
[34,] 0.003728559 0.007457118 0.99627144
[35,] 0.003242485 0.006484970 0.99675751
[36,] 0.003329717 0.006659435 0.99667028
[37,] 0.003122712 0.006245424 0.99687729
[38,] 0.018110034 0.036220068 0.98188997
[39,] 0.034924923 0.069849846 0.96507508
[40,] 0.043693208 0.087386416 0.95630679
[41,] 0.051088789 0.102177578 0.94891121
[42,] 0.249038906 0.498077812 0.75096109
[43,] 0.822652211 0.354695578 0.17734779
[44,] 0.839430152 0.321139697 0.16056985
[45,] 0.895918190 0.208163621 0.10408181
[46,] 0.948092302 0.103815396 0.05190770
[47,] 0.936959972 0.126080056 0.06304003
[48,] 0.907779015 0.184441970 0.09222098
[49,] 0.867510026 0.264979947 0.13248997
[50,] 0.789059669 0.421880662 0.21094033
[51,] 0.774993533 0.450012934 0.22500647
> postscript(file="/var/www/html/rcomp/tmp/1hb1b1258908258.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/2586t1258908258.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/3t6wc1258908258.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/4s66r1258908258.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/5t10c1258908258.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
4.4333285 1.7718083 2.4429552 2.1554747 -4.2494437 5.3067110
7 8 9 10 11 12
5.4892462 3.1169949 2.0713611 -2.1561506 -2.2698014 2.7205719
13 14 15 16 17 18
1.9156535 3.2957430 5.9668899 9.0894832 0.3704669 2.9080524
19 20 21 22 23 24
-4.1152251 6.4993200 1.7460850 0.0809878 -0.1892648 -2.4205906
25 26 27 28 29 30
5.0545804 4.4749381 4.4474264 6.0098409 2.5939545 8.8682312
31 32 33 34 35 36
0.4635230 0.5612873 6.0234917 9.0017926 -0.7064927 -1.9449724
37 38 39 40 41 42
1.2966372 -0.2250619 1.0008984 2.2496620 1.0545804 -9.0579391
43 44 45 46 47 48
2.8635230 -6.7648830 2.7796464 6.1230446 4.6487678 -8.8091754
49 50 51 52 53 54
-2.3029157 -3.1440782 -6.2919476 -7.3702485 -7.1060455 -7.8601747
55 56 57 58 59 60
-7.6306644 -13.7838993 -10.0995488 -5.9530207 -7.8756140 -8.5698014
> postscript(file="/var/www/html/rcomp/tmp/6j62u1258908258.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 4.4333285 NA
1 1.7718083 4.4333285
2 2.4429552 1.7718083
3 2.1554747 2.4429552
4 -4.2494437 2.1554747
5 5.3067110 -4.2494437
6 5.4892462 5.3067110
7 3.1169949 5.4892462
8 2.0713611 3.1169949
9 -2.1561506 2.0713611
10 -2.2698014 -2.1561506
11 2.7205719 -2.2698014
12 1.9156535 2.7205719
13 3.2957430 1.9156535
14 5.9668899 3.2957430
15 9.0894832 5.9668899
16 0.3704669 9.0894832
17 2.9080524 0.3704669
18 -4.1152251 2.9080524
19 6.4993200 -4.1152251
20 1.7460850 6.4993200
21 0.0809878 1.7460850
22 -0.1892648 0.0809878
23 -2.4205906 -0.1892648
24 5.0545804 -2.4205906
25 4.4749381 5.0545804
26 4.4474264 4.4749381
27 6.0098409 4.4474264
28 2.5939545 6.0098409
29 8.8682312 2.5939545
30 0.4635230 8.8682312
31 0.5612873 0.4635230
32 6.0234917 0.5612873
33 9.0017926 6.0234917
34 -0.7064927 9.0017926
35 -1.9449724 -0.7064927
36 1.2966372 -1.9449724
37 -0.2250619 1.2966372
38 1.0008984 -0.2250619
39 2.2496620 1.0008984
40 1.0545804 2.2496620
41 -9.0579391 1.0545804
42 2.8635230 -9.0579391
43 -6.7648830 2.8635230
44 2.7796464 -6.7648830
45 6.1230446 2.7796464
46 4.6487678 6.1230446
47 -8.8091754 4.6487678
48 -2.3029157 -8.8091754
49 -3.1440782 -2.3029157
50 -6.2919476 -3.1440782
51 -7.3702485 -6.2919476
52 -7.1060455 -7.3702485
53 -7.8601747 -7.1060455
54 -7.6306644 -7.8601747
55 -13.7838993 -7.6306644
56 -10.0995488 -13.7838993
57 -5.9530207 -10.0995488
58 -7.8756140 -5.9530207
59 -8.5698014 -7.8756140
60 NA -8.5698014
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.7718083 4.4333285
[2,] 2.4429552 1.7718083
[3,] 2.1554747 2.4429552
[4,] -4.2494437 2.1554747
[5,] 5.3067110 -4.2494437
[6,] 5.4892462 5.3067110
[7,] 3.1169949 5.4892462
[8,] 2.0713611 3.1169949
[9,] -2.1561506 2.0713611
[10,] -2.2698014 -2.1561506
[11,] 2.7205719 -2.2698014
[12,] 1.9156535 2.7205719
[13,] 3.2957430 1.9156535
[14,] 5.9668899 3.2957430
[15,] 9.0894832 5.9668899
[16,] 0.3704669 9.0894832
[17,] 2.9080524 0.3704669
[18,] -4.1152251 2.9080524
[19,] 6.4993200 -4.1152251
[20,] 1.7460850 6.4993200
[21,] 0.0809878 1.7460850
[22,] -0.1892648 0.0809878
[23,] -2.4205906 -0.1892648
[24,] 5.0545804 -2.4205906
[25,] 4.4749381 5.0545804
[26,] 4.4474264 4.4749381
[27,] 6.0098409 4.4474264
[28,] 2.5939545 6.0098409
[29,] 8.8682312 2.5939545
[30,] 0.4635230 8.8682312
[31,] 0.5612873 0.4635230
[32,] 6.0234917 0.5612873
[33,] 9.0017926 6.0234917
[34,] -0.7064927 9.0017926
[35,] -1.9449724 -0.7064927
[36,] 1.2966372 -1.9449724
[37,] -0.2250619 1.2966372
[38,] 1.0008984 -0.2250619
[39,] 2.2496620 1.0008984
[40,] 1.0545804 2.2496620
[41,] -9.0579391 1.0545804
[42,] 2.8635230 -9.0579391
[43,] -6.7648830 2.8635230
[44,] 2.7796464 -6.7648830
[45,] 6.1230446 2.7796464
[46,] 4.6487678 6.1230446
[47,] -8.8091754 4.6487678
[48,] -2.3029157 -8.8091754
[49,] -3.1440782 -2.3029157
[50,] -6.2919476 -3.1440782
[51,] -7.3702485 -6.2919476
[52,] -7.1060455 -7.3702485
[53,] -7.8601747 -7.1060455
[54,] -7.6306644 -7.8601747
[55,] -13.7838993 -7.6306644
[56,] -10.0995488 -13.7838993
[57,] -5.9530207 -10.0995488
[58,] -7.8756140 -5.9530207
[59,] -8.5698014 -7.8756140
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.7718083 4.4333285
2 2.4429552 1.7718083
3 2.1554747 2.4429552
4 -4.2494437 2.1554747
5 5.3067110 -4.2494437
6 5.4892462 5.3067110
7 3.1169949 5.4892462
8 2.0713611 3.1169949
9 -2.1561506 2.0713611
10 -2.2698014 -2.1561506
11 2.7205719 -2.2698014
12 1.9156535 2.7205719
13 3.2957430 1.9156535
14 5.9668899 3.2957430
15 9.0894832 5.9668899
16 0.3704669 9.0894832
17 2.9080524 0.3704669
18 -4.1152251 2.9080524
19 6.4993200 -4.1152251
20 1.7460850 6.4993200
21 0.0809878 1.7460850
22 -0.1892648 0.0809878
23 -2.4205906 -0.1892648
24 5.0545804 -2.4205906
25 4.4749381 5.0545804
26 4.4474264 4.4749381
27 6.0098409 4.4474264
28 2.5939545 6.0098409
29 8.8682312 2.5939545
30 0.4635230 8.8682312
31 0.5612873 0.4635230
32 6.0234917 0.5612873
33 9.0017926 6.0234917
34 -0.7064927 9.0017926
35 -1.9449724 -0.7064927
36 1.2966372 -1.9449724
37 -0.2250619 1.2966372
38 1.0008984 -0.2250619
39 2.2496620 1.0008984
40 1.0545804 2.2496620
41 -9.0579391 1.0545804
42 2.8635230 -9.0579391
43 -6.7648830 2.8635230
44 2.7796464 -6.7648830
45 6.1230446 2.7796464
46 4.6487678 6.1230446
47 -8.8091754 4.6487678
48 -2.3029157 -8.8091754
49 -3.1440782 -2.3029157
50 -6.2919476 -3.1440782
51 -7.3702485 -6.2919476
52 -7.1060455 -7.3702485
53 -7.8601747 -7.1060455
54 -7.6306644 -7.8601747
55 -13.7838993 -7.6306644
56 -10.0995488 -13.7838993
57 -5.9530207 -10.0995488
58 -7.8756140 -5.9530207
59 -8.5698014 -7.8756140
> 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/7s2go1258908258.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/8l9nc1258908258.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/9tg001258908258.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/10hnts1258908258.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/11c79m1258908258.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/12zqxi1258908258.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/13p1ax1258908259.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/14y0al1258908259.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/159jkv1258908259.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/16ek6f1258908259.tab")
+ }
>
> system("convert tmp/1hb1b1258908258.ps tmp/1hb1b1258908258.png")
> system("convert tmp/2586t1258908258.ps tmp/2586t1258908258.png")
> system("convert tmp/3t6wc1258908258.ps tmp/3t6wc1258908258.png")
> system("convert tmp/4s66r1258908258.ps tmp/4s66r1258908258.png")
> system("convert tmp/5t10c1258908258.ps tmp/5t10c1258908258.png")
> system("convert tmp/6j62u1258908258.ps tmp/6j62u1258908258.png")
> system("convert tmp/7s2go1258908258.ps tmp/7s2go1258908258.png")
> system("convert tmp/8l9nc1258908258.ps tmp/8l9nc1258908258.png")
> system("convert tmp/9tg001258908258.ps tmp/9tg001258908258.png")
> system("convert tmp/10hnts1258908258.ps tmp/10hnts1258908258.png")
>
>
> proc.time()
user system elapsed
2.467 1.568 3.404