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,6.3,8.2,6.2,7.6,6.1,7.7,6.3,8.1,6.5,8.3,6.6,8.3,6.5,7.9,6.2,7.8,6.2,8,5.9,8.5,6.1,8.6,6.1,8.5,6.1,8,6.1,7.8,6.1,8,6.4,8.2,6.7,8.3,6.9,8.2,7,8.1,7,8,6.8,7.8,6.4,7.8,5.9,7.7,5.5,7.6,5.5,7.6,5.6,7.6,5.8,7.8,5.9,8,6.1,8,6.1,7.9,6,7.7,6,7.4,5.9,6.9,5.5,6.7,5.6,6.5,5.4,6.4,5.2,6.7,5.2,6.8,5.2,6.9,5.5,6.9,5.8,6.7,5.8,6.4,5.5,6.2,5.3,5.9,5.1,6.1,5.2,6.7,5.8,6.8,5.8,6.6,5.5,6.4,5,6.4,4.9,6.7,5.3,7.1,6.1,7.1,6.5,6.9,6.8,6.4,6.6,6,6.4,6,6.4),dim=c(2,58),dimnames=list(c('wv','wm'),1:58))
> y <- array(NA,dim=c(2,58),dimnames=list(c('wv','wm'),1:58))
> 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
wv wm
1 8.9 6.3
2 8.2 6.2
3 7.6 6.1
4 7.7 6.3
5 8.1 6.5
6 8.3 6.6
7 8.3 6.5
8 7.9 6.2
9 7.8 6.2
10 8.0 5.9
11 8.5 6.1
12 8.6 6.1
13 8.5 6.1
14 8.0 6.1
15 7.8 6.1
16 8.0 6.4
17 8.2 6.7
18 8.3 6.9
19 8.2 7.0
20 8.1 7.0
21 8.0 6.8
22 7.8 6.4
23 7.8 5.9
24 7.7 5.5
25 7.6 5.5
26 7.6 5.6
27 7.6 5.8
28 7.8 5.9
29 8.0 6.1
30 8.0 6.1
31 7.9 6.0
32 7.7 6.0
33 7.4 5.9
34 6.9 5.5
35 6.7 5.6
36 6.5 5.4
37 6.4 5.2
38 6.7 5.2
39 6.8 5.2
40 6.9 5.5
41 6.9 5.8
42 6.7 5.8
43 6.4 5.5
44 6.2 5.3
45 5.9 5.1
46 6.1 5.2
47 6.7 5.8
48 6.8 5.8
49 6.6 5.5
50 6.4 5.0
51 6.4 4.9
52 6.7 5.3
53 7.1 6.1
54 7.1 6.5
55 6.9 6.8
56 6.4 6.6
57 6.0 6.4
58 6.0 6.4
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) wm
2.1275 0.8801
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.76040 -0.36528 0.05963 0.47264 1.22761
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.1275 0.9601 2.216 0.0308 *
wm 0.8801 0.1602 5.493 1e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.641 on 56 degrees of freedom
Multiple R-squared: 0.3501, Adjusted R-squared: 0.3385
F-statistic: 30.17 on 1 and 56 DF, p-value: 1.000e-06
> 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.493060317 0.986120634 0.5069397
[2,] 0.327297767 0.654595534 0.6727022
[3,] 0.202049500 0.404099000 0.7979505
[4,] 0.118308533 0.236617066 0.8816915
[5,] 0.068596762 0.137193524 0.9314032
[6,] 0.044987783 0.089975566 0.9550122
[7,] 0.054185212 0.108370425 0.9458148
[8,] 0.072355343 0.144710687 0.9276447
[9,] 0.073552731 0.147105462 0.9264473
[10,] 0.051435192 0.102870385 0.9485648
[11,] 0.040406024 0.080812048 0.9595940
[12,] 0.027338001 0.054676002 0.9726620
[13,] 0.017015128 0.034030256 0.9829849
[14,] 0.010465563 0.020931125 0.9895344
[15,] 0.006230706 0.012461412 0.9937693
[16,] 0.003776527 0.007553054 0.9962235
[17,] 0.002467685 0.004935370 0.9975323
[18,] 0.002113002 0.004226004 0.9978870
[19,] 0.001916783 0.003833566 0.9980832
[20,] 0.001902939 0.003805877 0.9980971
[21,] 0.001936373 0.003872746 0.9980636
[22,] 0.001955894 0.003911788 0.9980441
[23,] 0.002036356 0.004072712 0.9979636
[24,] 0.002349421 0.004698841 0.9976506
[25,] 0.004105063 0.008210127 0.9958949
[26,] 0.010439995 0.020879990 0.9895600
[27,] 0.034174865 0.068349731 0.9658251
[28,] 0.104075949 0.208151898 0.8959241
[29,] 0.242306435 0.484612869 0.7576936
[30,] 0.388405834 0.776811667 0.6115942
[31,] 0.545593058 0.908813885 0.4544069
[32,] 0.637257011 0.725485978 0.3627430
[33,] 0.657468402 0.685063195 0.3425316
[34,] 0.617805631 0.764388738 0.3821944
[35,] 0.590607653 0.818784693 0.4093923
[36,] 0.600498851 0.799002298 0.3995011
[37,] 0.634531882 0.730936237 0.3654681
[38,] 0.648103714 0.703792571 0.3518963
[39,] 0.629611592 0.740776816 0.3703884
[40,] 0.610155933 0.779688135 0.3898441
[41,] 0.682439135 0.635121730 0.3175609
[42,] 0.693775890 0.612448220 0.3062241
[43,] 0.635024108 0.729951784 0.3649759
[44,] 0.575951363 0.848097274 0.4240486
[45,] 0.472440183 0.944880366 0.5275598
[46,] 0.358488832 0.716977663 0.6415112
[47,] 0.262737552 0.525475104 0.7372624
[48,] 0.162510010 0.325020019 0.8374900
[49,] 0.386405829 0.772811657 0.6135942
> postscript(file="/var/www/html/rcomp/tmp/1in0x1258659317.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/2bm4p1258659317.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/3i0aw1258659317.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/46a481258659317.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/5t3531258659317.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 = 58
Frequency = 1
1 2 3 4 5 6
1.227609239 0.615623115 0.103636990 0.027609239 0.251581488 0.363567612
7 8 9 10 11 12
0.451581488 0.315623115 0.215623115 0.679664742 1.003636990 1.103636990
13 14 15 16 17 18
1.003636990 0.503636990 0.303636990 0.239595363 0.175553736 0.099525985
19 20 21 22 23 24
-0.088487891 -0.188487891 -0.112460140 0.039595363 0.479664742 0.731720245
25 26 27 28 29 30
0.631720245 0.543706369 0.367678618 0.479664742 0.503636990 0.503636990
31 32 33 34 35 36
0.491650866 0.291650866 0.079664742 -0.068279755 -0.356293631 -0.380265880
37 38 39 40 41 42
-0.304238128 -0.004238128 0.095761872 -0.068279755 -0.332321382 -0.532321382
43 44 45 46 47 48
-0.568279755 -0.592252004 -0.716224252 -0.604238128 -0.532321382 -0.432321382
49 50 51 52 53 54
-0.368279755 -0.128210377 -0.040196501 -0.092252004 -0.396363010 -0.748418512
55 56 57 58
-1.212460140 -1.536432388 -1.760404637 -1.760404637
> postscript(file="/var/www/html/rcomp/tmp/6oeyd1258659317.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 = 58
Frequency = 1
lag(myerror, k = 1) myerror
0 1.227609239 NA
1 0.615623115 1.227609239
2 0.103636990 0.615623115
3 0.027609239 0.103636990
4 0.251581488 0.027609239
5 0.363567612 0.251581488
6 0.451581488 0.363567612
7 0.315623115 0.451581488
8 0.215623115 0.315623115
9 0.679664742 0.215623115
10 1.003636990 0.679664742
11 1.103636990 1.003636990
12 1.003636990 1.103636990
13 0.503636990 1.003636990
14 0.303636990 0.503636990
15 0.239595363 0.303636990
16 0.175553736 0.239595363
17 0.099525985 0.175553736
18 -0.088487891 0.099525985
19 -0.188487891 -0.088487891
20 -0.112460140 -0.188487891
21 0.039595363 -0.112460140
22 0.479664742 0.039595363
23 0.731720245 0.479664742
24 0.631720245 0.731720245
25 0.543706369 0.631720245
26 0.367678618 0.543706369
27 0.479664742 0.367678618
28 0.503636990 0.479664742
29 0.503636990 0.503636990
30 0.491650866 0.503636990
31 0.291650866 0.491650866
32 0.079664742 0.291650866
33 -0.068279755 0.079664742
34 -0.356293631 -0.068279755
35 -0.380265880 -0.356293631
36 -0.304238128 -0.380265880
37 -0.004238128 -0.304238128
38 0.095761872 -0.004238128
39 -0.068279755 0.095761872
40 -0.332321382 -0.068279755
41 -0.532321382 -0.332321382
42 -0.568279755 -0.532321382
43 -0.592252004 -0.568279755
44 -0.716224252 -0.592252004
45 -0.604238128 -0.716224252
46 -0.532321382 -0.604238128
47 -0.432321382 -0.532321382
48 -0.368279755 -0.432321382
49 -0.128210377 -0.368279755
50 -0.040196501 -0.128210377
51 -0.092252004 -0.040196501
52 -0.396363010 -0.092252004
53 -0.748418512 -0.396363010
54 -1.212460140 -0.748418512
55 -1.536432388 -1.212460140
56 -1.760404637 -1.536432388
57 -1.760404637 -1.760404637
58 NA -1.760404637
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.615623115 1.227609239
[2,] 0.103636990 0.615623115
[3,] 0.027609239 0.103636990
[4,] 0.251581488 0.027609239
[5,] 0.363567612 0.251581488
[6,] 0.451581488 0.363567612
[7,] 0.315623115 0.451581488
[8,] 0.215623115 0.315623115
[9,] 0.679664742 0.215623115
[10,] 1.003636990 0.679664742
[11,] 1.103636990 1.003636990
[12,] 1.003636990 1.103636990
[13,] 0.503636990 1.003636990
[14,] 0.303636990 0.503636990
[15,] 0.239595363 0.303636990
[16,] 0.175553736 0.239595363
[17,] 0.099525985 0.175553736
[18,] -0.088487891 0.099525985
[19,] -0.188487891 -0.088487891
[20,] -0.112460140 -0.188487891
[21,] 0.039595363 -0.112460140
[22,] 0.479664742 0.039595363
[23,] 0.731720245 0.479664742
[24,] 0.631720245 0.731720245
[25,] 0.543706369 0.631720245
[26,] 0.367678618 0.543706369
[27,] 0.479664742 0.367678618
[28,] 0.503636990 0.479664742
[29,] 0.503636990 0.503636990
[30,] 0.491650866 0.503636990
[31,] 0.291650866 0.491650866
[32,] 0.079664742 0.291650866
[33,] -0.068279755 0.079664742
[34,] -0.356293631 -0.068279755
[35,] -0.380265880 -0.356293631
[36,] -0.304238128 -0.380265880
[37,] -0.004238128 -0.304238128
[38,] 0.095761872 -0.004238128
[39,] -0.068279755 0.095761872
[40,] -0.332321382 -0.068279755
[41,] -0.532321382 -0.332321382
[42,] -0.568279755 -0.532321382
[43,] -0.592252004 -0.568279755
[44,] -0.716224252 -0.592252004
[45,] -0.604238128 -0.716224252
[46,] -0.532321382 -0.604238128
[47,] -0.432321382 -0.532321382
[48,] -0.368279755 -0.432321382
[49,] -0.128210377 -0.368279755
[50,] -0.040196501 -0.128210377
[51,] -0.092252004 -0.040196501
[52,] -0.396363010 -0.092252004
[53,] -0.748418512 -0.396363010
[54,] -1.212460140 -0.748418512
[55,] -1.536432388 -1.212460140
[56,] -1.760404637 -1.536432388
[57,] -1.760404637 -1.760404637
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.615623115 1.227609239
2 0.103636990 0.615623115
3 0.027609239 0.103636990
4 0.251581488 0.027609239
5 0.363567612 0.251581488
6 0.451581488 0.363567612
7 0.315623115 0.451581488
8 0.215623115 0.315623115
9 0.679664742 0.215623115
10 1.003636990 0.679664742
11 1.103636990 1.003636990
12 1.003636990 1.103636990
13 0.503636990 1.003636990
14 0.303636990 0.503636990
15 0.239595363 0.303636990
16 0.175553736 0.239595363
17 0.099525985 0.175553736
18 -0.088487891 0.099525985
19 -0.188487891 -0.088487891
20 -0.112460140 -0.188487891
21 0.039595363 -0.112460140
22 0.479664742 0.039595363
23 0.731720245 0.479664742
24 0.631720245 0.731720245
25 0.543706369 0.631720245
26 0.367678618 0.543706369
27 0.479664742 0.367678618
28 0.503636990 0.479664742
29 0.503636990 0.503636990
30 0.491650866 0.503636990
31 0.291650866 0.491650866
32 0.079664742 0.291650866
33 -0.068279755 0.079664742
34 -0.356293631 -0.068279755
35 -0.380265880 -0.356293631
36 -0.304238128 -0.380265880
37 -0.004238128 -0.304238128
38 0.095761872 -0.004238128
39 -0.068279755 0.095761872
40 -0.332321382 -0.068279755
41 -0.532321382 -0.332321382
42 -0.568279755 -0.532321382
43 -0.592252004 -0.568279755
44 -0.716224252 -0.592252004
45 -0.604238128 -0.716224252
46 -0.532321382 -0.604238128
47 -0.432321382 -0.532321382
48 -0.368279755 -0.432321382
49 -0.128210377 -0.368279755
50 -0.040196501 -0.128210377
51 -0.092252004 -0.040196501
52 -0.396363010 -0.092252004
53 -0.748418512 -0.396363010
54 -1.212460140 -0.748418512
55 -1.536432388 -1.212460140
56 -1.760404637 -1.536432388
57 -1.760404637 -1.760404637
> 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/7x0iu1258659317.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/8vtrn1258659317.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/97o781258659317.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/10yvf21258659317.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/11oz9g1258659317.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/12jjef1258659317.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/133kxk1258659317.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/14z49n1258659317.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/15nyu21258659317.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/163ykp1258659317.tab")
+ }
>
> system("convert tmp/1in0x1258659317.ps tmp/1in0x1258659317.png")
> system("convert tmp/2bm4p1258659317.ps tmp/2bm4p1258659317.png")
> system("convert tmp/3i0aw1258659317.ps tmp/3i0aw1258659317.png")
> system("convert tmp/46a481258659317.ps tmp/46a481258659317.png")
> system("convert tmp/5t3531258659317.ps tmp/5t3531258659317.png")
> system("convert tmp/6oeyd1258659317.ps tmp/6oeyd1258659317.png")
> system("convert tmp/7x0iu1258659317.ps tmp/7x0iu1258659317.png")
> system("convert tmp/8vtrn1258659317.ps tmp/8vtrn1258659317.png")
> system("convert tmp/97o781258659317.ps tmp/97o781258659317.png")
> system("convert tmp/10yvf21258659317.ps tmp/10yvf21258659317.png")
>
>
> proc.time()
user system elapsed
2.361 1.593 3.953