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(5.4,2.7,5.4,2.5,5.6,2.2,5.7,2.9,5.8,3.1,5.8,3,5.8,2.8,5.9,2.5,6.1,1.9,6.4,1.9,6.4,1.8,6.3,2,6.2,2.6,6.2,2.5,6.3,2.5,6.4,1.6,6.5,1.4,6.6,0.8,6.6,1.1,6.6,1.3,6.8,1.2,7,1.3,7.2,1.1,7.3,1.3,7.5,1.2,7.6,1.6,7.6,1.7,7.7,1.5,7.7,0.9,7.7,1.5,7.7,1.4,7.6,1.6,7.7,1.7,7.9,1.4,7.9,1.8,7.9,1.7,7.8,1.4,7.6,1.2,7.4,1,7,1.7,7,2.4,7.2,2,7.5,2.1,7.8,2,7.8,1.8,7.7,2.7,7.6,2.3,7.6,1.9,7.5,2,7.5,2.3,7.6,2.8,7.6,2.4,7.9,2.3,7.6,2.7,7.5,2.7,7.5,2.9,7.6,3,7.7,2.2,7.8,2.3,7.9,2.8,7.9,2.8),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 5.4 2.7 2 5.4 2.5 3 5.6 2.2 4 5.7 2.9 5 5.8 3.1 6 5.8 3.0 7 5.8 2.8 8 5.9 2.5 9 6.1 1.9 10 6.4 1.9 11 6.4 1.8 12 6.3 2.0 13 6.2 2.6 14 6.2 2.5 15 6.3 2.5 16 6.4 1.6 17 6.5 1.4 18 6.6 0.8 19 6.6 1.1 20 6.6 1.3 21 6.8 1.2 22 7.0 1.3 23 7.2 1.1 24 7.3 1.3 25 7.5 1.2 26 7.6 1.6 27 7.6 1.7 28 7.7 1.5 29 7.7 0.9 30 7.7 1.5 31 7.7 1.4 32 7.6 1.6 33 7.7 1.7 34 7.9 1.4 35 7.9 1.8 36 7.9 1.7 37 7.8 1.4 38 7.6 1.2 39 7.4 1.0 40 7.0 1.7 41 7.0 2.4 42 7.2 2.0 43 7.5 2.1 44 7.8 2.0 45 7.8 1.8 46 7.7 2.7 47 7.6 2.3 48 7.6 1.9 49 7.5 2.0 50 7.5 2.3 51 7.6 2.8 52 7.6 2.4 53 7.9 2.3 54 7.6 2.7 55 7.5 2.7 56 7.5 2.9 57 7.6 3.0 58 7.7 2.2 59 7.8 2.3 60 7.9 2.8 61 7.9 2.8 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 7.7055 -0.3092 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.5324 -0.7324 0.2728 0.6295 1.0604 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.7055 0.3242 23.770 <2e-16 *** X -0.3092 0.1553 -1.991 0.0511 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.7458 on 59 degrees of freedom Multiple R-squared: 0.06299, Adjusted R-squared: 0.0471 F-statistic: 3.966 on 1 and 59 DF, p-value: 0.05107 > 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.025096447 5.019289e-02 9.749036e-01 [2,] 0.008088075 1.617615e-02 9.919119e-01 [3,] 0.003622818 7.245636e-03 9.963772e-01 [4,] 0.005751338 1.150268e-02 9.942487e-01 [5,] 0.014378817 2.875763e-02 9.856212e-01 [6,] 0.028870291 5.774058e-02 9.711297e-01 [7,] 0.025836142 5.167228e-02 9.741639e-01 [8,] 0.022276382 4.455276e-02 9.777236e-01 [9,] 0.039381686 7.876337e-02 9.606183e-01 [10,] 0.066800864 1.336017e-01 9.331991e-01 [11,] 0.148875668 2.977513e-01 8.511243e-01 [12,] 0.176396927 3.527939e-01 8.236031e-01 [13,] 0.203264154 4.065283e-01 7.967358e-01 [14,] 0.216057774 4.321155e-01 7.839422e-01 [15,] 0.267248008 5.344960e-01 7.327520e-01 [16,] 0.410929281 8.218586e-01 5.890707e-01 [17,] 0.573923001 8.521540e-01 4.260770e-01 [18,] 0.772852443 4.542951e-01 2.271476e-01 [19,] 0.875509536 2.489809e-01 1.244905e-01 [20,] 0.954212950 9.157410e-02 4.578705e-02 [21,] 0.982421327 3.515735e-02 1.757867e-02 [22,] 0.997491703 5.016595e-03 2.508297e-03 [23,] 0.999493671 1.012659e-03 5.063295e-04 [24,] 0.999799623 4.007547e-04 2.003773e-04 [25,] 0.999707961 5.840783e-04 2.920391e-04 [26,] 0.999809315 3.813695e-04 1.906847e-04 [27,] 0.999817235 3.655304e-04 1.827652e-04 [28,] 0.999815782 3.684352e-04 1.842176e-04 [29,] 0.999853066 2.938684e-04 1.469342e-04 [30,] 0.999903303 1.933934e-04 9.669668e-05 [31,] 0.999962289 7.542259e-05 3.771129e-05 [32,] 0.999981516 3.696713e-05 1.848356e-05 [33,] 0.999981627 3.674539e-05 1.837269e-05 [34,] 0.999963968 7.206486e-05 3.603243e-05 [35,] 0.999912832 1.743353e-04 8.716765e-05 [36,] 0.999964467 7.106582e-05 3.553291e-05 [37,] 0.999998647 2.705054e-06 1.352527e-06 [38,] 0.999999835 3.304591e-07 1.652295e-07 [39,] 0.999999777 4.461632e-07 2.230816e-07 [40,] 0.999999623 7.535493e-07 3.767746e-07 [41,] 0.999999295 1.409410e-06 7.047051e-07 [42,] 0.999998721 2.557483e-06 1.278741e-06 [43,] 0.999996178 7.643424e-06 3.821712e-06 [44,] 0.999986342 2.731680e-05 1.365840e-05 [45,] 0.999971626 5.674740e-05 2.837370e-05 [46,] 0.999957618 8.476412e-05 4.238206e-05 [47,] 0.999868816 2.623684e-04 1.311842e-04 [48,] 0.999647590 7.048193e-04 3.524096e-04 [49,] 0.999033139 1.933722e-03 9.668609e-04 [50,] 0.996646246 6.707508e-03 3.353754e-03 [51,] 0.992747937 1.450413e-02 7.252063e-03 [52,] 0.987681599 2.463680e-02 1.231840e-02 > postscript(file="/var/www/html/rcomp/tmp/1s3q61258655455.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/2nn5l1258655455.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/36iko1258655455.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/4gdmo1258655455.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/5w2v71258655455.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 -1.470543925 -1.532389602 -1.425158118 -1.108698248 -0.946852570 -0.977775409 7 8 9 10 11 12 -1.039621086 -1.032389602 -1.017926633 -0.717926633 -0.748849472 -0.787003795 13 14 15 16 17 18 -0.701466763 -0.732389602 -0.632389602 -0.810695149 -0.772540826 -0.858077858 19 20 21 22 23 24 -0.765309342 -0.703463665 -0.534386504 -0.303463665 -0.165309342 -0.003463665 25 26 27 28 29 30 0.165613496 0.389304851 0.420227689 0.458382012 0.272844981 0.458382012 31 32 33 34 35 36 0.427459174 0.389304851 0.520227689 0.627459174 0.751150528 0.720227689 37 38 39 40 41 42 0.527459174 0.265613496 0.003767819 -0.179772311 0.036687560 0.112996205 43 44 45 46 47 48 0.443919044 0.712996205 0.651150528 0.829456075 0.605764721 0.482073367 49 50 51 52 53 54 0.412996205 0.505764721 0.760378914 0.636687560 0.905764721 0.729456075 55 56 57 58 59 60 0.629456075 0.691301752 0.822224591 0.674841882 0.805764721 1.060378914 61 1.060378914 > postscript(file="/var/www/html/rcomp/tmp/6ua1x1258655455.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 -1.470543925 NA 1 -1.532389602 -1.470543925 2 -1.425158118 -1.532389602 3 -1.108698248 -1.425158118 4 -0.946852570 -1.108698248 5 -0.977775409 -0.946852570 6 -1.039621086 -0.977775409 7 -1.032389602 -1.039621086 8 -1.017926633 -1.032389602 9 -0.717926633 -1.017926633 10 -0.748849472 -0.717926633 11 -0.787003795 -0.748849472 12 -0.701466763 -0.787003795 13 -0.732389602 -0.701466763 14 -0.632389602 -0.732389602 15 -0.810695149 -0.632389602 16 -0.772540826 -0.810695149 17 -0.858077858 -0.772540826 18 -0.765309342 -0.858077858 19 -0.703463665 -0.765309342 20 -0.534386504 -0.703463665 21 -0.303463665 -0.534386504 22 -0.165309342 -0.303463665 23 -0.003463665 -0.165309342 24 0.165613496 -0.003463665 25 0.389304851 0.165613496 26 0.420227689 0.389304851 27 0.458382012 0.420227689 28 0.272844981 0.458382012 29 0.458382012 0.272844981 30 0.427459174 0.458382012 31 0.389304851 0.427459174 32 0.520227689 0.389304851 33 0.627459174 0.520227689 34 0.751150528 0.627459174 35 0.720227689 0.751150528 36 0.527459174 0.720227689 37 0.265613496 0.527459174 38 0.003767819 0.265613496 39 -0.179772311 0.003767819 40 0.036687560 -0.179772311 41 0.112996205 0.036687560 42 0.443919044 0.112996205 43 0.712996205 0.443919044 44 0.651150528 0.712996205 45 0.829456075 0.651150528 46 0.605764721 0.829456075 47 0.482073367 0.605764721 48 0.412996205 0.482073367 49 0.505764721 0.412996205 50 0.760378914 0.505764721 51 0.636687560 0.760378914 52 0.905764721 0.636687560 53 0.729456075 0.905764721 54 0.629456075 0.729456075 55 0.691301752 0.629456075 56 0.822224591 0.691301752 57 0.674841882 0.822224591 58 0.805764721 0.674841882 59 1.060378914 0.805764721 60 1.060378914 1.060378914 61 NA 1.060378914 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.532389602 -1.470543925 [2,] -1.425158118 -1.532389602 [3,] -1.108698248 -1.425158118 [4,] -0.946852570 -1.108698248 [5,] -0.977775409 -0.946852570 [6,] -1.039621086 -0.977775409 [7,] -1.032389602 -1.039621086 [8,] -1.017926633 -1.032389602 [9,] -0.717926633 -1.017926633 [10,] -0.748849472 -0.717926633 [11,] -0.787003795 -0.748849472 [12,] -0.701466763 -0.787003795 [13,] -0.732389602 -0.701466763 [14,] -0.632389602 -0.732389602 [15,] -0.810695149 -0.632389602 [16,] -0.772540826 -0.810695149 [17,] -0.858077858 -0.772540826 [18,] -0.765309342 -0.858077858 [19,] -0.703463665 -0.765309342 [20,] -0.534386504 -0.703463665 [21,] -0.303463665 -0.534386504 [22,] -0.165309342 -0.303463665 [23,] -0.003463665 -0.165309342 [24,] 0.165613496 -0.003463665 [25,] 0.389304851 0.165613496 [26,] 0.420227689 0.389304851 [27,] 0.458382012 0.420227689 [28,] 0.272844981 0.458382012 [29,] 0.458382012 0.272844981 [30,] 0.427459174 0.458382012 [31,] 0.389304851 0.427459174 [32,] 0.520227689 0.389304851 [33,] 0.627459174 0.520227689 [34,] 0.751150528 0.627459174 [35,] 0.720227689 0.751150528 [36,] 0.527459174 0.720227689 [37,] 0.265613496 0.527459174 [38,] 0.003767819 0.265613496 [39,] -0.179772311 0.003767819 [40,] 0.036687560 -0.179772311 [41,] 0.112996205 0.036687560 [42,] 0.443919044 0.112996205 [43,] 0.712996205 0.443919044 [44,] 0.651150528 0.712996205 [45,] 0.829456075 0.651150528 [46,] 0.605764721 0.829456075 [47,] 0.482073367 0.605764721 [48,] 0.412996205 0.482073367 [49,] 0.505764721 0.412996205 [50,] 0.760378914 0.505764721 [51,] 0.636687560 0.760378914 [52,] 0.905764721 0.636687560 [53,] 0.729456075 0.905764721 [54,] 0.629456075 0.729456075 [55,] 0.691301752 0.629456075 [56,] 0.822224591 0.691301752 [57,] 0.674841882 0.822224591 [58,] 0.805764721 0.674841882 [59,] 1.060378914 0.805764721 [60,] 1.060378914 1.060378914 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.532389602 -1.470543925 2 -1.425158118 -1.532389602 3 -1.108698248 -1.425158118 4 -0.946852570 -1.108698248 5 -0.977775409 -0.946852570 6 -1.039621086 -0.977775409 7 -1.032389602 -1.039621086 8 -1.017926633 -1.032389602 9 -0.717926633 -1.017926633 10 -0.748849472 -0.717926633 11 -0.787003795 -0.748849472 12 -0.701466763 -0.787003795 13 -0.732389602 -0.701466763 14 -0.632389602 -0.732389602 15 -0.810695149 -0.632389602 16 -0.772540826 -0.810695149 17 -0.858077858 -0.772540826 18 -0.765309342 -0.858077858 19 -0.703463665 -0.765309342 20 -0.534386504 -0.703463665 21 -0.303463665 -0.534386504 22 -0.165309342 -0.303463665 23 -0.003463665 -0.165309342 24 0.165613496 -0.003463665 25 0.389304851 0.165613496 26 0.420227689 0.389304851 27 0.458382012 0.420227689 28 0.272844981 0.458382012 29 0.458382012 0.272844981 30 0.427459174 0.458382012 31 0.389304851 0.427459174 32 0.520227689 0.389304851 33 0.627459174 0.520227689 34 0.751150528 0.627459174 35 0.720227689 0.751150528 36 0.527459174 0.720227689 37 0.265613496 0.527459174 38 0.003767819 0.265613496 39 -0.179772311 0.003767819 40 0.036687560 -0.179772311 41 0.112996205 0.036687560 42 0.443919044 0.112996205 43 0.712996205 0.443919044 44 0.651150528 0.712996205 45 0.829456075 0.651150528 46 0.605764721 0.829456075 47 0.482073367 0.605764721 48 0.412996205 0.482073367 49 0.505764721 0.412996205 50 0.760378914 0.505764721 51 0.636687560 0.760378914 52 0.905764721 0.636687560 53 0.729456075 0.905764721 54 0.629456075 0.729456075 55 0.691301752 0.629456075 56 0.822224591 0.691301752 57 0.674841882 0.822224591 58 0.805764721 0.674841882 59 1.060378914 0.805764721 60 1.060378914 1.060378914 > 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/7d5781258655455.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/823h11258655455.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/9e8rj1258655455.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/109ygy1258655455.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/11o4631258655455.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/12izpa1258655455.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/13eiqq1258655455.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/14bbp91258655455.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/15ox7i1258655455.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/16zgm81258655455.tab") + } > > system("convert tmp/1s3q61258655455.ps tmp/1s3q61258655455.png") > system("convert tmp/2nn5l1258655455.ps tmp/2nn5l1258655455.png") > system("convert tmp/36iko1258655455.ps tmp/36iko1258655455.png") > system("convert tmp/4gdmo1258655455.ps tmp/4gdmo1258655455.png") > system("convert tmp/5w2v71258655455.ps tmp/5w2v71258655455.png") > system("convert tmp/6ua1x1258655455.ps tmp/6ua1x1258655455.png") > system("convert tmp/7d5781258655455.ps tmp/7d5781258655455.png") > system("convert tmp/823h11258655455.ps tmp/823h11258655455.png") > system("convert tmp/9e8rj1258655455.ps tmp/9e8rj1258655455.png") > system("convert tmp/109ygy1258655455.ps tmp/109ygy1258655455.png") > > > proc.time() user system elapsed 2.446 1.546 2.963