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.8,8.4,111.7,8.4,98.6,8.4,96.9,8.6,95.1,8.9,97,8.8,112.7,8.3,102.9,7.5,97.4,7.2,111.4,7.4,87.4,8.8,96.8,9.3,114.1,9.3,110.3,8.7,103.9,8.2,101.6,8.3,94.6,8.5,95.9,8.6,104.7,8.5,102.8,8.2,98.1,8.1,113.9,7.9,80.9,8.6,95.7,8.7,113.2,8.7,105.9,8.5,108.8,8.4,102.3,8.5,99,8.7,100.7,8.7,115.5,8.6,100.7,8.5,109.9,8.3,114.6,8,85.4,8.2,100.5,8.1,114.8,8.1,116.5,8,112.9,7.9,102,7.9,106,8,105.3,8,118.8,7.9,106.1,8,109.3,7.7,117.2,7.2,92.5,7.5,104.2,7.3,112.5,7,122.4,7,113.3,7,100,7.2,110.7,7.3,112.8,7.1,109.8,6.8,117.3,6.4,109.1,6.1,115.9,6.5,96,7.7,99.8,7.9,116.8,7.5,115.7,6.9),dim=c(2,62),dimnames=list(c('Y','X'),1:62))
> y <- array(NA,dim=c(2,62),dimnames=list(c('Y','X'),1:62))
> 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 = '2'
> #'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
X Y
1 8.4 109.8
2 8.4 111.7
3 8.4 98.6
4 8.6 96.9
5 8.9 95.1
6 8.8 97.0
7 8.3 112.7
8 7.5 102.9
9 7.2 97.4
10 7.4 111.4
11 8.8 87.4
12 9.3 96.8
13 9.3 114.1
14 8.7 110.3
15 8.2 103.9
16 8.3 101.6
17 8.5 94.6
18 8.6 95.9
19 8.5 104.7
20 8.2 102.8
21 8.1 98.1
22 7.9 113.9
23 8.6 80.9
24 8.7 95.7
25 8.7 113.2
26 8.5 105.9
27 8.4 108.8
28 8.5 102.3
29 8.7 99.0
30 8.7 100.7
31 8.6 115.5
32 8.5 100.7
33 8.3 109.9
34 8.0 114.6
35 8.2 85.4
36 8.1 100.5
37 8.1 114.8
38 8.0 116.5
39 7.9 112.9
40 7.9 102.0
41 8.0 106.0
42 8.0 105.3
43 7.9 118.8
44 8.0 106.1
45 7.7 109.3
46 7.2 117.2
47 7.5 92.5
48 7.3 104.2
49 7.0 112.5
50 7.0 122.4
51 7.0 113.3
52 7.2 100.0
53 7.3 110.7
54 7.1 112.8
55 6.8 109.8
56 6.4 117.3
57 6.1 109.1
58 6.5 115.9
59 7.7 96.0
60 7.9 99.8
61 7.5 116.8
62 6.9 115.7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Y
11.61278 -0.03440
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.7593 -0.4564 0.1518 0.4604 1.6127
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 11.612778 0.989812 11.732 < 2e-16 ***
Y -0.034404 0.009339 -3.684 0.000495 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6466 on 60 degrees of freedom
Multiple R-squared: 0.1845, Adjusted R-squared: 0.1709
F-statistic: 13.57 on 1 and 60 DF, p-value: 0.000495
> 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.026667427 0.053334854 0.9733326
[2,] 0.008193809 0.016387619 0.9918062
[3,] 0.001843946 0.003687892 0.9981561
[4,] 0.129547011 0.259094021 0.8704530
[5,] 0.452580083 0.905160165 0.5474199
[6,] 0.466540855 0.933081710 0.5334591
[7,] 0.371711727 0.743423453 0.6282883
[8,] 0.468757925 0.937515850 0.5312421
[9,] 0.737870347 0.524259307 0.2621297
[10,] 0.720633869 0.558732262 0.2793661
[11,] 0.650034118 0.699931764 0.3499659
[12,] 0.571689328 0.856621345 0.4283107
[13,] 0.488406810 0.976813620 0.5115932
[14,] 0.415317822 0.830635644 0.5846822
[15,] 0.358288856 0.716577711 0.6417111
[16,] 0.294436000 0.588871999 0.7055640
[17,] 0.243629361 0.487258722 0.7563706
[18,] 0.204106690 0.408213380 0.7958933
[19,] 0.152151701 0.304303401 0.8478483
[20,] 0.124729725 0.249459450 0.8752703
[21,] 0.147938047 0.295876094 0.8520620
[22,] 0.129124392 0.258248785 0.8708756
[23,] 0.113112914 0.226225827 0.8868871
[24,] 0.095856068 0.191712135 0.9041439
[25,] 0.092324522 0.184649043 0.9076755
[26,] 0.098110225 0.196220450 0.9018898
[27,] 0.147324250 0.294648500 0.8526757
[28,] 0.145984282 0.291968563 0.8540157
[29,] 0.156747645 0.313495290 0.8432524
[30,] 0.162536687 0.325073374 0.8374633
[31,] 0.135113671 0.270227343 0.8648863
[32,] 0.123006859 0.246013719 0.8769931
[33,] 0.145765575 0.291531150 0.8542344
[34,] 0.181631605 0.363263209 0.8183684
[35,] 0.206540080 0.413080161 0.7934599
[36,] 0.198274927 0.396549853 0.8017251
[37,] 0.215007484 0.430014969 0.7849925
[38,] 0.241581914 0.483163827 0.7584181
[39,] 0.393252515 0.786505030 0.6067475
[40,] 0.497022417 0.994044834 0.5029776
[41,] 0.569322454 0.861355092 0.4306775
[42,] 0.614375779 0.771248442 0.3856242
[43,] 0.618113246 0.763773507 0.3818868
[44,] 0.603662390 0.792675219 0.3963376
[45,] 0.598157291 0.803685418 0.4018427
[46,] 0.607585268 0.784829465 0.3924147
[47,] 0.566601983 0.866796034 0.4333980
[48,] 0.540611776 0.918776448 0.4593882
[49,] 0.481803826 0.963607652 0.5181962
[50,] 0.410349340 0.820698680 0.5896507
[51,] 0.349135125 0.698270249 0.6508649
[52,] 0.297185546 0.594371092 0.7028145
[53,] 0.682899764 0.634200472 0.3171002
> postscript(file="/var/www/html/rcomp/tmp/1qtpz1258663515.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/2losr1258663515.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/3lk8l1258663515.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/428k41258663515.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/5y9en1258663515.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 = 62
Frequency = 1
1 2 3 4 5 6
0.564799354 0.630167270 0.179472690 0.320985608 0.559058108 0.524426024
7 8 9 10 11 12
0.564571436 -0.572589394 -1.061812309 -0.380153980 0.194146027 1.017545191
13 14 15 16 17 18
1.612737269 0.882001437 0.161814772 0.182685189 0.141856025 0.286581441
19 20 21 22 23 24
0.489338105 0.123970189 -0.137729393 0.205856436 -0.229481054 0.379700608
25 26 27 28 29 30
0.981773519 0.530623105 0.530395187 0.406768106 0.493234357 0.551721440
31 32 33 34 35 36
0.960903102 0.351721440 0.468239770 0.329939352 -0.474662306 -0.055159394
37 38 39 40 41 42
0.436820185 0.395307268 0.171452269 -0.203553144 0.034063521 0.009980605
43 44 45 46 47 48
0.374436851 0.037503938 -0.152402730 -0.380609815 -0.930392724 -0.727863978
49 50 51 52 53 54
-0.742309397 -0.401708150 -0.714786064 -0.972361477 -0.504236897 -0.631988147
55 56 57 58 59 60
-1.035200646 -1.177169399 -1.759283563 -1.125335232 -0.609978142 -0.279242310
61 62
-0.094371482 -0.732216065
> postscript(file="/var/www/html/rcomp/tmp/6riq21258663515.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 = 62
Frequency = 1
lag(myerror, k = 1) myerror
0 0.564799354 NA
1 0.630167270 0.564799354
2 0.179472690 0.630167270
3 0.320985608 0.179472690
4 0.559058108 0.320985608
5 0.524426024 0.559058108
6 0.564571436 0.524426024
7 -0.572589394 0.564571436
8 -1.061812309 -0.572589394
9 -0.380153980 -1.061812309
10 0.194146027 -0.380153980
11 1.017545191 0.194146027
12 1.612737269 1.017545191
13 0.882001437 1.612737269
14 0.161814772 0.882001437
15 0.182685189 0.161814772
16 0.141856025 0.182685189
17 0.286581441 0.141856025
18 0.489338105 0.286581441
19 0.123970189 0.489338105
20 -0.137729393 0.123970189
21 0.205856436 -0.137729393
22 -0.229481054 0.205856436
23 0.379700608 -0.229481054
24 0.981773519 0.379700608
25 0.530623105 0.981773519
26 0.530395187 0.530623105
27 0.406768106 0.530395187
28 0.493234357 0.406768106
29 0.551721440 0.493234357
30 0.960903102 0.551721440
31 0.351721440 0.960903102
32 0.468239770 0.351721440
33 0.329939352 0.468239770
34 -0.474662306 0.329939352
35 -0.055159394 -0.474662306
36 0.436820185 -0.055159394
37 0.395307268 0.436820185
38 0.171452269 0.395307268
39 -0.203553144 0.171452269
40 0.034063521 -0.203553144
41 0.009980605 0.034063521
42 0.374436851 0.009980605
43 0.037503938 0.374436851
44 -0.152402730 0.037503938
45 -0.380609815 -0.152402730
46 -0.930392724 -0.380609815
47 -0.727863978 -0.930392724
48 -0.742309397 -0.727863978
49 -0.401708150 -0.742309397
50 -0.714786064 -0.401708150
51 -0.972361477 -0.714786064
52 -0.504236897 -0.972361477
53 -0.631988147 -0.504236897
54 -1.035200646 -0.631988147
55 -1.177169399 -1.035200646
56 -1.759283563 -1.177169399
57 -1.125335232 -1.759283563
58 -0.609978142 -1.125335232
59 -0.279242310 -0.609978142
60 -0.094371482 -0.279242310
61 -0.732216065 -0.094371482
62 NA -0.732216065
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.630167270 0.564799354
[2,] 0.179472690 0.630167270
[3,] 0.320985608 0.179472690
[4,] 0.559058108 0.320985608
[5,] 0.524426024 0.559058108
[6,] 0.564571436 0.524426024
[7,] -0.572589394 0.564571436
[8,] -1.061812309 -0.572589394
[9,] -0.380153980 -1.061812309
[10,] 0.194146027 -0.380153980
[11,] 1.017545191 0.194146027
[12,] 1.612737269 1.017545191
[13,] 0.882001437 1.612737269
[14,] 0.161814772 0.882001437
[15,] 0.182685189 0.161814772
[16,] 0.141856025 0.182685189
[17,] 0.286581441 0.141856025
[18,] 0.489338105 0.286581441
[19,] 0.123970189 0.489338105
[20,] -0.137729393 0.123970189
[21,] 0.205856436 -0.137729393
[22,] -0.229481054 0.205856436
[23,] 0.379700608 -0.229481054
[24,] 0.981773519 0.379700608
[25,] 0.530623105 0.981773519
[26,] 0.530395187 0.530623105
[27,] 0.406768106 0.530395187
[28,] 0.493234357 0.406768106
[29,] 0.551721440 0.493234357
[30,] 0.960903102 0.551721440
[31,] 0.351721440 0.960903102
[32,] 0.468239770 0.351721440
[33,] 0.329939352 0.468239770
[34,] -0.474662306 0.329939352
[35,] -0.055159394 -0.474662306
[36,] 0.436820185 -0.055159394
[37,] 0.395307268 0.436820185
[38,] 0.171452269 0.395307268
[39,] -0.203553144 0.171452269
[40,] 0.034063521 -0.203553144
[41,] 0.009980605 0.034063521
[42,] 0.374436851 0.009980605
[43,] 0.037503938 0.374436851
[44,] -0.152402730 0.037503938
[45,] -0.380609815 -0.152402730
[46,] -0.930392724 -0.380609815
[47,] -0.727863978 -0.930392724
[48,] -0.742309397 -0.727863978
[49,] -0.401708150 -0.742309397
[50,] -0.714786064 -0.401708150
[51,] -0.972361477 -0.714786064
[52,] -0.504236897 -0.972361477
[53,] -0.631988147 -0.504236897
[54,] -1.035200646 -0.631988147
[55,] -1.177169399 -1.035200646
[56,] -1.759283563 -1.177169399
[57,] -1.125335232 -1.759283563
[58,] -0.609978142 -1.125335232
[59,] -0.279242310 -0.609978142
[60,] -0.094371482 -0.279242310
[61,] -0.732216065 -0.094371482
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.630167270 0.564799354
2 0.179472690 0.630167270
3 0.320985608 0.179472690
4 0.559058108 0.320985608
5 0.524426024 0.559058108
6 0.564571436 0.524426024
7 -0.572589394 0.564571436
8 -1.061812309 -0.572589394
9 -0.380153980 -1.061812309
10 0.194146027 -0.380153980
11 1.017545191 0.194146027
12 1.612737269 1.017545191
13 0.882001437 1.612737269
14 0.161814772 0.882001437
15 0.182685189 0.161814772
16 0.141856025 0.182685189
17 0.286581441 0.141856025
18 0.489338105 0.286581441
19 0.123970189 0.489338105
20 -0.137729393 0.123970189
21 0.205856436 -0.137729393
22 -0.229481054 0.205856436
23 0.379700608 -0.229481054
24 0.981773519 0.379700608
25 0.530623105 0.981773519
26 0.530395187 0.530623105
27 0.406768106 0.530395187
28 0.493234357 0.406768106
29 0.551721440 0.493234357
30 0.960903102 0.551721440
31 0.351721440 0.960903102
32 0.468239770 0.351721440
33 0.329939352 0.468239770
34 -0.474662306 0.329939352
35 -0.055159394 -0.474662306
36 0.436820185 -0.055159394
37 0.395307268 0.436820185
38 0.171452269 0.395307268
39 -0.203553144 0.171452269
40 0.034063521 -0.203553144
41 0.009980605 0.034063521
42 0.374436851 0.009980605
43 0.037503938 0.374436851
44 -0.152402730 0.037503938
45 -0.380609815 -0.152402730
46 -0.930392724 -0.380609815
47 -0.727863978 -0.930392724
48 -0.742309397 -0.727863978
49 -0.401708150 -0.742309397
50 -0.714786064 -0.401708150
51 -0.972361477 -0.714786064
52 -0.504236897 -0.972361477
53 -0.631988147 -0.504236897
54 -1.035200646 -0.631988147
55 -1.177169399 -1.035200646
56 -1.759283563 -1.177169399
57 -1.125335232 -1.759283563
58 -0.609978142 -1.125335232
59 -0.279242310 -0.609978142
60 -0.094371482 -0.279242310
61 -0.732216065 -0.094371482
> 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/7pswv1258663515.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/8rr281258663515.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/983091258663516.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/10n5681258663516.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/1142rx1258663516.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/12uum71258663516.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/13czrr1258663516.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/14ywp61258663516.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/15pcr91258663516.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/16st451258663516.tab")
+ }
> system("convert tmp/1qtpz1258663515.ps tmp/1qtpz1258663515.png")
> system("convert tmp/2losr1258663515.ps tmp/2losr1258663515.png")
> system("convert tmp/3lk8l1258663515.ps tmp/3lk8l1258663515.png")
> system("convert tmp/428k41258663515.ps tmp/428k41258663515.png")
> system("convert tmp/5y9en1258663515.ps tmp/5y9en1258663515.png")
> system("convert tmp/6riq21258663515.ps tmp/6riq21258663515.png")
> system("convert tmp/7pswv1258663515.ps tmp/7pswv1258663515.png")
> system("convert tmp/8rr281258663515.ps tmp/8rr281258663515.png")
> system("convert tmp/983091258663516.ps tmp/983091258663516.png")
> system("convert tmp/10n5681258663516.ps tmp/10n5681258663516.png")
>
>
> proc.time()
user system elapsed
2.549 1.599 3.038