R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
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(6.8,9.2,6.3,11.7,6.4,15.8,6.2,8.6,6.9,23.2,6.4,27.4,6.3,9.3,6.8,16,6.9,4.7,6.7,12.5,6.9,20.1,6.9,9.1,6.3,8.1,6.1,8.6,6.2,20.3,6.8,25,6.5,19.2,7.6,3.3,6.3,11.2,7.1,10.5,6.8,10.1,7.3,7.2,6.4,13.6,6.8,9,7.2,24.6,6.4,12.6,6.6,5.6,6.8,8.7,6.1,7.7,6.5,24.1,6.4,11.7,6,7.7,6,9.6,7.3,7.2,6.1,12.3,6.7,8.9,6.4,13.6,5.8,11.2,6.9,2.8,7,3.2,7.3,9.4,5.9,11.9,6.2,15.4,6.8,7.4,7,18.9,5.9,7.9,6.1,12.2,5.7,11,7.1,2.8,5.8,11.8,7.4,17.1,6.8,11.6,6.8,5.8,7,8.3,6.2,15.4,6.8,7.4,7,18.9,5.9,7.9,6.4,13.6,6,7.7),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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'
> 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, 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
Y X t
1 6.8 9.2 1
2 6.3 11.7 2
3 6.4 15.8 3
4 6.2 8.6 4
5 6.9 23.2 5
6 6.4 27.4 6
7 6.3 9.3 7
8 6.8 16.0 8
9 6.9 4.7 9
10 6.7 12.5 10
11 6.9 20.1 11
12 6.9 9.1 12
13 6.3 8.1 13
14 6.1 8.6 14
15 6.2 20.3 15
16 6.8 25.0 16
17 6.5 19.2 17
18 7.6 3.3 18
19 6.3 11.2 19
20 7.1 10.5 20
21 6.8 10.1 21
22 7.3 7.2 22
23 6.4 13.6 23
24 6.8 9.0 24
25 7.2 24.6 25
26 6.4 12.6 26
27 6.6 5.6 27
28 6.8 8.7 28
29 6.1 7.7 29
30 6.5 24.1 30
31 6.4 11.7 31
32 6.0 7.7 32
33 6.0 9.6 33
34 7.3 7.2 34
35 6.1 12.3 35
36 6.7 8.9 36
37 6.4 13.6 37
38 5.8 11.2 38
39 6.9 2.8 39
40 7.0 3.2 40
41 7.3 9.4 41
42 5.9 11.9 42
43 6.2 15.4 43
44 6.8 7.4 44
45 7.0 18.9 45
46 5.9 7.9 46
47 6.1 12.2 47
48 5.7 11.0 48
49 7.1 2.8 49
50 5.8 11.8 50
51 7.4 17.1 51
52 6.8 11.6 52
53 6.8 5.8 53
54 7.0 8.3 54
55 6.2 15.4 55
56 6.8 7.4 56
57 7.0 18.9 57
58 5.9 7.9 58
59 6.4 13.6 59
60 6.0 7.7 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X t
6.712933 -0.004346 -0.003115
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.81560 -0.36139 -0.00961 0.30047 0.95748
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.712933 0.191969 34.969 <2e-16 ***
X -0.004346 0.010684 -0.407 0.686
t -0.003115 0.003528 -0.883 0.381
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4622 on 57 degrees of freedom
Multiple R-squared: 0.01433, Adjusted R-squared: -0.02025
F-statistic: 0.4144 on 2 and 57 DF, p-value: 0.6627
> 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.25268569 0.50537138 0.7473143
[2,] 0.15907541 0.31815082 0.8409246
[3,] 0.15997744 0.31995488 0.8400226
[4,] 0.14013746 0.28027491 0.8598625
[5,] 0.07671060 0.15342120 0.9232894
[6,] 0.04302791 0.08605583 0.9569721
[7,] 0.02204128 0.04408257 0.9779587
[8,] 0.03469918 0.06939837 0.9653008
[9,] 0.05978518 0.11957037 0.9402148
[10,] 0.05907986 0.11815971 0.9409201
[11,] 0.04027581 0.08055163 0.9597242
[12,] 0.02369709 0.04739419 0.9763029
[13,] 0.14059320 0.28118640 0.8594068
[14,] 0.13847193 0.27694385 0.8615281
[15,] 0.12318318 0.24636636 0.8768168
[16,] 0.08524835 0.17049670 0.9147517
[17,] 0.09505934 0.19011869 0.9049407
[18,] 0.08842229 0.17684457 0.9115777
[19,] 0.06207222 0.12414445 0.9379278
[20,] 0.07254803 0.14509606 0.9274520
[21,] 0.06911779 0.13823557 0.9308822
[22,] 0.05175956 0.10351912 0.9482404
[23,] 0.03686634 0.07373267 0.9631337
[24,] 0.05320240 0.10640481 0.9467976
[25,] 0.03825685 0.07651370 0.9617432
[26,] 0.02817122 0.05634244 0.9718288
[27,] 0.03897196 0.07794392 0.9610280
[28,] 0.04745877 0.09491755 0.9525412
[29,] 0.07848115 0.15696230 0.9215189
[30,] 0.07505687 0.15011374 0.9249431
[31,] 0.05263019 0.10526037 0.9473698
[32,] 0.03572791 0.07145582 0.9642721
[33,] 0.06492628 0.12985257 0.9350737
[34,] 0.05094126 0.10188252 0.9490587
[35,] 0.04644867 0.09289735 0.9535513
[36,] 0.08999511 0.17999023 0.9100049
[37,] 0.10560795 0.21121590 0.8943921
[38,] 0.08774887 0.17549775 0.9122511
[39,] 0.06847003 0.13694007 0.9315300
[40,] 0.06418554 0.12837108 0.9358145
[41,] 0.07113129 0.14226258 0.9288687
[42,] 0.06472453 0.12944906 0.9352755
[43,] 0.22799892 0.45599785 0.7720011
[44,] 0.21192268 0.42384536 0.7880773
[45,] 0.75276457 0.49447085 0.2472354
[46,] 0.70896775 0.58206450 0.2910322
[47,] 0.61235093 0.77529815 0.3876491
[48,] 0.46512042 0.93024084 0.5348796
[49,] 0.39025726 0.78051451 0.6097427
> postscript(file="/var/fisher/rcomp/tmp/10x051353257030.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/fisher/rcomp/tmp/2m7d51353257030.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/fisher/rcomp/tmp/3udus1353257030.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/fisher/rcomp/tmp/4pn6c1353257030.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/fisher/rcomp/tmp/523e11353257030.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
0.130163159 -0.355857174 -0.234924288 -0.463098519 0.303464874 -0.175167663
7 8 9 10 11 12
-0.350710706 0.181521163 0.235529306 0.072541514 0.308684569 0.263996440
13 14 15 16 17 18
-0.337234062 -0.531945921 -0.377985239 0.245555104 -0.076535059 0.957482576
19 20 21 22 23 24
-0.305070640 0.495002586 0.196379541 0.686892089 -0.182179771 0.200944981
25 26 27 28 29 30
0.671854137 -0.177179754 -0.004484832 0.212102292 -0.489128211 -0.014742445
31 32 33 34 35 36
-0.165514641 -0.579782432 -0.568410223 0.724275206 -0.450446145 0.137893522
37 38 39 40 41 42
-0.138566134 -0.745880704 0.320730150 0.425583715 0.755642702 -0.630377631
43 44 45 46 47 48
-0.312052203 0.256296957 0.509388486 -0.635299643 -0.413497604 -0.815597259
49 50 51 52 53 54
0.551882748 -0.705890129 0.920257672 0.299471238 0.277381074 0.491360741
55 56 57 58 59 60
-0.274669085 0.293680074 0.546771603 -0.597916525 -0.070030419 -0.492555158
> postscript(file="/var/fisher/rcomp/tmp/684bz1353257030.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 0.130163159 NA
1 -0.355857174 0.130163159
2 -0.234924288 -0.355857174
3 -0.463098519 -0.234924288
4 0.303464874 -0.463098519
5 -0.175167663 0.303464874
6 -0.350710706 -0.175167663
7 0.181521163 -0.350710706
8 0.235529306 0.181521163
9 0.072541514 0.235529306
10 0.308684569 0.072541514
11 0.263996440 0.308684569
12 -0.337234062 0.263996440
13 -0.531945921 -0.337234062
14 -0.377985239 -0.531945921
15 0.245555104 -0.377985239
16 -0.076535059 0.245555104
17 0.957482576 -0.076535059
18 -0.305070640 0.957482576
19 0.495002586 -0.305070640
20 0.196379541 0.495002586
21 0.686892089 0.196379541
22 -0.182179771 0.686892089
23 0.200944981 -0.182179771
24 0.671854137 0.200944981
25 -0.177179754 0.671854137
26 -0.004484832 -0.177179754
27 0.212102292 -0.004484832
28 -0.489128211 0.212102292
29 -0.014742445 -0.489128211
30 -0.165514641 -0.014742445
31 -0.579782432 -0.165514641
32 -0.568410223 -0.579782432
33 0.724275206 -0.568410223
34 -0.450446145 0.724275206
35 0.137893522 -0.450446145
36 -0.138566134 0.137893522
37 -0.745880704 -0.138566134
38 0.320730150 -0.745880704
39 0.425583715 0.320730150
40 0.755642702 0.425583715
41 -0.630377631 0.755642702
42 -0.312052203 -0.630377631
43 0.256296957 -0.312052203
44 0.509388486 0.256296957
45 -0.635299643 0.509388486
46 -0.413497604 -0.635299643
47 -0.815597259 -0.413497604
48 0.551882748 -0.815597259
49 -0.705890129 0.551882748
50 0.920257672 -0.705890129
51 0.299471238 0.920257672
52 0.277381074 0.299471238
53 0.491360741 0.277381074
54 -0.274669085 0.491360741
55 0.293680074 -0.274669085
56 0.546771603 0.293680074
57 -0.597916525 0.546771603
58 -0.070030419 -0.597916525
59 -0.492555158 -0.070030419
60 NA -0.492555158
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.355857174 0.130163159
[2,] -0.234924288 -0.355857174
[3,] -0.463098519 -0.234924288
[4,] 0.303464874 -0.463098519
[5,] -0.175167663 0.303464874
[6,] -0.350710706 -0.175167663
[7,] 0.181521163 -0.350710706
[8,] 0.235529306 0.181521163
[9,] 0.072541514 0.235529306
[10,] 0.308684569 0.072541514
[11,] 0.263996440 0.308684569
[12,] -0.337234062 0.263996440
[13,] -0.531945921 -0.337234062
[14,] -0.377985239 -0.531945921
[15,] 0.245555104 -0.377985239
[16,] -0.076535059 0.245555104
[17,] 0.957482576 -0.076535059
[18,] -0.305070640 0.957482576
[19,] 0.495002586 -0.305070640
[20,] 0.196379541 0.495002586
[21,] 0.686892089 0.196379541
[22,] -0.182179771 0.686892089
[23,] 0.200944981 -0.182179771
[24,] 0.671854137 0.200944981
[25,] -0.177179754 0.671854137
[26,] -0.004484832 -0.177179754
[27,] 0.212102292 -0.004484832
[28,] -0.489128211 0.212102292
[29,] -0.014742445 -0.489128211
[30,] -0.165514641 -0.014742445
[31,] -0.579782432 -0.165514641
[32,] -0.568410223 -0.579782432
[33,] 0.724275206 -0.568410223
[34,] -0.450446145 0.724275206
[35,] 0.137893522 -0.450446145
[36,] -0.138566134 0.137893522
[37,] -0.745880704 -0.138566134
[38,] 0.320730150 -0.745880704
[39,] 0.425583715 0.320730150
[40,] 0.755642702 0.425583715
[41,] -0.630377631 0.755642702
[42,] -0.312052203 -0.630377631
[43,] 0.256296957 -0.312052203
[44,] 0.509388486 0.256296957
[45,] -0.635299643 0.509388486
[46,] -0.413497604 -0.635299643
[47,] -0.815597259 -0.413497604
[48,] 0.551882748 -0.815597259
[49,] -0.705890129 0.551882748
[50,] 0.920257672 -0.705890129
[51,] 0.299471238 0.920257672
[52,] 0.277381074 0.299471238
[53,] 0.491360741 0.277381074
[54,] -0.274669085 0.491360741
[55,] 0.293680074 -0.274669085
[56,] 0.546771603 0.293680074
[57,] -0.597916525 0.546771603
[58,] -0.070030419 -0.597916525
[59,] -0.492555158 -0.070030419
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.355857174 0.130163159
2 -0.234924288 -0.355857174
3 -0.463098519 -0.234924288
4 0.303464874 -0.463098519
5 -0.175167663 0.303464874
6 -0.350710706 -0.175167663
7 0.181521163 -0.350710706
8 0.235529306 0.181521163
9 0.072541514 0.235529306
10 0.308684569 0.072541514
11 0.263996440 0.308684569
12 -0.337234062 0.263996440
13 -0.531945921 -0.337234062
14 -0.377985239 -0.531945921
15 0.245555104 -0.377985239
16 -0.076535059 0.245555104
17 0.957482576 -0.076535059
18 -0.305070640 0.957482576
19 0.495002586 -0.305070640
20 0.196379541 0.495002586
21 0.686892089 0.196379541
22 -0.182179771 0.686892089
23 0.200944981 -0.182179771
24 0.671854137 0.200944981
25 -0.177179754 0.671854137
26 -0.004484832 -0.177179754
27 0.212102292 -0.004484832
28 -0.489128211 0.212102292
29 -0.014742445 -0.489128211
30 -0.165514641 -0.014742445
31 -0.579782432 -0.165514641
32 -0.568410223 -0.579782432
33 0.724275206 -0.568410223
34 -0.450446145 0.724275206
35 0.137893522 -0.450446145
36 -0.138566134 0.137893522
37 -0.745880704 -0.138566134
38 0.320730150 -0.745880704
39 0.425583715 0.320730150
40 0.755642702 0.425583715
41 -0.630377631 0.755642702
42 -0.312052203 -0.630377631
43 0.256296957 -0.312052203
44 0.509388486 0.256296957
45 -0.635299643 0.509388486
46 -0.413497604 -0.635299643
47 -0.815597259 -0.413497604
48 0.551882748 -0.815597259
49 -0.705890129 0.551882748
50 0.920257672 -0.705890129
51 0.299471238 0.920257672
52 0.277381074 0.299471238
53 0.491360741 0.277381074
54 -0.274669085 0.491360741
55 0.293680074 -0.274669085
56 0.546771603 0.293680074
57 -0.597916525 0.546771603
58 -0.070030419 -0.597916525
59 -0.492555158 -0.070030419
> 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/fisher/rcomp/tmp/788yc1353257030.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/fisher/rcomp/tmp/8qh5z1353257030.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/fisher/rcomp/tmp/9b5vc1353257030.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/fisher/rcomp/tmp/100nfz1353257030.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11jndm1353257030.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/fisher/rcomp/tmp/1289dy1353257030.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/fisher/rcomp/tmp/133xsh1353257030.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/fisher/rcomp/tmp/14syo21353257030.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/fisher/rcomp/tmp/15nr3s1353257030.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/fisher/rcomp/tmp/16dlqb1353257030.tab")
+ }
>
> try(system("convert tmp/10x051353257030.ps tmp/10x051353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/2m7d51353257030.ps tmp/2m7d51353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/3udus1353257030.ps tmp/3udus1353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/4pn6c1353257030.ps tmp/4pn6c1353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/523e11353257030.ps tmp/523e11353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/684bz1353257030.ps tmp/684bz1353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/788yc1353257030.ps tmp/788yc1353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qh5z1353257030.ps tmp/8qh5z1353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/9b5vc1353257030.ps tmp/9b5vc1353257030.png",intern=TRUE))
character(0)
> try(system("convert tmp/100nfz1353257030.ps tmp/100nfz1353257030.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.005 1.282 7.284