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(109,102.86,108.6,102.55,108.8,102.28,108.5,102.26,108.3,102.57,108.2,103.08,108,102.76,107.9,102.51,108,102.87,109.3,103.14,109.6,103.12,109,103.16,108.7,102.48,108.3,102.57,108.4,102.88,107.8,102.63,107.8,102.38,107.6,101.69,107.7,101.96,107.6,102.19,107.6,101.87,108.6,101.6,108.6,101.63,108.2,101.22,107.5,101.21,107.1,101.49,107,101.64,106.9,101.66,106.6,101.77,106.3,101.82,106.1,101.78,105.9,101.28,106,101.29,107.2,101.37,107.2,101.12,106.4,101.51,106.1,102.24,105.9,102.94,106.1,103.09,105.9,103.46,105.8,103.64,105.7,104.39,105.6,104.15,105.3,105.21,105.5,105.8,106.5,105.91,106.5,105.39,106.1,105.46,105.9,104.72,105.8,103.14,106.2,102.63,106.5,102.32,106.6,101.93,106.7,100.62,106.6,100.6,106.5,99.63,106.8,98.9,107.8,98.32,107.9,99.22,107.4,98.81),dim=c(2,60),dimnames=list(c('Werkl','Infl'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Werkl','Infl'),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 = '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
Werkl Infl t
1 109.0 102.86 1
2 108.6 102.55 2
3 108.8 102.28 3
4 108.5 102.26 4
5 108.3 102.57 5
6 108.2 103.08 6
7 108.0 102.76 7
8 107.9 102.51 8
9 108.0 102.87 9
10 109.3 103.14 10
11 109.6 103.12 11
12 109.0 103.16 12
13 108.7 102.48 13
14 108.3 102.57 14
15 108.4 102.88 15
16 107.8 102.63 16
17 107.8 102.38 17
18 107.6 101.69 18
19 107.7 101.96 19
20 107.6 102.19 20
21 107.6 101.87 21
22 108.6 101.60 22
23 108.6 101.63 23
24 108.2 101.22 24
25 107.5 101.21 25
26 107.1 101.49 26
27 107.0 101.64 27
28 106.9 101.66 28
29 106.6 101.77 29
30 106.3 101.82 30
31 106.1 101.78 31
32 105.9 101.28 32
33 106.0 101.29 33
34 107.2 101.37 34
35 107.2 101.12 35
36 106.4 101.51 36
37 106.1 102.24 37
38 105.9 102.94 38
39 106.1 103.09 39
40 105.9 103.46 40
41 105.8 103.64 41
42 105.7 104.39 42
43 105.6 104.15 43
44 105.3 105.21 44
45 105.5 105.80 45
46 106.5 105.91 46
47 106.5 105.39 47
48 106.1 105.46 48
49 105.9 104.72 49
50 105.8 103.14 50
51 106.2 102.63 51
52 106.5 102.32 52
53 106.6 101.93 53
54 106.7 100.62 54
55 106.6 100.60 55
56 106.5 99.63 56
57 106.8 98.90 57
58 107.8 98.32 58
59 107.9 99.22 59
60 107.4 98.81 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Infl t
134.16658 -0.24875 -0.04971
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.48215 -0.48995 -0.06657 0.40980 1.63163
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 134.166582 5.760827 23.289 < 2e-16 ***
Infl -0.248753 0.056039 -4.439 4.20e-05 ***
t -0.049711 0.005107 -9.733 1.00e-13 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6765 on 57 degrees of freedom
Multiple R-squared: 0.6446, Adjusted R-squared: 0.6321
F-statistic: 51.68 on 2 and 57 DF, p-value: 1.573e-13
> 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.0121872065 0.0243744131 0.98781279
[2,] 0.0020994132 0.0041988263 0.99790059
[3,] 0.0003214871 0.0006429743 0.99967851
[4,] 0.0002066763 0.0004133527 0.99979332
[5,] 0.1295245516 0.2590491031 0.87047545
[6,] 0.3520750615 0.7041501231 0.64792494
[7,] 0.3222110873 0.6444221745 0.67778891
[8,] 0.2906255911 0.5812511821 0.70937441
[9,] 0.2358608763 0.4717217526 0.76413912
[10,] 0.2129801921 0.4259603842 0.78701981
[11,] 0.2049787266 0.4099574532 0.79502127
[12,] 0.1584628950 0.3169257901 0.84153710
[13,] 0.1144201655 0.2288403310 0.88557983
[14,] 0.0804719445 0.1609438890 0.91952806
[15,] 0.0581401347 0.1162802695 0.94185987
[16,] 0.0397625801 0.0795251603 0.96023742
[17,] 0.2035049377 0.4070098753 0.79649506
[18,] 0.5084624657 0.9830750687 0.49153753
[19,] 0.7101440323 0.5797119355 0.28985597
[20,] 0.7459755868 0.5080488265 0.25402441
[21,] 0.7892198788 0.4215602425 0.21078012
[22,] 0.8338182748 0.3323634503 0.16618173
[23,] 0.8673522399 0.2652955201 0.13264776
[24,] 0.8934426127 0.2131147747 0.10655739
[25,] 0.9121732773 0.1756534453 0.08782672
[26,] 0.9224167535 0.1551664930 0.07758325
[27,] 0.9376179015 0.1247641970 0.06238210
[28,] 0.9395322357 0.1209355287 0.06046776
[29,] 0.9604369107 0.0791261786 0.03956309
[30,] 0.9863118381 0.0273763238 0.01368816
[31,] 0.9825368638 0.0349262724 0.01746314
[32,] 0.9764722584 0.0470554832 0.02352774
[33,] 0.9664831351 0.0670337298 0.03351686
[34,] 0.9611905643 0.0776188715 0.03880944
[35,] 0.9518746681 0.0962506637 0.04812533
[36,] 0.9421532280 0.1156935440 0.05784677
[37,] 0.9313398306 0.1373203389 0.06866017
[38,] 0.9265539781 0.1468920439 0.07344602
[39,] 0.8876100491 0.2247799018 0.11238995
[40,] 0.8398686325 0.3202627351 0.16013137
[41,] 0.9155204860 0.1689590280 0.08447951
[42,] 0.9727698045 0.0544603910 0.02723020
[43,] 0.9620190325 0.0759619350 0.03798097
[44,] 0.9302681872 0.1394636256 0.06973181
[45,] 0.8882009580 0.2235980839 0.11179904
[46,] 0.8243073259 0.3513853483 0.17569267
[47,] 0.7625700496 0.4748599007 0.23742995
[48,] 0.6953779649 0.6092440701 0.30462204
[49,] 0.6214568830 0.7570862340 0.37854312
> postscript(file="/var/www/html/rcomp/tmp/18vg71258736244.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/2jl7e1258736244.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/33blk1258736244.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/4tcb11258736244.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/519wv1258736244.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 60
Frequency = 1
1 2 3 4 5 6
0.46983809 0.04243586 0.22498375 -0.03028017 -0.10345568 -0.02688064
7 8 9 10 11 12
-0.25677039 -0.36924745 -0.12998532 1.28688906 1.63162513 1.09128638
13 14 15 16 17 18
0.67184563 0.34394452 0.57076900 -0.04170805 -0.05418511 -0.37611338
19 20 21 22 23 24
-0.15923900 -0.15231473 -0.18220448 0.80034340 0.85751712 0.40523962
25 26 27 28 29 30
-0.24753677 -0.52817487 -0.54115082 -0.58646463 -0.80939070 -1.04724192
31 32 33 34 35 36
-1.20748090 -1.48214615 -1.32994749 -0.06033613 -0.07281319 -0.72608848
37 38 39 40 41 42
-0.79478783 -0.77094977 -0.48392572 -0.54217607 -0.54768944 -0.41141373
43 44 45 46 47 48
-0.52140326 -0.50801421 -0.11153894 0.96553499 0.88589469 0.55301852
49 50 51 52 53 54
0.21865261 -0.22466562 0.09818161 0.37077938 0.42347694 0.24732196
55 56 57 58 59 60
0.19205804 -0.09952101 0.06860061 0.97403514 1.34762376 0.79534626
> postscript(file="/var/www/html/rcomp/tmp/6cg3u1258736244.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 0.46983809 NA
1 0.04243586 0.46983809
2 0.22498375 0.04243586
3 -0.03028017 0.22498375
4 -0.10345568 -0.03028017
5 -0.02688064 -0.10345568
6 -0.25677039 -0.02688064
7 -0.36924745 -0.25677039
8 -0.12998532 -0.36924745
9 1.28688906 -0.12998532
10 1.63162513 1.28688906
11 1.09128638 1.63162513
12 0.67184563 1.09128638
13 0.34394452 0.67184563
14 0.57076900 0.34394452
15 -0.04170805 0.57076900
16 -0.05418511 -0.04170805
17 -0.37611338 -0.05418511
18 -0.15923900 -0.37611338
19 -0.15231473 -0.15923900
20 -0.18220448 -0.15231473
21 0.80034340 -0.18220448
22 0.85751712 0.80034340
23 0.40523962 0.85751712
24 -0.24753677 0.40523962
25 -0.52817487 -0.24753677
26 -0.54115082 -0.52817487
27 -0.58646463 -0.54115082
28 -0.80939070 -0.58646463
29 -1.04724192 -0.80939070
30 -1.20748090 -1.04724192
31 -1.48214615 -1.20748090
32 -1.32994749 -1.48214615
33 -0.06033613 -1.32994749
34 -0.07281319 -0.06033613
35 -0.72608848 -0.07281319
36 -0.79478783 -0.72608848
37 -0.77094977 -0.79478783
38 -0.48392572 -0.77094977
39 -0.54217607 -0.48392572
40 -0.54768944 -0.54217607
41 -0.41141373 -0.54768944
42 -0.52140326 -0.41141373
43 -0.50801421 -0.52140326
44 -0.11153894 -0.50801421
45 0.96553499 -0.11153894
46 0.88589469 0.96553499
47 0.55301852 0.88589469
48 0.21865261 0.55301852
49 -0.22466562 0.21865261
50 0.09818161 -0.22466562
51 0.37077938 0.09818161
52 0.42347694 0.37077938
53 0.24732196 0.42347694
54 0.19205804 0.24732196
55 -0.09952101 0.19205804
56 0.06860061 -0.09952101
57 0.97403514 0.06860061
58 1.34762376 0.97403514
59 0.79534626 1.34762376
60 NA 0.79534626
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.04243586 0.46983809
[2,] 0.22498375 0.04243586
[3,] -0.03028017 0.22498375
[4,] -0.10345568 -0.03028017
[5,] -0.02688064 -0.10345568
[6,] -0.25677039 -0.02688064
[7,] -0.36924745 -0.25677039
[8,] -0.12998532 -0.36924745
[9,] 1.28688906 -0.12998532
[10,] 1.63162513 1.28688906
[11,] 1.09128638 1.63162513
[12,] 0.67184563 1.09128638
[13,] 0.34394452 0.67184563
[14,] 0.57076900 0.34394452
[15,] -0.04170805 0.57076900
[16,] -0.05418511 -0.04170805
[17,] -0.37611338 -0.05418511
[18,] -0.15923900 -0.37611338
[19,] -0.15231473 -0.15923900
[20,] -0.18220448 -0.15231473
[21,] 0.80034340 -0.18220448
[22,] 0.85751712 0.80034340
[23,] 0.40523962 0.85751712
[24,] -0.24753677 0.40523962
[25,] -0.52817487 -0.24753677
[26,] -0.54115082 -0.52817487
[27,] -0.58646463 -0.54115082
[28,] -0.80939070 -0.58646463
[29,] -1.04724192 -0.80939070
[30,] -1.20748090 -1.04724192
[31,] -1.48214615 -1.20748090
[32,] -1.32994749 -1.48214615
[33,] -0.06033613 -1.32994749
[34,] -0.07281319 -0.06033613
[35,] -0.72608848 -0.07281319
[36,] -0.79478783 -0.72608848
[37,] -0.77094977 -0.79478783
[38,] -0.48392572 -0.77094977
[39,] -0.54217607 -0.48392572
[40,] -0.54768944 -0.54217607
[41,] -0.41141373 -0.54768944
[42,] -0.52140326 -0.41141373
[43,] -0.50801421 -0.52140326
[44,] -0.11153894 -0.50801421
[45,] 0.96553499 -0.11153894
[46,] 0.88589469 0.96553499
[47,] 0.55301852 0.88589469
[48,] 0.21865261 0.55301852
[49,] -0.22466562 0.21865261
[50,] 0.09818161 -0.22466562
[51,] 0.37077938 0.09818161
[52,] 0.42347694 0.37077938
[53,] 0.24732196 0.42347694
[54,] 0.19205804 0.24732196
[55,] -0.09952101 0.19205804
[56,] 0.06860061 -0.09952101
[57,] 0.97403514 0.06860061
[58,] 1.34762376 0.97403514
[59,] 0.79534626 1.34762376
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.04243586 0.46983809
2 0.22498375 0.04243586
3 -0.03028017 0.22498375
4 -0.10345568 -0.03028017
5 -0.02688064 -0.10345568
6 -0.25677039 -0.02688064
7 -0.36924745 -0.25677039
8 -0.12998532 -0.36924745
9 1.28688906 -0.12998532
10 1.63162513 1.28688906
11 1.09128638 1.63162513
12 0.67184563 1.09128638
13 0.34394452 0.67184563
14 0.57076900 0.34394452
15 -0.04170805 0.57076900
16 -0.05418511 -0.04170805
17 -0.37611338 -0.05418511
18 -0.15923900 -0.37611338
19 -0.15231473 -0.15923900
20 -0.18220448 -0.15231473
21 0.80034340 -0.18220448
22 0.85751712 0.80034340
23 0.40523962 0.85751712
24 -0.24753677 0.40523962
25 -0.52817487 -0.24753677
26 -0.54115082 -0.52817487
27 -0.58646463 -0.54115082
28 -0.80939070 -0.58646463
29 -1.04724192 -0.80939070
30 -1.20748090 -1.04724192
31 -1.48214615 -1.20748090
32 -1.32994749 -1.48214615
33 -0.06033613 -1.32994749
34 -0.07281319 -0.06033613
35 -0.72608848 -0.07281319
36 -0.79478783 -0.72608848
37 -0.77094977 -0.79478783
38 -0.48392572 -0.77094977
39 -0.54217607 -0.48392572
40 -0.54768944 -0.54217607
41 -0.41141373 -0.54768944
42 -0.52140326 -0.41141373
43 -0.50801421 -0.52140326
44 -0.11153894 -0.50801421
45 0.96553499 -0.11153894
46 0.88589469 0.96553499
47 0.55301852 0.88589469
48 0.21865261 0.55301852
49 -0.22466562 0.21865261
50 0.09818161 -0.22466562
51 0.37077938 0.09818161
52 0.42347694 0.37077938
53 0.24732196 0.42347694
54 0.19205804 0.24732196
55 -0.09952101 0.19205804
56 0.06860061 -0.09952101
57 0.97403514 0.06860061
58 1.34762376 0.97403514
59 0.79534626 1.34762376
> 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/7io7w1258736244.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/8y1yi1258736244.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/9a2tx1258736244.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/10bev91258736244.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/11x3nk1258736244.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/12uq8c1258736244.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/13hq061258736244.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/14ea1e1258736244.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/15gzin1258736244.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/168a011258736244.tab")
+ }
>
> system("convert tmp/18vg71258736244.ps tmp/18vg71258736244.png")
> system("convert tmp/2jl7e1258736244.ps tmp/2jl7e1258736244.png")
> system("convert tmp/33blk1258736244.ps tmp/33blk1258736244.png")
> system("convert tmp/4tcb11258736244.ps tmp/4tcb11258736244.png")
> system("convert tmp/519wv1258736244.ps tmp/519wv1258736244.png")
> system("convert tmp/6cg3u1258736244.ps tmp/6cg3u1258736244.png")
> system("convert tmp/7io7w1258736244.ps tmp/7io7w1258736244.png")
> system("convert tmp/8y1yi1258736244.ps tmp/8y1yi1258736244.png")
> system("convert tmp/9a2tx1258736244.ps tmp/9a2tx1258736244.png")
> system("convert tmp/10bev91258736244.ps tmp/10bev91258736244.png")
>
>
> proc.time()
user system elapsed
2.604 1.639 5.309