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(8,0,8.1,0,7.7,0,7.5,0,7.6,0,7.8,0,7.8,0,7.8,0,7.5,0,7.5,0,7.1,0,7.5,0,7.5,0,7.6,0,7.7,0,7.7,0,7.9,0,8.1,0,8.2,0,8.2,0,8.2,0,7.9,0,7.3,0,6.9,0,6.6,0,6.7,0,6.9,0,7,0,7.1,0,7.2,0,7.1,0,6.9,0,7,0,6.8,0,6.4,0,6.7,0,6.6,0,6.4,0,6.3,0,6.2,0,6.5,0,6.8,1,6.8,1,6.4,1,6.1,1,5.8,1,6.1,1,7.2,1,7.3,1,6.9,1,6.1,1,5.8,1,6.2,1,7.1,1,7.7,1,7.9,1,7.7,1,7.4,1,7.5,1,8,1,8.1,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','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 Y X 1 8.0 0 2 8.1 0 3 7.7 0 4 7.5 0 5 7.6 0 6 7.8 0 7 7.8 0 8 7.8 0 9 7.5 0 10 7.5 0 11 7.1 0 12 7.5 0 13 7.5 0 14 7.6 0 15 7.7 0 16 7.7 0 17 7.9 0 18 8.1 0 19 8.2 0 20 8.2 0 21 8.2 0 22 7.9 0 23 7.3 0 24 6.9 0 25 6.6 0 26 6.7 0 27 6.9 0 28 7.0 0 29 7.1 0 30 7.2 0 31 7.1 0 32 6.9 0 33 7.0 0 34 6.8 0 35 6.4 0 36 6.7 0 37 6.6 0 38 6.4 0 39 6.3 0 40 6.2 0 41 6.5 0 42 6.8 1 43 6.8 1 44 6.4 1 45 6.1 1 46 5.8 1 47 6.1 1 48 7.2 1 49 7.3 1 50 6.9 1 51 6.1 1 52 5.8 1 53 6.2 1 54 7.1 1 55 7.7 1 56 7.9 1 57 7.7 1 58 7.4 1 59 7.5 1 60 8.0 1 61 8.1 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 7.3049 -0.3599 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.1450 -0.5450 0.1550 0.4951 1.1550 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.3049 0.1009 72.396 <2e-16 *** X -0.3599 0.1762 -2.042 0.0456 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6461 on 59 degrees of freedom Multiple R-squared: 0.06602, Adjusted R-squared: 0.05019 F-statistic: 4.171 on 1 and 59 DF, p-value: 0.04561 > 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.103023e-01 2.206045e-01 0.88969773 [2,] 4.067792e-02 8.135584e-02 0.95932208 [3,] 1.376282e-02 2.752563e-02 0.98623718 [4,] 4.339764e-03 8.679528e-03 0.99566024 [5,] 2.678576e-03 5.357152e-03 0.99732142 [6,] 1.428889e-03 2.857778e-03 0.99857111 [7,] 5.325053e-03 1.065011e-02 0.99467495 [8,] 2.439586e-03 4.879172e-03 0.99756041 [9,] 1.070129e-03 2.140258e-03 0.99892987 [10,] 4.117614e-04 8.235229e-04 0.99958824 [11,] 1.591844e-04 3.183688e-04 0.99984082 [12,] 6.029702e-05 1.205940e-04 0.99993970 [13,] 3.813288e-05 7.626577e-05 0.99996187 [14,] 6.571238e-05 1.314248e-04 0.99993429 [15,] 1.778078e-04 3.556156e-04 0.99982219 [16,] 4.196872e-04 8.393744e-04 0.99958031 [17,] 9.950125e-04 1.990025e-03 0.99900499 [18,] 9.450056e-04 1.890011e-03 0.99905499 [19,] 1.190692e-03 2.381384e-03 0.99880931 [20,] 4.858506e-03 9.717012e-03 0.99514149 [21,] 2.707697e-02 5.415394e-02 0.97292303 [22,] 5.357501e-02 1.071500e-01 0.94642499 [23,] 6.113946e-02 1.222789e-01 0.93886054 [24,] 5.935735e-02 1.187147e-01 0.94064265 [25,] 5.275536e-02 1.055107e-01 0.94724464 [26,] 4.547989e-02 9.095977e-02 0.95452011 [27,] 4.066860e-02 8.133720e-02 0.95933140 [28,] 4.032605e-02 8.065209e-02 0.95967395 [29,] 3.738452e-02 7.476903e-02 0.96261548 [30,] 3.853904e-02 7.707808e-02 0.96146096 [31,] 5.747965e-02 1.149593e-01 0.94252035 [32,] 5.670603e-02 1.134121e-01 0.94329397 [33,] 5.789744e-02 1.157949e-01 0.94210256 [34,] 6.583039e-02 1.316608e-01 0.93416961 [35,] 7.573682e-02 1.514736e-01 0.92426318 [36,] 8.899844e-02 1.779969e-01 0.91100156 [37,] 7.826484e-02 1.565297e-01 0.92173516 [38,] 5.349422e-02 1.069884e-01 0.94650578 [39,] 3.527602e-02 7.055204e-02 0.96472398 [40,] 2.784235e-02 5.568471e-02 0.97215765 [41,] 3.111138e-02 6.222276e-02 0.96888862 [42,] 6.228617e-02 1.245723e-01 0.93771383 [43,] 8.481042e-02 1.696208e-01 0.91518958 [44,] 6.707008e-02 1.341402e-01 0.93292992 [45,] 5.109074e-02 1.021815e-01 0.94890926 [46,] 3.393659e-02 6.787319e-02 0.96606341 [47,] 6.276074e-02 1.255215e-01 0.93723926 [48,] 3.421558e-01 6.843115e-01 0.65784425 [49,] 8.799235e-01 2.401531e-01 0.12007653 [50,] 9.423715e-01 1.152569e-01 0.05762846 [51,] 8.880376e-01 2.239248e-01 0.11196241 [52,] 8.007276e-01 3.985449e-01 0.19927244 > postscript(file="/var/www/html/rcomp/tmp/1y3xk1258894959.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/2p8ka1258894959.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/3ireq1258894959.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/4xfef1258894959.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/574m51258894959.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 0.695121951 0.795121951 0.395121951 0.195121951 0.295121951 0.495121951 7 8 9 10 11 12 0.495121951 0.495121951 0.195121951 0.195121951 -0.204878049 0.195121951 13 14 15 16 17 18 0.195121951 0.295121951 0.395121951 0.395121951 0.595121951 0.795121951 19 20 21 22 23 24 0.895121951 0.895121951 0.895121951 0.595121951 -0.004878049 -0.404878049 25 26 27 28 29 30 -0.704878049 -0.604878049 -0.404878049 -0.304878049 -0.204878049 -0.104878049 31 32 33 34 35 36 -0.204878049 -0.404878049 -0.304878049 -0.504878049 -0.904878049 -0.604878049 37 38 39 40 41 42 -0.704878049 -0.904878049 -1.004878049 -1.104878049 -0.804878049 -0.145000000 43 44 45 46 47 48 -0.145000000 -0.545000000 -0.845000000 -1.145000000 -0.845000000 0.255000000 49 50 51 52 53 54 0.355000000 -0.045000000 -0.845000000 -1.145000000 -0.745000000 0.155000000 55 56 57 58 59 60 0.755000000 0.955000000 0.755000000 0.455000000 0.555000000 1.055000000 61 1.155000000 > postscript(file="/var/www/html/rcomp/tmp/6f2fw1258894959.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 0.695121951 NA 1 0.795121951 0.695121951 2 0.395121951 0.795121951 3 0.195121951 0.395121951 4 0.295121951 0.195121951 5 0.495121951 0.295121951 6 0.495121951 0.495121951 7 0.495121951 0.495121951 8 0.195121951 0.495121951 9 0.195121951 0.195121951 10 -0.204878049 0.195121951 11 0.195121951 -0.204878049 12 0.195121951 0.195121951 13 0.295121951 0.195121951 14 0.395121951 0.295121951 15 0.395121951 0.395121951 16 0.595121951 0.395121951 17 0.795121951 0.595121951 18 0.895121951 0.795121951 19 0.895121951 0.895121951 20 0.895121951 0.895121951 21 0.595121951 0.895121951 22 -0.004878049 0.595121951 23 -0.404878049 -0.004878049 24 -0.704878049 -0.404878049 25 -0.604878049 -0.704878049 26 -0.404878049 -0.604878049 27 -0.304878049 -0.404878049 28 -0.204878049 -0.304878049 29 -0.104878049 -0.204878049 30 -0.204878049 -0.104878049 31 -0.404878049 -0.204878049 32 -0.304878049 -0.404878049 33 -0.504878049 -0.304878049 34 -0.904878049 -0.504878049 35 -0.604878049 -0.904878049 36 -0.704878049 -0.604878049 37 -0.904878049 -0.704878049 38 -1.004878049 -0.904878049 39 -1.104878049 -1.004878049 40 -0.804878049 -1.104878049 41 -0.145000000 -0.804878049 42 -0.145000000 -0.145000000 43 -0.545000000 -0.145000000 44 -0.845000000 -0.545000000 45 -1.145000000 -0.845000000 46 -0.845000000 -1.145000000 47 0.255000000 -0.845000000 48 0.355000000 0.255000000 49 -0.045000000 0.355000000 50 -0.845000000 -0.045000000 51 -1.145000000 -0.845000000 52 -0.745000000 -1.145000000 53 0.155000000 -0.745000000 54 0.755000000 0.155000000 55 0.955000000 0.755000000 56 0.755000000 0.955000000 57 0.455000000 0.755000000 58 0.555000000 0.455000000 59 1.055000000 0.555000000 60 1.155000000 1.055000000 61 NA 1.155000000 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.795121951 0.695121951 [2,] 0.395121951 0.795121951 [3,] 0.195121951 0.395121951 [4,] 0.295121951 0.195121951 [5,] 0.495121951 0.295121951 [6,] 0.495121951 0.495121951 [7,] 0.495121951 0.495121951 [8,] 0.195121951 0.495121951 [9,] 0.195121951 0.195121951 [10,] -0.204878049 0.195121951 [11,] 0.195121951 -0.204878049 [12,] 0.195121951 0.195121951 [13,] 0.295121951 0.195121951 [14,] 0.395121951 0.295121951 [15,] 0.395121951 0.395121951 [16,] 0.595121951 0.395121951 [17,] 0.795121951 0.595121951 [18,] 0.895121951 0.795121951 [19,] 0.895121951 0.895121951 [20,] 0.895121951 0.895121951 [21,] 0.595121951 0.895121951 [22,] -0.004878049 0.595121951 [23,] -0.404878049 -0.004878049 [24,] -0.704878049 -0.404878049 [25,] -0.604878049 -0.704878049 [26,] -0.404878049 -0.604878049 [27,] -0.304878049 -0.404878049 [28,] -0.204878049 -0.304878049 [29,] -0.104878049 -0.204878049 [30,] -0.204878049 -0.104878049 [31,] -0.404878049 -0.204878049 [32,] -0.304878049 -0.404878049 [33,] -0.504878049 -0.304878049 [34,] -0.904878049 -0.504878049 [35,] -0.604878049 -0.904878049 [36,] -0.704878049 -0.604878049 [37,] -0.904878049 -0.704878049 [38,] -1.004878049 -0.904878049 [39,] -1.104878049 -1.004878049 [40,] -0.804878049 -1.104878049 [41,] -0.145000000 -0.804878049 [42,] -0.145000000 -0.145000000 [43,] -0.545000000 -0.145000000 [44,] -0.845000000 -0.545000000 [45,] -1.145000000 -0.845000000 [46,] -0.845000000 -1.145000000 [47,] 0.255000000 -0.845000000 [48,] 0.355000000 0.255000000 [49,] -0.045000000 0.355000000 [50,] -0.845000000 -0.045000000 [51,] -1.145000000 -0.845000000 [52,] -0.745000000 -1.145000000 [53,] 0.155000000 -0.745000000 [54,] 0.755000000 0.155000000 [55,] 0.955000000 0.755000000 [56,] 0.755000000 0.955000000 [57,] 0.455000000 0.755000000 [58,] 0.555000000 0.455000000 [59,] 1.055000000 0.555000000 [60,] 1.155000000 1.055000000 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.795121951 0.695121951 2 0.395121951 0.795121951 3 0.195121951 0.395121951 4 0.295121951 0.195121951 5 0.495121951 0.295121951 6 0.495121951 0.495121951 7 0.495121951 0.495121951 8 0.195121951 0.495121951 9 0.195121951 0.195121951 10 -0.204878049 0.195121951 11 0.195121951 -0.204878049 12 0.195121951 0.195121951 13 0.295121951 0.195121951 14 0.395121951 0.295121951 15 0.395121951 0.395121951 16 0.595121951 0.395121951 17 0.795121951 0.595121951 18 0.895121951 0.795121951 19 0.895121951 0.895121951 20 0.895121951 0.895121951 21 0.595121951 0.895121951 22 -0.004878049 0.595121951 23 -0.404878049 -0.004878049 24 -0.704878049 -0.404878049 25 -0.604878049 -0.704878049 26 -0.404878049 -0.604878049 27 -0.304878049 -0.404878049 28 -0.204878049 -0.304878049 29 -0.104878049 -0.204878049 30 -0.204878049 -0.104878049 31 -0.404878049 -0.204878049 32 -0.304878049 -0.404878049 33 -0.504878049 -0.304878049 34 -0.904878049 -0.504878049 35 -0.604878049 -0.904878049 36 -0.704878049 -0.604878049 37 -0.904878049 -0.704878049 38 -1.004878049 -0.904878049 39 -1.104878049 -1.004878049 40 -0.804878049 -1.104878049 41 -0.145000000 -0.804878049 42 -0.145000000 -0.145000000 43 -0.545000000 -0.145000000 44 -0.845000000 -0.545000000 45 -1.145000000 -0.845000000 46 -0.845000000 -1.145000000 47 0.255000000 -0.845000000 48 0.355000000 0.255000000 49 -0.045000000 0.355000000 50 -0.845000000 -0.045000000 51 -1.145000000 -0.845000000 52 -0.745000000 -1.145000000 53 0.155000000 -0.745000000 54 0.755000000 0.155000000 55 0.955000000 0.755000000 56 0.755000000 0.955000000 57 0.455000000 0.755000000 58 0.555000000 0.455000000 59 1.055000000 0.555000000 60 1.155000000 1.055000000 > 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/7098r1258894959.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/8ggm51258894959.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/9qjvw1258894959.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/10b0r71258894959.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/11a43j1258894959.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/12wmyr1258894959.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/13e1rt1258894959.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/14bt0y1258894959.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/1591ws1258894959.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/16xd6q1258894959.tab") + } > > system("convert tmp/1y3xk1258894959.ps tmp/1y3xk1258894959.png") > system("convert tmp/2p8ka1258894959.ps tmp/2p8ka1258894959.png") > system("convert tmp/3ireq1258894959.ps tmp/3ireq1258894959.png") > system("convert tmp/4xfef1258894959.ps tmp/4xfef1258894959.png") > system("convert tmp/574m51258894959.ps tmp/574m51258894959.png") > system("convert tmp/6f2fw1258894959.ps tmp/6f2fw1258894959.png") > system("convert tmp/7098r1258894959.ps tmp/7098r1258894959.png") > system("convert tmp/8ggm51258894959.ps tmp/8ggm51258894959.png") > system("convert tmp/9qjvw1258894959.ps tmp/9qjvw1258894959.png") > system("convert tmp/10b0r71258894959.ps tmp/10b0r71258894959.png") > > > proc.time() user system elapsed 2.449 1.541 3.149