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(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,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,587,1,597,1,581,1,564,1,558,0,575,0,580,0,575,0,563,0,552,0,537,0,545,0,601),dim=c(2,55),dimnames=list(c('X','Y'),1:55)) > y <- array(NA,dim=c(2,55),dimnames=list(c('X','Y'),1:55)) > 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 = '2' > #'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 593 0 1 0 0 0 0 0 0 0 0 0 0 2 590 0 0 1 0 0 0 0 0 0 0 0 0 3 580 0 0 0 1 0 0 0 0 0 0 0 0 4 574 0 0 0 0 1 0 0 0 0 0 0 0 5 573 0 0 0 0 0 1 0 0 0 0 0 0 6 573 0 0 0 0 0 0 1 0 0 0 0 0 7 620 0 0 0 0 0 0 0 1 0 0 0 0 8 626 0 0 0 0 0 0 0 0 1 0 0 0 9 620 0 0 0 0 0 0 0 0 0 1 0 0 10 588 0 0 0 0 0 0 0 0 0 0 1 0 11 566 0 0 0 0 0 0 0 0 0 0 0 1 12 557 0 0 0 0 0 0 0 0 0 0 0 0 13 561 0 1 0 0 0 0 0 0 0 0 0 0 14 549 0 0 1 0 0 0 0 0 0 0 0 0 15 532 0 0 0 1 0 0 0 0 0 0 0 0 16 526 0 0 0 0 1 0 0 0 0 0 0 0 17 511 0 0 0 0 0 1 0 0 0 0 0 0 18 499 0 0 0 0 0 0 1 0 0 0 0 0 19 555 0 0 0 0 0 0 0 1 0 0 0 0 20 565 0 0 0 0 0 0 0 0 1 0 0 0 21 542 0 0 0 0 0 0 0 0 0 1 0 0 22 527 0 0 0 0 0 0 0 0 0 0 1 0 23 510 0 0 0 0 0 0 0 0 0 0 0 1 24 514 0 0 0 0 0 0 0 0 0 0 0 0 25 517 0 1 0 0 0 0 0 0 0 0 0 0 26 508 0 0 1 0 0 0 0 0 0 0 0 0 27 493 0 0 0 1 0 0 0 0 0 0 0 0 28 490 0 0 0 0 1 0 0 0 0 0 0 0 29 469 0 0 0 0 0 1 0 0 0 0 0 0 30 478 0 0 0 0 0 0 1 0 0 0 0 0 31 528 1 0 0 0 0 0 0 1 0 0 0 0 32 534 1 0 0 0 0 0 0 0 1 0 0 0 33 518 1 0 0 0 0 0 0 0 0 1 0 0 34 506 1 0 0 0 0 0 0 0 0 0 1 0 35 502 1 0 0 0 0 0 0 0 0 0 0 1 36 516 1 0 0 0 0 0 0 0 0 0 0 0 37 528 1 1 0 0 0 0 0 0 0 0 0 0 38 533 1 0 1 0 0 0 0 0 0 0 0 0 39 536 1 0 0 1 0 0 0 0 0 0 0 0 40 537 1 0 0 0 1 0 0 0 0 0 0 0 41 524 1 0 0 0 0 1 0 0 0 0 0 0 42 536 1 0 0 0 0 0 1 0 0 0 0 0 43 587 1 0 0 0 0 0 0 1 0 0 0 0 44 597 1 0 0 0 0 0 0 0 1 0 0 0 45 581 1 0 0 0 0 0 0 0 0 1 0 0 46 564 1 0 0 0 0 0 0 0 0 0 1 0 47 558 1 0 0 0 0 0 0 0 0 0 0 1 48 575 0 0 0 0 0 0 0 0 0 0 0 0 49 580 0 1 0 0 0 0 0 0 0 0 0 0 50 575 0 0 1 0 0 0 0 0 0 0 0 0 51 563 0 0 0 1 0 0 0 0 0 0 0 0 52 552 0 0 0 0 1 0 0 0 0 0 0 0 53 537 0 0 0 0 0 1 0 0 0 0 0 0 54 545 0 0 0 0 0 0 1 0 0 0 0 0 55 601 0 0 0 0 0 0 0 1 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 545.065 -18.260 14.387 9.587 -0.613 -5.613 M5 M6 M7 M8 M9 M10 -18.613 -15.213 40.439 44.565 29.315 10.315 M11 -1.935 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -57.45 -30.68 10.55 25.26 46.55 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 545.065 17.614 30.946 <2e-16 *** X -18.261 10.621 -1.719 0.0929 . M1 14.387 23.367 0.616 0.5414 M2 9.587 23.367 0.410 0.6837 M3 -0.613 23.367 -0.026 0.9792 M4 -5.613 23.367 -0.240 0.8113 M5 -18.613 23.367 -0.797 0.4302 M6 -15.213 23.367 -0.651 0.5186 M7 40.439 23.415 1.727 0.0915 . M8 44.565 24.767 1.799 0.0792 . M9 29.315 24.767 1.184 0.2432 M10 10.315 24.767 0.416 0.6792 M11 -1.935 24.767 -0.078 0.9381 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 34.82 on 42 degrees of freedom Multiple R-squared: 0.2966, Adjusted R-squared: 0.09562 F-statistic: 1.476 on 12 and 42 DF, p-value: 0.1719 > 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.6475006 0.7049988398 0.3524994199 [2,] 0.6847461 0.6305078654 0.3152539327 [3,] 0.7565723 0.4868554155 0.2434277078 [4,] 0.7646850 0.4706299459 0.2353149730 [5,] 0.7496127 0.5007745276 0.2503872638 [6,] 0.7741599 0.4516801265 0.2258400633 [7,] 0.7475352 0.5049295672 0.2524647836 [8,] 0.7130557 0.5738885282 0.2869442641 [9,] 0.6643369 0.6713261119 0.3356630560 [10,] 0.6708519 0.6582962938 0.3291481469 [11,] 0.6940225 0.6119549962 0.3059774981 [12,] 0.7448019 0.5103961441 0.2551980720 [13,] 0.7901738 0.4196524476 0.2098262238 [14,] 0.8741610 0.2516779467 0.1258389734 [15,] 0.9392794 0.1214411018 0.0607205509 [16,] 0.9404119 0.1191761541 0.0595880771 [17,] 0.9528818 0.0942364151 0.0471182075 [18,] 0.9703103 0.0593793713 0.0296896856 [19,] 0.9844868 0.0310264541 0.0155132271 [20,] 0.9963191 0.0073618352 0.0036809176 [21,] 0.9970967 0.0058065570 0.0029032785 [22,] 0.9982700 0.0034600558 0.0017300279 [23,] 0.9995018 0.0009963821 0.0004981910 [24,] 0.9998396 0.0003208633 0.0001604316 > postscript(file="/var/www/html/rcomp/tmp/1gz581291031089.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/2q8nb1291031089.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/3q8nb1291031089.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/4q8nb1291031089.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/5jhmw1291031089.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 = 55 Frequency = 1 1 2 3 4 5 6 7 33.547907 35.347907 35.547907 34.547907 46.547907 43.147907 34.495814 8 9 10 11 12 13 14 36.369767 45.619767 32.619767 22.869767 11.934884 1.547907 -5.652093 15 16 17 18 19 20 21 -12.452093 -13.452093 -15.452093 -30.852093 -30.504186 -24.630233 -32.380233 22 23 24 25 26 27 28 -28.380233 -33.130233 -31.065116 -42.452093 -46.652093 -51.452093 -49.452093 29 30 31 32 33 34 35 -57.452093 -51.852093 -39.243721 -37.369767 -38.119767 -31.119767 -22.869767 36 37 38 39 40 41 42 -10.804651 -13.191628 -3.391628 9.808372 15.808372 15.808372 24.408372 43 44 45 46 47 48 49 19.756279 25.630233 24.880233 26.880233 33.130233 29.934884 20.547907 50 51 52 53 54 55 20.347907 18.547907 12.547907 10.547907 15.147907 15.495814 > postscript(file="/var/www/html/rcomp/tmp/6jhmw1291031089.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 = 55 Frequency = 1 lag(myerror, k = 1) myerror 0 33.547907 NA 1 35.347907 33.547907 2 35.547907 35.347907 3 34.547907 35.547907 4 46.547907 34.547907 5 43.147907 46.547907 6 34.495814 43.147907 7 36.369767 34.495814 8 45.619767 36.369767 9 32.619767 45.619767 10 22.869767 32.619767 11 11.934884 22.869767 12 1.547907 11.934884 13 -5.652093 1.547907 14 -12.452093 -5.652093 15 -13.452093 -12.452093 16 -15.452093 -13.452093 17 -30.852093 -15.452093 18 -30.504186 -30.852093 19 -24.630233 -30.504186 20 -32.380233 -24.630233 21 -28.380233 -32.380233 22 -33.130233 -28.380233 23 -31.065116 -33.130233 24 -42.452093 -31.065116 25 -46.652093 -42.452093 26 -51.452093 -46.652093 27 -49.452093 -51.452093 28 -57.452093 -49.452093 29 -51.852093 -57.452093 30 -39.243721 -51.852093 31 -37.369767 -39.243721 32 -38.119767 -37.369767 33 -31.119767 -38.119767 34 -22.869767 -31.119767 35 -10.804651 -22.869767 36 -13.191628 -10.804651 37 -3.391628 -13.191628 38 9.808372 -3.391628 39 15.808372 9.808372 40 15.808372 15.808372 41 24.408372 15.808372 42 19.756279 24.408372 43 25.630233 19.756279 44 24.880233 25.630233 45 26.880233 24.880233 46 33.130233 26.880233 47 29.934884 33.130233 48 20.547907 29.934884 49 20.347907 20.547907 50 18.547907 20.347907 51 12.547907 18.547907 52 10.547907 12.547907 53 15.147907 10.547907 54 15.495814 15.147907 55 NA 15.495814 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 35.347907 33.547907 [2,] 35.547907 35.347907 [3,] 34.547907 35.547907 [4,] 46.547907 34.547907 [5,] 43.147907 46.547907 [6,] 34.495814 43.147907 [7,] 36.369767 34.495814 [8,] 45.619767 36.369767 [9,] 32.619767 45.619767 [10,] 22.869767 32.619767 [11,] 11.934884 22.869767 [12,] 1.547907 11.934884 [13,] -5.652093 1.547907 [14,] -12.452093 -5.652093 [15,] -13.452093 -12.452093 [16,] -15.452093 -13.452093 [17,] -30.852093 -15.452093 [18,] -30.504186 -30.852093 [19,] -24.630233 -30.504186 [20,] -32.380233 -24.630233 [21,] -28.380233 -32.380233 [22,] -33.130233 -28.380233 [23,] -31.065116 -33.130233 [24,] -42.452093 -31.065116 [25,] -46.652093 -42.452093 [26,] -51.452093 -46.652093 [27,] -49.452093 -51.452093 [28,] -57.452093 -49.452093 [29,] -51.852093 -57.452093 [30,] -39.243721 -51.852093 [31,] -37.369767 -39.243721 [32,] -38.119767 -37.369767 [33,] -31.119767 -38.119767 [34,] -22.869767 -31.119767 [35,] -10.804651 -22.869767 [36,] -13.191628 -10.804651 [37,] -3.391628 -13.191628 [38,] 9.808372 -3.391628 [39,] 15.808372 9.808372 [40,] 15.808372 15.808372 [41,] 24.408372 15.808372 [42,] 19.756279 24.408372 [43,] 25.630233 19.756279 [44,] 24.880233 25.630233 [45,] 26.880233 24.880233 [46,] 33.130233 26.880233 [47,] 29.934884 33.130233 [48,] 20.547907 29.934884 [49,] 20.347907 20.547907 [50,] 18.547907 20.347907 [51,] 12.547907 18.547907 [52,] 10.547907 12.547907 [53,] 15.147907 10.547907 [54,] 15.495814 15.147907 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 35.347907 33.547907 2 35.547907 35.347907 3 34.547907 35.547907 4 46.547907 34.547907 5 43.147907 46.547907 6 34.495814 43.147907 7 36.369767 34.495814 8 45.619767 36.369767 9 32.619767 45.619767 10 22.869767 32.619767 11 11.934884 22.869767 12 1.547907 11.934884 13 -5.652093 1.547907 14 -12.452093 -5.652093 15 -13.452093 -12.452093 16 -15.452093 -13.452093 17 -30.852093 -15.452093 18 -30.504186 -30.852093 19 -24.630233 -30.504186 20 -32.380233 -24.630233 21 -28.380233 -32.380233 22 -33.130233 -28.380233 23 -31.065116 -33.130233 24 -42.452093 -31.065116 25 -46.652093 -42.452093 26 -51.452093 -46.652093 27 -49.452093 -51.452093 28 -57.452093 -49.452093 29 -51.852093 -57.452093 30 -39.243721 -51.852093 31 -37.369767 -39.243721 32 -38.119767 -37.369767 33 -31.119767 -38.119767 34 -22.869767 -31.119767 35 -10.804651 -22.869767 36 -13.191628 -10.804651 37 -3.391628 -13.191628 38 9.808372 -3.391628 39 15.808372 9.808372 40 15.808372 15.808372 41 24.408372 15.808372 42 19.756279 24.408372 43 25.630233 19.756279 44 24.880233 25.630233 45 26.880233 24.880233 46 33.130233 26.880233 47 29.934884 33.130233 48 20.547907 29.934884 49 20.347907 20.547907 50 18.547907 20.347907 51 12.547907 18.547907 52 10.547907 12.547907 53 15.147907 10.547907 54 15.495814 15.147907 > 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/7u9lh1291031089.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/8u9lh1291031089.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/9u9lh1291031089.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/104ik21291031089.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/11801q1291031089.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/12t1iw1291031089.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/130kfp1291031089.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/14bbea1291031089.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/15euug1291031089.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/16a3s71291031089.tab") + } > try(system("convert tmp/1gz581291031089.ps tmp/1gz581291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/2q8nb1291031089.ps tmp/2q8nb1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/3q8nb1291031089.ps tmp/3q8nb1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/4q8nb1291031089.ps tmp/4q8nb1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/5jhmw1291031089.ps tmp/5jhmw1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/6jhmw1291031089.ps tmp/6jhmw1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/7u9lh1291031089.ps tmp/7u9lh1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/8u9lh1291031089.ps tmp/8u9lh1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/9u9lh1291031089.ps tmp/9u9lh1291031089.png",intern=TRUE)) character(0) > try(system("convert tmp/104ik21291031089.ps tmp/104ik21291031089.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.310 1.516 5.455