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.2,267722,8,266003,7.9,262971,7.6,265521,7.6,264676,8.3,270223,8.4,269508,8.4,268457,8.4,265814,8.4,266680,8.6,263018,8.9,269285,8.8,269829,8.3,270911,7.5,266844,7.2,271244,7.4,269907,8.8,271296,9.3,270157,9.3,271322,8.7,267179,8.2,264101,8.3,265518,8.5,269419,8.6,268714,8.5,272482,8.2,268351,8.1,268175,7.9,270674,8.6,272764,8.7,272599,8.7,270333,8.5,270846,8.4,270491,8.5,269160,8.7,274027,8.7,273784,8.6,276663,8.5,274525,8.3,271344,8,271115,8.2,270798,8.1,273911,8.1,273985,8,271917,7.9,273338,7.9,270601,8,273547,8,275363,7.9,281229,8,277793,7.7,279913,7.2,282500,7.5,280041,7.3,282166,7,290304,7,283519,7,287816,7.2,285226,7.3,287595),dim=c(2,60),dimnames=list(c('wkh','los'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('wkh','los'),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
wkh los
1 8.2 267722
2 8.0 266003
3 7.9 262971
4 7.6 265521
5 7.6 264676
6 8.3 270223
7 8.4 269508
8 8.4 268457
9 8.4 265814
10 8.4 266680
11 8.6 263018
12 8.9 269285
13 8.8 269829
14 8.3 270911
15 7.5 266844
16 7.2 271244
17 7.4 269907
18 8.8 271296
19 9.3 270157
20 9.3 271322
21 8.7 267179
22 8.2 264101
23 8.3 265518
24 8.5 269419
25 8.6 268714
26 8.5 272482
27 8.2 268351
28 8.1 268175
29 7.9 270674
30 8.6 272764
31 8.7 272599
32 8.7 270333
33 8.5 270846
34 8.4 270491
35 8.5 269160
36 8.7 274027
37 8.7 273784
38 8.6 276663
39 8.5 274525
40 8.3 271344
41 8.0 271115
42 8.2 270798
43 8.1 273911
44 8.1 273985
45 8.0 271917
46 7.9 273338
47 7.9 270601
48 8.0 273547
49 8.0 275363
50 7.9 281229
51 8.0 277793
52 7.7 279913
53 7.2 282500
54 7.5 280041
55 7.3 282166
56 7.0 290304
57 7.0 283519
58 7.0 287816
59 7.2 285226
60 7.3 287595
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) los
2.142e+01 -4.878e-05
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.987380 -0.270003 0.001098 0.290201 1.116425
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.142e+01 2.668e+00 8.029 5.47e-11 ***
los -4.878e-05 9.790e-06 -4.983 5.98e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4683 on 58 degrees of freedom
Multiple R-squared: 0.2998, Adjusted R-squared: 0.2877
F-statistic: 24.83 on 1 and 58 DF, p-value: 5.976e-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.21475300 0.4295059962 0.7852470019
[2,] 0.10007804 0.2001560892 0.8999219554
[3,] 0.05211281 0.1042256286 0.9478871857
[4,] 0.03211868 0.0642373502 0.9678813249
[5,] 0.05814761 0.1162952196 0.9418523902
[6,] 0.04963801 0.0992760293 0.9503619853
[7,] 0.17142734 0.3428546711 0.8285726645
[8,] 0.22838479 0.4567695766 0.7716152117
[9,] 0.20215557 0.4043111441 0.7978444279
[10,] 0.16069445 0.3213889077 0.8393055461
[11,] 0.35340298 0.7068059666 0.6465970167
[12,] 0.82959828 0.3408034337 0.1704017169
[13,] 0.93817540 0.1236492084 0.0618246042
[14,] 0.94929966 0.1014006835 0.0507003417
[15,] 0.99133504 0.0173299241 0.0086649620
[16,] 0.99906658 0.0018668305 0.0009334152
[17,] 0.99875926 0.0024814805 0.0012407403
[18,] 0.99889894 0.0022021121 0.0011010560
[19,] 0.99867690 0.0026462023 0.0013231012
[20,] 0.99759024 0.0048195215 0.0024097608
[21,] 0.99605262 0.0078947556 0.0039473778
[22,] 0.99415946 0.0116810853 0.0058405426
[23,] 0.99220300 0.0155939959 0.0077969980
[24,] 0.99233349 0.0153330242 0.0076665121
[25,] 0.99495954 0.0100809270 0.0050404635
[26,] 0.99350195 0.0129961082 0.0064980541
[27,] 0.99355178 0.0128964396 0.0064482198
[28,] 0.99185528 0.0162894366 0.0081447183
[29,] 0.98700890 0.0259822066 0.0129911033
[30,] 0.97873165 0.0425366928 0.0212683464
[31,] 0.96674413 0.0665117433 0.0332558717
[32,] 0.97907882 0.0418423634 0.0209211817
[33,] 0.99019467 0.0196106683 0.0098053341
[34,] 0.99900186 0.0019962888 0.0009981444
[35,] 0.99982697 0.0003460645 0.0001730322
[36,] 0.99971131 0.0005773887 0.0002886944
[37,] 0.99952727 0.0009454636 0.0004727318
[38,] 0.99897432 0.0020513656 0.0010256828
[39,] 0.99838407 0.0032318678 0.0016159339
[40,] 0.99754708 0.0049058320 0.0024529160
[41,] 0.99531904 0.0093619128 0.0046809564
[42,] 0.99201695 0.0159661085 0.0079830543
[43,] 0.99266159 0.0146768138 0.0073384069
[44,] 0.98631944 0.0273611212 0.0136805606
[45,] 0.97397950 0.0520410086 0.0260205043
[46,] 0.98519831 0.0296033812 0.0148016906
[47,] 0.99166471 0.0166705779 0.0083352889
[48,] 0.99451051 0.0109789895 0.0054894947
[49,] 0.98730932 0.0253813667 0.0126906834
[50,] 0.97770303 0.0445939404 0.0222969702
[51,] 0.94660471 0.1067905750 0.0533952875
> postscript(file="/var/www/html/rcomp/tmp/1pwc61258707387.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/2uvzq1258707387.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/3wmo41258707387.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/4dfp31258707387.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/54tfq1258707387.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.15919317 -0.44305087 -0.69096045 -0.86656420 -0.90778570 0.06281272
7 8 9 10 11 12
0.12793298 0.07666222 -0.05227083 -0.01002489 0.01133235 0.61705441
13 14 15 16 17 18
0.54359228 0.09637531 -0.90202450 -0.98738000 -0.85260266 0.61515670
19 20 21 22 23 24
1.05959305 1.11642506 0.31431775 -0.33583584 -0.16671055 0.22359131
25 26 27 28 29 30
0.28919941 0.37301315 -0.12850876 -0.23709454 -0.31518622 0.48676991
31 32 33 34 35 36
0.57872075 0.46817883 0.29320443 0.17588652 0.21095656 0.64838264
37 38 39 40 41 42
0.63652841 0.67697421 0.47267650 0.11749828 -0.19367299 -0.00913715
43 44 45 46 47 48
0.04272383 0.04633376 -0.15454915 -0.18522873 -0.31874737 -0.07503312
49 50 51 52 53 54
0.01355652 0.19971666 0.13209882 -0.06448155 -0.43828035 -0.25823735
55 56 57 58 59 60
-0.35457381 -0.25757905 -0.58857063 -0.37895076 -0.30529832 -0.08973177
> postscript(file="/var/www/html/rcomp/tmp/6b6kq1258707387.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.15919317 NA
1 -0.44305087 -0.15919317
2 -0.69096045 -0.44305087
3 -0.86656420 -0.69096045
4 -0.90778570 -0.86656420
5 0.06281272 -0.90778570
6 0.12793298 0.06281272
7 0.07666222 0.12793298
8 -0.05227083 0.07666222
9 -0.01002489 -0.05227083
10 0.01133235 -0.01002489
11 0.61705441 0.01133235
12 0.54359228 0.61705441
13 0.09637531 0.54359228
14 -0.90202450 0.09637531
15 -0.98738000 -0.90202450
16 -0.85260266 -0.98738000
17 0.61515670 -0.85260266
18 1.05959305 0.61515670
19 1.11642506 1.05959305
20 0.31431775 1.11642506
21 -0.33583584 0.31431775
22 -0.16671055 -0.33583584
23 0.22359131 -0.16671055
24 0.28919941 0.22359131
25 0.37301315 0.28919941
26 -0.12850876 0.37301315
27 -0.23709454 -0.12850876
28 -0.31518622 -0.23709454
29 0.48676991 -0.31518622
30 0.57872075 0.48676991
31 0.46817883 0.57872075
32 0.29320443 0.46817883
33 0.17588652 0.29320443
34 0.21095656 0.17588652
35 0.64838264 0.21095656
36 0.63652841 0.64838264
37 0.67697421 0.63652841
38 0.47267650 0.67697421
39 0.11749828 0.47267650
40 -0.19367299 0.11749828
41 -0.00913715 -0.19367299
42 0.04272383 -0.00913715
43 0.04633376 0.04272383
44 -0.15454915 0.04633376
45 -0.18522873 -0.15454915
46 -0.31874737 -0.18522873
47 -0.07503312 -0.31874737
48 0.01355652 -0.07503312
49 0.19971666 0.01355652
50 0.13209882 0.19971666
51 -0.06448155 0.13209882
52 -0.43828035 -0.06448155
53 -0.25823735 -0.43828035
54 -0.35457381 -0.25823735
55 -0.25757905 -0.35457381
56 -0.58857063 -0.25757905
57 -0.37895076 -0.58857063
58 -0.30529832 -0.37895076
59 -0.08973177 -0.30529832
60 NA -0.08973177
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.44305087 -0.15919317
[2,] -0.69096045 -0.44305087
[3,] -0.86656420 -0.69096045
[4,] -0.90778570 -0.86656420
[5,] 0.06281272 -0.90778570
[6,] 0.12793298 0.06281272
[7,] 0.07666222 0.12793298
[8,] -0.05227083 0.07666222
[9,] -0.01002489 -0.05227083
[10,] 0.01133235 -0.01002489
[11,] 0.61705441 0.01133235
[12,] 0.54359228 0.61705441
[13,] 0.09637531 0.54359228
[14,] -0.90202450 0.09637531
[15,] -0.98738000 -0.90202450
[16,] -0.85260266 -0.98738000
[17,] 0.61515670 -0.85260266
[18,] 1.05959305 0.61515670
[19,] 1.11642506 1.05959305
[20,] 0.31431775 1.11642506
[21,] -0.33583584 0.31431775
[22,] -0.16671055 -0.33583584
[23,] 0.22359131 -0.16671055
[24,] 0.28919941 0.22359131
[25,] 0.37301315 0.28919941
[26,] -0.12850876 0.37301315
[27,] -0.23709454 -0.12850876
[28,] -0.31518622 -0.23709454
[29,] 0.48676991 -0.31518622
[30,] 0.57872075 0.48676991
[31,] 0.46817883 0.57872075
[32,] 0.29320443 0.46817883
[33,] 0.17588652 0.29320443
[34,] 0.21095656 0.17588652
[35,] 0.64838264 0.21095656
[36,] 0.63652841 0.64838264
[37,] 0.67697421 0.63652841
[38,] 0.47267650 0.67697421
[39,] 0.11749828 0.47267650
[40,] -0.19367299 0.11749828
[41,] -0.00913715 -0.19367299
[42,] 0.04272383 -0.00913715
[43,] 0.04633376 0.04272383
[44,] -0.15454915 0.04633376
[45,] -0.18522873 -0.15454915
[46,] -0.31874737 -0.18522873
[47,] -0.07503312 -0.31874737
[48,] 0.01355652 -0.07503312
[49,] 0.19971666 0.01355652
[50,] 0.13209882 0.19971666
[51,] -0.06448155 0.13209882
[52,] -0.43828035 -0.06448155
[53,] -0.25823735 -0.43828035
[54,] -0.35457381 -0.25823735
[55,] -0.25757905 -0.35457381
[56,] -0.58857063 -0.25757905
[57,] -0.37895076 -0.58857063
[58,] -0.30529832 -0.37895076
[59,] -0.08973177 -0.30529832
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.44305087 -0.15919317
2 -0.69096045 -0.44305087
3 -0.86656420 -0.69096045
4 -0.90778570 -0.86656420
5 0.06281272 -0.90778570
6 0.12793298 0.06281272
7 0.07666222 0.12793298
8 -0.05227083 0.07666222
9 -0.01002489 -0.05227083
10 0.01133235 -0.01002489
11 0.61705441 0.01133235
12 0.54359228 0.61705441
13 0.09637531 0.54359228
14 -0.90202450 0.09637531
15 -0.98738000 -0.90202450
16 -0.85260266 -0.98738000
17 0.61515670 -0.85260266
18 1.05959305 0.61515670
19 1.11642506 1.05959305
20 0.31431775 1.11642506
21 -0.33583584 0.31431775
22 -0.16671055 -0.33583584
23 0.22359131 -0.16671055
24 0.28919941 0.22359131
25 0.37301315 0.28919941
26 -0.12850876 0.37301315
27 -0.23709454 -0.12850876
28 -0.31518622 -0.23709454
29 0.48676991 -0.31518622
30 0.57872075 0.48676991
31 0.46817883 0.57872075
32 0.29320443 0.46817883
33 0.17588652 0.29320443
34 0.21095656 0.17588652
35 0.64838264 0.21095656
36 0.63652841 0.64838264
37 0.67697421 0.63652841
38 0.47267650 0.67697421
39 0.11749828 0.47267650
40 -0.19367299 0.11749828
41 -0.00913715 -0.19367299
42 0.04272383 -0.00913715
43 0.04633376 0.04272383
44 -0.15454915 0.04633376
45 -0.18522873 -0.15454915
46 -0.31874737 -0.18522873
47 -0.07503312 -0.31874737
48 0.01355652 -0.07503312
49 0.19971666 0.01355652
50 0.13209882 0.19971666
51 -0.06448155 0.13209882
52 -0.43828035 -0.06448155
53 -0.25823735 -0.43828035
54 -0.35457381 -0.25823735
55 -0.25757905 -0.35457381
56 -0.58857063 -0.25757905
57 -0.37895076 -0.58857063
58 -0.30529832 -0.37895076
59 -0.08973177 -0.30529832
> 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/7wuv41258707387.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/84yqf1258707387.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/97y581258707387.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/10v7a31258707387.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/11wov11258707387.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/12fhvq1258707387.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/13fth11258707387.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/14o4h61258707387.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/15mmij1258707387.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/16q0ke1258707387.tab")
+ }
>
> system("convert tmp/1pwc61258707387.ps tmp/1pwc61258707387.png")
> system("convert tmp/2uvzq1258707387.ps tmp/2uvzq1258707387.png")
> system("convert tmp/3wmo41258707387.ps tmp/3wmo41258707387.png")
> system("convert tmp/4dfp31258707387.ps tmp/4dfp31258707387.png")
> system("convert tmp/54tfq1258707387.ps tmp/54tfq1258707387.png")
> system("convert tmp/6b6kq1258707387.ps tmp/6b6kq1258707387.png")
> system("convert tmp/7wuv41258707387.ps tmp/7wuv41258707387.png")
> system("convert tmp/84yqf1258707387.ps tmp/84yqf1258707387.png")
> system("convert tmp/97y581258707387.ps tmp/97y581258707387.png")
> system("convert tmp/10v7a31258707387.ps tmp/10v7a31258707387.png")
>
>
> proc.time()
user system elapsed
2.439 1.526 3.195