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(564,-0.9,581,-1,597,-0.7,587,-1.7,536,-1,524,-0.2,537,0.7,536,0.6,533,1.9,528,2.1,516,2.7,502,3.2,506,4.8,518,5.5,534,5.4,528,5.9,478,5.8,469,5.1,490,4.1,493,4.4,508,3.6,517,3.5,514,3.1,510,2.9,527,2.2,542,1.4,565,1.2,555,1.3,499,1.3,511,1.3,526,1.8,532,1.8,549,1.8,561,1.7,557,2.1,566,2,588,1.7,620,1.9,626,2.3,620,2.4,573,2.5,573,2.8,574,2.6,580,2.2,590,2.8,593,2.8,597,2.8,595,2.3,612,2.2,628,3,629,2.9,621,2.7,569,2.7,567,2.3,573,2.4,584,2.8,589,2.3,591,2,595,1.9,594,2.3),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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
Y X
1 564 -0.9
2 581 -1.0
3 597 -0.7
4 587 -1.7
5 536 -1.0
6 524 -0.2
7 537 0.7
8 536 0.6
9 533 1.9
10 528 2.1
11 516 2.7
12 502 3.2
13 506 4.8
14 518 5.5
15 534 5.4
16 528 5.9
17 478 5.8
18 469 5.1
19 490 4.1
20 493 4.4
21 508 3.6
22 517 3.5
23 514 3.1
24 510 2.9
25 527 2.2
26 542 1.4
27 565 1.2
28 555 1.3
29 499 1.3
30 511 1.3
31 526 1.8
32 532 1.8
33 549 1.8
34 561 1.7
35 557 2.1
36 566 2.0
37 588 1.7
38 620 1.9
39 626 2.3
40 620 2.4
41 573 2.5
42 573 2.8
43 574 2.6
44 580 2.2
45 590 2.8
46 593 2.8
47 597 2.8
48 595 2.3
49 612 2.2
50 628 3.0
51 629 2.9
52 621 2.7
53 569 2.7
54 567 2.3
55 573 2.4
56 584 2.8
57 589 2.3
58 591 2.0
59 595 1.9
60 594 2.3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
575.794 -8.465
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-65.7902 -33.2912 -0.8276 31.9637 77.7531
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 575.794 8.948 64.349 <2e-16 ***
X -8.465 3.200 -2.645 0.0105 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 39.25 on 58 degrees of freedom
Multiple R-squared: 0.1077, Adjusted R-squared: 0.09229
F-statistic: 6.998 on 1 and 58 DF, p-value: 0.01048
> 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.293053412 0.5861068233 0.7069465884
[2,] 0.252197272 0.5043945435 0.7478027282
[3,] 0.162096251 0.3241925023 0.8379037488
[4,] 0.093340285 0.1866805694 0.9066597153
[5,] 0.063156579 0.1263131586 0.9368434207
[6,] 0.035102274 0.0702045476 0.9648977262
[7,] 0.018264565 0.0365291293 0.9817354353
[8,] 0.009705509 0.0194110177 0.9902944911
[9,] 0.006345055 0.0126901105 0.9936549448
[10,] 0.006334048 0.0126680956 0.9936659522
[11,] 0.007699856 0.0153997123 0.9923001438
[12,] 0.005990041 0.0119800827 0.9940099587
[13,] 0.005676151 0.0113523011 0.9943238495
[14,] 0.010341237 0.0206824746 0.9896587627
[15,] 0.011244483 0.0224889659 0.9887555171
[16,] 0.013520512 0.0270410243 0.9864794878
[17,] 0.015917785 0.0318355691 0.9840822154
[18,] 0.022002440 0.0440048792 0.9779975604
[19,] 0.041307470 0.0826149404 0.9586925298
[20,] 0.121017165 0.2420343309 0.8789828346
[21,] 0.141610461 0.2832209228 0.8583895386
[22,] 0.104043902 0.2080878039 0.8959560980
[23,] 0.117117462 0.2342349242 0.8828825379
[24,] 0.099264499 0.1985289981 0.9007355009
[25,] 0.189250618 0.3785012366 0.8107493817
[26,] 0.239099404 0.4781988086 0.7609005957
[27,] 0.293165220 0.5863304397 0.7068347801
[28,] 0.361045980 0.7220919607 0.6389540197
[29,] 0.393637161 0.7872743228 0.6063628386
[30,] 0.419687112 0.8393742243 0.5803128879
[31,] 0.504404939 0.9911901213 0.4955950607
[32,] 0.577405784 0.8451884311 0.4225942156
[33,] 0.656313337 0.6873733253 0.3436866627
[34,] 0.887687100 0.2246258007 0.1123129003
[35,] 0.977911847 0.0441763051 0.0220881526
[36,] 0.993308488 0.0133830240 0.0066915120
[37,] 0.992394456 0.0152110881 0.0076055440
[38,] 0.993342514 0.0133149727 0.0066574863
[39,] 0.993267315 0.0134653703 0.0067326851
[40,] 0.989707975 0.0205840498 0.0102920249
[41,] 0.986633902 0.0267321967 0.0133660984
[42,] 0.981714087 0.0365718252 0.0182859126
[43,] 0.973761949 0.0524761025 0.0262380512
[44,] 0.958347456 0.0833050886 0.0416525443
[45,] 0.960041374 0.0799172522 0.0399586261
[46,] 0.963061294 0.0738774114 0.0369387057
[47,] 0.983440896 0.0331182079 0.0165591040
[48,] 0.998753717 0.0024925659 0.0012462829
[49,] 0.996003912 0.0079921769 0.0039960884
[50,] 0.997362700 0.0052745997 0.0026372998
[51,] 0.999532882 0.0009342356 0.0004671178
> postscript(file="/var/www/html/rcomp/tmp/1qsji1260825622.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/2gh5b1260825622.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/3ic6o1260825622.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/45fqj1260825622.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/5wvs41260825622.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
-19.4123471 -3.2588062 15.2805711 -3.1840198 -48.2588062 -53.4871335
7 8 9 10 11 12
-32.8690017 -34.7154608 -26.7114926 -30.0185745 -36.9398199 -46.7075245
13 14 15 16 17 18
-29.1641791 -11.2389655 3.9145754 2.1468709 -48.6995882 -63.6248018
19 20 21 22 23 24
-51.0893927 -45.5500155 -37.3216882 -29.1681472 -35.5539836 -41.2469018
25 26 27 28 29 30
-30.1721154 -21.9437881 -0.6367062 -9.7902472 -65.7902472 -53.7902472
31 32 33 34 35 36
-34.5579517 -28.5579517 -11.5579517 -0.4044108 -1.0185745 7.1349665
37 38 39 40 41 42
26.5955892 60.2885074 69.6743437 64.5208028 18.3672619 20.9066391
43 44 45 46 47 48
20.2137210 22.8278846 37.9066391 40.9066391 44.9066391 38.6743437
49 50 51 52 53 54
54.8278846 77.5995573 77.7530982 68.0601801 16.0601801 10.6743437
55 56 57 58 59 60
17.5208028 31.9066391 32.6743437 32.1349665 35.2885074 37.6743437
> postscript(file="/var/www/html/rcomp/tmp/6nzra1260825622.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 -19.4123471 NA
1 -3.2588062 -19.4123471
2 15.2805711 -3.2588062
3 -3.1840198 15.2805711
4 -48.2588062 -3.1840198
5 -53.4871335 -48.2588062
6 -32.8690017 -53.4871335
7 -34.7154608 -32.8690017
8 -26.7114926 -34.7154608
9 -30.0185745 -26.7114926
10 -36.9398199 -30.0185745
11 -46.7075245 -36.9398199
12 -29.1641791 -46.7075245
13 -11.2389655 -29.1641791
14 3.9145754 -11.2389655
15 2.1468709 3.9145754
16 -48.6995882 2.1468709
17 -63.6248018 -48.6995882
18 -51.0893927 -63.6248018
19 -45.5500155 -51.0893927
20 -37.3216882 -45.5500155
21 -29.1681472 -37.3216882
22 -35.5539836 -29.1681472
23 -41.2469018 -35.5539836
24 -30.1721154 -41.2469018
25 -21.9437881 -30.1721154
26 -0.6367062 -21.9437881
27 -9.7902472 -0.6367062
28 -65.7902472 -9.7902472
29 -53.7902472 -65.7902472
30 -34.5579517 -53.7902472
31 -28.5579517 -34.5579517
32 -11.5579517 -28.5579517
33 -0.4044108 -11.5579517
34 -1.0185745 -0.4044108
35 7.1349665 -1.0185745
36 26.5955892 7.1349665
37 60.2885074 26.5955892
38 69.6743437 60.2885074
39 64.5208028 69.6743437
40 18.3672619 64.5208028
41 20.9066391 18.3672619
42 20.2137210 20.9066391
43 22.8278846 20.2137210
44 37.9066391 22.8278846
45 40.9066391 37.9066391
46 44.9066391 40.9066391
47 38.6743437 44.9066391
48 54.8278846 38.6743437
49 77.5995573 54.8278846
50 77.7530982 77.5995573
51 68.0601801 77.7530982
52 16.0601801 68.0601801
53 10.6743437 16.0601801
54 17.5208028 10.6743437
55 31.9066391 17.5208028
56 32.6743437 31.9066391
57 32.1349665 32.6743437
58 35.2885074 32.1349665
59 37.6743437 35.2885074
60 NA 37.6743437
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -3.2588062 -19.4123471
[2,] 15.2805711 -3.2588062
[3,] -3.1840198 15.2805711
[4,] -48.2588062 -3.1840198
[5,] -53.4871335 -48.2588062
[6,] -32.8690017 -53.4871335
[7,] -34.7154608 -32.8690017
[8,] -26.7114926 -34.7154608
[9,] -30.0185745 -26.7114926
[10,] -36.9398199 -30.0185745
[11,] -46.7075245 -36.9398199
[12,] -29.1641791 -46.7075245
[13,] -11.2389655 -29.1641791
[14,] 3.9145754 -11.2389655
[15,] 2.1468709 3.9145754
[16,] -48.6995882 2.1468709
[17,] -63.6248018 -48.6995882
[18,] -51.0893927 -63.6248018
[19,] -45.5500155 -51.0893927
[20,] -37.3216882 -45.5500155
[21,] -29.1681472 -37.3216882
[22,] -35.5539836 -29.1681472
[23,] -41.2469018 -35.5539836
[24,] -30.1721154 -41.2469018
[25,] -21.9437881 -30.1721154
[26,] -0.6367062 -21.9437881
[27,] -9.7902472 -0.6367062
[28,] -65.7902472 -9.7902472
[29,] -53.7902472 -65.7902472
[30,] -34.5579517 -53.7902472
[31,] -28.5579517 -34.5579517
[32,] -11.5579517 -28.5579517
[33,] -0.4044108 -11.5579517
[34,] -1.0185745 -0.4044108
[35,] 7.1349665 -1.0185745
[36,] 26.5955892 7.1349665
[37,] 60.2885074 26.5955892
[38,] 69.6743437 60.2885074
[39,] 64.5208028 69.6743437
[40,] 18.3672619 64.5208028
[41,] 20.9066391 18.3672619
[42,] 20.2137210 20.9066391
[43,] 22.8278846 20.2137210
[44,] 37.9066391 22.8278846
[45,] 40.9066391 37.9066391
[46,] 44.9066391 40.9066391
[47,] 38.6743437 44.9066391
[48,] 54.8278846 38.6743437
[49,] 77.5995573 54.8278846
[50,] 77.7530982 77.5995573
[51,] 68.0601801 77.7530982
[52,] 16.0601801 68.0601801
[53,] 10.6743437 16.0601801
[54,] 17.5208028 10.6743437
[55,] 31.9066391 17.5208028
[56,] 32.6743437 31.9066391
[57,] 32.1349665 32.6743437
[58,] 35.2885074 32.1349665
[59,] 37.6743437 35.2885074
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -3.2588062 -19.4123471
2 15.2805711 -3.2588062
3 -3.1840198 15.2805711
4 -48.2588062 -3.1840198
5 -53.4871335 -48.2588062
6 -32.8690017 -53.4871335
7 -34.7154608 -32.8690017
8 -26.7114926 -34.7154608
9 -30.0185745 -26.7114926
10 -36.9398199 -30.0185745
11 -46.7075245 -36.9398199
12 -29.1641791 -46.7075245
13 -11.2389655 -29.1641791
14 3.9145754 -11.2389655
15 2.1468709 3.9145754
16 -48.6995882 2.1468709
17 -63.6248018 -48.6995882
18 -51.0893927 -63.6248018
19 -45.5500155 -51.0893927
20 -37.3216882 -45.5500155
21 -29.1681472 -37.3216882
22 -35.5539836 -29.1681472
23 -41.2469018 -35.5539836
24 -30.1721154 -41.2469018
25 -21.9437881 -30.1721154
26 -0.6367062 -21.9437881
27 -9.7902472 -0.6367062
28 -65.7902472 -9.7902472
29 -53.7902472 -65.7902472
30 -34.5579517 -53.7902472
31 -28.5579517 -34.5579517
32 -11.5579517 -28.5579517
33 -0.4044108 -11.5579517
34 -1.0185745 -0.4044108
35 7.1349665 -1.0185745
36 26.5955892 7.1349665
37 60.2885074 26.5955892
38 69.6743437 60.2885074
39 64.5208028 69.6743437
40 18.3672619 64.5208028
41 20.9066391 18.3672619
42 20.2137210 20.9066391
43 22.8278846 20.2137210
44 37.9066391 22.8278846
45 40.9066391 37.9066391
46 44.9066391 40.9066391
47 38.6743437 44.9066391
48 54.8278846 38.6743437
49 77.5995573 54.8278846
50 77.7530982 77.5995573
51 68.0601801 77.7530982
52 16.0601801 68.0601801
53 10.6743437 16.0601801
54 17.5208028 10.6743437
55 31.9066391 17.5208028
56 32.6743437 31.9066391
57 32.1349665 32.6743437
58 35.2885074 32.1349665
59 37.6743437 35.2885074
> 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/7uil71260825622.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/8kich1260825622.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/9p3u21260825622.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/10ktii1260825622.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/11n6fv1260825622.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/12cnn81260825622.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/13flx51260825622.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/144e3e1260825622.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/15e5ku1260825622.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/16pina1260825622.tab")
+ }
>
> try(system("convert tmp/1qsji1260825622.ps tmp/1qsji1260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/2gh5b1260825622.ps tmp/2gh5b1260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ic6o1260825622.ps tmp/3ic6o1260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/45fqj1260825622.ps tmp/45fqj1260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wvs41260825622.ps tmp/5wvs41260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/6nzra1260825622.ps tmp/6nzra1260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/7uil71260825622.ps tmp/7uil71260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/8kich1260825622.ps tmp/8kich1260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/9p3u21260825622.ps tmp/9p3u21260825622.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ktii1260825622.ps tmp/10ktii1260825622.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.552 1.615 7.431