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(543,0,594,0,611,0,613,0,611,0,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,1,478,1,528,1,534,1,518,1,506,1,502,1,516,1,528,1,533,1,536,1,537,1,524,1,536,1),dim=c(2,61),dimnames=list(c('Yt','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Yt','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
Yt X
1 543 0
2 594 0
3 611 0
4 613 0
5 611 0
6 594 0
7 595 0
8 591 0
9 589 0
10 584 0
11 573 0
12 567 0
13 569 0
14 621 0
15 629 0
16 628 0
17 612 0
18 595 0
19 597 0
20 593 0
21 590 0
22 580 0
23 574 0
24 573 0
25 573 0
26 620 0
27 626 0
28 620 0
29 588 0
30 566 0
31 557 0
32 561 0
33 549 0
34 532 0
35 526 0
36 511 0
37 499 0
38 555 0
39 565 0
40 542 0
41 527 0
42 510 0
43 514 0
44 517 0
45 508 0
46 493 0
47 490 0
48 469 1
49 478 1
50 528 1
51 534 1
52 518 1
53 506 1
54 502 1
55 516 1
56 528 1
57 533 1
58 536 1
59 537 1
60 524 1
61 536 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
569.68 -52.18
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-79.681 -20.681 4.319 23.319 59.319
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 569.681 5.309 107.308 < 2e-16 ***
X -52.181 11.082 -4.709 1.55e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 36.4 on 59 degrees of freedom
Multiple R-squared: 0.2732, Adjusted R-squared: 0.2608
F-statistic: 22.17 on 1 and 59 DF, p-value: 1.555e-05
> 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.550132966 0.8997340690 0.4498670345
[2,] 0.381458254 0.7629165077 0.6185417462
[3,] 0.246813233 0.4936264665 0.7531867668
[4,] 0.149967196 0.2999343924 0.8500328038
[5,] 0.086586703 0.1731734055 0.9134132973
[6,] 0.049418252 0.0988365034 0.9505817483
[7,] 0.033621866 0.0672437315 0.9663781342
[8,] 0.026009855 0.0520197105 0.9739901447
[9,] 0.017669875 0.0353397504 0.9823301248
[10,] 0.024937061 0.0498741212 0.9750629394
[11,] 0.045581991 0.0911639816 0.9544180092
[12,] 0.069605591 0.1392111830 0.9303944085
[13,] 0.063286164 0.1265723282 0.9367138359
[14,] 0.045555418 0.0911108368 0.9544445816
[15,] 0.033600685 0.0672013701 0.9663993149
[16,] 0.024364860 0.0487297209 0.9756351396
[17,] 0.017678692 0.0353573831 0.9823213084
[18,] 0.013388330 0.0267766595 0.9866116702
[19,] 0.010943900 0.0218877996 0.9890561002
[20,] 0.008975168 0.0179503365 0.9910248317
[21,] 0.007280296 0.0145605920 0.9927197040
[22,] 0.017540400 0.0350807999 0.9824596001
[23,] 0.068999663 0.1379993259 0.9310003371
[24,] 0.224410109 0.4488202176 0.7755898912
[25,] 0.316731088 0.6334621752 0.6832689124
[26,] 0.392848377 0.7856967545 0.6071516228
[27,] 0.480995132 0.9619902636 0.5190048682
[28,] 0.576310545 0.8473789106 0.4236894553
[29,] 0.667362867 0.6652742664 0.3326371332
[30,] 0.763392216 0.4732155690 0.2366077845
[31,] 0.831715936 0.3365681283 0.1682840642
[32,] 0.901591588 0.1968168246 0.0984084123
[33,] 0.955693974 0.0886120528 0.0443060264
[34,] 0.963915076 0.0721698476 0.0360849238
[35,] 0.986095858 0.0278082831 0.0139041416
[36,] 0.990592184 0.0188156321 0.0094078161
[37,] 0.991606577 0.0167868462 0.0083934231
[38,] 0.991433412 0.0171331758 0.0085665879
[39,] 0.990462023 0.0190759534 0.0095379767
[40,] 0.989777981 0.0204440374 0.0102220187
[41,] 0.988354308 0.0232913849 0.0116456925
[42,] 0.986025614 0.0279487721 0.0139743861
[43,] 0.982139072 0.0357218551 0.0178609276
[44,] 0.996160277 0.0076794453 0.0038397226
[45,] 0.999737208 0.0005255838 0.0002627919
[46,] 0.999254497 0.0014910053 0.0007455026
[47,] 0.998269481 0.0034610385 0.0017305193
[48,] 0.995142471 0.0097150586 0.0048575293
[49,] 0.993770813 0.0124583731 0.0062291866
[50,] 0.998354633 0.0032907348 0.0016453674
[51,] 0.998841456 0.0023170886 0.0011585443
[52,] 0.993892675 0.0122146502 0.0061073251
> postscript(file="/var/www/html/rcomp/tmp/15h461258738950.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/2ncnu1258738950.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/3km1s1258738950.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/4r1b31258738950.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/5m8xo1258738950.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 7
-26.680851 24.319149 41.319149 43.319149 41.319149 24.319149 25.319149
8 9 10 11 12 13 14
21.319149 19.319149 14.319149 3.319149 -2.680851 -0.680851 51.319149
15 16 17 18 19 20 21
59.319149 58.319149 42.319149 25.319149 27.319149 23.319149 20.319149
22 23 24 25 26 27 28
10.319149 4.319149 3.319149 3.319149 50.319149 56.319149 50.319149
29 30 31 32 33 34 35
18.319149 -3.680851 -12.680851 -8.680851 -20.680851 -37.680851 -43.680851
36 37 38 39 40 41 42
-58.680851 -70.680851 -14.680851 -4.680851 -27.680851 -42.680851 -59.680851
43 44 45 46 47 48 49
-55.680851 -52.680851 -61.680851 -76.680851 -79.680851 -48.500000 -39.500000
50 51 52 53 54 55 56
10.500000 16.500000 0.500000 -11.500000 -15.500000 -1.500000 10.500000
57 58 59 60 61
15.500000 18.500000 19.500000 6.500000 18.500000
> postscript(file="/var/www/html/rcomp/tmp/6dk9n1258738950.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 -26.680851 NA
1 24.319149 -26.680851
2 41.319149 24.319149
3 43.319149 41.319149
4 41.319149 43.319149
5 24.319149 41.319149
6 25.319149 24.319149
7 21.319149 25.319149
8 19.319149 21.319149
9 14.319149 19.319149
10 3.319149 14.319149
11 -2.680851 3.319149
12 -0.680851 -2.680851
13 51.319149 -0.680851
14 59.319149 51.319149
15 58.319149 59.319149
16 42.319149 58.319149
17 25.319149 42.319149
18 27.319149 25.319149
19 23.319149 27.319149
20 20.319149 23.319149
21 10.319149 20.319149
22 4.319149 10.319149
23 3.319149 4.319149
24 3.319149 3.319149
25 50.319149 3.319149
26 56.319149 50.319149
27 50.319149 56.319149
28 18.319149 50.319149
29 -3.680851 18.319149
30 -12.680851 -3.680851
31 -8.680851 -12.680851
32 -20.680851 -8.680851
33 -37.680851 -20.680851
34 -43.680851 -37.680851
35 -58.680851 -43.680851
36 -70.680851 -58.680851
37 -14.680851 -70.680851
38 -4.680851 -14.680851
39 -27.680851 -4.680851
40 -42.680851 -27.680851
41 -59.680851 -42.680851
42 -55.680851 -59.680851
43 -52.680851 -55.680851
44 -61.680851 -52.680851
45 -76.680851 -61.680851
46 -79.680851 -76.680851
47 -48.500000 -79.680851
48 -39.500000 -48.500000
49 10.500000 -39.500000
50 16.500000 10.500000
51 0.500000 16.500000
52 -11.500000 0.500000
53 -15.500000 -11.500000
54 -1.500000 -15.500000
55 10.500000 -1.500000
56 15.500000 10.500000
57 18.500000 15.500000
58 19.500000 18.500000
59 6.500000 19.500000
60 18.500000 6.500000
61 NA 18.500000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 24.319149 -26.680851
[2,] 41.319149 24.319149
[3,] 43.319149 41.319149
[4,] 41.319149 43.319149
[5,] 24.319149 41.319149
[6,] 25.319149 24.319149
[7,] 21.319149 25.319149
[8,] 19.319149 21.319149
[9,] 14.319149 19.319149
[10,] 3.319149 14.319149
[11,] -2.680851 3.319149
[12,] -0.680851 -2.680851
[13,] 51.319149 -0.680851
[14,] 59.319149 51.319149
[15,] 58.319149 59.319149
[16,] 42.319149 58.319149
[17,] 25.319149 42.319149
[18,] 27.319149 25.319149
[19,] 23.319149 27.319149
[20,] 20.319149 23.319149
[21,] 10.319149 20.319149
[22,] 4.319149 10.319149
[23,] 3.319149 4.319149
[24,] 3.319149 3.319149
[25,] 50.319149 3.319149
[26,] 56.319149 50.319149
[27,] 50.319149 56.319149
[28,] 18.319149 50.319149
[29,] -3.680851 18.319149
[30,] -12.680851 -3.680851
[31,] -8.680851 -12.680851
[32,] -20.680851 -8.680851
[33,] -37.680851 -20.680851
[34,] -43.680851 -37.680851
[35,] -58.680851 -43.680851
[36,] -70.680851 -58.680851
[37,] -14.680851 -70.680851
[38,] -4.680851 -14.680851
[39,] -27.680851 -4.680851
[40,] -42.680851 -27.680851
[41,] -59.680851 -42.680851
[42,] -55.680851 -59.680851
[43,] -52.680851 -55.680851
[44,] -61.680851 -52.680851
[45,] -76.680851 -61.680851
[46,] -79.680851 -76.680851
[47,] -48.500000 -79.680851
[48,] -39.500000 -48.500000
[49,] 10.500000 -39.500000
[50,] 16.500000 10.500000
[51,] 0.500000 16.500000
[52,] -11.500000 0.500000
[53,] -15.500000 -11.500000
[54,] -1.500000 -15.500000
[55,] 10.500000 -1.500000
[56,] 15.500000 10.500000
[57,] 18.500000 15.500000
[58,] 19.500000 18.500000
[59,] 6.500000 19.500000
[60,] 18.500000 6.500000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 24.319149 -26.680851
2 41.319149 24.319149
3 43.319149 41.319149
4 41.319149 43.319149
5 24.319149 41.319149
6 25.319149 24.319149
7 21.319149 25.319149
8 19.319149 21.319149
9 14.319149 19.319149
10 3.319149 14.319149
11 -2.680851 3.319149
12 -0.680851 -2.680851
13 51.319149 -0.680851
14 59.319149 51.319149
15 58.319149 59.319149
16 42.319149 58.319149
17 25.319149 42.319149
18 27.319149 25.319149
19 23.319149 27.319149
20 20.319149 23.319149
21 10.319149 20.319149
22 4.319149 10.319149
23 3.319149 4.319149
24 3.319149 3.319149
25 50.319149 3.319149
26 56.319149 50.319149
27 50.319149 56.319149
28 18.319149 50.319149
29 -3.680851 18.319149
30 -12.680851 -3.680851
31 -8.680851 -12.680851
32 -20.680851 -8.680851
33 -37.680851 -20.680851
34 -43.680851 -37.680851
35 -58.680851 -43.680851
36 -70.680851 -58.680851
37 -14.680851 -70.680851
38 -4.680851 -14.680851
39 -27.680851 -4.680851
40 -42.680851 -27.680851
41 -59.680851 -42.680851
42 -55.680851 -59.680851
43 -52.680851 -55.680851
44 -61.680851 -52.680851
45 -76.680851 -61.680851
46 -79.680851 -76.680851
47 -48.500000 -79.680851
48 -39.500000 -48.500000
49 10.500000 -39.500000
50 16.500000 10.500000
51 0.500000 16.500000
52 -11.500000 0.500000
53 -15.500000 -11.500000
54 -1.500000 -15.500000
55 10.500000 -1.500000
56 15.500000 10.500000
57 18.500000 15.500000
58 19.500000 18.500000
59 6.500000 19.500000
60 18.500000 6.500000
> 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/7aqhk1258738950.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/8q9911258738950.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/9te351258738950.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/109vo11258738950.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/11y1j31258738950.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/12d3z71258738950.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/13y04k1258738950.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/14xbub1258738950.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/15hy5o1258738950.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/16i6kn1258738950.tab")
+ }
>
> system("convert tmp/15h461258738950.ps tmp/15h461258738950.png")
> system("convert tmp/2ncnu1258738950.ps tmp/2ncnu1258738950.png")
> system("convert tmp/3km1s1258738950.ps tmp/3km1s1258738950.png")
> system("convert tmp/4r1b31258738950.ps tmp/4r1b31258738950.png")
> system("convert tmp/5m8xo1258738950.ps tmp/5m8xo1258738950.png")
> system("convert tmp/6dk9n1258738950.ps tmp/6dk9n1258738950.png")
> system("convert tmp/7aqhk1258738950.ps tmp/7aqhk1258738950.png")
> system("convert tmp/8q9911258738950.ps tmp/8q9911258738950.png")
> system("convert tmp/9te351258738950.ps tmp/9te351258738950.png")
> system("convert tmp/109vo11258738950.ps tmp/109vo11258738950.png")
>
>
> proc.time()
user system elapsed
2.489 1.605 2.883