R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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(296.95,17.20,296.84,17.20,287.54,17.20,287.81,17.20,283.99,20.63,275.79,20.63,269.52,20.63,278.35,20.63,283.43,19.32,289.46,19.32,282.30,19.32,293.55,19.32,304.78,12.99,300.99,12.99,315.29,12.99,316.21,12.99,331.79,18.13,329.38,18.13,317.27,18.13,317.98,18.13,340.28,28.37,339.21,28.37,336.71,28.37,340.11,28.37,347.72,24.35,328.68,24.35,303.05,24.35,299.83,24.35,320.04,24.99,317.94,24.99,303.31,24.99,308.85,24.99,319.19,28.84,314.52,28.84,312.39,28.84,315.77,28.84,320.23,37.88,309.45,37.88,296.54,37.88,297.28,37.88,301.39,54.04,306.68,54.04,305.91,54.04,314.76,54.04,323.34,64.93,341.58,64.93,330.12,64.93,318.16,64.93,317.84,71.81,325.39,71.81,327.56,71.81,329.77,71.81,333.29,99.75,346.10,99.75,358.00,99.75,344.82,99.75,313.30,61.25,301.26,61.25,306.38,61.25,319.31,61.25),dim=c(2,60),dimnames=list(c('Gemiddelde_prijs_vliegticket_in$','Gemiddelde_olieprijs_in$'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Gemiddelde_prijs_vliegticket_in$','Gemiddelde_olieprijs_in$'),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 Quarterly 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
Gemiddelde_prijs_vliegticket_in$ Gemiddelde_olieprijs_in$ Q1 Q2 Q3
1 296.95 17.20 1 0 0
2 296.84 17.20 0 1 0
3 287.54 17.20 0 0 1
4 287.81 17.20 0 0 0
5 283.99 20.63 1 0 0
6 275.79 20.63 0 1 0
7 269.52 20.63 0 0 1
8 278.35 20.63 0 0 0
9 283.43 19.32 1 0 0
10 289.46 19.32 0 1 0
11 282.30 19.32 0 0 1
12 293.55 19.32 0 0 0
13 304.78 12.99 1 0 0
14 300.99 12.99 0 1 0
15 315.29 12.99 0 0 1
16 316.21 12.99 0 0 0
17 331.79 18.13 1 0 0
18 329.38 18.13 0 1 0
19 317.27 18.13 0 0 1
20 317.98 18.13 0 0 0
21 340.28 28.37 1 0 0
22 339.21 28.37 0 1 0
23 336.71 28.37 0 0 1
24 340.11 28.37 0 0 0
25 347.72 24.35 1 0 0
26 328.68 24.35 0 1 0
27 303.05 24.35 0 0 1
28 299.83 24.35 0 0 0
29 320.04 24.99 1 0 0
30 317.94 24.99 0 1 0
31 303.31 24.99 0 0 1
32 308.85 24.99 0 0 0
33 319.19 28.84 1 0 0
34 314.52 28.84 0 1 0
35 312.39 28.84 0 0 1
36 315.77 28.84 0 0 0
37 320.23 37.88 1 0 0
38 309.45 37.88 0 1 0
39 296.54 37.88 0 0 1
40 297.28 37.88 0 0 0
41 301.39 54.04 1 0 0
42 306.68 54.04 0 1 0
43 305.91 54.04 0 0 1
44 314.76 54.04 0 0 0
45 323.34 64.93 1 0 0
46 341.58 64.93 0 1 0
47 330.12 64.93 0 0 1
48 318.16 64.93 0 0 0
49 317.84 71.81 1 0 0
50 325.39 71.81 0 1 0
51 327.56 71.81 0 0 1
52 329.77 71.81 0 0 0
53 333.29 99.75 1 0 0
54 346.10 99.75 0 1 0
55 358.00 99.75 0 0 1
56 344.82 99.75 0 0 0
57 313.30 61.25 1 0 0
58 301.26 61.25 0 1 0
59 306.38 61.25 0 0 1
60 319.31 61.25 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `Gemiddelde_olieprijs_in$`
296.2491 0.4086
Q1 Q2
3.6667 2.7140
Q3
-2.0447
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-33.114 -11.945 -1.536 9.517 37.855
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 296.24907 5.71060 51.877 < 2e-16 ***
`Gemiddelde_olieprijs_in$` 0.40861 0.09092 4.494 3.64e-05 ***
Q1 3.66667 6.33419 0.579 0.565
Q2 2.71400 6.33419 0.428 0.670
Q3 -2.04467 6.33419 -0.323 0.748
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 17.35 on 55 degrees of freedom
Multiple R-squared: 0.2783, Adjusted R-squared: 0.2258
F-statistic: 5.303 on 4 and 55 DF, p-value: 0.001101
> 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.016700756 0.0334015125 0.9832992437
[2,] 0.007498614 0.0149972288 0.9925013856
[3,] 0.003266028 0.0065320561 0.9967339720
[4,] 0.001830433 0.0036608658 0.9981695671
[5,] 0.004942954 0.0098859087 0.9950570456
[6,] 0.002811551 0.0056231029 0.9971884486
[7,] 0.001588097 0.0031761941 0.9984119029
[8,] 0.004354757 0.0087095146 0.9956452427
[9,] 0.002328853 0.0046577066 0.9976711467
[10,] 0.261124740 0.5222494794 0.7388752603
[11,] 0.619244866 0.7615102679 0.3807551339
[12,] 0.714868153 0.5702636935 0.2851318467
[13,] 0.744804581 0.5103908376 0.2551954188
[14,] 0.965802219 0.0683955611 0.0341977805
[15,] 0.985345292 0.0293094164 0.0146547082
[16,] 0.992658693 0.0146826139 0.0073413070
[17,] 0.996774304 0.0064513911 0.0032256955
[18,] 0.999760034 0.0004799318 0.0002399659
[19,] 0.999826602 0.0003467954 0.0001733977
[20,] 0.999646669 0.0007066624 0.0003533312
[21,] 0.999410669 0.0011786623 0.0005893312
[22,] 0.999350030 0.0012999392 0.0006499696
[23,] 0.999118826 0.0017623482 0.0008811741
[24,] 0.998300740 0.0033985198 0.0016992599
[25,] 0.996998420 0.0060031592 0.0030015796
[26,] 0.997601665 0.0047966694 0.0023983347
[27,] 0.997024912 0.0059501769 0.0029750884
[28,] 0.996265979 0.0074680428 0.0037340214
[29,] 0.997036280 0.0059274403 0.0029637201
[30,] 0.999424699 0.0011506030 0.0005753015
[31,] 0.999379436 0.0012411285 0.0006205642
[32,] 0.998910946 0.0021781083 0.0010890541
[33,] 0.998037170 0.0039256607 0.0019628303
[34,] 0.997056085 0.0058878303 0.0029439151
[35,] 0.994572761 0.0108544777 0.0054272388
[36,] 0.991067929 0.0178641428 0.0089320714
[37,] 0.982000616 0.0359987679 0.0179993839
[38,] 0.974308777 0.0513824457 0.0256912228
[39,] 0.996649210 0.0067015800 0.0033507900
[40,] 0.995323325 0.0093533497 0.0046766748
[41,] 0.987764950 0.0244701008 0.0122350504
[42,] 0.970660558 0.0586788835 0.0293394417
[43,] 0.949633249 0.1007335016 0.0503667508
[44,] 0.888510303 0.2229793934 0.1114896967
[45,] 0.782219535 0.4355609302 0.2177804651
> postscript(file="/var/www/html/freestat/rcomp/tmp/12xfr1292001814.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/22xfr1292001814.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/3u6xt1292001814.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/4u6xt1292001814.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/5u6xt1292001814.ps",horizontal=F,onefile=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 7
-9.993816 -9.151149 -13.692483 -15.467149 -24.355346 -31.602679 -33.114013
8 9 10 11 12 13 14
-26.328679 -24.380068 -17.397401 -19.798734 -10.593401 -0.443571 -3.280904
15 16 17 18 19 20 21
15.777762 14.653096 24.466177 23.008844 15.657511 14.322844 28.772018
22 23 24 25 26 27 28
28.654685 30.913352 32.268685 37.854628 19.767294 -1.104039 -6.368706
29 30 31 32 33 34 35
9.913118 8.765784 -1.105549 2.389784 7.489972 3.772639 6.401305
36 37 38 39 40 41 42
7.736639 4.836144 -4.991189 -13.142523 -14.447189 -20.606982 -14.364315
43 44 45 46 47 48 49
-10.375649 -3.570315 -3.106737 16.085930 9.384596 -4.620070 -11.417969
50 51 52 53 54 55 56
-2.915302 4.013364 4.178698 -7.384512 6.378154 23.036821 7.812154
57 58 59 60
-11.643055 -22.730388 -12.851722 -1.966388
> postscript(file="/var/www/html/freestat/rcomp/tmp/65xef1292001814.ps",horizontal=F,onefile=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 -9.993816 NA
1 -9.151149 -9.993816
2 -13.692483 -9.151149
3 -15.467149 -13.692483
4 -24.355346 -15.467149
5 -31.602679 -24.355346
6 -33.114013 -31.602679
7 -26.328679 -33.114013
8 -24.380068 -26.328679
9 -17.397401 -24.380068
10 -19.798734 -17.397401
11 -10.593401 -19.798734
12 -0.443571 -10.593401
13 -3.280904 -0.443571
14 15.777762 -3.280904
15 14.653096 15.777762
16 24.466177 14.653096
17 23.008844 24.466177
18 15.657511 23.008844
19 14.322844 15.657511
20 28.772018 14.322844
21 28.654685 28.772018
22 30.913352 28.654685
23 32.268685 30.913352
24 37.854628 32.268685
25 19.767294 37.854628
26 -1.104039 19.767294
27 -6.368706 -1.104039
28 9.913118 -6.368706
29 8.765784 9.913118
30 -1.105549 8.765784
31 2.389784 -1.105549
32 7.489972 2.389784
33 3.772639 7.489972
34 6.401305 3.772639
35 7.736639 6.401305
36 4.836144 7.736639
37 -4.991189 4.836144
38 -13.142523 -4.991189
39 -14.447189 -13.142523
40 -20.606982 -14.447189
41 -14.364315 -20.606982
42 -10.375649 -14.364315
43 -3.570315 -10.375649
44 -3.106737 -3.570315
45 16.085930 -3.106737
46 9.384596 16.085930
47 -4.620070 9.384596
48 -11.417969 -4.620070
49 -2.915302 -11.417969
50 4.013364 -2.915302
51 4.178698 4.013364
52 -7.384512 4.178698
53 6.378154 -7.384512
54 23.036821 6.378154
55 7.812154 23.036821
56 -11.643055 7.812154
57 -22.730388 -11.643055
58 -12.851722 -22.730388
59 -1.966388 -12.851722
60 NA -1.966388
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -9.151149 -9.993816
[2,] -13.692483 -9.151149
[3,] -15.467149 -13.692483
[4,] -24.355346 -15.467149
[5,] -31.602679 -24.355346
[6,] -33.114013 -31.602679
[7,] -26.328679 -33.114013
[8,] -24.380068 -26.328679
[9,] -17.397401 -24.380068
[10,] -19.798734 -17.397401
[11,] -10.593401 -19.798734
[12,] -0.443571 -10.593401
[13,] -3.280904 -0.443571
[14,] 15.777762 -3.280904
[15,] 14.653096 15.777762
[16,] 24.466177 14.653096
[17,] 23.008844 24.466177
[18,] 15.657511 23.008844
[19,] 14.322844 15.657511
[20,] 28.772018 14.322844
[21,] 28.654685 28.772018
[22,] 30.913352 28.654685
[23,] 32.268685 30.913352
[24,] 37.854628 32.268685
[25,] 19.767294 37.854628
[26,] -1.104039 19.767294
[27,] -6.368706 -1.104039
[28,] 9.913118 -6.368706
[29,] 8.765784 9.913118
[30,] -1.105549 8.765784
[31,] 2.389784 -1.105549
[32,] 7.489972 2.389784
[33,] 3.772639 7.489972
[34,] 6.401305 3.772639
[35,] 7.736639 6.401305
[36,] 4.836144 7.736639
[37,] -4.991189 4.836144
[38,] -13.142523 -4.991189
[39,] -14.447189 -13.142523
[40,] -20.606982 -14.447189
[41,] -14.364315 -20.606982
[42,] -10.375649 -14.364315
[43,] -3.570315 -10.375649
[44,] -3.106737 -3.570315
[45,] 16.085930 -3.106737
[46,] 9.384596 16.085930
[47,] -4.620070 9.384596
[48,] -11.417969 -4.620070
[49,] -2.915302 -11.417969
[50,] 4.013364 -2.915302
[51,] 4.178698 4.013364
[52,] -7.384512 4.178698
[53,] 6.378154 -7.384512
[54,] 23.036821 6.378154
[55,] 7.812154 23.036821
[56,] -11.643055 7.812154
[57,] -22.730388 -11.643055
[58,] -12.851722 -22.730388
[59,] -1.966388 -12.851722
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -9.151149 -9.993816
2 -13.692483 -9.151149
3 -15.467149 -13.692483
4 -24.355346 -15.467149
5 -31.602679 -24.355346
6 -33.114013 -31.602679
7 -26.328679 -33.114013
8 -24.380068 -26.328679
9 -17.397401 -24.380068
10 -19.798734 -17.397401
11 -10.593401 -19.798734
12 -0.443571 -10.593401
13 -3.280904 -0.443571
14 15.777762 -3.280904
15 14.653096 15.777762
16 24.466177 14.653096
17 23.008844 24.466177
18 15.657511 23.008844
19 14.322844 15.657511
20 28.772018 14.322844
21 28.654685 28.772018
22 30.913352 28.654685
23 32.268685 30.913352
24 37.854628 32.268685
25 19.767294 37.854628
26 -1.104039 19.767294
27 -6.368706 -1.104039
28 9.913118 -6.368706
29 8.765784 9.913118
30 -1.105549 8.765784
31 2.389784 -1.105549
32 7.489972 2.389784
33 3.772639 7.489972
34 6.401305 3.772639
35 7.736639 6.401305
36 4.836144 7.736639
37 -4.991189 4.836144
38 -13.142523 -4.991189
39 -14.447189 -13.142523
40 -20.606982 -14.447189
41 -14.364315 -20.606982
42 -10.375649 -14.364315
43 -3.570315 -10.375649
44 -3.106737 -3.570315
45 16.085930 -3.106737
46 9.384596 16.085930
47 -4.620070 9.384596
48 -11.417969 -4.620070
49 -2.915302 -11.417969
50 4.013364 -2.915302
51 4.178698 4.013364
52 -7.384512 4.178698
53 6.378154 -7.384512
54 23.036821 6.378154
55 7.812154 23.036821
56 -11.643055 7.812154
57 -22.730388 -11.643055
58 -12.851722 -22.730388
59 -1.966388 -12.851722
> 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/freestat/rcomp/tmp/7ypv01292001814.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/8ypv01292001814.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/9ypv01292001814.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/10rgck1292001814.ps",horizontal=F,onefile=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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11cyt81292001814.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/freestat/rcomp/tmp/12ghaw1292001814.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/freestat/rcomp/tmp/13yceb1292001814.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/freestat/rcomp/tmp/14fr6t1292001814.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/freestat/rcomp/tmp/158i5e1292001814.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/freestat/rcomp/tmp/16ms3m1292001814.tab")
+ }
>
> try(system("convert tmp/12xfr1292001814.ps tmp/12xfr1292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/22xfr1292001814.ps tmp/22xfr1292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/3u6xt1292001814.ps tmp/3u6xt1292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/4u6xt1292001814.ps tmp/4u6xt1292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/5u6xt1292001814.ps tmp/5u6xt1292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/65xef1292001814.ps tmp/65xef1292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ypv01292001814.ps tmp/7ypv01292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ypv01292001814.ps tmp/8ypv01292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ypv01292001814.ps tmp/9ypv01292001814.png",intern=TRUE))
character(0)
> try(system("convert tmp/10rgck1292001814.ps tmp/10rgck1292001814.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.872 2.517 4.202