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.6,0,8.5,0,8.3,0,7.8,0,7.8,0,8,0,8.6,0,8.9,0,8.9,0,8.6,0,8.3,0,8.3,0,8.3,0,8.4,0,8.5,0,8.4,0,8.6,0,8.5,0,8.5,0,8.5,0,8.5,0,8.5,0,8.5,0,8.5,0,8.5,0,8.5,0,8.5,0,8.5,0,8.6,0,8.4,0,8.1,0,8,0,8,0,8,0,8,0,7.9,0,7.8,0,7.8,0,7.9,0,8.1,0,8,0,7.6,0,7.3,0,7,0,6.8,0,7,0,7.1,0,7.2,0,7.1,1,6.9,1,6.7,1,6.7,1,6.6,1,6.9,1,7.3,1,7.5,1,7.3,1,7.1,1,6.9,1,7.1,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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' > #'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.6 0 2 8.5 0 3 8.3 0 4 7.8 0 5 7.8 0 6 8.0 0 7 8.6 0 8 8.9 0 9 8.9 0 10 8.6 0 11 8.3 0 12 8.3 0 13 8.3 0 14 8.4 0 15 8.5 0 16 8.4 0 17 8.6 0 18 8.5 0 19 8.5 0 20 8.5 0 21 8.5 0 22 8.5 0 23 8.5 0 24 8.5 0 25 8.5 0 26 8.5 0 27 8.5 0 28 8.5 0 29 8.6 0 30 8.4 0 31 8.1 0 32 8.0 0 33 8.0 0 34 8.0 0 35 8.0 0 36 7.9 0 37 7.8 0 38 7.8 0 39 7.9 0 40 8.1 0 41 8.0 0 42 7.6 0 43 7.3 0 44 7.0 0 45 6.8 0 46 7.0 0 47 7.1 0 48 7.2 0 49 7.1 1 50 6.9 1 51 6.7 1 52 6.7 1 53 6.6 1 54 6.9 1 55 7.3 1 56 7.5 1 57 7.3 1 58 7.1 1 59 6.9 1 60 7.1 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 8.144 -1.135 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.3438 -0.2437 0.1240 0.3563 0.7563 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.14375 0.06856 118.777 < 2e-16 *** X -1.13542 0.15331 -7.406 6.09e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.475 on 58 degrees of freedom Multiple R-squared: 0.486, Adjusted R-squared: 0.4772 F-statistic: 54.85 on 1 and 58 DF, p-value: 6.092e-10 > 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.511600002 0.976799996 0.48840000 [2,] 0.363224270 0.726448540 0.63677573 [3,] 0.333151711 0.666303421 0.66684829 [4,] 0.452247713 0.904495426 0.54775229 [5,] 0.514153079 0.971693843 0.48584692 [6,] 0.435193416 0.870386832 0.56480658 [7,] 0.335806122 0.671612244 0.66419388 [8,] 0.249591268 0.499182536 0.75040873 [9,] 0.178858884 0.357717767 0.82114112 [10,] 0.124698361 0.249396721 0.87530164 [11,] 0.089564276 0.179128552 0.91043572 [12,] 0.059557037 0.119114073 0.94044296 [13,] 0.047225775 0.094451551 0.95277422 [14,] 0.033041581 0.066083162 0.96695842 [15,] 0.023086330 0.046172660 0.97691367 [16,] 0.016201483 0.032402966 0.98379852 [17,] 0.011497100 0.022994199 0.98850290 [18,] 0.008316547 0.016633093 0.99168345 [19,] 0.006192076 0.012384151 0.99380792 [20,] 0.004802295 0.009604590 0.99519770 [21,] 0.003937779 0.007875559 0.99606222 [22,] 0.003479098 0.006958197 0.99652090 [23,] 0.003394183 0.006788366 0.99660582 [24,] 0.003776435 0.007552871 0.99622356 [25,] 0.007004529 0.014009058 0.99299547 [26,] 0.009366650 0.018733299 0.99063335 [27,] 0.012332904 0.024665808 0.98766710 [28,] 0.018052613 0.036105225 0.98194739 [29,] 0.025221058 0.050442116 0.97477894 [30,] 0.034659538 0.069319075 0.96534046 [31,] 0.048119765 0.096239531 0.95188023 [32,] 0.069062058 0.138124117 0.93093794 [33,] 0.099803132 0.199606264 0.90019687 [34,] 0.135438517 0.270877035 0.86456148 [35,] 0.187441837 0.374883674 0.81255816 [36,] 0.378628353 0.757256707 0.62137165 [37,] 0.713247591 0.573504818 0.28675241 [38,] 0.871122367 0.257755266 0.12887763 [39,] 0.932387303 0.135225394 0.06761270 [40,] 0.963438813 0.073122374 0.03656119 [41,] 0.985024127 0.029951747 0.01497587 [42,] 0.986110327 0.027779346 0.01388967 [43,] 0.982706948 0.034586104 0.01729305 [44,] 0.974454320 0.051091360 0.02554568 [45,] 0.952872704 0.094254593 0.04712730 [46,] 0.917693034 0.164613931 0.08230697 [47,] 0.898691162 0.202617676 0.10130884 [48,] 0.886310509 0.227378982 0.11368949 [49,] 0.940886976 0.118226049 0.05911302 [50,] 0.920229630 0.159540741 0.07977037 [51,] 0.831684607 0.336630785 0.16831539 > postscript(file="/var/www/html/rcomp/tmp/1h49w1258714442.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/2hjue1258714442.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/381981258714442.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/4kp6b1258714442.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/53rgw1258714442.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 = 60 Frequency = 1 1 2 3 4 5 6 0.45625000 0.35625000 0.15625000 -0.34375000 -0.34375000 -0.14375000 7 8 9 10 11 12 0.45625000 0.75625000 0.75625000 0.45625000 0.15625000 0.15625000 13 14 15 16 17 18 0.15625000 0.25625000 0.35625000 0.25625000 0.45625000 0.35625000 19 20 21 22 23 24 0.35625000 0.35625000 0.35625000 0.35625000 0.35625000 0.35625000 25 26 27 28 29 30 0.35625000 0.35625000 0.35625000 0.35625000 0.45625000 0.25625000 31 32 33 34 35 36 -0.04375000 -0.14375000 -0.14375000 -0.14375000 -0.14375000 -0.24375000 37 38 39 40 41 42 -0.34375000 -0.34375000 -0.24375000 -0.04375000 -0.14375000 -0.54375000 43 44 45 46 47 48 -0.84375000 -1.14375000 -1.34375000 -1.14375000 -1.04375000 -0.94375000 49 50 51 52 53 54 0.09166667 -0.10833333 -0.30833333 -0.30833333 -0.40833333 -0.10833333 55 56 57 58 59 60 0.29166667 0.49166667 0.29166667 0.09166667 -0.10833333 0.09166667 > postscript(file="/var/www/html/rcomp/tmp/65y621258714442.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 0.45625000 NA 1 0.35625000 0.45625000 2 0.15625000 0.35625000 3 -0.34375000 0.15625000 4 -0.34375000 -0.34375000 5 -0.14375000 -0.34375000 6 0.45625000 -0.14375000 7 0.75625000 0.45625000 8 0.75625000 0.75625000 9 0.45625000 0.75625000 10 0.15625000 0.45625000 11 0.15625000 0.15625000 12 0.15625000 0.15625000 13 0.25625000 0.15625000 14 0.35625000 0.25625000 15 0.25625000 0.35625000 16 0.45625000 0.25625000 17 0.35625000 0.45625000 18 0.35625000 0.35625000 19 0.35625000 0.35625000 20 0.35625000 0.35625000 21 0.35625000 0.35625000 22 0.35625000 0.35625000 23 0.35625000 0.35625000 24 0.35625000 0.35625000 25 0.35625000 0.35625000 26 0.35625000 0.35625000 27 0.35625000 0.35625000 28 0.45625000 0.35625000 29 0.25625000 0.45625000 30 -0.04375000 0.25625000 31 -0.14375000 -0.04375000 32 -0.14375000 -0.14375000 33 -0.14375000 -0.14375000 34 -0.14375000 -0.14375000 35 -0.24375000 -0.14375000 36 -0.34375000 -0.24375000 37 -0.34375000 -0.34375000 38 -0.24375000 -0.34375000 39 -0.04375000 -0.24375000 40 -0.14375000 -0.04375000 41 -0.54375000 -0.14375000 42 -0.84375000 -0.54375000 43 -1.14375000 -0.84375000 44 -1.34375000 -1.14375000 45 -1.14375000 -1.34375000 46 -1.04375000 -1.14375000 47 -0.94375000 -1.04375000 48 0.09166667 -0.94375000 49 -0.10833333 0.09166667 50 -0.30833333 -0.10833333 51 -0.30833333 -0.30833333 52 -0.40833333 -0.30833333 53 -0.10833333 -0.40833333 54 0.29166667 -0.10833333 55 0.49166667 0.29166667 56 0.29166667 0.49166667 57 0.09166667 0.29166667 58 -0.10833333 0.09166667 59 0.09166667 -0.10833333 60 NA 0.09166667 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.35625000 0.45625000 [2,] 0.15625000 0.35625000 [3,] -0.34375000 0.15625000 [4,] -0.34375000 -0.34375000 [5,] -0.14375000 -0.34375000 [6,] 0.45625000 -0.14375000 [7,] 0.75625000 0.45625000 [8,] 0.75625000 0.75625000 [9,] 0.45625000 0.75625000 [10,] 0.15625000 0.45625000 [11,] 0.15625000 0.15625000 [12,] 0.15625000 0.15625000 [13,] 0.25625000 0.15625000 [14,] 0.35625000 0.25625000 [15,] 0.25625000 0.35625000 [16,] 0.45625000 0.25625000 [17,] 0.35625000 0.45625000 [18,] 0.35625000 0.35625000 [19,] 0.35625000 0.35625000 [20,] 0.35625000 0.35625000 [21,] 0.35625000 0.35625000 [22,] 0.35625000 0.35625000 [23,] 0.35625000 0.35625000 [24,] 0.35625000 0.35625000 [25,] 0.35625000 0.35625000 [26,] 0.35625000 0.35625000 [27,] 0.35625000 0.35625000 [28,] 0.45625000 0.35625000 [29,] 0.25625000 0.45625000 [30,] -0.04375000 0.25625000 [31,] -0.14375000 -0.04375000 [32,] -0.14375000 -0.14375000 [33,] -0.14375000 -0.14375000 [34,] -0.14375000 -0.14375000 [35,] -0.24375000 -0.14375000 [36,] -0.34375000 -0.24375000 [37,] -0.34375000 -0.34375000 [38,] -0.24375000 -0.34375000 [39,] -0.04375000 -0.24375000 [40,] -0.14375000 -0.04375000 [41,] -0.54375000 -0.14375000 [42,] -0.84375000 -0.54375000 [43,] -1.14375000 -0.84375000 [44,] -1.34375000 -1.14375000 [45,] -1.14375000 -1.34375000 [46,] -1.04375000 -1.14375000 [47,] -0.94375000 -1.04375000 [48,] 0.09166667 -0.94375000 [49,] -0.10833333 0.09166667 [50,] -0.30833333 -0.10833333 [51,] -0.30833333 -0.30833333 [52,] -0.40833333 -0.30833333 [53,] -0.10833333 -0.40833333 [54,] 0.29166667 -0.10833333 [55,] 0.49166667 0.29166667 [56,] 0.29166667 0.49166667 [57,] 0.09166667 0.29166667 [58,] -0.10833333 0.09166667 [59,] 0.09166667 -0.10833333 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.35625000 0.45625000 2 0.15625000 0.35625000 3 -0.34375000 0.15625000 4 -0.34375000 -0.34375000 5 -0.14375000 -0.34375000 6 0.45625000 -0.14375000 7 0.75625000 0.45625000 8 0.75625000 0.75625000 9 0.45625000 0.75625000 10 0.15625000 0.45625000 11 0.15625000 0.15625000 12 0.15625000 0.15625000 13 0.25625000 0.15625000 14 0.35625000 0.25625000 15 0.25625000 0.35625000 16 0.45625000 0.25625000 17 0.35625000 0.45625000 18 0.35625000 0.35625000 19 0.35625000 0.35625000 20 0.35625000 0.35625000 21 0.35625000 0.35625000 22 0.35625000 0.35625000 23 0.35625000 0.35625000 24 0.35625000 0.35625000 25 0.35625000 0.35625000 26 0.35625000 0.35625000 27 0.35625000 0.35625000 28 0.45625000 0.35625000 29 0.25625000 0.45625000 30 -0.04375000 0.25625000 31 -0.14375000 -0.04375000 32 -0.14375000 -0.14375000 33 -0.14375000 -0.14375000 34 -0.14375000 -0.14375000 35 -0.24375000 -0.14375000 36 -0.34375000 -0.24375000 37 -0.34375000 -0.34375000 38 -0.24375000 -0.34375000 39 -0.04375000 -0.24375000 40 -0.14375000 -0.04375000 41 -0.54375000 -0.14375000 42 -0.84375000 -0.54375000 43 -1.14375000 -0.84375000 44 -1.34375000 -1.14375000 45 -1.14375000 -1.34375000 46 -1.04375000 -1.14375000 47 -0.94375000 -1.04375000 48 0.09166667 -0.94375000 49 -0.10833333 0.09166667 50 -0.30833333 -0.10833333 51 -0.30833333 -0.30833333 52 -0.40833333 -0.30833333 53 -0.10833333 -0.40833333 54 0.29166667 -0.10833333 55 0.49166667 0.29166667 56 0.29166667 0.49166667 57 0.09166667 0.29166667 58 -0.10833333 0.09166667 59 0.09166667 -0.10833333 > 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/73n4u1258714442.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/8hd1u1258714442.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/99n9x1258714442.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/10qela1258714442.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/11dw6p1258714443.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/12fh6d1258714443.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/13u9rh1258714443.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/141i3n1258714443.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/15eksu1258714443.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/169zrn1258714443.tab") + } > > system("convert tmp/1h49w1258714442.ps tmp/1h49w1258714442.png") > system("convert tmp/2hjue1258714442.ps tmp/2hjue1258714442.png") > system("convert tmp/381981258714442.ps tmp/381981258714442.png") > system("convert tmp/4kp6b1258714442.ps tmp/4kp6b1258714442.png") > system("convert tmp/53rgw1258714442.ps tmp/53rgw1258714442.png") > system("convert tmp/65y621258714442.ps tmp/65y621258714442.png") > system("convert tmp/73n4u1258714442.ps tmp/73n4u1258714442.png") > system("convert tmp/8hd1u1258714442.ps tmp/8hd1u1258714442.png") > system("convert tmp/99n9x1258714442.ps tmp/99n9x1258714442.png") > system("convert tmp/10qela1258714442.ps tmp/10qela1258714442.png") > > > proc.time() user system elapsed 2.417 1.531 3.426