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(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,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),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 = 'Include Monthly 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 611 0 1 0 0 0 0 0 0 0 0 0 0 2 594 0 0 1 0 0 0 0 0 0 0 0 0 3 595 0 0 0 1 0 0 0 0 0 0 0 0 4 591 0 0 0 0 1 0 0 0 0 0 0 0 5 589 0 0 0 0 0 1 0 0 0 0 0 0 6 584 0 0 0 0 0 0 1 0 0 0 0 0 7 573 0 0 0 0 0 0 0 1 0 0 0 0 8 567 0 0 0 0 0 0 0 0 1 0 0 0 9 569 0 0 0 0 0 0 0 0 0 1 0 0 10 621 0 0 0 0 0 0 0 0 0 0 1 0 11 629 0 0 0 0 0 0 0 0 0 0 0 1 12 628 0 0 0 0 0 0 0 0 0 0 0 0 13 612 0 1 0 0 0 0 0 0 0 0 0 0 14 595 0 0 1 0 0 0 0 0 0 0 0 0 15 597 0 0 0 1 0 0 0 0 0 0 0 0 16 593 0 0 0 0 1 0 0 0 0 0 0 0 17 590 0 0 0 0 0 1 0 0 0 0 0 0 18 580 0 0 0 0 0 0 1 0 0 0 0 0 19 574 0 0 0 0 0 0 0 1 0 0 0 0 20 573 0 0 0 0 0 0 0 0 1 0 0 0 21 573 0 0 0 0 0 0 0 0 0 1 0 0 22 620 0 0 0 0 0 0 0 0 0 0 1 0 23 626 0 0 0 0 0 0 0 0 0 0 0 1 24 620 0 0 0 0 0 0 0 0 0 0 0 0 25 588 0 1 0 0 0 0 0 0 0 0 0 0 26 566 0 0 1 0 0 0 0 0 0 0 0 0 27 557 0 0 0 1 0 0 0 0 0 0 0 0 28 561 0 0 0 0 1 0 0 0 0 0 0 0 29 549 0 0 0 0 0 1 0 0 0 0 0 0 30 532 0 0 0 0 0 0 1 0 0 0 0 0 31 526 0 0 0 0 0 0 0 1 0 0 0 0 32 511 0 0 0 0 0 0 0 0 1 0 0 0 33 499 0 0 0 0 0 0 0 0 0 1 0 0 34 555 0 0 0 0 0 0 0 0 0 0 1 0 35 565 0 0 0 0 0 0 0 0 0 0 0 1 36 542 0 0 0 0 0 0 0 0 0 0 0 0 37 527 0 1 0 0 0 0 0 0 0 0 0 0 38 510 0 0 1 0 0 0 0 0 0 0 0 0 39 514 0 0 0 1 0 0 0 0 0 0 0 0 40 517 0 0 0 0 1 0 0 0 0 0 0 0 41 508 0 0 0 0 0 1 0 0 0 0 0 0 42 493 0 0 0 0 0 0 1 0 0 0 0 0 43 490 0 0 0 0 0 0 0 1 0 0 0 0 44 469 0 0 0 0 0 0 0 0 1 0 0 0 45 478 0 0 0 0 0 0 0 0 0 1 0 0 46 528 0 0 0 0 0 0 0 0 0 0 1 0 47 534 0 0 0 0 0 0 0 0 0 0 0 1 48 518 1 0 0 0 0 0 0 0 0 0 0 0 49 506 1 1 0 0 0 0 0 0 0 0 0 0 50 502 1 0 1 0 0 0 0 0 0 0 0 0 51 516 1 0 0 1 0 0 0 0 0 0 0 0 52 528 1 0 0 0 1 0 0 0 0 0 0 0 53 533 1 0 0 0 0 1 0 0 0 0 0 0 54 536 1 0 0 0 0 0 1 0 0 0 0 0 55 537 1 0 0 0 0 0 0 1 0 0 0 0 56 524 1 0 0 0 0 0 0 0 1 0 0 0 57 536 1 0 0 0 0 0 0 0 0 1 0 0 58 587 1 0 0 0 0 0 0 0 0 0 1 0 59 597 1 0 0 0 0 0 0 0 0 0 0 1 60 581 1 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 588.264 -26.160 -14.232 -29.632 -27.232 -25.032 M5 M6 M7 M8 M9 M10 -29.232 -38.032 -43.032 -54.232 -52.032 -0.832 M11 7.168 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -65.03 -33.63 15.05 31.94 39.74 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 588.264 18.562 31.691 <2e-16 *** X -26.160 12.630 -2.071 0.0439 * M1 -14.232 25.386 -0.561 0.5777 M2 -29.632 25.386 -1.167 0.2490 M3 -27.232 25.386 -1.073 0.2889 M4 -25.032 25.386 -0.986 0.3292 M5 -29.232 25.386 -1.151 0.2554 M6 -38.032 25.386 -1.498 0.1408 M7 -43.032 25.386 -1.695 0.0967 . M8 -54.232 25.386 -2.136 0.0379 * M9 -52.032 25.386 -2.050 0.0460 * M10 -0.832 25.386 -0.033 0.9740 M11 7.168 25.386 0.282 0.7789 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 39.94 on 47 degrees of freedom Multiple R-squared: 0.2722, Adjusted R-squared: 0.08635 F-statistic: 1.465 on 12 and 47 DF, p-value: 0.1718 > 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,] 5.494704e-05 1.098941e-04 0.99994505 [2,] 2.005061e-06 4.010122e-06 0.99999799 [3,] 5.684170e-07 1.136834e-06 0.99999943 [4,] 2.852951e-08 5.705902e-08 0.99999997 [5,] 2.681812e-08 5.363625e-08 0.99999997 [6,] 5.392190e-09 1.078438e-08 0.99999999 [7,] 5.369499e-10 1.073900e-09 1.00000000 [8,] 9.135240e-11 1.827048e-10 1.00000000 [9,] 3.209229e-10 6.418458e-10 1.00000000 [10,] 2.670199e-06 5.340398e-06 0.99999733 [11,] 1.955284e-04 3.910568e-04 0.99980447 [12,] 6.275775e-03 1.255155e-02 0.99372422 [13,] 2.244810e-02 4.489620e-02 0.97755190 [14,] 8.194733e-02 1.638947e-01 0.91805267 [15,] 2.190423e-01 4.380846e-01 0.78095771 [16,] 3.371617e-01 6.743234e-01 0.66283830 [17,] 5.224011e-01 9.551978e-01 0.47759891 [18,] 6.709844e-01 6.580312e-01 0.32901562 [19,] 7.264356e-01 5.471288e-01 0.27356441 [20,] 7.464335e-01 5.071331e-01 0.25356653 [21,] 8.098948e-01 3.802103e-01 0.19010517 [22,] 9.072019e-01 1.855963e-01 0.09279813 [23,] 9.460982e-01 1.078037e-01 0.05390184 [24,] 9.612638e-01 7.747240e-02 0.03873620 [25,] 9.665245e-01 6.695103e-02 0.03347552 [26,] 9.593651e-01 8.126988e-02 0.04063494 [27,] 9.296281e-01 1.407439e-01 0.07037193 [28,] 8.706093e-01 2.587813e-01 0.12939066 [29,] 7.660566e-01 4.678869e-01 0.23394344 > postscript(file="/var/www/html/rcomp/tmp/1s6ns1258656953.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/29hl71258656953.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/31m8m1258656953.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/48fkw1258656953.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/506hi1258656953.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 7 8 9 10 36.968 35.368 33.968 27.768 29.968 33.768 27.768 32.968 32.768 33.568 11 12 13 14 15 16 17 18 19 20 33.568 39.736 37.968 36.368 35.968 29.768 30.968 29.768 28.768 38.968 21 22 23 24 25 26 27 28 29 30 36.768 32.568 30.568 31.736 13.968 7.368 -4.032 -2.232 -10.032 -18.232 31 32 33 34 35 36 37 38 39 40 -19.232 -23.032 -37.232 -32.432 -30.432 -46.264 -47.032 -48.632 -47.032 -46.232 41 42 43 44 45 46 47 48 49 50 -51.032 -57.232 -55.232 -65.032 -58.232 -59.432 -61.432 -44.104 -41.872 -30.472 51 52 53 54 55 56 57 58 59 60 -18.872 -9.072 0.128 11.928 17.928 16.128 25.928 25.728 27.728 18.896 > postscript(file="/var/www/html/rcomp/tmp/6n5tx1258656953.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 36.968 NA 1 35.368 36.968 2 33.968 35.368 3 27.768 33.968 4 29.968 27.768 5 33.768 29.968 6 27.768 33.768 7 32.968 27.768 8 32.768 32.968 9 33.568 32.768 10 33.568 33.568 11 39.736 33.568 12 37.968 39.736 13 36.368 37.968 14 35.968 36.368 15 29.768 35.968 16 30.968 29.768 17 29.768 30.968 18 28.768 29.768 19 38.968 28.768 20 36.768 38.968 21 32.568 36.768 22 30.568 32.568 23 31.736 30.568 24 13.968 31.736 25 7.368 13.968 26 -4.032 7.368 27 -2.232 -4.032 28 -10.032 -2.232 29 -18.232 -10.032 30 -19.232 -18.232 31 -23.032 -19.232 32 -37.232 -23.032 33 -32.432 -37.232 34 -30.432 -32.432 35 -46.264 -30.432 36 -47.032 -46.264 37 -48.632 -47.032 38 -47.032 -48.632 39 -46.232 -47.032 40 -51.032 -46.232 41 -57.232 -51.032 42 -55.232 -57.232 43 -65.032 -55.232 44 -58.232 -65.032 45 -59.432 -58.232 46 -61.432 -59.432 47 -44.104 -61.432 48 -41.872 -44.104 49 -30.472 -41.872 50 -18.872 -30.472 51 -9.072 -18.872 52 0.128 -9.072 53 11.928 0.128 54 17.928 11.928 55 16.128 17.928 56 25.928 16.128 57 25.728 25.928 58 27.728 25.728 59 18.896 27.728 60 NA 18.896 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 35.368 36.968 [2,] 33.968 35.368 [3,] 27.768 33.968 [4,] 29.968 27.768 [5,] 33.768 29.968 [6,] 27.768 33.768 [7,] 32.968 27.768 [8,] 32.768 32.968 [9,] 33.568 32.768 [10,] 33.568 33.568 [11,] 39.736 33.568 [12,] 37.968 39.736 [13,] 36.368 37.968 [14,] 35.968 36.368 [15,] 29.768 35.968 [16,] 30.968 29.768 [17,] 29.768 30.968 [18,] 28.768 29.768 [19,] 38.968 28.768 [20,] 36.768 38.968 [21,] 32.568 36.768 [22,] 30.568 32.568 [23,] 31.736 30.568 [24,] 13.968 31.736 [25,] 7.368 13.968 [26,] -4.032 7.368 [27,] -2.232 -4.032 [28,] -10.032 -2.232 [29,] -18.232 -10.032 [30,] -19.232 -18.232 [31,] -23.032 -19.232 [32,] -37.232 -23.032 [33,] -32.432 -37.232 [34,] -30.432 -32.432 [35,] -46.264 -30.432 [36,] -47.032 -46.264 [37,] -48.632 -47.032 [38,] -47.032 -48.632 [39,] -46.232 -47.032 [40,] -51.032 -46.232 [41,] -57.232 -51.032 [42,] -55.232 -57.232 [43,] -65.032 -55.232 [44,] -58.232 -65.032 [45,] -59.432 -58.232 [46,] -61.432 -59.432 [47,] -44.104 -61.432 [48,] -41.872 -44.104 [49,] -30.472 -41.872 [50,] -18.872 -30.472 [51,] -9.072 -18.872 [52,] 0.128 -9.072 [53,] 11.928 0.128 [54,] 17.928 11.928 [55,] 16.128 17.928 [56,] 25.928 16.128 [57,] 25.728 25.928 [58,] 27.728 25.728 [59,] 18.896 27.728 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 35.368 36.968 2 33.968 35.368 3 27.768 33.968 4 29.968 27.768 5 33.768 29.968 6 27.768 33.768 7 32.968 27.768 8 32.768 32.968 9 33.568 32.768 10 33.568 33.568 11 39.736 33.568 12 37.968 39.736 13 36.368 37.968 14 35.968 36.368 15 29.768 35.968 16 30.968 29.768 17 29.768 30.968 18 28.768 29.768 19 38.968 28.768 20 36.768 38.968 21 32.568 36.768 22 30.568 32.568 23 31.736 30.568 24 13.968 31.736 25 7.368 13.968 26 -4.032 7.368 27 -2.232 -4.032 28 -10.032 -2.232 29 -18.232 -10.032 30 -19.232 -18.232 31 -23.032 -19.232 32 -37.232 -23.032 33 -32.432 -37.232 34 -30.432 -32.432 35 -46.264 -30.432 36 -47.032 -46.264 37 -48.632 -47.032 38 -47.032 -48.632 39 -46.232 -47.032 40 -51.032 -46.232 41 -57.232 -51.032 42 -55.232 -57.232 43 -65.032 -55.232 44 -58.232 -65.032 45 -59.432 -58.232 46 -61.432 -59.432 47 -44.104 -61.432 48 -41.872 -44.104 49 -30.472 -41.872 50 -18.872 -30.472 51 -9.072 -18.872 52 0.128 -9.072 53 11.928 0.128 54 17.928 11.928 55 16.128 17.928 56 25.928 16.128 57 25.728 25.928 58 27.728 25.728 59 18.896 27.728 > 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/7c78d1258656953.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/80bjb1258656953.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/91y531258656953.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/10371k1258656953.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/111den1258656953.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/129pmv1258656953.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/13aiiz1258656953.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/14vnuu1258656953.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/155zms1258656953.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/16b9v11258656953.tab") + } > system("convert tmp/1s6ns1258656953.ps tmp/1s6ns1258656953.png") > system("convert tmp/29hl71258656953.ps tmp/29hl71258656953.png") > system("convert tmp/31m8m1258656953.ps tmp/31m8m1258656953.png") > system("convert tmp/48fkw1258656953.ps tmp/48fkw1258656953.png") > system("convert tmp/506hi1258656953.ps tmp/506hi1258656953.png") > system("convert tmp/6n5tx1258656953.ps tmp/6n5tx1258656953.png") > system("convert tmp/7c78d1258656953.ps tmp/7c78d1258656953.png") > system("convert tmp/80bjb1258656953.ps tmp/80bjb1258656953.png") > system("convert tmp/91y531258656953.ps tmp/91y531258656953.png") > system("convert tmp/10371k1258656953.ps tmp/10371k1258656953.png") > > > proc.time() user system elapsed 2.424 1.562 2.818