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(5560,543,3922,594,3759,611,4138,613,4634,611,3996,594,4308,595,4143,591,4429,589,5219,584,4929,573,5755,567,5592,569,4163,621,4962,629,5208,628,4755,612,4491,595,5732,597,5731,593,5040,590,6102,580,4904,574,5369,573,5578,573,4619,620,4731,626,5011,620,5299,588,4146,566,4625,557,4736,561,4219,549,5116,532,4205,526,4121,511,5103,499,4300,555,4578,565,3809,542,5526,527,4247,510,3830,514,4394,517,4826,508,4409,493,4569,490,4106,469,4794,478,3914,528,3793,534,4405,518,4022,506,4100,502,4788,516,3163,528,3585,533,3903,536,4178,537,3863,524,4187,536),dim=c(2,61),dimnames=list(c('Y','X'),1:61))
>  y <- array(NA,dim=c(2,61),dimnames=list(c('Y','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'
> 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
      Y   X
1  5560 543
2  3922 594
3  3759 611
4  4138 613
5  4634 611
6  3996 594
7  4308 595
8  4143 591
9  4429 589
10 5219 584
11 4929 573
12 5755 567
13 5592 569
14 4163 621
15 4962 629
16 5208 628
17 4755 612
18 4491 595
19 5732 597
20 5731 593
21 5040 590
22 6102 580
23 4904 574
24 5369 573
25 5578 573
26 4619 620
27 4731 626
28 5011 620
29 5299 588
30 4146 566
31 4625 557
32 4736 561
33 4219 549
34 5116 532
35 4205 526
36 4121 511
37 5103 499
38 4300 555
39 4578 565
40 3809 542
41 5526 527
42 4247 510
43 3830 514
44 4394 517
45 4826 508
46 4409 493
47 4569 490
48 4106 469
49 4794 478
50 3914 528
51 3793 534
52 4405 518
53 4022 506
54 4100 502
55 4788 516
56 3163 528
57 3585 533
58 3903 536
59 4178 537
60 3863 524
61 4187 536
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept)            X  
   2311.026        4.076  
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
    Min      1Q  Median      3Q     Max 
-1300.2  -428.3  -116.7   373.7  1426.9 
Coefficients:
            Estimate Std. Error t value Pr(>|t|)  
(Intercept) 2311.026   1048.195   2.205   0.0314 *
X              4.076      1.874   2.175   0.0337 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
Residual standard error: 614.6 on 59 degrees of freedom
Multiple R-squared: 0.07422,	Adjusted R-squared: 0.05853 
F-statistic:  4.73 on 1 and 59 DF,  p-value: 0.03366 
> 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.41726113 0.83452226 0.58273887
 [2,] 0.34094066 0.68188131 0.65905934
 [3,] 0.21437009 0.42874017 0.78562991
 [4,] 0.14951261 0.29902521 0.85048739
 [5,] 0.08564288 0.17128577 0.91435712
 [6,] 0.13802951 0.27605902 0.86197049
 [7,] 0.08441715 0.16883430 0.91558285
 [8,] 0.15221748 0.30443496 0.84778252
 [9,] 0.16270648 0.32541295 0.83729352
[10,] 0.15906221 0.31812442 0.84093779
[11,] 0.39932968 0.79865936 0.60067032
[12,] 0.57141966 0.85716068 0.42858034
[13,] 0.50782507 0.98434985 0.49217493
[14,] 0.44217369 0.88434738 0.55782631
[15,] 0.59643119 0.80713763 0.40356881
[16,] 0.70322583 0.59354834 0.29677417
[17,] 0.63960485 0.72079030 0.36039515
[18,] 0.84314038 0.31371924 0.15685962
[19,] 0.80298593 0.39402813 0.19701407
[20,] 0.79946592 0.40106816 0.20053408
[21,] 0.84671729 0.30656542 0.15328271
[22,] 0.79910461 0.40179078 0.20089539
[23,] 0.75284492 0.49431016 0.24715508
[24,] 0.73720777 0.52558447 0.26279223
[25,] 0.79306928 0.41386144 0.20693072
[26,] 0.83215860 0.33568281 0.16784140
[27,] 0.82432106 0.35135789 0.17567894
[28,] 0.82013355 0.35973290 0.17986645
[29,] 0.82613572 0.34772855 0.17386428
[30,] 0.86230443 0.27539115 0.13769557
[31,] 0.86029890 0.27940220 0.13970110
[32,] 0.85308071 0.29383858 0.14691929
[33,] 0.86824463 0.26351073 0.13175537
[34,] 0.84209900 0.31580201 0.15790100
[35,] 0.85243633 0.29512735 0.14756367
[36,] 0.84752898 0.30494205 0.15247102
[37,] 0.98715341 0.02569318 0.01284659
[38,] 0.98013458 0.03973084 0.01986542
[39,] 0.97850950 0.04298099 0.02149050
[40,] 0.96857428 0.06285143 0.03142572
[41,] 0.97580664 0.04838672 0.02419336
[42,] 0.95916247 0.08167505 0.04083753
[43,] 0.93878268 0.12243465 0.06121732
[44,] 0.94190504 0.11618992 0.05809496
[45,] 0.90964706 0.18070589 0.09035294
[46,] 0.86676102 0.26647795 0.13323898
[47,] 0.81442789 0.37114421 0.18557211
[48,] 0.76147222 0.47705556 0.23852778
[49,] 0.66494814 0.67010372 0.33505186
[50,] 0.56163509 0.87672982 0.43836491
[51,] 0.82401094 0.35197813 0.17598906
[52,] 0.90835715 0.18328570 0.09164285
> postscript(file="/var/www/html/rcomp/tmp/1vyyk1258980468.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/2it2t1258980468.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/32qgc1258980468.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/4au3e1258980468.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/55hpe1258980468.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 
 1035.69173  -810.18560 -1042.47804  -671.63009  -167.47804  -736.18560 
          7           8           9          10          11          12 
 -428.26163  -576.95752  -282.80547   527.57466   282.41095  1132.86710 
         13          14          15          16          17          18 
  961.71505  -679.23830    87.15349   337.22952   -50.55407  -245.26163 
         19          20          21          22          23          24 
  987.58632  1002.89043   324.11850  1426.87876   253.33492   722.41095 
         25          26          27          28          29          30 
  931.41095  -219.16228  -131.61843   172.83772   591.27056  -472.05687 
         31          32          33          34          35          36 
   43.62736   138.32326  -329.76443   636.52801  -250.01583  -272.87544 
         37          38          39          40          41          42 
  758.03687  -273.22059   -35.98085  -711.23225  1066.90814  -142.79942 
         43          44          45          46          47          48 
 -576.10352   -24.33160   444.35264    88.49303   260.72110  -116.68235 
         49          50          51          52          53          54 
  534.63342  -549.16788  -694.62404   -17.40762  -351.49531  -257.19121 
         55          56          57          58          59          60 
  373.74443 -1300.16788  -898.54801  -592.77609  -321.85212  -583.86378 
         61 
 -308.77609 
> postscript(file="/var/www/html/rcomp/tmp/6t8tk1258980468.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          1035.69173          NA
 1          -810.18560  1035.69173
 2         -1042.47804  -810.18560
 3          -671.63009 -1042.47804
 4          -167.47804  -671.63009
 5          -736.18560  -167.47804
 6          -428.26163  -736.18560
 7          -576.95752  -428.26163
 8          -282.80547  -576.95752
 9           527.57466  -282.80547
10           282.41095   527.57466
11          1132.86710   282.41095
12           961.71505  1132.86710
13          -679.23830   961.71505
14            87.15349  -679.23830
15           337.22952    87.15349
16           -50.55407   337.22952
17          -245.26163   -50.55407
18           987.58632  -245.26163
19          1002.89043   987.58632
20           324.11850  1002.89043
21          1426.87876   324.11850
22           253.33492  1426.87876
23           722.41095   253.33492
24           931.41095   722.41095
25          -219.16228   931.41095
26          -131.61843  -219.16228
27           172.83772  -131.61843
28           591.27056   172.83772
29          -472.05687   591.27056
30            43.62736  -472.05687
31           138.32326    43.62736
32          -329.76443   138.32326
33           636.52801  -329.76443
34          -250.01583   636.52801
35          -272.87544  -250.01583
36           758.03687  -272.87544
37          -273.22059   758.03687
38           -35.98085  -273.22059
39          -711.23225   -35.98085
40          1066.90814  -711.23225
41          -142.79942  1066.90814
42          -576.10352  -142.79942
43           -24.33160  -576.10352
44           444.35264   -24.33160
45            88.49303   444.35264
46           260.72110    88.49303
47          -116.68235   260.72110
48           534.63342  -116.68235
49          -549.16788   534.63342
50          -694.62404  -549.16788
51           -17.40762  -694.62404
52          -351.49531   -17.40762
53          -257.19121  -351.49531
54           373.74443  -257.19121
55         -1300.16788   373.74443
56          -898.54801 -1300.16788
57          -592.77609  -898.54801
58          -321.85212  -592.77609
59          -583.86378  -321.85212
60          -308.77609  -583.86378
61                  NA  -308.77609
> dum1 <- dum[2:length(myerror),]
> dum1
      lag(myerror, k = 1)     myerror
 [1,]          -810.18560  1035.69173
 [2,]         -1042.47804  -810.18560
 [3,]          -671.63009 -1042.47804
 [4,]          -167.47804  -671.63009
 [5,]          -736.18560  -167.47804
 [6,]          -428.26163  -736.18560
 [7,]          -576.95752  -428.26163
 [8,]          -282.80547  -576.95752
 [9,]           527.57466  -282.80547
[10,]           282.41095   527.57466
[11,]          1132.86710   282.41095
[12,]           961.71505  1132.86710
[13,]          -679.23830   961.71505
[14,]            87.15349  -679.23830
[15,]           337.22952    87.15349
[16,]           -50.55407   337.22952
[17,]          -245.26163   -50.55407
[18,]           987.58632  -245.26163
[19,]          1002.89043   987.58632
[20,]           324.11850  1002.89043
[21,]          1426.87876   324.11850
[22,]           253.33492  1426.87876
[23,]           722.41095   253.33492
[24,]           931.41095   722.41095
[25,]          -219.16228   931.41095
[26,]          -131.61843  -219.16228
[27,]           172.83772  -131.61843
[28,]           591.27056   172.83772
[29,]          -472.05687   591.27056
[30,]            43.62736  -472.05687
[31,]           138.32326    43.62736
[32,]          -329.76443   138.32326
[33,]           636.52801  -329.76443
[34,]          -250.01583   636.52801
[35,]          -272.87544  -250.01583
[36,]           758.03687  -272.87544
[37,]          -273.22059   758.03687
[38,]           -35.98085  -273.22059
[39,]          -711.23225   -35.98085
[40,]          1066.90814  -711.23225
[41,]          -142.79942  1066.90814
[42,]          -576.10352  -142.79942
[43,]           -24.33160  -576.10352
[44,]           444.35264   -24.33160
[45,]            88.49303   444.35264
[46,]           260.72110    88.49303
[47,]          -116.68235   260.72110
[48,]           534.63342  -116.68235
[49,]          -549.16788   534.63342
[50,]          -694.62404  -549.16788
[51,]           -17.40762  -694.62404
[52,]          -351.49531   -17.40762
[53,]          -257.19121  -351.49531
[54,]           373.74443  -257.19121
[55,]         -1300.16788   373.74443
[56,]          -898.54801 -1300.16788
[57,]          -592.77609  -898.54801
[58,]          -321.85212  -592.77609
[59,]          -583.86378  -321.85212
[60,]          -308.77609  -583.86378
> z <- as.data.frame(dum1)
> z
   lag(myerror, k = 1)     myerror
1           -810.18560  1035.69173
2          -1042.47804  -810.18560
3           -671.63009 -1042.47804
4           -167.47804  -671.63009
5           -736.18560  -167.47804
6           -428.26163  -736.18560
7           -576.95752  -428.26163
8           -282.80547  -576.95752
9            527.57466  -282.80547
10           282.41095   527.57466
11          1132.86710   282.41095
12           961.71505  1132.86710
13          -679.23830   961.71505
14            87.15349  -679.23830
15           337.22952    87.15349
16           -50.55407   337.22952
17          -245.26163   -50.55407
18           987.58632  -245.26163
19          1002.89043   987.58632
20           324.11850  1002.89043
21          1426.87876   324.11850
22           253.33492  1426.87876
23           722.41095   253.33492
24           931.41095   722.41095
25          -219.16228   931.41095
26          -131.61843  -219.16228
27           172.83772  -131.61843
28           591.27056   172.83772
29          -472.05687   591.27056
30            43.62736  -472.05687
31           138.32326    43.62736
32          -329.76443   138.32326
33           636.52801  -329.76443
34          -250.01583   636.52801
35          -272.87544  -250.01583
36           758.03687  -272.87544
37          -273.22059   758.03687
38           -35.98085  -273.22059
39          -711.23225   -35.98085
40          1066.90814  -711.23225
41          -142.79942  1066.90814
42          -576.10352  -142.79942
43           -24.33160  -576.10352
44           444.35264   -24.33160
45            88.49303   444.35264
46           260.72110    88.49303
47          -116.68235   260.72110
48           534.63342  -116.68235
49          -549.16788   534.63342
50          -694.62404  -549.16788
51           -17.40762  -694.62404
52          -351.49531   -17.40762
53          -257.19121  -351.49531
54           373.74443  -257.19121
55         -1300.16788   373.74443
56          -898.54801 -1300.16788
57          -592.77609  -898.54801
58          -321.85212  -592.77609
59          -583.86378  -321.85212
60          -308.77609  -583.86378
> 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/7uz3l1258980468.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/8822k1258980468.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/96z8d1258980468.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/10gvzj1258980468.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/116p9l1258980468.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/12v0s31258980468.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/1308db1258980469.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/14issf1258980469.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/151bzy1258980469.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/16fvhc1258980469.tab") 
+ }
> 
> system("convert tmp/1vyyk1258980468.ps tmp/1vyyk1258980468.png")
> system("convert tmp/2it2t1258980468.ps tmp/2it2t1258980468.png")
> system("convert tmp/32qgc1258980468.ps tmp/32qgc1258980468.png")
> system("convert tmp/4au3e1258980468.ps tmp/4au3e1258980468.png")
> system("convert tmp/55hpe1258980468.ps tmp/55hpe1258980468.png")
> system("convert tmp/6t8tk1258980468.ps tmp/6t8tk1258980468.png")
> system("convert tmp/7uz3l1258980468.ps tmp/7uz3l1258980468.png")
> system("convert tmp/8822k1258980468.ps tmp/8822k1258980468.png")
> system("convert tmp/96z8d1258980468.ps tmp/96z8d1258980468.png")
> system("convert tmp/10gvzj1258980468.ps tmp/10gvzj1258980468.png")
> 
> 
> proc.time()
   user  system elapsed 
  2.485   1.565   3.018