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.9,0,8.8,0,8.3,0,7.5,0,7.2,0,7.4,0,8.8,0,9.3,0,9.3,0,8.7,0,8.2,0,8.3,0,8.5,0,8.6,0,8.5,0,8.2,0,8.1,0,7.9,0,8.6,0,8.7,0,8.7,0,8.5,0,8.4,0,8.5,0,8.7,0,8.7,0,8.6,0,8.5,0,8.3,0,8,0,8.2,0,8.1,0,8.1,0,8,0,7.9,0,7.9,0,8,0,8,0,7.9,0,8,0,7.7,0,7.2,0,7.5,0,7.3,0,7,0,7,0,7,0,7.2,0,7.3,1,7.1,1,6.8,1,6.4,1,6.1,1,6.5,1,7.7,1,7.9,1,7.5,1,6.9,1,6.6,1,6.9,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.9 0 2 8.8 0 3 8.3 0 4 7.5 0 5 7.2 0 6 7.4 0 7 8.8 0 8 9.3 0 9 9.3 0 10 8.7 0 11 8.2 0 12 8.3 0 13 8.5 0 14 8.6 0 15 8.5 0 16 8.2 0 17 8.1 0 18 7.9 0 19 8.6 0 20 8.7 0 21 8.7 0 22 8.5 0 23 8.4 0 24 8.5 0 25 8.7 0 26 8.7 0 27 8.6 0 28 8.5 0 29 8.3 0 30 8.0 0 31 8.2 0 32 8.1 0 33 8.1 0 34 8.0 0 35 7.9 0 36 7.9 0 37 8.0 0 38 8.0 0 39 7.9 0 40 8.0 0 41 7.7 0 42 7.2 0 43 7.5 0 44 7.3 0 45 7.0 0 46 7.0 0 47 7.0 0 48 7.2 0 49 7.3 1 50 7.1 1 51 6.8 1 52 6.4 1 53 6.1 1 54 6.5 1 55 7.7 1 56 7.9 1 57 7.5 1 58 6.9 1 59 6.6 1 60 6.9 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 8.140 -1.165 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.13958 -0.27344 0.01042 0.46042 1.16042 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.13958 0.08386 97.065 < 2e-16 *** X -1.16458 0.18751 -6.211 6.11e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.581 on 58 degrees of freedom Multiple R-squared: 0.3994, Adjusted R-squared: 0.3891 F-statistic: 38.57 on 1 and 58 DF, p-value: 6.108e-08 > 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.9209000 0.15819994 0.07909997 [2,] 0.9150295 0.16994092 0.08497046 [3,] 0.9167650 0.16646996 0.08323498 [4,] 0.9675199 0.06496029 0.03248014 [5,] 0.9855098 0.02898031 0.01449016 [6,] 0.9786862 0.04262769 0.02131385 [7,] 0.9641397 0.07172068 0.03586034 [8,] 0.9423329 0.11533416 0.05766708 [9,] 0.9164473 0.16710532 0.08355266 [10,] 0.8902355 0.21952893 0.10976446 [11,] 0.8535081 0.29298381 0.14649190 [12,] 0.8047630 0.39047393 0.19523697 [13,] 0.7524262 0.49514762 0.24757381 [14,] 0.7139647 0.57207068 0.28603534 [15,] 0.6745976 0.65080481 0.32540241 [16,] 0.6558149 0.68837021 0.34418510 [17,] 0.6420907 0.71581862 0.35790931 [18,] 0.5974252 0.80514966 0.40257483 [19,] 0.5435038 0.91299235 0.45649617 [20,] 0.5056533 0.98869338 0.49434669 [21,] 0.5197726 0.96045475 0.48022737 [22,] 0.5488968 0.90220649 0.45110325 [23,] 0.5664548 0.86709047 0.43354523 [24,] 0.5747077 0.85058462 0.42529231 [25,] 0.5571929 0.88561419 0.44280710 [26,] 0.5272423 0.94551545 0.47275773 [27,] 0.5080259 0.98394817 0.49197409 [28,] 0.4858783 0.97175656 0.51412172 [29,] 0.4694924 0.93898481 0.53050760 [30,] 0.4515210 0.90304203 0.54847899 [31,] 0.4335011 0.86700227 0.56649886 [32,] 0.4172356 0.83447127 0.58276436 [33,] 0.4145968 0.82919355 0.58540322 [34,] 0.4255087 0.85101750 0.57449125 [35,] 0.4374172 0.87483436 0.56258282 [36,] 0.4960936 0.99218711 0.50390645 [37,] 0.5224088 0.95518245 0.47759122 [38,] 0.5629309 0.87413817 0.43706909 [39,] 0.5672776 0.86544487 0.43272244 [40,] 0.5683805 0.86323894 0.43161947 [41,] 0.5886767 0.82264658 0.41132329 [42,] 0.5878143 0.82437149 0.41218575 [43,] 0.5726214 0.85475720 0.42737860 [44,] 0.5179009 0.96419818 0.48209909 [45,] 0.4419587 0.88391741 0.55804130 [46,] 0.3453999 0.69079978 0.65460011 [47,] 0.2561499 0.51229971 0.74385015 [48,] 0.2382460 0.47649202 0.76175399 [49,] 0.3797712 0.75954239 0.62022880 [50,] 0.4070712 0.81414241 0.59292880 [51,] 0.3651029 0.73020587 0.63489706 > postscript(file="/var/www/html/rcomp/tmp/12wth1259936168.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/21zdu1259936168.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/3nnlk1259936168.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/4aiaj1259936168.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/5tme51259936168.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.76041667 0.66041667 0.16041667 -0.63958333 -0.93958333 -0.73958333 7 8 9 10 11 12 0.66041667 1.16041667 1.16041667 0.56041667 0.06041667 0.16041667 13 14 15 16 17 18 0.36041667 0.46041667 0.36041667 0.06041667 -0.03958333 -0.23958333 19 20 21 22 23 24 0.46041667 0.56041667 0.56041667 0.36041667 0.26041667 0.36041667 25 26 27 28 29 30 0.56041667 0.56041667 0.46041667 0.36041667 0.16041667 -0.13958333 31 32 33 34 35 36 0.06041667 -0.03958333 -0.03958333 -0.13958333 -0.23958333 -0.23958333 37 38 39 40 41 42 -0.13958333 -0.13958333 -0.23958333 -0.13958333 -0.43958333 -0.93958333 43 44 45 46 47 48 -0.63958333 -0.83958333 -1.13958333 -1.13958333 -1.13958333 -0.93958333 49 50 51 52 53 54 0.32500000 0.12500000 -0.17500000 -0.57500000 -0.87500000 -0.47500000 55 56 57 58 59 60 0.72500000 0.92500000 0.52500000 -0.07500000 -0.37500000 -0.07500000 > postscript(file="/var/www/html/rcomp/tmp/60nx31259936168.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.76041667 NA 1 0.66041667 0.76041667 2 0.16041667 0.66041667 3 -0.63958333 0.16041667 4 -0.93958333 -0.63958333 5 -0.73958333 -0.93958333 6 0.66041667 -0.73958333 7 1.16041667 0.66041667 8 1.16041667 1.16041667 9 0.56041667 1.16041667 10 0.06041667 0.56041667 11 0.16041667 0.06041667 12 0.36041667 0.16041667 13 0.46041667 0.36041667 14 0.36041667 0.46041667 15 0.06041667 0.36041667 16 -0.03958333 0.06041667 17 -0.23958333 -0.03958333 18 0.46041667 -0.23958333 19 0.56041667 0.46041667 20 0.56041667 0.56041667 21 0.36041667 0.56041667 22 0.26041667 0.36041667 23 0.36041667 0.26041667 24 0.56041667 0.36041667 25 0.56041667 0.56041667 26 0.46041667 0.56041667 27 0.36041667 0.46041667 28 0.16041667 0.36041667 29 -0.13958333 0.16041667 30 0.06041667 -0.13958333 31 -0.03958333 0.06041667 32 -0.03958333 -0.03958333 33 -0.13958333 -0.03958333 34 -0.23958333 -0.13958333 35 -0.23958333 -0.23958333 36 -0.13958333 -0.23958333 37 -0.13958333 -0.13958333 38 -0.23958333 -0.13958333 39 -0.13958333 -0.23958333 40 -0.43958333 -0.13958333 41 -0.93958333 -0.43958333 42 -0.63958333 -0.93958333 43 -0.83958333 -0.63958333 44 -1.13958333 -0.83958333 45 -1.13958333 -1.13958333 46 -1.13958333 -1.13958333 47 -0.93958333 -1.13958333 48 0.32500000 -0.93958333 49 0.12500000 0.32500000 50 -0.17500000 0.12500000 51 -0.57500000 -0.17500000 52 -0.87500000 -0.57500000 53 -0.47500000 -0.87500000 54 0.72500000 -0.47500000 55 0.92500000 0.72500000 56 0.52500000 0.92500000 57 -0.07500000 0.52500000 58 -0.37500000 -0.07500000 59 -0.07500000 -0.37500000 60 NA -0.07500000 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.66041667 0.76041667 [2,] 0.16041667 0.66041667 [3,] -0.63958333 0.16041667 [4,] -0.93958333 -0.63958333 [5,] -0.73958333 -0.93958333 [6,] 0.66041667 -0.73958333 [7,] 1.16041667 0.66041667 [8,] 1.16041667 1.16041667 [9,] 0.56041667 1.16041667 [10,] 0.06041667 0.56041667 [11,] 0.16041667 0.06041667 [12,] 0.36041667 0.16041667 [13,] 0.46041667 0.36041667 [14,] 0.36041667 0.46041667 [15,] 0.06041667 0.36041667 [16,] -0.03958333 0.06041667 [17,] -0.23958333 -0.03958333 [18,] 0.46041667 -0.23958333 [19,] 0.56041667 0.46041667 [20,] 0.56041667 0.56041667 [21,] 0.36041667 0.56041667 [22,] 0.26041667 0.36041667 [23,] 0.36041667 0.26041667 [24,] 0.56041667 0.36041667 [25,] 0.56041667 0.56041667 [26,] 0.46041667 0.56041667 [27,] 0.36041667 0.46041667 [28,] 0.16041667 0.36041667 [29,] -0.13958333 0.16041667 [30,] 0.06041667 -0.13958333 [31,] -0.03958333 0.06041667 [32,] -0.03958333 -0.03958333 [33,] -0.13958333 -0.03958333 [34,] -0.23958333 -0.13958333 [35,] -0.23958333 -0.23958333 [36,] -0.13958333 -0.23958333 [37,] -0.13958333 -0.13958333 [38,] -0.23958333 -0.13958333 [39,] -0.13958333 -0.23958333 [40,] -0.43958333 -0.13958333 [41,] -0.93958333 -0.43958333 [42,] -0.63958333 -0.93958333 [43,] -0.83958333 -0.63958333 [44,] -1.13958333 -0.83958333 [45,] -1.13958333 -1.13958333 [46,] -1.13958333 -1.13958333 [47,] -0.93958333 -1.13958333 [48,] 0.32500000 -0.93958333 [49,] 0.12500000 0.32500000 [50,] -0.17500000 0.12500000 [51,] -0.57500000 -0.17500000 [52,] -0.87500000 -0.57500000 [53,] -0.47500000 -0.87500000 [54,] 0.72500000 -0.47500000 [55,] 0.92500000 0.72500000 [56,] 0.52500000 0.92500000 [57,] -0.07500000 0.52500000 [58,] -0.37500000 -0.07500000 [59,] -0.07500000 -0.37500000 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.66041667 0.76041667 2 0.16041667 0.66041667 3 -0.63958333 0.16041667 4 -0.93958333 -0.63958333 5 -0.73958333 -0.93958333 6 0.66041667 -0.73958333 7 1.16041667 0.66041667 8 1.16041667 1.16041667 9 0.56041667 1.16041667 10 0.06041667 0.56041667 11 0.16041667 0.06041667 12 0.36041667 0.16041667 13 0.46041667 0.36041667 14 0.36041667 0.46041667 15 0.06041667 0.36041667 16 -0.03958333 0.06041667 17 -0.23958333 -0.03958333 18 0.46041667 -0.23958333 19 0.56041667 0.46041667 20 0.56041667 0.56041667 21 0.36041667 0.56041667 22 0.26041667 0.36041667 23 0.36041667 0.26041667 24 0.56041667 0.36041667 25 0.56041667 0.56041667 26 0.46041667 0.56041667 27 0.36041667 0.46041667 28 0.16041667 0.36041667 29 -0.13958333 0.16041667 30 0.06041667 -0.13958333 31 -0.03958333 0.06041667 32 -0.03958333 -0.03958333 33 -0.13958333 -0.03958333 34 -0.23958333 -0.13958333 35 -0.23958333 -0.23958333 36 -0.13958333 -0.23958333 37 -0.13958333 -0.13958333 38 -0.23958333 -0.13958333 39 -0.13958333 -0.23958333 40 -0.43958333 -0.13958333 41 -0.93958333 -0.43958333 42 -0.63958333 -0.93958333 43 -0.83958333 -0.63958333 44 -1.13958333 -0.83958333 45 -1.13958333 -1.13958333 46 -1.13958333 -1.13958333 47 -0.93958333 -1.13958333 48 0.32500000 -0.93958333 49 0.12500000 0.32500000 50 -0.17500000 0.12500000 51 -0.57500000 -0.17500000 52 -0.87500000 -0.57500000 53 -0.47500000 -0.87500000 54 0.72500000 -0.47500000 55 0.92500000 0.72500000 56 0.52500000 0.92500000 57 -0.07500000 0.52500000 58 -0.37500000 -0.07500000 59 -0.07500000 -0.37500000 > 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/7vuvp1259936168.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/8pw0z1259936168.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/9ykld1259936168.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/10dt9o1259936168.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/1178zq1259936168.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/12tso11259936168.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/13bpd51259936168.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/14ki1i1259936168.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/150h4n1259936168.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/16op4r1259936168.tab") + } > > system("convert tmp/12wth1259936168.ps tmp/12wth1259936168.png") > system("convert tmp/21zdu1259936168.ps tmp/21zdu1259936168.png") > system("convert tmp/3nnlk1259936168.ps tmp/3nnlk1259936168.png") > system("convert tmp/4aiaj1259936168.ps tmp/4aiaj1259936168.png") > system("convert tmp/5tme51259936168.ps tmp/5tme51259936168.png") > system("convert tmp/60nx31259936168.ps tmp/60nx31259936168.png") > system("convert tmp/7vuvp1259936168.ps tmp/7vuvp1259936168.png") > system("convert tmp/8pw0z1259936168.ps tmp/8pw0z1259936168.png") > system("convert tmp/9ykld1259936168.ps tmp/9ykld1259936168.png") > system("convert tmp/10dt9o1259936168.ps tmp/10dt9o1259936168.png") > > > proc.time() user system elapsed 2.506 1.591 8.009