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(4755
+ ,37.79
+ ,5208
+ ,4962
+ ,5560
+ ,4491
+ ,37.84
+ ,4755
+ ,5208
+ ,3922
+ ,5732
+ ,37.88
+ ,4491
+ ,4755
+ ,3759
+ ,5731
+ ,38.34
+ ,5732
+ ,4491
+ ,4138
+ ,5040
+ ,38.58
+ ,5731
+ ,5732
+ ,4634
+ ,6102
+ ,38.72
+ ,5040
+ ,5731
+ ,3996
+ ,4904
+ ,38.83
+ ,6102
+ ,5040
+ ,4308
+ ,5369
+ ,38.9
+ ,4904
+ ,6102
+ ,4429
+ ,5578
+ ,38.92
+ ,5369
+ ,4904
+ ,5219
+ ,4619
+ ,38.94
+ ,5578
+ ,5369
+ ,4929
+ ,4731
+ ,39.1
+ ,4619
+ ,5578
+ ,5755
+ ,5011
+ ,39.14
+ ,4731
+ ,4619
+ ,5592
+ ,5299
+ ,39.16
+ ,5011
+ ,4731
+ ,4163
+ ,4146
+ ,39.32
+ ,5299
+ ,5011
+ ,4962
+ ,4625
+ ,39.34
+ ,4146
+ ,5299
+ ,5208
+ ,4736
+ ,39.44
+ ,4625
+ ,4146
+ ,4755
+ ,4219
+ ,39.92
+ ,4736
+ ,4625
+ ,4491
+ ,5116
+ ,40.19
+ ,4219
+ ,4736
+ ,5732
+ ,4205
+ ,40.2
+ ,5116
+ ,4219
+ ,5731
+ ,4121
+ ,40.27
+ ,4205
+ ,5116
+ ,5040
+ ,5103
+ ,40.28
+ ,4121
+ ,4205
+ ,6102
+ ,4300
+ ,40.3
+ ,5103
+ ,4121
+ ,4904
+ ,4578
+ ,40.34
+ ,4300
+ ,5103
+ ,5369
+ ,3809
+ ,40.4
+ ,4578
+ ,4300
+ ,5578
+ ,5526
+ ,40.43
+ ,3809
+ ,4578
+ ,4619
+ ,4247
+ ,40.48
+ ,5526
+ ,3809
+ ,4731
+ ,3830
+ ,40.48
+ ,4247
+ ,5526
+ ,5011
+ ,4394
+ ,40.63
+ ,3830
+ ,4247
+ ,5299
+ ,4826
+ ,40.74
+ ,4394
+ ,3830
+ ,4146
+ ,4409
+ ,40.77
+ ,4826
+ ,4394
+ ,4625
+ ,4569
+ ,40.91
+ ,4409
+ ,4826
+ ,4736
+ ,4106
+ ,40.92
+ ,4569
+ ,4409
+ ,4219
+ ,4794
+ ,41.03
+ ,4106
+ ,4569
+ ,5116
+ ,3914
+ ,41
+ ,4794
+ ,4106
+ ,4205
+ ,3793
+ ,41.04
+ ,3914
+ ,4794
+ ,4121
+ ,4405
+ ,41.33
+ ,3793
+ ,3914
+ ,5103
+ ,4022
+ ,41.44
+ ,4405
+ ,3793
+ ,4300
+ ,4100
+ ,41.46
+ ,4022
+ ,4405
+ ,4578
+ ,4788
+ ,41.55
+ ,4100
+ ,4022
+ ,3809
+ ,3163
+ ,41.55
+ ,4788
+ ,4100
+ ,5526
+ ,3585
+ ,41.81
+ ,3163
+ ,4788
+ ,4247
+ ,3903
+ ,41.78
+ ,3585
+ ,3163
+ ,3830
+ ,4178
+ ,41.84
+ ,3903
+ ,3585
+ ,4394
+ ,3863
+ ,41.84
+ ,4178
+ ,3903
+ ,4826
+ ,4187
+ ,41.86
+ ,3863
+ ,4178
+ ,4409)
+ ,dim=c(5
+ ,45)
+ ,dimnames=list(c('Y'
+ ,'X'
+ ,'Y1'
+ ,'Y2'
+ ,'Y15')
+ ,1:45))
> y <- array(NA,dim=c(5,45),dimnames=list(c('Y','X','Y1','Y2','Y15'),1:45))
> 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 = '4'
> #'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
Y2 Y X Y1 Y15 t
1 4962 4755 37.79 5208 5560 1
2 5208 4491 37.84 4755 3922 2
3 4755 5732 37.88 4491 3759 3
4 4491 5731 38.34 5732 4138 4
5 5732 5040 38.58 5731 4634 5
6 5731 6102 38.72 5040 3996 6
7 5040 4904 38.83 6102 4308 7
8 6102 5369 38.90 4904 4429 8
9 4904 5578 38.92 5369 5219 9
10 5369 4619 38.94 5578 4929 10
11 5578 4731 39.10 4619 5755 11
12 4619 5011 39.14 4731 5592 12
13 4731 5299 39.16 5011 4163 13
14 5011 4146 39.32 5299 4962 14
15 5299 4625 39.34 4146 5208 15
16 4146 4736 39.44 4625 4755 16
17 4625 4219 39.92 4736 4491 17
18 4736 5116 40.19 4219 5732 18
19 4219 4205 40.20 5116 5731 19
20 5116 4121 40.27 4205 5040 20
21 4205 5103 40.28 4121 6102 21
22 4121 4300 40.30 5103 4904 22
23 5103 4578 40.34 4300 5369 23
24 4300 3809 40.40 4578 5578 24
25 4578 5526 40.43 3809 4619 25
26 3809 4247 40.48 5526 4731 26
27 5526 3830 40.48 4247 5011 27
28 4247 4394 40.63 3830 5299 28
29 3830 4826 40.74 4394 4146 29
30 4394 4409 40.77 4826 4625 30
31 4826 4569 40.91 4409 4736 31
32 4409 4106 40.92 4569 4219 32
33 4569 4794 41.03 4106 5116 33
34 4106 3914 41.00 4794 4205 34
35 4794 3793 41.04 3914 4121 35
36 3914 4405 41.33 3793 5103 36
37 3793 4022 41.44 4405 4300 37
38 4405 4100 41.46 4022 4578 38
39 4022 4788 41.55 4100 3809 39
40 4100 3163 41.55 4788 5526 40
41 4788 3585 41.81 3163 4247 41
42 3163 3903 41.78 3585 3830 42
43 3585 4178 41.84 3903 4394 43
44 3903 3863 41.84 4178 4826 44
45 4178 4187 41.86 3863 4409 45
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Y X Y1 Y15 t
-571.80493 -0.16904 221.34113 -0.25553 -0.05361 -66.13999
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-953.82 -331.93 37.74 375.61 990.84
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.718e+02 1.527e+04 -0.037 0.970
Y -1.690e-01 1.666e-01 -1.014 0.317
X 2.213e+02 4.139e+02 0.535 0.596
Y1 -2.555e-01 1.612e-01 -1.585 0.121
Y15 -5.361e-02 1.410e-01 -0.380 0.706
t -6.614e+01 4.035e+01 -1.639 0.109
Residual standard error: 477.4 on 39 degrees of freedom
Multiple R-squared: 0.4886, Adjusted R-squared: 0.423
F-statistic: 7.451 on 5 and 39 DF, p-value: 5.487e-05
> 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.1250471 0.2500941 0.8749529
[2,] 0.1749960 0.3499920 0.8250040
[3,] 0.2647318 0.5294637 0.7352682
[4,] 0.3922500 0.7845000 0.6077500
[5,] 0.2879248 0.5758496 0.7120752
[6,] 0.1925255 0.3850511 0.8074745
[7,] 0.1203497 0.2406994 0.8796503
[8,] 0.2862498 0.5724996 0.7137502
[9,] 0.6846875 0.6306249 0.3153125
[10,] 0.7578305 0.4843389 0.2421695
[11,] 0.7594985 0.4810029 0.2405015
[12,] 0.7188158 0.5623683 0.2811842
[13,] 0.6756353 0.6487295 0.3243647
[14,] 0.5844223 0.8311554 0.4155777
[15,] 0.6741590 0.6516821 0.3258410
[16,] 0.6250576 0.7498847 0.3749424
[17,] 0.5463148 0.9073703 0.4536852
[18,] 0.4876196 0.9752392 0.5123804
[19,] 0.7088361 0.5823278 0.2911639
[20,] 0.7441892 0.5116215 0.2558108
[21,] 0.7636817 0.4726367 0.2363183
[22,] 0.6873711 0.6252577 0.3126289
[23,] 0.6807072 0.6385856 0.3192928
[24,] 0.5702845 0.8594309 0.4297155
[25,] 0.4668265 0.9336531 0.5331735
[26,] 0.3376318 0.6752637 0.6623682
[27,] 0.2382178 0.4764356 0.7617822
[28,] 0.5425650 0.9148701 0.4574350
> postscript(file="/var/www/html/rcomp/tmp/1lfut1258561933.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/2qk3s1258561933.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/3hx081258561933.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/4g5zd1258561933.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/5dy1e1258561933.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 = 45
Frequency = 1
1 2 3 4 5 6
-331.927930 -279.043691 -541.180703 -503.600829 659.947347 662.845202
7 8 9 10 11 12
99.227343 990.840943 51.052692 453.519070 511.406621 -323.096043
13 14 15 16 17 18
-105.758663 126.492503 275.739340 -716.378910 -350.663318 -147.239998
19 20 21 22 23 24
-525.151537 138.467829 -507.144897 -478.462784 427.555399 -370.333373
25 26 27 28 29 30
9.491427 -475.889554 924.954128 -316.886239 -536.763061 152.314297
31 32 33 34 35 36
545.908191 127.740077 375.606780 -36.399185 459.067365 -293.807323
37 38 39 40 41 42
-324.420503 279.513784 37.736514 175.039871 459.169285 -953.819289
43 44 45
-320.982582 103.339447 391.974957
> postscript(file="/var/www/html/rcomp/tmp/6cil81258561933.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 = 45
Frequency = 1
lag(myerror, k = 1) myerror
0 -331.927930 NA
1 -279.043691 -331.927930
2 -541.180703 -279.043691
3 -503.600829 -541.180703
4 659.947347 -503.600829
5 662.845202 659.947347
6 99.227343 662.845202
7 990.840943 99.227343
8 51.052692 990.840943
9 453.519070 51.052692
10 511.406621 453.519070
11 -323.096043 511.406621
12 -105.758663 -323.096043
13 126.492503 -105.758663
14 275.739340 126.492503
15 -716.378910 275.739340
16 -350.663318 -716.378910
17 -147.239998 -350.663318
18 -525.151537 -147.239998
19 138.467829 -525.151537
20 -507.144897 138.467829
21 -478.462784 -507.144897
22 427.555399 -478.462784
23 -370.333373 427.555399
24 9.491427 -370.333373
25 -475.889554 9.491427
26 924.954128 -475.889554
27 -316.886239 924.954128
28 -536.763061 -316.886239
29 152.314297 -536.763061
30 545.908191 152.314297
31 127.740077 545.908191
32 375.606780 127.740077
33 -36.399185 375.606780
34 459.067365 -36.399185
35 -293.807323 459.067365
36 -324.420503 -293.807323
37 279.513784 -324.420503
38 37.736514 279.513784
39 175.039871 37.736514
40 459.169285 175.039871
41 -953.819289 459.169285
42 -320.982582 -953.819289
43 103.339447 -320.982582
44 391.974957 103.339447
45 NA 391.974957
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -279.043691 -331.927930
[2,] -541.180703 -279.043691
[3,] -503.600829 -541.180703
[4,] 659.947347 -503.600829
[5,] 662.845202 659.947347
[6,] 99.227343 662.845202
[7,] 990.840943 99.227343
[8,] 51.052692 990.840943
[9,] 453.519070 51.052692
[10,] 511.406621 453.519070
[11,] -323.096043 511.406621
[12,] -105.758663 -323.096043
[13,] 126.492503 -105.758663
[14,] 275.739340 126.492503
[15,] -716.378910 275.739340
[16,] -350.663318 -716.378910
[17,] -147.239998 -350.663318
[18,] -525.151537 -147.239998
[19,] 138.467829 -525.151537
[20,] -507.144897 138.467829
[21,] -478.462784 -507.144897
[22,] 427.555399 -478.462784
[23,] -370.333373 427.555399
[24,] 9.491427 -370.333373
[25,] -475.889554 9.491427
[26,] 924.954128 -475.889554
[27,] -316.886239 924.954128
[28,] -536.763061 -316.886239
[29,] 152.314297 -536.763061
[30,] 545.908191 152.314297
[31,] 127.740077 545.908191
[32,] 375.606780 127.740077
[33,] -36.399185 375.606780
[34,] 459.067365 -36.399185
[35,] -293.807323 459.067365
[36,] -324.420503 -293.807323
[37,] 279.513784 -324.420503
[38,] 37.736514 279.513784
[39,] 175.039871 37.736514
[40,] 459.169285 175.039871
[41,] -953.819289 459.169285
[42,] -320.982582 -953.819289
[43,] 103.339447 -320.982582
[44,] 391.974957 103.339447
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -279.043691 -331.927930
2 -541.180703 -279.043691
3 -503.600829 -541.180703
4 659.947347 -503.600829
5 662.845202 659.947347
6 99.227343 662.845202
7 990.840943 99.227343
8 51.052692 990.840943
9 453.519070 51.052692
10 511.406621 453.519070
11 -323.096043 511.406621
12 -105.758663 -323.096043
13 126.492503 -105.758663
14 275.739340 126.492503
15 -716.378910 275.739340
16 -350.663318 -716.378910
17 -147.239998 -350.663318
18 -525.151537 -147.239998
19 138.467829 -525.151537
20 -507.144897 138.467829
21 -478.462784 -507.144897
22 427.555399 -478.462784
23 -370.333373 427.555399
24 9.491427 -370.333373
25 -475.889554 9.491427
26 924.954128 -475.889554
27 -316.886239 924.954128
28 -536.763061 -316.886239
29 152.314297 -536.763061
30 545.908191 152.314297
31 127.740077 545.908191
32 375.606780 127.740077
33 -36.399185 375.606780
34 459.067365 -36.399185
35 -293.807323 459.067365
36 -324.420503 -293.807323
37 279.513784 -324.420503
38 37.736514 279.513784
39 175.039871 37.736514
40 459.169285 175.039871
41 -953.819289 459.169285
42 -320.982582 -953.819289
43 103.339447 -320.982582
44 391.974957 103.339447
> 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/7k6c61258561933.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/8okr51258561933.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/9m6s91258561933.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/1014n91258561933.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/117k151258561933.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/12neng1258561933.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/13jyrv1258561933.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/14p9vc1258561933.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/15optu1258561933.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/16yx691258561933.tab")
+ }
>
> system("convert tmp/1lfut1258561933.ps tmp/1lfut1258561933.png")
> system("convert tmp/2qk3s1258561933.ps tmp/2qk3s1258561933.png")
> system("convert tmp/3hx081258561933.ps tmp/3hx081258561933.png")
> system("convert tmp/4g5zd1258561933.ps tmp/4g5zd1258561933.png")
> system("convert tmp/5dy1e1258561933.ps tmp/5dy1e1258561933.png")
> system("convert tmp/6cil81258561933.ps tmp/6cil81258561933.png")
> system("convert tmp/7k6c61258561933.ps tmp/7k6c61258561933.png")
> system("convert tmp/8okr51258561933.ps tmp/8okr51258561933.png")
> system("convert tmp/9m6s91258561933.ps tmp/9m6s91258561933.png")
> system("convert tmp/1014n91258561933.ps tmp/1014n91258561933.png")
>
>
> proc.time()
user system elapsed
2.330 1.540 2.709