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(22.680,1,22.052,1,21.467,1,21.383,1,21.777,1,21.928,1,21.814,1,22.937,1,23.595,1,20.830,1,19.650,1,19.195,1,19.644,0,18.483,0,18.079,0,19.178,0,18.391,0,18.441,0,18.584,0,20.108,0,20.148,0,19.394,0,17.745,0,17.696,0,17.032,0,16.438,0,15.683,0,15.594,0,15.713,0,15.937,0,16.171,0,15.928,0,16.348,0,15.579,0,15.305,0,15.648,0,14.954,0,15.137,0,15.839,0,16.050,0,15.168,0,17.064,0,16.005,0,14.886,0,14.931,0,14.544,0,13.812,0),dim=c(2,47),dimnames=list(c('gk','cr'),1:47)) > y <- array(NA,dim=c(2,47),dimnames=list(c('gk','cr'),1:47)) > 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 gk cr M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 22.680 1 1 0 0 0 0 0 0 0 0 0 0 2 22.052 1 0 1 0 0 0 0 0 0 0 0 0 3 21.467 1 0 0 1 0 0 0 0 0 0 0 0 4 21.383 1 0 0 0 1 0 0 0 0 0 0 0 5 21.777 1 0 0 0 0 1 0 0 0 0 0 0 6 21.928 1 0 0 0 0 0 1 0 0 0 0 0 7 21.814 1 0 0 0 0 0 0 1 0 0 0 0 8 22.937 1 0 0 0 0 0 0 0 1 0 0 0 9 23.595 1 0 0 0 0 0 0 0 0 1 0 0 10 20.830 1 0 0 0 0 0 0 0 0 0 1 0 11 19.650 1 0 0 0 0 0 0 0 0 0 0 1 12 19.195 1 0 0 0 0 0 0 0 0 0 0 0 13 19.644 0 1 0 0 0 0 0 0 0 0 0 0 14 18.483 0 0 1 0 0 0 0 0 0 0 0 0 15 18.079 0 0 0 1 0 0 0 0 0 0 0 0 16 19.178 0 0 0 0 1 0 0 0 0 0 0 0 17 18.391 0 0 0 0 0 1 0 0 0 0 0 0 18 18.441 0 0 0 0 0 0 1 0 0 0 0 0 19 18.584 0 0 0 0 0 0 0 1 0 0 0 0 20 20.108 0 0 0 0 0 0 0 0 1 0 0 0 21 20.148 0 0 0 0 0 0 0 0 0 1 0 0 22 19.394 0 0 0 0 0 0 0 0 0 0 1 0 23 17.745 0 0 0 0 0 0 0 0 0 0 0 1 24 17.696 0 0 0 0 0 0 0 0 0 0 0 0 25 17.032 0 1 0 0 0 0 0 0 0 0 0 0 26 16.438 0 0 1 0 0 0 0 0 0 0 0 0 27 15.683 0 0 0 1 0 0 0 0 0 0 0 0 28 15.594 0 0 0 0 1 0 0 0 0 0 0 0 29 15.713 0 0 0 0 0 1 0 0 0 0 0 0 30 15.937 0 0 0 0 0 0 1 0 0 0 0 0 31 16.171 0 0 0 0 0 0 0 1 0 0 0 0 32 15.928 0 0 0 0 0 0 0 0 1 0 0 0 33 16.348 0 0 0 0 0 0 0 0 0 1 0 0 34 15.579 0 0 0 0 0 0 0 0 0 0 1 0 35 15.305 0 0 0 0 0 0 0 0 0 0 0 1 36 15.648 0 0 0 0 0 0 0 0 0 0 0 0 37 14.954 0 1 0 0 0 0 0 0 0 0 0 0 38 15.137 0 0 1 0 0 0 0 0 0 0 0 0 39 15.839 0 0 0 1 0 0 0 0 0 0 0 0 40 16.050 0 0 0 0 1 0 0 0 0 0 0 0 41 15.168 0 0 0 0 0 1 0 0 0 0 0 0 42 17.064 0 0 0 0 0 0 1 0 0 0 0 0 43 16.005 0 0 0 0 0 0 0 1 0 0 0 0 44 14.886 0 0 0 0 0 0 0 0 1 0 0 0 45 14.931 0 0 0 0 0 0 0 0 0 1 0 0 46 14.544 0 0 0 0 0 0 0 0 0 0 1 0 47 13.812 0 0 0 0 0 0 0 0 0 0 0 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) cr M1 M2 M3 M4 15.8798 4.8996 1.4728 0.9228 0.6623 0.9466 M5 M6 M7 M8 M9 M10 0.6576 1.2378 1.0388 1.3601 1.6508 0.4821 M11 -0.4767 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.5996 -1.0471 -0.3206 1.2441 3.0322 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 15.8798 1.0187 15.588 < 2e-16 *** cr 4.8996 0.5801 8.446 7.31e-10 *** M1 1.4728 1.3240 1.112 0.274 M2 0.9228 1.3240 0.697 0.491 M3 0.6623 1.3240 0.500 0.620 M4 0.9466 1.3240 0.715 0.480 M5 0.6576 1.3240 0.497 0.623 M6 1.2378 1.3240 0.935 0.356 M7 1.0388 1.3240 0.785 0.438 M8 1.3601 1.3240 1.027 0.312 M9 1.6508 1.3240 1.247 0.221 M10 0.4821 1.3240 0.364 0.718 M11 -0.4767 1.3240 -0.360 0.721 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.732 on 34 degrees of freedom Multiple R-squared: 0.6913, Adjusted R-squared: 0.5823 F-statistic: 6.344 on 12 and 34 DF, p-value: 9.944e-06 > 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,] 1.420061e-02 0.0284012153 0.9857994 [2,] 3.318590e-03 0.0066371794 0.9966814 [3,] 7.380975e-04 0.0014761950 0.9992619 [4,] 1.399912e-04 0.0002799824 0.9998600 [5,] 7.322077e-05 0.0001464415 0.9999268 [6,] 6.321768e-05 0.0001264354 0.9999368 [7,] 6.941342e-03 0.0138826830 0.9930587 [8,] 4.054691e-02 0.0810938225 0.9594531 [9,] 1.060714e-01 0.2121428157 0.8939286 [10,] 6.355343e-01 0.7289313368 0.3644657 [11,] 7.963184e-01 0.4073632248 0.2036816 [12,] 8.176558e-01 0.3646883197 0.1823442 [13,] 8.385264e-01 0.3229471174 0.1614736 [14,] 8.061797e-01 0.3876405833 0.1938203 [15,] 7.814511e-01 0.4370978391 0.2185489 [16,] 6.518236e-01 0.6963527547 0.3481764 > postscript(file="/var/www/html/rcomp/tmp/1p2601258788504.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/2tw451258788504.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/33l0v1258788504.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/4axu51258788504.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/5b0ng1258788504.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 = 47 Frequency = 1 1 2 3 4 5 6 0.427766355 0.349766355 0.025266355 -0.342983645 0.340016355 -0.089233645 7 8 9 10 11 12 -0.004233645 0.797516355 1.164766355 -0.431483645 -0.652733645 -1.584429907 13 14 15 16 17 18 2.291411215 1.680411215 1.536911215 2.351661215 1.853661215 1.323411215 19 20 21 22 23 24 1.665411215 2.868161215 2.617411215 3.032161215 2.341911215 1.816214953 25 26 27 28 29 30 -0.320588785 -0.364588785 -0.859088785 -1.232338785 -0.824338785 -1.180588785 31 32 33 34 35 36 -0.747588785 -1.311838785 -1.182588785 -0.782838785 -0.098088785 -0.231785047 37 38 39 40 41 42 -2.398588785 -1.665588785 -0.703088785 -0.776338785 -1.369338785 -0.053588785 43 44 45 46 47 -0.913588785 -2.353838785 -2.599588785 -1.817838785 -1.591088785 > postscript(file="/var/www/html/rcomp/tmp/6ar161258788504.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 = 47 Frequency = 1 lag(myerror, k = 1) myerror 0 0.427766355 NA 1 0.349766355 0.427766355 2 0.025266355 0.349766355 3 -0.342983645 0.025266355 4 0.340016355 -0.342983645 5 -0.089233645 0.340016355 6 -0.004233645 -0.089233645 7 0.797516355 -0.004233645 8 1.164766355 0.797516355 9 -0.431483645 1.164766355 10 -0.652733645 -0.431483645 11 -1.584429907 -0.652733645 12 2.291411215 -1.584429907 13 1.680411215 2.291411215 14 1.536911215 1.680411215 15 2.351661215 1.536911215 16 1.853661215 2.351661215 17 1.323411215 1.853661215 18 1.665411215 1.323411215 19 2.868161215 1.665411215 20 2.617411215 2.868161215 21 3.032161215 2.617411215 22 2.341911215 3.032161215 23 1.816214953 2.341911215 24 -0.320588785 1.816214953 25 -0.364588785 -0.320588785 26 -0.859088785 -0.364588785 27 -1.232338785 -0.859088785 28 -0.824338785 -1.232338785 29 -1.180588785 -0.824338785 30 -0.747588785 -1.180588785 31 -1.311838785 -0.747588785 32 -1.182588785 -1.311838785 33 -0.782838785 -1.182588785 34 -0.098088785 -0.782838785 35 -0.231785047 -0.098088785 36 -2.398588785 -0.231785047 37 -1.665588785 -2.398588785 38 -0.703088785 -1.665588785 39 -0.776338785 -0.703088785 40 -1.369338785 -0.776338785 41 -0.053588785 -1.369338785 42 -0.913588785 -0.053588785 43 -2.353838785 -0.913588785 44 -2.599588785 -2.353838785 45 -1.817838785 -2.599588785 46 -1.591088785 -1.817838785 47 NA -1.591088785 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.349766355 0.427766355 [2,] 0.025266355 0.349766355 [3,] -0.342983645 0.025266355 [4,] 0.340016355 -0.342983645 [5,] -0.089233645 0.340016355 [6,] -0.004233645 -0.089233645 [7,] 0.797516355 -0.004233645 [8,] 1.164766355 0.797516355 [9,] -0.431483645 1.164766355 [10,] -0.652733645 -0.431483645 [11,] -1.584429907 -0.652733645 [12,] 2.291411215 -1.584429907 [13,] 1.680411215 2.291411215 [14,] 1.536911215 1.680411215 [15,] 2.351661215 1.536911215 [16,] 1.853661215 2.351661215 [17,] 1.323411215 1.853661215 [18,] 1.665411215 1.323411215 [19,] 2.868161215 1.665411215 [20,] 2.617411215 2.868161215 [21,] 3.032161215 2.617411215 [22,] 2.341911215 3.032161215 [23,] 1.816214953 2.341911215 [24,] -0.320588785 1.816214953 [25,] -0.364588785 -0.320588785 [26,] -0.859088785 -0.364588785 [27,] -1.232338785 -0.859088785 [28,] -0.824338785 -1.232338785 [29,] -1.180588785 -0.824338785 [30,] -0.747588785 -1.180588785 [31,] -1.311838785 -0.747588785 [32,] -1.182588785 -1.311838785 [33,] -0.782838785 -1.182588785 [34,] -0.098088785 -0.782838785 [35,] -0.231785047 -0.098088785 [36,] -2.398588785 -0.231785047 [37,] -1.665588785 -2.398588785 [38,] -0.703088785 -1.665588785 [39,] -0.776338785 -0.703088785 [40,] -1.369338785 -0.776338785 [41,] -0.053588785 -1.369338785 [42,] -0.913588785 -0.053588785 [43,] -2.353838785 -0.913588785 [44,] -2.599588785 -2.353838785 [45,] -1.817838785 -2.599588785 [46,] -1.591088785 -1.817838785 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.349766355 0.427766355 2 0.025266355 0.349766355 3 -0.342983645 0.025266355 4 0.340016355 -0.342983645 5 -0.089233645 0.340016355 6 -0.004233645 -0.089233645 7 0.797516355 -0.004233645 8 1.164766355 0.797516355 9 -0.431483645 1.164766355 10 -0.652733645 -0.431483645 11 -1.584429907 -0.652733645 12 2.291411215 -1.584429907 13 1.680411215 2.291411215 14 1.536911215 1.680411215 15 2.351661215 1.536911215 16 1.853661215 2.351661215 17 1.323411215 1.853661215 18 1.665411215 1.323411215 19 2.868161215 1.665411215 20 2.617411215 2.868161215 21 3.032161215 2.617411215 22 2.341911215 3.032161215 23 1.816214953 2.341911215 24 -0.320588785 1.816214953 25 -0.364588785 -0.320588785 26 -0.859088785 -0.364588785 27 -1.232338785 -0.859088785 28 -0.824338785 -1.232338785 29 -1.180588785 -0.824338785 30 -0.747588785 -1.180588785 31 -1.311838785 -0.747588785 32 -1.182588785 -1.311838785 33 -0.782838785 -1.182588785 34 -0.098088785 -0.782838785 35 -0.231785047 -0.098088785 36 -2.398588785 -0.231785047 37 -1.665588785 -2.398588785 38 -0.703088785 -1.665588785 39 -0.776338785 -0.703088785 40 -1.369338785 -0.776338785 41 -0.053588785 -1.369338785 42 -0.913588785 -0.053588785 43 -2.353838785 -0.913588785 44 -2.599588785 -2.353838785 45 -1.817838785 -2.599588785 46 -1.591088785 -1.817838785 > 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/7f0be1258788504.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/84dsu1258788504.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/9odh71258788504.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/10k9031258788504.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/11fgt31258788504.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/12zvhr1258788504.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/13xcaf1258788504.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/140v7w1258788504.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/15phqb1258788504.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/1638s91258788504.tab") + } > > system("convert tmp/1p2601258788504.ps tmp/1p2601258788504.png") > system("convert tmp/2tw451258788504.ps tmp/2tw451258788504.png") > system("convert tmp/33l0v1258788504.ps tmp/33l0v1258788504.png") > system("convert tmp/4axu51258788504.ps tmp/4axu51258788504.png") > system("convert tmp/5b0ng1258788504.ps tmp/5b0ng1258788504.png") > system("convert tmp/6ar161258788504.ps tmp/6ar161258788504.png") > system("convert tmp/7f0be1258788504.ps tmp/7f0be1258788504.png") > system("convert tmp/84dsu1258788504.ps tmp/84dsu1258788504.png") > system("convert tmp/9odh71258788504.ps tmp/9odh71258788504.png") > system("convert tmp/10k9031258788504.ps tmp/10k9031258788504.png") > > > proc.time() user system elapsed 2.241 1.528 3.366