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(8.9,-3,8.8,-1,8.3,-3,7.5,-4,7.2,-6,7.4,0,8.8,-4,9.3,-2,9.3,-2,8.7,-6,8.2,-7,8.3,-6,8.5,-6,8.6,-3,8.5,-2,8.2,-5,8.1,-11,7.9,-11,8.6,-11,8.7,-10,8.7,-14,8.5,-8,8.4,-9,8.5,-5,8.7,-1,8.7,-2,8.6,-5,8.5,-4,8.3,-6,8,-2,8.2,-2,8.1,-2,8.1,-2,8,2,7.9,1,7.9,-8,8,-1,8,1,7.9,-1,8,2,7.7,2,7.2,1,7.5,-1,7.3,-2,7,-2,7,-1,7,-8,7.2,-4,7.3,-6,7.1,-3,6.8,-3,6.4,-7,6.1,-9,6.5,-11,7.7,-13,7.9,-11,7.5,-9,6.9,-17,6.6,-22,6.9,-25),dim=c(2,60),dimnames=list(c('TW','CV'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('TW','CV'),1:60))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = '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
TW CV
1 8.9 -3
2 8.8 -1
3 8.3 -3
4 7.5 -4
5 7.2 -6
6 7.4 0
7 8.8 -4
8 9.3 -2
9 9.3 -2
10 8.7 -6
11 8.2 -7
12 8.3 -6
13 8.5 -6
14 8.6 -3
15 8.5 -2
16 8.2 -5
17 8.1 -11
18 7.9 -11
19 8.6 -11
20 8.7 -10
21 8.7 -14
22 8.5 -8
23 8.4 -9
24 8.5 -5
25 8.7 -1
26 8.7 -2
27 8.6 -5
28 8.5 -4
29 8.3 -6
30 8.0 -2
31 8.2 -2
32 8.1 -2
33 8.1 -2
34 8.0 2
35 7.9 1
36 7.9 -8
37 8.0 -1
38 8.0 1
39 7.9 -1
40 8.0 2
41 7.7 2
42 7.2 1
43 7.5 -1
44 7.3 -2
45 7.0 -2
46 7.0 -1
47 7.0 -8
48 7.2 -4
49 7.3 -6
50 7.1 -3
51 6.8 -3
52 6.4 -7
53 6.1 -9
54 6.5 -11
55 7.7 -13
56 7.9 -11
57 7.5 -9
58 6.9 -17
59 6.6 -22
60 6.9 -25
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CV
8.10122 0.03648
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.67291 -0.58139 0.07237 0.61057 1.27174
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.10122 0.13096 61.860 <2e-16 ***
CV 0.03648 0.01724 2.116 0.0387 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.7223 on 58 degrees of freedom
Multiple R-squared: 0.07166, Adjusted R-squared: 0.05565
F-statistic: 4.477 on 1 and 58 DF, p-value: 0.03866
> 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.2307406 0.4614813 0.7692594
[2,] 0.6623261 0.6753479 0.3376739
[3,] 0.6773810 0.6452381 0.3226190
[4,] 0.7593968 0.4812064 0.2406032
[5,] 0.8005031 0.3989937 0.1994969
[6,] 0.7844690 0.4310621 0.2155310
[7,] 0.7063120 0.5873760 0.2936880
[8,] 0.6233570 0.7532861 0.3766430
[9,] 0.5562691 0.8874618 0.4437309
[10,] 0.4865226 0.9730451 0.5134774
[11,] 0.4112515 0.8225030 0.5887485
[12,] 0.3351038 0.6702076 0.6648962
[13,] 0.2687755 0.5375509 0.7312245
[14,] 0.2055850 0.4111700 0.7944150
[15,] 0.2151299 0.4302598 0.7848701
[16,] 0.2326526 0.4653053 0.7673474
[17,] 0.2846718 0.5693437 0.7153282
[18,] 0.2722291 0.5444582 0.7277709
[19,] 0.2612681 0.5225362 0.7387319
[20,] 0.2490270 0.4980541 0.7509730
[21,] 0.2516318 0.5032635 0.7483682
[22,] 0.2730145 0.5460290 0.7269855
[23,] 0.3160375 0.6320749 0.6839625
[24,] 0.3489687 0.6979375 0.6510313
[25,] 0.3788584 0.7577169 0.6211416
[26,] 0.3692516 0.7385032 0.6307484
[27,] 0.3705102 0.7410204 0.6294898
[28,] 0.3692655 0.7385310 0.6307345
[29,] 0.3744725 0.7489451 0.6255275
[30,] 0.3538616 0.7077232 0.6461384
[31,] 0.3349593 0.6699186 0.6650407
[32,] 0.3798101 0.7596202 0.6201899
[33,] 0.3911667 0.7823335 0.6088333
[34,] 0.4005307 0.8010614 0.5994693
[35,] 0.4239127 0.8478255 0.5760873
[36,] 0.4728451 0.9456901 0.5271549
[37,] 0.4852180 0.9704361 0.5147820
[38,] 0.5056169 0.9887662 0.4943831
[39,] 0.5088645 0.9822710 0.4911355
[40,] 0.5098069 0.9803861 0.4901931
[41,] 0.5278648 0.9442703 0.4721352
[42,] 0.5183490 0.9633019 0.4816510
[43,] 0.5284022 0.9431957 0.4715978
[44,] 0.4846731 0.9693462 0.5153269
[45,] 0.4459428 0.8918856 0.5540572
[46,] 0.3893823 0.7787645 0.6106177
[47,] 0.3463881 0.6927763 0.6536119
[48,] 0.4196615 0.8393231 0.5803385
[49,] 0.7533848 0.4932304 0.2466152
[50,] 0.9427761 0.1144478 0.0572239
[51,] 0.8862461 0.2275078 0.1137539
> postscript(file="/var/www/html/rcomp/tmp/1169x1260811411.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/2elcn1260811411.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/3vh3e1260811411.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/4d3uz1260811411.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/5uieo1260811411.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.90821496 0.73525636 0.30821496 -0.45530573 -0.68234713 -0.70122294
7 8 9 10 11 12
0.84469427 1.27173566 1.27173566 0.81765287 0.35413217 0.41765287
13 14 15 16 17 18
0.61765287 0.60821496 0.47173566 0.28117357 0.40004937 0.20004937
19 20 21 22 23 24
0.90004937 0.96357007 1.10948728 0.69061147 0.62709077 0.58117357
25 26 27 28 29 30
0.63525636 0.67173566 0.68117357 0.54469427 0.41765287 -0.02826434
31 32 33 34 35 36
0.17173566 0.07173566 0.07173566 -0.17418154 -0.23770224 0.09061147
37 38 39 40 41 42
-0.06474364 -0.13770224 -0.16474364 -0.17418154 -0.47418154 -0.93770224
43 44 45 46 47 48
-0.56474364 -0.72826434 -1.02826434 -1.06474364 -0.80938853 -0.75530573
49 50 51 52 53 54
-0.58234713 -0.89178504 -1.19178504 -1.44586783 -1.67290923 -1.19995063
55 56 57 58 59 60
0.07300798 0.20004937 -0.27290923 -0.58107482 -0.69867831 -0.28924041
> postscript(file="/var/www/html/rcomp/tmp/6pspq1260811411.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.90821496 NA
1 0.73525636 0.90821496
2 0.30821496 0.73525636
3 -0.45530573 0.30821496
4 -0.68234713 -0.45530573
5 -0.70122294 -0.68234713
6 0.84469427 -0.70122294
7 1.27173566 0.84469427
8 1.27173566 1.27173566
9 0.81765287 1.27173566
10 0.35413217 0.81765287
11 0.41765287 0.35413217
12 0.61765287 0.41765287
13 0.60821496 0.61765287
14 0.47173566 0.60821496
15 0.28117357 0.47173566
16 0.40004937 0.28117357
17 0.20004937 0.40004937
18 0.90004937 0.20004937
19 0.96357007 0.90004937
20 1.10948728 0.96357007
21 0.69061147 1.10948728
22 0.62709077 0.69061147
23 0.58117357 0.62709077
24 0.63525636 0.58117357
25 0.67173566 0.63525636
26 0.68117357 0.67173566
27 0.54469427 0.68117357
28 0.41765287 0.54469427
29 -0.02826434 0.41765287
30 0.17173566 -0.02826434
31 0.07173566 0.17173566
32 0.07173566 0.07173566
33 -0.17418154 0.07173566
34 -0.23770224 -0.17418154
35 0.09061147 -0.23770224
36 -0.06474364 0.09061147
37 -0.13770224 -0.06474364
38 -0.16474364 -0.13770224
39 -0.17418154 -0.16474364
40 -0.47418154 -0.17418154
41 -0.93770224 -0.47418154
42 -0.56474364 -0.93770224
43 -0.72826434 -0.56474364
44 -1.02826434 -0.72826434
45 -1.06474364 -1.02826434
46 -0.80938853 -1.06474364
47 -0.75530573 -0.80938853
48 -0.58234713 -0.75530573
49 -0.89178504 -0.58234713
50 -1.19178504 -0.89178504
51 -1.44586783 -1.19178504
52 -1.67290923 -1.44586783
53 -1.19995063 -1.67290923
54 0.07300798 -1.19995063
55 0.20004937 0.07300798
56 -0.27290923 0.20004937
57 -0.58107482 -0.27290923
58 -0.69867831 -0.58107482
59 -0.28924041 -0.69867831
60 NA -0.28924041
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.73525636 0.90821496
[2,] 0.30821496 0.73525636
[3,] -0.45530573 0.30821496
[4,] -0.68234713 -0.45530573
[5,] -0.70122294 -0.68234713
[6,] 0.84469427 -0.70122294
[7,] 1.27173566 0.84469427
[8,] 1.27173566 1.27173566
[9,] 0.81765287 1.27173566
[10,] 0.35413217 0.81765287
[11,] 0.41765287 0.35413217
[12,] 0.61765287 0.41765287
[13,] 0.60821496 0.61765287
[14,] 0.47173566 0.60821496
[15,] 0.28117357 0.47173566
[16,] 0.40004937 0.28117357
[17,] 0.20004937 0.40004937
[18,] 0.90004937 0.20004937
[19,] 0.96357007 0.90004937
[20,] 1.10948728 0.96357007
[21,] 0.69061147 1.10948728
[22,] 0.62709077 0.69061147
[23,] 0.58117357 0.62709077
[24,] 0.63525636 0.58117357
[25,] 0.67173566 0.63525636
[26,] 0.68117357 0.67173566
[27,] 0.54469427 0.68117357
[28,] 0.41765287 0.54469427
[29,] -0.02826434 0.41765287
[30,] 0.17173566 -0.02826434
[31,] 0.07173566 0.17173566
[32,] 0.07173566 0.07173566
[33,] -0.17418154 0.07173566
[34,] -0.23770224 -0.17418154
[35,] 0.09061147 -0.23770224
[36,] -0.06474364 0.09061147
[37,] -0.13770224 -0.06474364
[38,] -0.16474364 -0.13770224
[39,] -0.17418154 -0.16474364
[40,] -0.47418154 -0.17418154
[41,] -0.93770224 -0.47418154
[42,] -0.56474364 -0.93770224
[43,] -0.72826434 -0.56474364
[44,] -1.02826434 -0.72826434
[45,] -1.06474364 -1.02826434
[46,] -0.80938853 -1.06474364
[47,] -0.75530573 -0.80938853
[48,] -0.58234713 -0.75530573
[49,] -0.89178504 -0.58234713
[50,] -1.19178504 -0.89178504
[51,] -1.44586783 -1.19178504
[52,] -1.67290923 -1.44586783
[53,] -1.19995063 -1.67290923
[54,] 0.07300798 -1.19995063
[55,] 0.20004937 0.07300798
[56,] -0.27290923 0.20004937
[57,] -0.58107482 -0.27290923
[58,] -0.69867831 -0.58107482
[59,] -0.28924041 -0.69867831
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.73525636 0.90821496
2 0.30821496 0.73525636
3 -0.45530573 0.30821496
4 -0.68234713 -0.45530573
5 -0.70122294 -0.68234713
6 0.84469427 -0.70122294
7 1.27173566 0.84469427
8 1.27173566 1.27173566
9 0.81765287 1.27173566
10 0.35413217 0.81765287
11 0.41765287 0.35413217
12 0.61765287 0.41765287
13 0.60821496 0.61765287
14 0.47173566 0.60821496
15 0.28117357 0.47173566
16 0.40004937 0.28117357
17 0.20004937 0.40004937
18 0.90004937 0.20004937
19 0.96357007 0.90004937
20 1.10948728 0.96357007
21 0.69061147 1.10948728
22 0.62709077 0.69061147
23 0.58117357 0.62709077
24 0.63525636 0.58117357
25 0.67173566 0.63525636
26 0.68117357 0.67173566
27 0.54469427 0.68117357
28 0.41765287 0.54469427
29 -0.02826434 0.41765287
30 0.17173566 -0.02826434
31 0.07173566 0.17173566
32 0.07173566 0.07173566
33 -0.17418154 0.07173566
34 -0.23770224 -0.17418154
35 0.09061147 -0.23770224
36 -0.06474364 0.09061147
37 -0.13770224 -0.06474364
38 -0.16474364 -0.13770224
39 -0.17418154 -0.16474364
40 -0.47418154 -0.17418154
41 -0.93770224 -0.47418154
42 -0.56474364 -0.93770224
43 -0.72826434 -0.56474364
44 -1.02826434 -0.72826434
45 -1.06474364 -1.02826434
46 -0.80938853 -1.06474364
47 -0.75530573 -0.80938853
48 -0.58234713 -0.75530573
49 -0.89178504 -0.58234713
50 -1.19178504 -0.89178504
51 -1.44586783 -1.19178504
52 -1.67290923 -1.44586783
53 -1.19995063 -1.67290923
54 0.07300798 -1.19995063
55 0.20004937 0.07300798
56 -0.27290923 0.20004937
57 -0.58107482 -0.27290923
58 -0.69867831 -0.58107482
59 -0.28924041 -0.69867831
> 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/7fhq51260811411.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/88uhf1260811411.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/9jipn1260811411.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/10y58f1260811411.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/1116pl1260811411.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/12x11w1260811411.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/13z2xz1260811411.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/147m791260811411.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/15ezbs1260811411.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/16c07q1260811412.tab")
+ }
>
> try(system("convert tmp/1169x1260811411.ps tmp/1169x1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/2elcn1260811411.ps tmp/2elcn1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vh3e1260811411.ps tmp/3vh3e1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/4d3uz1260811411.ps tmp/4d3uz1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/5uieo1260811411.ps tmp/5uieo1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/6pspq1260811411.ps tmp/6pspq1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/7fhq51260811411.ps tmp/7fhq51260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/88uhf1260811411.ps tmp/88uhf1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/9jipn1260811411.ps tmp/9jipn1260811411.png",intern=TRUE))
character(0)
> try(system("convert tmp/10y58f1260811411.ps tmp/10y58f1260811411.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.482 1.568 5.799