R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(611,120.9,594,119.6,595,125.9,591,116.1,589,107.5,584,116.7,573,112.5,567,113,569,126.4,621,114.1,629,112.5,628,112.4,612,113.1,595,116.3,597,111.7,593,118.8,590,116.5,580,125.1,574,113.1,573,119.6,573,114.4,620,114,626,117.8,620,117,588,120.9,566,115,557,117.3,561,119.4,549,114.9,532,125.8,526,117.6,511,117.6,499,114.9,555,121.9,565,117,542,106.4,527,110.5,510,113.6,514,114.2,517,125.4,508,124.6,493,120.2,490,120.8,469,111.4,478,124.1,528,120.2,534,125.5,518,116,506,117,502,105.7,516,102,528,106.4,533,96.9,536,107.6,537,98.8,524,101.1,536,105.7,587,104.6,597,103.2,581,101.6),dim=c(2,60),dimnames=list(c('WerkL','Chem.Nijv.'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('WerkL','Chem.Nijv.'),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
> 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
WerkL Chem.Nijv.
1 611 120.9
2 594 119.6
3 595 125.9
4 591 116.1
5 589 107.5
6 584 116.7
7 573 112.5
8 567 113.0
9 569 126.4
10 621 114.1
11 629 112.5
12 628 112.4
13 612 113.1
14 595 116.3
15 597 111.7
16 593 118.8
17 590 116.5
18 580 125.1
19 574 113.1
20 573 119.6
21 573 114.4
22 620 114.0
23 626 117.8
24 620 117.0
25 588 120.9
26 566 115.0
27 557 117.3
28 561 119.4
29 549 114.9
30 532 125.8
31 526 117.6
32 511 117.6
33 499 114.9
34 555 121.9
35 565 117.0
36 542 106.4
37 527 110.5
38 510 113.6
39 514 114.2
40 517 125.4
41 508 124.6
42 493 120.2
43 490 120.8
44 469 111.4
45 478 124.1
46 528 120.2
47 534 125.5
48 518 116.0
49 506 117.0
50 502 105.7
51 516 102.0
52 528 106.4
53 533 96.9
54 536 107.6
55 537 98.8
56 524 101.1
57 536 105.7
58 587 104.6
59 597 103.2
60 581 101.6
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Chem.Nijv.
548.19570 0.07735
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-87.813 -31.473 5.661 33.050 72.102
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 548.19570 87.33347 6.277 4.74e-08 ***
Chem.Nijv. 0.07735 0.76006 0.102 0.92
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 42.14 on 58 degrees of freedom
Multiple R-squared: 0.0001786, Adjusted R-squared: -0.01706
F-statistic: 0.01036 on 1 and 58 DF, p-value: 0.9193
> 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.0122503066 0.024500613 0.98774969
[2,] 0.0042688325 0.008537665 0.99573117
[3,] 0.0027331900 0.005466380 0.99726681
[4,] 0.0021000828 0.004200166 0.99789992
[5,] 0.0032623939 0.006524788 0.99673761
[6,] 0.0084668110 0.016933622 0.99153319
[7,] 0.0186682324 0.037336465 0.98133177
[8,] 0.0253756914 0.050751383 0.97462431
[9,] 0.0180452409 0.036090482 0.98195476
[10,] 0.0104588097 0.020917619 0.98954119
[11,] 0.0061779581 0.012355916 0.99382204
[12,] 0.0035706479 0.007141296 0.99642935
[13,] 0.0021074585 0.004214917 0.99789254
[14,] 0.0012178313 0.002435663 0.99878217
[15,] 0.0011610702 0.002322140 0.99883893
[16,] 0.0008645089 0.001729018 0.99913549
[17,] 0.0007446483 0.001489297 0.99925535
[18,] 0.0015914302 0.003182860 0.99840857
[19,] 0.0075294180 0.015058836 0.99247058
[20,] 0.0259681410 0.051936282 0.97403186
[21,] 0.0360846028 0.072169206 0.96391540
[22,] 0.0525988638 0.105197728 0.94740114
[23,] 0.0811528742 0.162305748 0.91884713
[24,] 0.1106206842 0.221241368 0.88937932
[25,] 0.1676441864 0.335288373 0.83235581
[26,] 0.2369627342 0.473925468 0.76303727
[27,] 0.3565154333 0.713030867 0.64348457
[28,] 0.5289256791 0.942148642 0.47107432
[29,] 0.7355725240 0.528854952 0.26442748
[30,] 0.7613899646 0.477220071 0.23861004
[31,] 0.8108012701 0.378397460 0.18919873
[32,] 0.8097460471 0.380507906 0.19025395
[33,] 0.8099442056 0.380111589 0.19005579
[34,] 0.8313555884 0.337288823 0.16864441
[35,] 0.8301691722 0.339661656 0.16983083
[36,] 0.8244952288 0.351009542 0.17550477
[37,] 0.8109248054 0.378150389 0.18907519
[38,] 0.8179918459 0.364016308 0.18200815
[39,] 0.8216281356 0.356743729 0.17837186
[40,] 0.9376844948 0.124631010 0.06231551
[41,] 0.9530898491 0.093820302 0.04691015
[42,] 0.9260087617 0.147982477 0.07399124
[43,] 0.9000951819 0.199809636 0.09990482
[44,] 0.8552172003 0.289565599 0.14478280
[45,] 0.8183172181 0.363365564 0.18168278
[46,] 0.8587126907 0.282574619 0.14128731
[47,] 0.8478010289 0.304397942 0.15219897
[48,] 0.8127998352 0.374400330 0.18720016
[49,] 0.7232641619 0.553471676 0.27673584
[50,] 0.6694199621 0.661160076 0.33058004
[51,] 0.5175463071 0.964907386 0.48245369
> postscript(file="/var/www/rcomp/tmp/1e4q91293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/27w7c1293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/37w7c1293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/47w7c1293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/57w7c1293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 60
Frequency = 1
1 2 3 4 5 6
53.4521908 36.5527512 37.0654204 33.8234905 32.4887358 26.7770781
7 8 9 10 11 12
16.1019653 10.0632882 11.0267433 63.9781987 72.1019653 71.1097007
13 14 15 16 17 18
55.0555528 37.8080197 40.1638485 35.6146344 32.7925489 22.1273036
19 20 21 22 23 24
17.0555528 15.5527512 15.9549925 62.9859341 68.6919885 62.7538718
25 26 27 28 29 30
30.4521908 8.9085800 -0.2693344 3.5682220 -8.0836846 -25.9268442
31 32 33 34 35 36
-31.2925406 -46.2925406 -58.0836846 -2.6251633 7.7538718 -14.4261747
37 38 39 40 41 42
-29.7433265 -46.9831242 -43.0295367 -40.8959026 -49.8340193 -64.4936613
43 44 45 46 47 48
-67.5400737 -87.8129452 -79.7953423 -29.4936613 -23.9036380 -39.1687741
49 50 51 52 53 54
-51.2461282 -54.3720269 -40.0858167 -28.4261747 -22.6913108 -20.5189997
55 56 57 58 59 60
-18.8382836 -32.0161980 -20.3720269 30.7130626 40.8213584 24.9451249
> postscript(file="/var/www/rcomp/tmp/6i56x1293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 53.4521908 NA
1 36.5527512 53.4521908
2 37.0654204 36.5527512
3 33.8234905 37.0654204
4 32.4887358 33.8234905
5 26.7770781 32.4887358
6 16.1019653 26.7770781
7 10.0632882 16.1019653
8 11.0267433 10.0632882
9 63.9781987 11.0267433
10 72.1019653 63.9781987
11 71.1097007 72.1019653
12 55.0555528 71.1097007
13 37.8080197 55.0555528
14 40.1638485 37.8080197
15 35.6146344 40.1638485
16 32.7925489 35.6146344
17 22.1273036 32.7925489
18 17.0555528 22.1273036
19 15.5527512 17.0555528
20 15.9549925 15.5527512
21 62.9859341 15.9549925
22 68.6919885 62.9859341
23 62.7538718 68.6919885
24 30.4521908 62.7538718
25 8.9085800 30.4521908
26 -0.2693344 8.9085800
27 3.5682220 -0.2693344
28 -8.0836846 3.5682220
29 -25.9268442 -8.0836846
30 -31.2925406 -25.9268442
31 -46.2925406 -31.2925406
32 -58.0836846 -46.2925406
33 -2.6251633 -58.0836846
34 7.7538718 -2.6251633
35 -14.4261747 7.7538718
36 -29.7433265 -14.4261747
37 -46.9831242 -29.7433265
38 -43.0295367 -46.9831242
39 -40.8959026 -43.0295367
40 -49.8340193 -40.8959026
41 -64.4936613 -49.8340193
42 -67.5400737 -64.4936613
43 -87.8129452 -67.5400737
44 -79.7953423 -87.8129452
45 -29.4936613 -79.7953423
46 -23.9036380 -29.4936613
47 -39.1687741 -23.9036380
48 -51.2461282 -39.1687741
49 -54.3720269 -51.2461282
50 -40.0858167 -54.3720269
51 -28.4261747 -40.0858167
52 -22.6913108 -28.4261747
53 -20.5189997 -22.6913108
54 -18.8382836 -20.5189997
55 -32.0161980 -18.8382836
56 -20.3720269 -32.0161980
57 30.7130626 -20.3720269
58 40.8213584 30.7130626
59 24.9451249 40.8213584
60 NA 24.9451249
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 36.5527512 53.4521908
[2,] 37.0654204 36.5527512
[3,] 33.8234905 37.0654204
[4,] 32.4887358 33.8234905
[5,] 26.7770781 32.4887358
[6,] 16.1019653 26.7770781
[7,] 10.0632882 16.1019653
[8,] 11.0267433 10.0632882
[9,] 63.9781987 11.0267433
[10,] 72.1019653 63.9781987
[11,] 71.1097007 72.1019653
[12,] 55.0555528 71.1097007
[13,] 37.8080197 55.0555528
[14,] 40.1638485 37.8080197
[15,] 35.6146344 40.1638485
[16,] 32.7925489 35.6146344
[17,] 22.1273036 32.7925489
[18,] 17.0555528 22.1273036
[19,] 15.5527512 17.0555528
[20,] 15.9549925 15.5527512
[21,] 62.9859341 15.9549925
[22,] 68.6919885 62.9859341
[23,] 62.7538718 68.6919885
[24,] 30.4521908 62.7538718
[25,] 8.9085800 30.4521908
[26,] -0.2693344 8.9085800
[27,] 3.5682220 -0.2693344
[28,] -8.0836846 3.5682220
[29,] -25.9268442 -8.0836846
[30,] -31.2925406 -25.9268442
[31,] -46.2925406 -31.2925406
[32,] -58.0836846 -46.2925406
[33,] -2.6251633 -58.0836846
[34,] 7.7538718 -2.6251633
[35,] -14.4261747 7.7538718
[36,] -29.7433265 -14.4261747
[37,] -46.9831242 -29.7433265
[38,] -43.0295367 -46.9831242
[39,] -40.8959026 -43.0295367
[40,] -49.8340193 -40.8959026
[41,] -64.4936613 -49.8340193
[42,] -67.5400737 -64.4936613
[43,] -87.8129452 -67.5400737
[44,] -79.7953423 -87.8129452
[45,] -29.4936613 -79.7953423
[46,] -23.9036380 -29.4936613
[47,] -39.1687741 -23.9036380
[48,] -51.2461282 -39.1687741
[49,] -54.3720269 -51.2461282
[50,] -40.0858167 -54.3720269
[51,] -28.4261747 -40.0858167
[52,] -22.6913108 -28.4261747
[53,] -20.5189997 -22.6913108
[54,] -18.8382836 -20.5189997
[55,] -32.0161980 -18.8382836
[56,] -20.3720269 -32.0161980
[57,] 30.7130626 -20.3720269
[58,] 40.8213584 30.7130626
[59,] 24.9451249 40.8213584
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 36.5527512 53.4521908
2 37.0654204 36.5527512
3 33.8234905 37.0654204
4 32.4887358 33.8234905
5 26.7770781 32.4887358
6 16.1019653 26.7770781
7 10.0632882 16.1019653
8 11.0267433 10.0632882
9 63.9781987 11.0267433
10 72.1019653 63.9781987
11 71.1097007 72.1019653
12 55.0555528 71.1097007
13 37.8080197 55.0555528
14 40.1638485 37.8080197
15 35.6146344 40.1638485
16 32.7925489 35.6146344
17 22.1273036 32.7925489
18 17.0555528 22.1273036
19 15.5527512 17.0555528
20 15.9549925 15.5527512
21 62.9859341 15.9549925
22 68.6919885 62.9859341
23 62.7538718 68.6919885
24 30.4521908 62.7538718
25 8.9085800 30.4521908
26 -0.2693344 8.9085800
27 3.5682220 -0.2693344
28 -8.0836846 3.5682220
29 -25.9268442 -8.0836846
30 -31.2925406 -25.9268442
31 -46.2925406 -31.2925406
32 -58.0836846 -46.2925406
33 -2.6251633 -58.0836846
34 7.7538718 -2.6251633
35 -14.4261747 7.7538718
36 -29.7433265 -14.4261747
37 -46.9831242 -29.7433265
38 -43.0295367 -46.9831242
39 -40.8959026 -43.0295367
40 -49.8340193 -40.8959026
41 -64.4936613 -49.8340193
42 -67.5400737 -64.4936613
43 -87.8129452 -67.5400737
44 -79.7953423 -87.8129452
45 -29.4936613 -79.7953423
46 -23.9036380 -29.4936613
47 -39.1687741 -23.9036380
48 -51.2461282 -39.1687741
49 -54.3720269 -51.2461282
50 -40.0858167 -54.3720269
51 -28.4261747 -40.0858167
52 -22.6913108 -28.4261747
53 -20.5189997 -22.6913108
54 -18.8382836 -20.5189997
55 -32.0161980 -18.8382836
56 -20.3720269 -32.0161980
57 30.7130626 -20.3720269
58 40.8213584 30.7130626
59 24.9451249 40.8213584
> 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/rcomp/tmp/7ten01293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/8ten01293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/9ten01293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/rcomp/tmp/10l6nl1293205415.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/117o3r1293205415.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/rcomp/tmp/12sp2x1293205415.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/rcomp/tmp/13z7h81293205415.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/rcomp/tmp/14azgb1293205415.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/rcomp/tmp/15vzwz1293205415.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/rcomp/tmp/16g0vn1293205415.tab")
+ }
> try(system("convert tmp/1e4q91293205415.ps tmp/1e4q91293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/27w7c1293205415.ps tmp/27w7c1293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/37w7c1293205415.ps tmp/37w7c1293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/47w7c1293205415.ps tmp/47w7c1293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/57w7c1293205415.ps tmp/57w7c1293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/6i56x1293205415.ps tmp/6i56x1293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ten01293205415.ps tmp/7ten01293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ten01293205415.ps tmp/8ten01293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ten01293205415.ps tmp/9ten01293205415.png",intern=TRUE))
character(0)
> try(system("convert tmp/10l6nl1293205415.ps tmp/10l6nl1293205415.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.960 1.740 4.736