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(15836.8,89.1,17570.4,82.6,18252.1,102.7,16196.7,91.8,16643,94.1,17729,103.1,16446.1,93.2,15993.8,91,16373.5,94.3,17842.2,99.4,22321.5,115.7,22786.7,116.8,18274.1,99.8,22392.9,96,23899.3,115.9,21343.5,109.1,22952.3,117.3,21374.4,109.8,21164.1,112.8,20906.5,110.7,17877.4,100,20664.3,113.3,22160,122.4,19813.6,112.5,17735.4,104.2,19640.2,92.5,20844.4,117.2,19823.1,109.3,18594.6,106.1,21350.6,118.8,18574.1,105.3,18924.2,106,17343.4,102,19961.2,112.9,19932.1,116.5,19464.6,114.8,16165.4,100.5,17574.9,85.4,19795.4,114.6,19439.5,109.9,17170,100.7,21072.4,115.5,17751.8,100.7,17515.5,99,18040.3,102.3,19090.1,108.8,17746.5,105.9,19202.1,113.2,15141.6,95.7,16258.1,80.9,18586.5,113.9,17209.4,98.1,17838.7,102.8,19123.5,104.7,16583.6,95.9,15991.2,94.6,16704.4,101.6,17420.4,103.9,17872,110.3,17823.2,114.1),dim=c(2,60),dimnames=list(c('uitvoer','indproc'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('uitvoer','indproc'),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 = 'Include Monthly Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> 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
uitvoer indproc M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 15836.8 89.1 1 0 0 0 0 0 0 0 0 0 0
2 17570.4 82.6 0 1 0 0 0 0 0 0 0 0 0
3 18252.1 102.7 0 0 1 0 0 0 0 0 0 0 0
4 16196.7 91.8 0 0 0 1 0 0 0 0 0 0 0
5 16643.0 94.1 0 0 0 0 1 0 0 0 0 0 0
6 17729.0 103.1 0 0 0 0 0 1 0 0 0 0 0
7 16446.1 93.2 0 0 0 0 0 0 1 0 0 0 0
8 15993.8 91.0 0 0 0 0 0 0 0 1 0 0 0
9 16373.5 94.3 0 0 0 0 0 0 0 0 1 0 0
10 17842.2 99.4 0 0 0 0 0 0 0 0 0 1 0
11 22321.5 115.7 0 0 0 0 0 0 0 0 0 0 1
12 22786.7 116.8 0 0 0 0 0 0 0 0 0 0 0
13 18274.1 99.8 1 0 0 0 0 0 0 0 0 0 0
14 22392.9 96.0 0 1 0 0 0 0 0 0 0 0 0
15 23899.3 115.9 0 0 1 0 0 0 0 0 0 0 0
16 21343.5 109.1 0 0 0 1 0 0 0 0 0 0 0
17 22952.3 117.3 0 0 0 0 1 0 0 0 0 0 0
18 21374.4 109.8 0 0 0 0 0 1 0 0 0 0 0
19 21164.1 112.8 0 0 0 0 0 0 1 0 0 0 0
20 20906.5 110.7 0 0 0 0 0 0 0 1 0 0 0
21 17877.4 100.0 0 0 0 0 0 0 0 0 1 0 0
22 20664.3 113.3 0 0 0 0 0 0 0 0 0 1 0
23 22160.0 122.4 0 0 0 0 0 0 0 0 0 0 1
24 19813.6 112.5 0 0 0 0 0 0 0 0 0 0 0
25 17735.4 104.2 1 0 0 0 0 0 0 0 0 0 0
26 19640.2 92.5 0 1 0 0 0 0 0 0 0 0 0
27 20844.4 117.2 0 0 1 0 0 0 0 0 0 0 0
28 19823.1 109.3 0 0 0 1 0 0 0 0 0 0 0
29 18594.6 106.1 0 0 0 0 1 0 0 0 0 0 0
30 21350.6 118.8 0 0 0 0 0 1 0 0 0 0 0
31 18574.1 105.3 0 0 0 0 0 0 1 0 0 0 0
32 18924.2 106.0 0 0 0 0 0 0 0 1 0 0 0
33 17343.4 102.0 0 0 0 0 0 0 0 0 1 0 0
34 19961.2 112.9 0 0 0 0 0 0 0 0 0 1 0
35 19932.1 116.5 0 0 0 0 0 0 0 0 0 0 1
36 19464.6 114.8 0 0 0 0 0 0 0 0 0 0 0
37 16165.4 100.5 1 0 0 0 0 0 0 0 0 0 0
38 17574.9 85.4 0 1 0 0 0 0 0 0 0 0 0
39 19795.4 114.6 0 0 1 0 0 0 0 0 0 0 0
40 19439.5 109.9 0 0 0 1 0 0 0 0 0 0 0
41 17170.0 100.7 0 0 0 0 1 0 0 0 0 0 0
42 21072.4 115.5 0 0 0 0 0 1 0 0 0 0 0
43 17751.8 100.7 0 0 0 0 0 0 1 0 0 0 0
44 17515.5 99.0 0 0 0 0 0 0 0 1 0 0 0
45 18040.3 102.3 0 0 0 0 0 0 0 0 1 0 0
46 19090.1 108.8 0 0 0 0 0 0 0 0 0 1 0
47 17746.5 105.9 0 0 0 0 0 0 0 0 0 0 1
48 19202.1 113.2 0 0 0 0 0 0 0 0 0 0 0
49 15141.6 95.7 1 0 0 0 0 0 0 0 0 0 0
50 16258.1 80.9 0 1 0 0 0 0 0 0 0 0 0
51 18586.5 113.9 0 0 1 0 0 0 0 0 0 0 0
52 17209.4 98.1 0 0 0 1 0 0 0 0 0 0 0
53 17838.7 102.8 0 0 0 0 1 0 0 0 0 0 0
54 19123.5 104.7 0 0 0 0 0 1 0 0 0 0 0
55 16583.6 95.9 0 0 0 0 0 0 1 0 0 0 0
56 15991.2 94.6 0 0 0 0 0 0 0 1 0 0 0
57 16704.4 101.6 0 0 0 0 0 0 0 0 1 0 0
58 17420.4 103.9 0 0 0 0 0 0 0 0 0 1 0
59 17872.0 110.3 0 0 0 0 0 0 0 0 0 0 1
60 17823.2 114.1 0 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) indproc M1 M2 M3 M4
-8805.8 250.5 925.4 5581.9 813.2 1649.4
M5 M6 M7 M8 M9 M10
1346.4 1288.8 1466.9 1559.8 1016.5 835.7
M11
218.4
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1949.8 -535.1 -198.3 442.8 2862.3
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -8805.83 2662.57 -3.307 0.00181 **
indproc 250.47 22.94 10.917 1.75e-14 ***
M1 925.36 756.54 1.223 0.22737
M2 5581.89 899.16 6.208 1.30e-07 ***
M3 813.17 656.89 1.238 0.22190
M4 1649.42 700.02 2.356 0.02268 *
M5 1346.43 695.64 1.936 0.05896 .
M6 1288.78 662.15 1.946 0.05760 .
M7 1466.89 717.87 2.043 0.04664 *
M8 1559.81 730.68 2.135 0.03803 *
M9 1016.47 732.92 1.387 0.17202
M10 835.72 673.43 1.241 0.22077
M11 218.44 656.08 0.333 0.74066
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1037 on 47 degrees of freedom
Multiple R-squared: 0.8004, Adjusted R-squared: 0.7495
F-statistic: 15.71 on 12 and 47 DF, p-value: 1.337e-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.7315763 0.5368473279 0.2684236639
[2,] 0.7734022 0.4531955147 0.2265977574
[3,] 0.9211348 0.1577304586 0.0788652293
[4,] 0.9317685 0.1364629020 0.0682314510
[5,] 0.9228531 0.1542937765 0.0771468882
[6,] 0.9059468 0.1881064501 0.0940532251
[7,] 0.9156792 0.1686416547 0.0843208273
[8,] 0.9730329 0.0539342983 0.0269671491
[9,] 0.9938602 0.0122795610 0.0061397805
[10,] 0.9979933 0.0040133053 0.0020066526
[11,] 0.9979998 0.0040003720 0.0020001860
[12,] 0.9996411 0.0007178089 0.0003589044
[13,] 0.9994679 0.0010641283 0.0005320642
[14,] 0.9991608 0.0016783444 0.0008391722
[15,] 0.9990628 0.0018743659 0.0009371830
[16,] 0.9980948 0.0038103708 0.0019051854
[17,] 0.9961782 0.0076436397 0.0038218199
[18,] 0.9928610 0.0142780104 0.0071390052
[19,] 0.9873416 0.0253168384 0.0126584192
[20,] 0.9834529 0.0330942363 0.0165471182
[21,] 0.9840395 0.0319209390 0.0159604695
[22,] 0.9763162 0.0473675934 0.0236837967
[23,] 0.9604664 0.0790671686 0.0395335843
[24,] 0.9649658 0.0700683464 0.0350341732
[25,] 0.9358280 0.1283440022 0.0641720011
[26,] 0.8854348 0.2291303711 0.1145651856
[27,] 0.8045570 0.3908860450 0.1954430225
[28,] 0.6722044 0.6555911318 0.3277955659
[29,] 0.5250823 0.9498353991 0.4749176995
> postscript(file="/var/www/html/rcomp/tmp/1fiqt1258479056.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/24fet1258479056.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/3hfog1258479056.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/46cb51258479056.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/52psz1258479056.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
1400.26956 105.40048 521.34953 359.84150 533.04125 -577.54813
7 8 9 10 11 12
441.11042 446.92526 543.40590 915.45385 1929.35403 2337.47205
13 14 15 16 17 18
1157.52546 1571.58358 2862.32691 1173.48610 1031.40452 1389.69342
19 20 21 22 23 24
249.87077 425.33847 619.61886 256.00124 89.69558 441.39911
25 26 27 28 29 30
-483.24874 -304.46648 -518.18592 -397.00818 -521.01568 -888.34928
31 32 33 34 35 36
-461.59365 -379.74590 -415.32396 -346.91019 -660.42310 -483.68513
37 38 39 40 41 42
-1126.50452 -591.41947 -915.96025 -930.89103 -593.07006 -339.99362
43 44 45 46 47 48
-131.72516 -35.14602 206.43461 -191.07741 -191.02615 -345.43088
49 50 51 52 53 54
-948.04175 -781.09812 -1949.53027 -205.42839 -450.36003 416.19761
55 56 57 58 59 60
-97.66239 -457.37182 -954.13540 -633.46750 -1167.60036 -1949.75515
> postscript(file="/var/www/html/rcomp/tmp/660761258479056.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 1400.26956 NA
1 105.40048 1400.26956
2 521.34953 105.40048
3 359.84150 521.34953
4 533.04125 359.84150
5 -577.54813 533.04125
6 441.11042 -577.54813
7 446.92526 441.11042
8 543.40590 446.92526
9 915.45385 543.40590
10 1929.35403 915.45385
11 2337.47205 1929.35403
12 1157.52546 2337.47205
13 1571.58358 1157.52546
14 2862.32691 1571.58358
15 1173.48610 2862.32691
16 1031.40452 1173.48610
17 1389.69342 1031.40452
18 249.87077 1389.69342
19 425.33847 249.87077
20 619.61886 425.33847
21 256.00124 619.61886
22 89.69558 256.00124
23 441.39911 89.69558
24 -483.24874 441.39911
25 -304.46648 -483.24874
26 -518.18592 -304.46648
27 -397.00818 -518.18592
28 -521.01568 -397.00818
29 -888.34928 -521.01568
30 -461.59365 -888.34928
31 -379.74590 -461.59365
32 -415.32396 -379.74590
33 -346.91019 -415.32396
34 -660.42310 -346.91019
35 -483.68513 -660.42310
36 -1126.50452 -483.68513
37 -591.41947 -1126.50452
38 -915.96025 -591.41947
39 -930.89103 -915.96025
40 -593.07006 -930.89103
41 -339.99362 -593.07006
42 -131.72516 -339.99362
43 -35.14602 -131.72516
44 206.43461 -35.14602
45 -191.07741 206.43461
46 -191.02615 -191.07741
47 -345.43088 -191.02615
48 -948.04175 -345.43088
49 -781.09812 -948.04175
50 -1949.53027 -781.09812
51 -205.42839 -1949.53027
52 -450.36003 -205.42839
53 416.19761 -450.36003
54 -97.66239 416.19761
55 -457.37182 -97.66239
56 -954.13540 -457.37182
57 -633.46750 -954.13540
58 -1167.60036 -633.46750
59 -1949.75515 -1167.60036
60 NA -1949.75515
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 105.40048 1400.26956
[2,] 521.34953 105.40048
[3,] 359.84150 521.34953
[4,] 533.04125 359.84150
[5,] -577.54813 533.04125
[6,] 441.11042 -577.54813
[7,] 446.92526 441.11042
[8,] 543.40590 446.92526
[9,] 915.45385 543.40590
[10,] 1929.35403 915.45385
[11,] 2337.47205 1929.35403
[12,] 1157.52546 2337.47205
[13,] 1571.58358 1157.52546
[14,] 2862.32691 1571.58358
[15,] 1173.48610 2862.32691
[16,] 1031.40452 1173.48610
[17,] 1389.69342 1031.40452
[18,] 249.87077 1389.69342
[19,] 425.33847 249.87077
[20,] 619.61886 425.33847
[21,] 256.00124 619.61886
[22,] 89.69558 256.00124
[23,] 441.39911 89.69558
[24,] -483.24874 441.39911
[25,] -304.46648 -483.24874
[26,] -518.18592 -304.46648
[27,] -397.00818 -518.18592
[28,] -521.01568 -397.00818
[29,] -888.34928 -521.01568
[30,] -461.59365 -888.34928
[31,] -379.74590 -461.59365
[32,] -415.32396 -379.74590
[33,] -346.91019 -415.32396
[34,] -660.42310 -346.91019
[35,] -483.68513 -660.42310
[36,] -1126.50452 -483.68513
[37,] -591.41947 -1126.50452
[38,] -915.96025 -591.41947
[39,] -930.89103 -915.96025
[40,] -593.07006 -930.89103
[41,] -339.99362 -593.07006
[42,] -131.72516 -339.99362
[43,] -35.14602 -131.72516
[44,] 206.43461 -35.14602
[45,] -191.07741 206.43461
[46,] -191.02615 -191.07741
[47,] -345.43088 -191.02615
[48,] -948.04175 -345.43088
[49,] -781.09812 -948.04175
[50,] -1949.53027 -781.09812
[51,] -205.42839 -1949.53027
[52,] -450.36003 -205.42839
[53,] 416.19761 -450.36003
[54,] -97.66239 416.19761
[55,] -457.37182 -97.66239
[56,] -954.13540 -457.37182
[57,] -633.46750 -954.13540
[58,] -1167.60036 -633.46750
[59,] -1949.75515 -1167.60036
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 105.40048 1400.26956
2 521.34953 105.40048
3 359.84150 521.34953
4 533.04125 359.84150
5 -577.54813 533.04125
6 441.11042 -577.54813
7 446.92526 441.11042
8 543.40590 446.92526
9 915.45385 543.40590
10 1929.35403 915.45385
11 2337.47205 1929.35403
12 1157.52546 2337.47205
13 1571.58358 1157.52546
14 2862.32691 1571.58358
15 1173.48610 2862.32691
16 1031.40452 1173.48610
17 1389.69342 1031.40452
18 249.87077 1389.69342
19 425.33847 249.87077
20 619.61886 425.33847
21 256.00124 619.61886
22 89.69558 256.00124
23 441.39911 89.69558
24 -483.24874 441.39911
25 -304.46648 -483.24874
26 -518.18592 -304.46648
27 -397.00818 -518.18592
28 -521.01568 -397.00818
29 -888.34928 -521.01568
30 -461.59365 -888.34928
31 -379.74590 -461.59365
32 -415.32396 -379.74590
33 -346.91019 -415.32396
34 -660.42310 -346.91019
35 -483.68513 -660.42310
36 -1126.50452 -483.68513
37 -591.41947 -1126.50452
38 -915.96025 -591.41947
39 -930.89103 -915.96025
40 -593.07006 -930.89103
41 -339.99362 -593.07006
42 -131.72516 -339.99362
43 -35.14602 -131.72516
44 206.43461 -35.14602
45 -191.07741 206.43461
46 -191.02615 -191.07741
47 -345.43088 -191.02615
48 -948.04175 -345.43088
49 -781.09812 -948.04175
50 -1949.53027 -781.09812
51 -205.42839 -1949.53027
52 -450.36003 -205.42839
53 416.19761 -450.36003
54 -97.66239 416.19761
55 -457.37182 -97.66239
56 -954.13540 -457.37182
57 -633.46750 -954.13540
58 -1167.60036 -633.46750
59 -1949.75515 -1167.60036
> 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/7s3ed1258479056.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/8fkxf1258479056.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/9wl5k1258479056.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/10yedf1258479056.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/11tysu1258479056.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/12venq1258479056.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/13us6u1258479056.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/14o24w1258479056.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/15vgo91258479056.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/16eo981258479056.tab")
+ }
>
> system("convert tmp/1fiqt1258479056.ps tmp/1fiqt1258479056.png")
> system("convert tmp/24fet1258479056.ps tmp/24fet1258479056.png")
> system("convert tmp/3hfog1258479056.ps tmp/3hfog1258479056.png")
> system("convert tmp/46cb51258479056.ps tmp/46cb51258479056.png")
> system("convert tmp/52psz1258479056.ps tmp/52psz1258479056.png")
> system("convert tmp/660761258479056.ps tmp/660761258479056.png")
> system("convert tmp/7s3ed1258479056.ps tmp/7s3ed1258479056.png")
> system("convert tmp/8fkxf1258479056.ps tmp/8fkxf1258479056.png")
> system("convert tmp/9wl5k1258479056.ps tmp/9wl5k1258479056.png")
> system("convert tmp/10yedf1258479056.ps tmp/10yedf1258479056.png")
>
>
> proc.time()
user system elapsed
2.403 1.563 2.956