R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(112.3,0,117.3,0,111.1,1,102.2,1,104.3,1,122.9,1,107.6,1,121.3,1,131.5,1,89,1,104.4,1,128.9,1,135.9,1,133.3,1,121.3,1,120.5,0,120.4,0,137.9,0,126.1,0,133.2,0,151.1,0,105,0,119,0,140.4,0,156.6,0,137.1,0,122.7,0,125.8,0,139.3,0,134.9,0,149.2,0,132.3,0,149,0,117.2,0,119.6,0,152,0,149.4,0,127.3,0,114.1,0,102.1,0,107.7,0,104.4,0,102.1,0,96,1,109.3,0,90,1,83.9,1,112,1,114.3,1,103.6,1,91.7,1,80.8,1,87.2,1,109.2,1,102.7,1,95.1,1,117.5,1,85.1,1,92.1,1,113.5,1),dim=c(2,60),dimnames=list(c('Promet','Dummy'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Promet','Dummy'),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 = 'Do not include Seasonal Dummies' > par1 = '1' > library(lattice) > library(lmtest) Loading required package: zoo > 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 Promet Dummy 1 112.3 0 2 117.3 0 3 111.1 1 4 102.2 1 5 104.3 1 6 122.9 1 7 107.6 1 8 121.3 1 9 131.5 1 10 89.0 1 11 104.4 1 12 128.9 1 13 135.9 1 14 133.3 1 15 121.3 1 16 120.5 0 17 120.4 0 18 137.9 0 19 126.1 0 20 133.2 0 21 151.1 0 22 105.0 0 23 119.0 0 24 140.4 0 25 156.6 0 26 137.1 0 27 122.7 0 28 125.8 0 29 139.3 0 30 134.9 0 31 149.2 0 32 132.3 0 33 149.0 0 34 117.2 0 35 119.6 0 36 152.0 0 37 149.4 0 38 127.3 0 39 114.1 0 40 102.1 0 41 107.7 0 42 104.4 0 43 102.1 0 44 96.0 1 45 109.3 0 46 90.0 1 47 83.9 1 48 112.0 1 49 114.3 1 50 103.6 1 51 91.7 1 52 80.8 1 53 87.2 1 54 109.2 1 55 102.7 1 56 95.1 1 57 117.5 1 58 85.1 1 59 92.1 1 60 113.5 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Dummy 126.95 -20.45 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -25.697 -13.233 -1.621 11.341 29.655 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 126.945 2.885 44.003 < 2e-16 *** Dummy -20.449 4.150 -4.928 7.29e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 16.06 on 58 degrees of freedom Multiple R-squared: 0.2951, Adjusted R-squared: 0.283 F-statistic: 24.28 on 1 and 58 DF, p-value: 7.292e-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,] 0.02308078 0.04616155 0.97691922 [2,] 0.09058063 0.18116125 0.90941937 [3,] 0.03836084 0.07672169 0.96163916 [4,] 0.03596145 0.07192291 0.96403855 [5,] 0.09302489 0.18604979 0.90697511 [6,] 0.22234104 0.44468207 0.77765896 [7,] 0.15761089 0.31522178 0.84238911 [8,] 0.19943928 0.39887856 0.80056072 [9,] 0.33605207 0.67210415 0.66394793 [10,] 0.42770922 0.85541845 0.57229078 [11,] 0.38500405 0.77000809 0.61499595 [12,] 0.31138544 0.62277088 0.68861456 [13,] 0.24341079 0.48682158 0.75658921 [14,] 0.26682965 0.53365931 0.73317035 [15,] 0.20462383 0.40924766 0.79537617 [16,] 0.17009588 0.34019177 0.82990412 [17,] 0.28909156 0.57818312 0.71090844 [18,] 0.36732393 0.73464786 0.63267607 [19,] 0.30939708 0.61879416 0.69060292 [20,] 0.30508215 0.61016431 0.69491785 [21,] 0.51999804 0.96000392 0.48000196 [22,] 0.47449196 0.94898392 0.52550804 [23,] 0.40641941 0.81283882 0.59358059 [24,] 0.33490748 0.66981497 0.66509252 [25,] 0.31138996 0.62277991 0.68861004 [26,] 0.26529869 0.53059738 0.73470131 [27,] 0.35373406 0.70746811 0.64626594 [28,] 0.30237362 0.60474723 0.69762638 [29,] 0.42760921 0.85521843 0.57239079 [30,] 0.38470060 0.76940120 0.61529940 [31,] 0.33074548 0.66149096 0.66925452 [32,] 0.59087778 0.81824444 0.40912222 [33,] 0.88092584 0.23814833 0.11907416 [34,] 0.90880021 0.18239958 0.09119979 [35,] 0.90122700 0.19754601 0.09877300 [36,] 0.90664842 0.18670317 0.09335158 [37,] 0.89133411 0.21733177 0.10866589 [38,] 0.87644982 0.24710035 0.12355018 [39,] 0.86525427 0.26949147 0.13474573 [40,] 0.83124648 0.33750703 0.16875352 [41,] 0.78410046 0.43179909 0.21589954 [42,] 0.76556985 0.46886030 0.23443015 [43,] 0.80301877 0.39396246 0.19698123 [44,] 0.77132808 0.45734383 0.22867192 [45,] 0.77095790 0.45808421 0.22904210 [46,] 0.69294182 0.61411635 0.30705818 [47,] 0.61632768 0.76734465 0.38367232 [48,] 0.68988137 0.62023725 0.31011863 [49,] 0.68030900 0.63938200 0.31969100 [50,] 0.56608004 0.86783991 0.43391996 [51,] 0.39765428 0.79530857 0.60234572 > postscript(file="/var/wessaorg/rcomp/tmp/1nsda1322331008.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2zn1d1322331008.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3fsc11322331008.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/4vw7n1322331008.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/59ci31322331008.ps",horizontal=F,onefile=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 -14.6451613 -9.6451613 4.6034483 -4.2965517 -2.1965517 16.4034483 7 8 9 10 11 12 1.1034483 14.8034483 25.0034483 -17.4965517 -2.0965517 22.4034483 13 14 15 16 17 18 29.4034483 26.8034483 14.8034483 -6.4451613 -6.5451613 10.9548387 19 20 21 22 23 24 -0.8451613 6.2548387 24.1548387 -21.9451613 -7.9451613 13.4548387 25 26 27 28 29 30 29.6548387 10.1548387 -4.2451613 -1.1451613 12.3548387 7.9548387 31 32 33 34 35 36 22.2548387 5.3548387 22.0548387 -9.7451613 -7.3451613 25.0548387 37 38 39 40 41 42 22.4548387 0.3548387 -12.8451613 -24.8451613 -19.2451613 -22.5451613 43 44 45 46 47 48 -24.8451613 -10.4965517 -17.6451613 -16.4965517 -22.5965517 5.5034483 49 50 51 52 53 54 7.8034483 -2.8965517 -14.7965517 -25.6965517 -19.2965517 2.7034483 55 56 57 58 59 60 -3.7965517 -11.3965517 11.0034483 -21.3965517 -14.3965517 7.0034483 > postscript(file="/var/wessaorg/rcomp/tmp/6hek81322331008.ps",horizontal=F,onefile=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 -14.6451613 NA 1 -9.6451613 -14.6451613 2 4.6034483 -9.6451613 3 -4.2965517 4.6034483 4 -2.1965517 -4.2965517 5 16.4034483 -2.1965517 6 1.1034483 16.4034483 7 14.8034483 1.1034483 8 25.0034483 14.8034483 9 -17.4965517 25.0034483 10 -2.0965517 -17.4965517 11 22.4034483 -2.0965517 12 29.4034483 22.4034483 13 26.8034483 29.4034483 14 14.8034483 26.8034483 15 -6.4451613 14.8034483 16 -6.5451613 -6.4451613 17 10.9548387 -6.5451613 18 -0.8451613 10.9548387 19 6.2548387 -0.8451613 20 24.1548387 6.2548387 21 -21.9451613 24.1548387 22 -7.9451613 -21.9451613 23 13.4548387 -7.9451613 24 29.6548387 13.4548387 25 10.1548387 29.6548387 26 -4.2451613 10.1548387 27 -1.1451613 -4.2451613 28 12.3548387 -1.1451613 29 7.9548387 12.3548387 30 22.2548387 7.9548387 31 5.3548387 22.2548387 32 22.0548387 5.3548387 33 -9.7451613 22.0548387 34 -7.3451613 -9.7451613 35 25.0548387 -7.3451613 36 22.4548387 25.0548387 37 0.3548387 22.4548387 38 -12.8451613 0.3548387 39 -24.8451613 -12.8451613 40 -19.2451613 -24.8451613 41 -22.5451613 -19.2451613 42 -24.8451613 -22.5451613 43 -10.4965517 -24.8451613 44 -17.6451613 -10.4965517 45 -16.4965517 -17.6451613 46 -22.5965517 -16.4965517 47 5.5034483 -22.5965517 48 7.8034483 5.5034483 49 -2.8965517 7.8034483 50 -14.7965517 -2.8965517 51 -25.6965517 -14.7965517 52 -19.2965517 -25.6965517 53 2.7034483 -19.2965517 54 -3.7965517 2.7034483 55 -11.3965517 -3.7965517 56 11.0034483 -11.3965517 57 -21.3965517 11.0034483 58 -14.3965517 -21.3965517 59 7.0034483 -14.3965517 60 NA 7.0034483 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -9.6451613 -14.6451613 [2,] 4.6034483 -9.6451613 [3,] -4.2965517 4.6034483 [4,] -2.1965517 -4.2965517 [5,] 16.4034483 -2.1965517 [6,] 1.1034483 16.4034483 [7,] 14.8034483 1.1034483 [8,] 25.0034483 14.8034483 [9,] -17.4965517 25.0034483 [10,] -2.0965517 -17.4965517 [11,] 22.4034483 -2.0965517 [12,] 29.4034483 22.4034483 [13,] 26.8034483 29.4034483 [14,] 14.8034483 26.8034483 [15,] -6.4451613 14.8034483 [16,] -6.5451613 -6.4451613 [17,] 10.9548387 -6.5451613 [18,] -0.8451613 10.9548387 [19,] 6.2548387 -0.8451613 [20,] 24.1548387 6.2548387 [21,] -21.9451613 24.1548387 [22,] -7.9451613 -21.9451613 [23,] 13.4548387 -7.9451613 [24,] 29.6548387 13.4548387 [25,] 10.1548387 29.6548387 [26,] -4.2451613 10.1548387 [27,] -1.1451613 -4.2451613 [28,] 12.3548387 -1.1451613 [29,] 7.9548387 12.3548387 [30,] 22.2548387 7.9548387 [31,] 5.3548387 22.2548387 [32,] 22.0548387 5.3548387 [33,] -9.7451613 22.0548387 [34,] -7.3451613 -9.7451613 [35,] 25.0548387 -7.3451613 [36,] 22.4548387 25.0548387 [37,] 0.3548387 22.4548387 [38,] -12.8451613 0.3548387 [39,] -24.8451613 -12.8451613 [40,] -19.2451613 -24.8451613 [41,] -22.5451613 -19.2451613 [42,] -24.8451613 -22.5451613 [43,] -10.4965517 -24.8451613 [44,] -17.6451613 -10.4965517 [45,] -16.4965517 -17.6451613 [46,] -22.5965517 -16.4965517 [47,] 5.5034483 -22.5965517 [48,] 7.8034483 5.5034483 [49,] -2.8965517 7.8034483 [50,] -14.7965517 -2.8965517 [51,] -25.6965517 -14.7965517 [52,] -19.2965517 -25.6965517 [53,] 2.7034483 -19.2965517 [54,] -3.7965517 2.7034483 [55,] -11.3965517 -3.7965517 [56,] 11.0034483 -11.3965517 [57,] -21.3965517 11.0034483 [58,] -14.3965517 -21.3965517 [59,] 7.0034483 -14.3965517 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -9.6451613 -14.6451613 2 4.6034483 -9.6451613 3 -4.2965517 4.6034483 4 -2.1965517 -4.2965517 5 16.4034483 -2.1965517 6 1.1034483 16.4034483 7 14.8034483 1.1034483 8 25.0034483 14.8034483 9 -17.4965517 25.0034483 10 -2.0965517 -17.4965517 11 22.4034483 -2.0965517 12 29.4034483 22.4034483 13 26.8034483 29.4034483 14 14.8034483 26.8034483 15 -6.4451613 14.8034483 16 -6.5451613 -6.4451613 17 10.9548387 -6.5451613 18 -0.8451613 10.9548387 19 6.2548387 -0.8451613 20 24.1548387 6.2548387 21 -21.9451613 24.1548387 22 -7.9451613 -21.9451613 23 13.4548387 -7.9451613 24 29.6548387 13.4548387 25 10.1548387 29.6548387 26 -4.2451613 10.1548387 27 -1.1451613 -4.2451613 28 12.3548387 -1.1451613 29 7.9548387 12.3548387 30 22.2548387 7.9548387 31 5.3548387 22.2548387 32 22.0548387 5.3548387 33 -9.7451613 22.0548387 34 -7.3451613 -9.7451613 35 25.0548387 -7.3451613 36 22.4548387 25.0548387 37 0.3548387 22.4548387 38 -12.8451613 0.3548387 39 -24.8451613 -12.8451613 40 -19.2451613 -24.8451613 41 -22.5451613 -19.2451613 42 -24.8451613 -22.5451613 43 -10.4965517 -24.8451613 44 -17.6451613 -10.4965517 45 -16.4965517 -17.6451613 46 -22.5965517 -16.4965517 47 5.5034483 -22.5965517 48 7.8034483 5.5034483 49 -2.8965517 7.8034483 50 -14.7965517 -2.8965517 51 -25.6965517 -14.7965517 52 -19.2965517 -25.6965517 53 2.7034483 -19.2965517 54 -3.7965517 2.7034483 55 -11.3965517 -3.7965517 56 11.0034483 -11.3965517 57 -21.3965517 11.0034483 58 -14.3965517 -21.3965517 59 7.0034483 -14.3965517 > 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/wessaorg/rcomp/tmp/7jfo81322331009.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/8nasa1322331009.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/925k21322331009.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/10smf81322331009.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11fraa1322331009.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/wessaorg/rcomp/tmp/12ohxy1322331009.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/wessaorg/rcomp/tmp/13tg1b1322331009.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/wessaorg/rcomp/tmp/14umkd1322331009.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/wessaorg/rcomp/tmp/1529lp1322331009.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/wessaorg/rcomp/tmp/16jd0m1322331009.tab") + } > > try(system("convert tmp/1nsda1322331008.ps tmp/1nsda1322331008.png",intern=TRUE)) character(0) > try(system("convert tmp/2zn1d1322331008.ps tmp/2zn1d1322331008.png",intern=TRUE)) character(0) > try(system("convert tmp/3fsc11322331008.ps tmp/3fsc11322331008.png",intern=TRUE)) character(0) > try(system("convert tmp/4vw7n1322331008.ps tmp/4vw7n1322331008.png",intern=TRUE)) character(0) > try(system("convert tmp/59ci31322331008.ps tmp/59ci31322331008.png",intern=TRUE)) character(0) > try(system("convert tmp/6hek81322331008.ps tmp/6hek81322331008.png",intern=TRUE)) character(0) > try(system("convert tmp/7jfo81322331009.ps tmp/7jfo81322331009.png",intern=TRUE)) character(0) > try(system("convert tmp/8nasa1322331009.ps tmp/8nasa1322331009.png",intern=TRUE)) character(0) > try(system("convert tmp/925k21322331009.ps tmp/925k21322331009.png",intern=TRUE)) character(0) > try(system("convert tmp/10smf81322331009.ps tmp/10smf81322331009.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.288 0.508 3.806