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(594,0,595,0,591,0,589,0,584,0,573,0,567,0,569,0,621,0,629,0,628,0,612,0,595,0,597,0,593,0,590,0,580,0,574,0,573,0,573,0,620,0,626,0,620,0,588,0,566,0,557,0,561,0,549,0,532,0,526,0,511,0,499,0,555,0,565,0,542,0,527,0,510,0,514,0,517,0,508,0,493,0,490,0,469,0,478,0,528,0,534,0,518,1,506,1,502,1,516,1,528,1,533,1,536,1,537,1,524,1,536,1,587,1,597,1,581,1,564,1,558,1),dim=c(2,61),dimnames=list(c('WlhBe','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('WlhBe','X'),1:61))
> 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
WlhBe X
1 594 0
2 595 0
3 591 0
4 589 0
5 584 0
6 573 0
7 567 0
8 569 0
9 621 0
10 629 0
11 628 0
12 612 0
13 595 0
14 597 0
15 593 0
16 590 0
17 580 0
18 574 0
19 573 0
20 573 0
21 620 0
22 626 0
23 620 0
24 588 0
25 566 0
26 557 0
27 561 0
28 549 0
29 532 0
30 526 0
31 511 0
32 499 0
33 555 0
34 565 0
35 542 0
36 527 0
37 510 0
38 514 0
39 517 0
40 508 0
41 493 0
42 490 0
43 469 0
44 478 0
45 528 0
46 534 0
47 518 1
48 506 1
49 502 1
50 516 1
51 528 1
52 533 1
53 536 1
54 537 1
55 524 1
56 536 1
57 587 1
58 597 1
59 581 1
60 564 1
61 558 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
561.13 -19.60
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-92.130 -29.130 3.870 29.870 67.870
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 561.13 5.94 94.459 <2e-16 ***
X -19.60 11.98 -1.636 0.107
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 40.29 on 59 degrees of freedom
Multiple R-squared: 0.04339, Adjusted R-squared: 0.02718
F-statistic: 2.676 on 1 and 59 DF, p-value: 0.1072
> 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.002613229 0.005226457 0.99738677
[2,] 0.004656487 0.009312973 0.99534351
[3,] 0.005036312 0.010072623 0.99496369
[4,] 0.002618494 0.005236988 0.99738151
[5,] 0.012513381 0.025026761 0.98748662
[6,] 0.033839748 0.067679496 0.96616025
[7,] 0.051681994 0.103363989 0.94831801
[8,] 0.039712742 0.079425485 0.96028726
[9,] 0.023696263 0.047392526 0.97630374
[10,] 0.014230313 0.028460626 0.98576969
[11,] 0.008403172 0.016806343 0.99159683
[12,] 0.004990871 0.009981742 0.99500913
[13,] 0.003358739 0.006717478 0.99664126
[14,] 0.002608799 0.005217598 0.99739120
[15,] 0.002028348 0.004056697 0.99797165
[16,] 0.001540212 0.003080424 0.99845979
[17,] 0.003494938 0.006989876 0.99650506
[18,] 0.013192558 0.026385116 0.98680744
[19,] 0.039810313 0.079620626 0.96018969
[20,] 0.050154639 0.100309277 0.94984536
[21,] 0.069279359 0.138558718 0.93072064
[22,] 0.104694934 0.209389867 0.89530507
[23,] 0.142487200 0.284974399 0.85751280
[24,] 0.207489135 0.414978271 0.79251086
[25,] 0.330855802 0.661711604 0.66914420
[26,] 0.458700275 0.917400550 0.54129973
[27,] 0.623535070 0.752929859 0.37646493
[28,] 0.778667678 0.442664645 0.22133232
[29,] 0.793887882 0.412224236 0.20611212
[30,] 0.848330433 0.303339133 0.15166957
[31,] 0.866045398 0.267909205 0.13395460
[32,] 0.876877979 0.246244042 0.12312202
[33,] 0.891521274 0.216957452 0.10847873
[34,] 0.894731427 0.210537146 0.10526857
[35,] 0.892895556 0.214208888 0.10710444
[36,] 0.890548024 0.218903951 0.10945198
[37,] 0.896858439 0.206283121 0.10314156
[38,] 0.900320095 0.199359811 0.09967991
[39,] 0.941244950 0.117510100 0.05875505
[40,] 0.965491715 0.069016570 0.03450829
[41,] 0.946545614 0.106908772 0.05345439
[42,] 0.917413200 0.165173600 0.08258680
[43,] 0.891588463 0.216823075 0.10841154
[44,] 0.891308205 0.217383589 0.10869179
[45,] 0.914927998 0.170144003 0.08507200
[46,] 0.913573070 0.172853859 0.08642693
[47,] 0.890754594 0.218490813 0.10924541
[48,] 0.855084365 0.289831271 0.14491564
[49,] 0.806992273 0.386015453 0.19300773
[50,] 0.752528925 0.494942150 0.24747108
[51,] 0.817706330 0.364587339 0.18229367
[52,] 0.881314429 0.237371141 0.11868557
> postscript(file="/var/www/html/rcomp/tmp/1voqj1260892995.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/21rfx1260892995.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/33d8j1260892995.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/4qc7r1260892995.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/5rz7j1260892995.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 = 61
Frequency = 1
1 2 3 4 5 6
32.8695652 33.8695652 29.8695652 27.8695652 22.8695652 11.8695652
7 8 9 10 11 12
5.8695652 7.8695652 59.8695652 67.8695652 66.8695652 50.8695652
13 14 15 16 17 18
33.8695652 35.8695652 31.8695652 28.8695652 18.8695652 12.8695652
19 20 21 22 23 24
11.8695652 11.8695652 58.8695652 64.8695652 58.8695652 26.8695652
25 26 27 28 29 30
4.8695652 -4.1304348 -0.1304348 -12.1304348 -29.1304348 -35.1304348
31 32 33 34 35 36
-50.1304348 -62.1304348 -6.1304348 3.8695652 -19.1304348 -34.1304348
37 38 39 40 41 42
-51.1304348 -47.1304348 -44.1304348 -53.1304348 -68.1304348 -71.1304348
43 44 45 46 47 48
-92.1304348 -83.1304348 -33.1304348 -27.1304348 -23.5333333 -35.5333333
49 50 51 52 53 54
-39.5333333 -25.5333333 -13.5333333 -8.5333333 -5.5333333 -4.5333333
55 56 57 58 59 60
-17.5333333 -5.5333333 45.4666667 55.4666667 39.4666667 22.4666667
61
16.4666667
> postscript(file="/var/www/html/rcomp/tmp/6w44l1260892995.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 32.8695652 NA
1 33.8695652 32.8695652
2 29.8695652 33.8695652
3 27.8695652 29.8695652
4 22.8695652 27.8695652
5 11.8695652 22.8695652
6 5.8695652 11.8695652
7 7.8695652 5.8695652
8 59.8695652 7.8695652
9 67.8695652 59.8695652
10 66.8695652 67.8695652
11 50.8695652 66.8695652
12 33.8695652 50.8695652
13 35.8695652 33.8695652
14 31.8695652 35.8695652
15 28.8695652 31.8695652
16 18.8695652 28.8695652
17 12.8695652 18.8695652
18 11.8695652 12.8695652
19 11.8695652 11.8695652
20 58.8695652 11.8695652
21 64.8695652 58.8695652
22 58.8695652 64.8695652
23 26.8695652 58.8695652
24 4.8695652 26.8695652
25 -4.1304348 4.8695652
26 -0.1304348 -4.1304348
27 -12.1304348 -0.1304348
28 -29.1304348 -12.1304348
29 -35.1304348 -29.1304348
30 -50.1304348 -35.1304348
31 -62.1304348 -50.1304348
32 -6.1304348 -62.1304348
33 3.8695652 -6.1304348
34 -19.1304348 3.8695652
35 -34.1304348 -19.1304348
36 -51.1304348 -34.1304348
37 -47.1304348 -51.1304348
38 -44.1304348 -47.1304348
39 -53.1304348 -44.1304348
40 -68.1304348 -53.1304348
41 -71.1304348 -68.1304348
42 -92.1304348 -71.1304348
43 -83.1304348 -92.1304348
44 -33.1304348 -83.1304348
45 -27.1304348 -33.1304348
46 -23.5333333 -27.1304348
47 -35.5333333 -23.5333333
48 -39.5333333 -35.5333333
49 -25.5333333 -39.5333333
50 -13.5333333 -25.5333333
51 -8.5333333 -13.5333333
52 -5.5333333 -8.5333333
53 -4.5333333 -5.5333333
54 -17.5333333 -4.5333333
55 -5.5333333 -17.5333333
56 45.4666667 -5.5333333
57 55.4666667 45.4666667
58 39.4666667 55.4666667
59 22.4666667 39.4666667
60 16.4666667 22.4666667
61 NA 16.4666667
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 33.8695652 32.8695652
[2,] 29.8695652 33.8695652
[3,] 27.8695652 29.8695652
[4,] 22.8695652 27.8695652
[5,] 11.8695652 22.8695652
[6,] 5.8695652 11.8695652
[7,] 7.8695652 5.8695652
[8,] 59.8695652 7.8695652
[9,] 67.8695652 59.8695652
[10,] 66.8695652 67.8695652
[11,] 50.8695652 66.8695652
[12,] 33.8695652 50.8695652
[13,] 35.8695652 33.8695652
[14,] 31.8695652 35.8695652
[15,] 28.8695652 31.8695652
[16,] 18.8695652 28.8695652
[17,] 12.8695652 18.8695652
[18,] 11.8695652 12.8695652
[19,] 11.8695652 11.8695652
[20,] 58.8695652 11.8695652
[21,] 64.8695652 58.8695652
[22,] 58.8695652 64.8695652
[23,] 26.8695652 58.8695652
[24,] 4.8695652 26.8695652
[25,] -4.1304348 4.8695652
[26,] -0.1304348 -4.1304348
[27,] -12.1304348 -0.1304348
[28,] -29.1304348 -12.1304348
[29,] -35.1304348 -29.1304348
[30,] -50.1304348 -35.1304348
[31,] -62.1304348 -50.1304348
[32,] -6.1304348 -62.1304348
[33,] 3.8695652 -6.1304348
[34,] -19.1304348 3.8695652
[35,] -34.1304348 -19.1304348
[36,] -51.1304348 -34.1304348
[37,] -47.1304348 -51.1304348
[38,] -44.1304348 -47.1304348
[39,] -53.1304348 -44.1304348
[40,] -68.1304348 -53.1304348
[41,] -71.1304348 -68.1304348
[42,] -92.1304348 -71.1304348
[43,] -83.1304348 -92.1304348
[44,] -33.1304348 -83.1304348
[45,] -27.1304348 -33.1304348
[46,] -23.5333333 -27.1304348
[47,] -35.5333333 -23.5333333
[48,] -39.5333333 -35.5333333
[49,] -25.5333333 -39.5333333
[50,] -13.5333333 -25.5333333
[51,] -8.5333333 -13.5333333
[52,] -5.5333333 -8.5333333
[53,] -4.5333333 -5.5333333
[54,] -17.5333333 -4.5333333
[55,] -5.5333333 -17.5333333
[56,] 45.4666667 -5.5333333
[57,] 55.4666667 45.4666667
[58,] 39.4666667 55.4666667
[59,] 22.4666667 39.4666667
[60,] 16.4666667 22.4666667
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 33.8695652 32.8695652
2 29.8695652 33.8695652
3 27.8695652 29.8695652
4 22.8695652 27.8695652
5 11.8695652 22.8695652
6 5.8695652 11.8695652
7 7.8695652 5.8695652
8 59.8695652 7.8695652
9 67.8695652 59.8695652
10 66.8695652 67.8695652
11 50.8695652 66.8695652
12 33.8695652 50.8695652
13 35.8695652 33.8695652
14 31.8695652 35.8695652
15 28.8695652 31.8695652
16 18.8695652 28.8695652
17 12.8695652 18.8695652
18 11.8695652 12.8695652
19 11.8695652 11.8695652
20 58.8695652 11.8695652
21 64.8695652 58.8695652
22 58.8695652 64.8695652
23 26.8695652 58.8695652
24 4.8695652 26.8695652
25 -4.1304348 4.8695652
26 -0.1304348 -4.1304348
27 -12.1304348 -0.1304348
28 -29.1304348 -12.1304348
29 -35.1304348 -29.1304348
30 -50.1304348 -35.1304348
31 -62.1304348 -50.1304348
32 -6.1304348 -62.1304348
33 3.8695652 -6.1304348
34 -19.1304348 3.8695652
35 -34.1304348 -19.1304348
36 -51.1304348 -34.1304348
37 -47.1304348 -51.1304348
38 -44.1304348 -47.1304348
39 -53.1304348 -44.1304348
40 -68.1304348 -53.1304348
41 -71.1304348 -68.1304348
42 -92.1304348 -71.1304348
43 -83.1304348 -92.1304348
44 -33.1304348 -83.1304348
45 -27.1304348 -33.1304348
46 -23.5333333 -27.1304348
47 -35.5333333 -23.5333333
48 -39.5333333 -35.5333333
49 -25.5333333 -39.5333333
50 -13.5333333 -25.5333333
51 -8.5333333 -13.5333333
52 -5.5333333 -8.5333333
53 -4.5333333 -5.5333333
54 -17.5333333 -4.5333333
55 -5.5333333 -17.5333333
56 45.4666667 -5.5333333
57 55.4666667 45.4666667
58 39.4666667 55.4666667
59 22.4666667 39.4666667
60 16.4666667 22.4666667
> 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/753m01260892995.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/8png61260892995.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/9l4pe1260892995.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/10p0th1260892995.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/11vgs21260892995.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/12bh3j1260892995.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/136ie21260892995.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/14ijeb1260892995.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/15mf6m1260892995.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/16b9341260892995.tab")
+ }
>
> try(system("convert tmp/1voqj1260892995.ps tmp/1voqj1260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/21rfx1260892995.ps tmp/21rfx1260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/33d8j1260892995.ps tmp/33d8j1260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qc7r1260892995.ps tmp/4qc7r1260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/5rz7j1260892995.ps tmp/5rz7j1260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/6w44l1260892995.ps tmp/6w44l1260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/753m01260892995.ps tmp/753m01260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/8png61260892995.ps tmp/8png61260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/9l4pe1260892995.ps tmp/9l4pe1260892995.png",intern=TRUE))
character(0)
> try(system("convert tmp/10p0th1260892995.ps tmp/10p0th1260892995.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.525 1.574 5.061