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 <- c(255 + ,280.2 + ,299.9 + ,339.2 + ,374.2 + ,393.5 + ,389.2 + ,381.7 + ,375.2 + ,369 + ,357.4 + ,352.1 + ,346.5 + ,342.9 + ,340.3 + ,328.3 + ,322.9 + ,314.3 + ,308.9 + ,294 + ,285.6 + ,281.2 + ,280.3 + ,278.8 + ,274.5 + ,270.4 + ,263.4 + ,259.9 + ,258 + ,262.7 + ,284.7 + ,311.3 + ,322.1 + ,327 + ,331.3 + ,333.3 + ,321.4 + ,327 + ,320 + ,314.7 + ,316.7 + ,314.4 + ,321.3 + ,318.2 + ,307.2 + ,301.3 + ,287.5 + ,277.7 + ,274.4 + ,258.8 + ,253.3 + ,251 + ,248.4 + ,249.5 + ,246.1 + ,244.5 + ,243.6 + ,244 + ,240.8 + ,249.8 + ,248 + ,259.4 + ,260.5 + ,260.8 + ,261.3 + ,259.5 + ,256.6 + ,257.9 + ,256.5 + ,254.2 + ,253.3 + ,253.8 + ,255.5 + ,257.1 + ,257.3 + ,253.2 + ,252.8 + ,252 + ,250.7 + ,252.2 + ,250 + ,251 + ,253.4 + ,251.2 + ,255.6 + ,261.1 + ,258.9 + ,259.9 + ,261.2 + ,264.7 + ,267.1 + ,266.4 + ,267.7 + ,268.6 + ,267.5 + ,268.5 + ,268.5 + ,270.5 + ,270.9 + ,270.1 + ,269.3 + ,269.8 + ,270.1 + ,264.9 + ,263.7 + ,264.8 + ,263.7 + ,255.9 + ,276.2 + ,360.1 + ,380.5 + ,373.7 + ,369.8 + ,366.6 + ,359.3 + ,345.8 + ,326.2 + ,324.5 + ,328.1 + ,327.5 + ,324.4 + ,316.5 + ,310.9 + ,301.5 + ,291.7 + ,290.4 + ,287.4 + ,277.7 + ,281.6 + ,288 + ,276 + ,272.9 + ,283 + ,283.3 + ,276.8 + ,284.5 + ,282.7 + ,281.2 + ,287.4 + ,283.1 + ,284 + ,285.5 + ,289.2 + ,292.5 + ,296.4 + ,305.2 + ,303.9 + ,311.5 + ,316.3 + ,316.7 + ,322.5 + ,317.1 + ,309.8 + ,303.8 + ,290.3 + ,293.7 + ,291.7 + ,296.5 + ,289.1 + ,288.5 + ,293.8 + ,297.7 + ,305.4 + ,302.7 + ,302.5 + ,303 + ,294.5 + ,294.1 + ,294.5 + ,297.1 + ,289.4 + ,292.4 + ,287.9 + ,286.6 + ,280.5 + ,272.4 + ,269.2 + ,270.6 + ,267.3 + ,262.5 + ,266.8 + ,268.8 + ,263.1 + ,261.2 + ,266 + ,262.5 + ,265.2 + ,261.3 + ,253.7 + ,249.2 + ,239.1 + ,236.4 + ,235.2 + ,245.2 + ,246.2 + ,247.7 + ,251.4 + ,253.3 + ,254.8 + ,250 + ,249.3 + ,241.5 + ,243.3 + ,248 + ,253 + ,252.9 + ,251.5 + ,251.6 + ,253.5 + ,259.8 + ,334.1 + ,448 + ,445.8 + ,445 + ,448.2 + ,438.2 + ,439.8 + ,423.4 + ,410.8 + ,408.4 + ,406.7 + ,405.9 + ,402.7 + ,405.1 + ,399.6 + ,386.5 + ,381.4 + ,375.2 + ,357.7 + ,359 + ,355 + ,352.7 + ,344.4 + ,343.8 + ,338 + ,339 + ,333.3 + ,334.4 + ,328.3 + ,330.7 + ,330 + ,331.6 + ,351.2 + ,389.4 + ,410.9 + ,442.8 + ,462.8 + ,466.9 + ,461.7 + ,439.2 + ,430.3 + ,416.1 + ,402.5 + ,397.3 + ,403.3 + ,395.9 + ,387.8 + ,378.6 + ,377.1 + ,370.4 + ,362 + ,350.3 + ,348.2 + ,344.6 + ,343.5 + ,342.8 + ,347.6 + ,346.6 + ,349.5 + ,342.1 + ,342 + ,342.8 + ,339.3 + ,348.2 + ,333.7 + ,334.7 + ,354 + ,367.7 + ,363.3 + ,358.4 + ,353.1 + ,343.1 + ,344.6 + ,344.4 + ,333.9 + ,331.7 + ,324.3 + ,321.2 + ,322.4 + ,321.7 + ,320.5 + ,312.8 + ,309.7 + ,315.6 + ,309.7 + ,304.6 + ,302.5 + ,301.5 + ,298.8 + ,291.3 + ,293.6 + ,294.6 + ,285.9 + ,297.6 + ,301.1 + ,293.8 + ,297.7 + ,292.9 + ,292.1 + ,287.2 + ,288.2 + ,283.8 + ,299.9 + ,292.4 + ,293.3 + ,300.8 + ,293.7 + ,293.1 + ,294.4 + ,292.1 + ,291.9 + ,282.5 + ,277.9 + ,287.5 + ,289.2 + ,285.6 + ,293.2 + ,290.8 + ,283.1 + ,275 + ,287.8 + ,287.8 + ,287.4 + ,284 + ,277.8 + ,277.6 + ,304.9 + ,294 + ,300.9 + ,324 + ,332.9 + ,341.6 + ,333.4 + ,348.2 + ,344.7 + ,344.7 + ,329.3 + ,323.5 + ,323.2 + ,317.4 + ,330.1 + ,329.2 + ,334.9 + ,315.8 + ,315.4 + ,319.6 + ,317.3 + ,313.8) > par9 = '0' > par8 = '0' > par7 = '0' > par6 = '3' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = 'FALSE' > #'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) > if (par1 == 'TRUE') par1 <- TRUE > if (par1 == 'FALSE') par1 <- FALSE > par2 <- as.numeric(par2) #Box-Cox lambda transformation parameter > par3 <- as.numeric(par3) #degree of non-seasonal differencing > par4 <- as.numeric(par4) #degree of seasonal differencing > par5 <- as.numeric(par5) #seasonal period > par6 <- as.numeric(par6) #degree (p) of the non-seasonal AR(p) polynomial > par7 <- as.numeric(par7) #degree (q) of the non-seasonal MA(q) polynomial > par8 <- as.numeric(par8) #degree (P) of the seasonal AR(P) polynomial > par9 <- as.numeric(par9) #degree (Q) of the seasonal MA(Q) polynomial > armaGR <- function(arima.out, names, n){ + try1 <- arima.out$coef + try2 <- sqrt(diag(arima.out$var.coef)) + try.data.frame <- data.frame(matrix(NA,ncol=4,nrow=length(names))) + dimnames(try.data.frame) <- list(names,c('coef','std','tstat','pv')) + try.data.frame[,1] <- try1 + for(i in 1:length(try2)) try.data.frame[which(rownames(try.data.frame)==names(try2)[i]),2] <- try2[i] + try.data.frame[,3] <- try.data.frame[,1] / try.data.frame[,2] + try.data.frame[,4] <- round((1-pt(abs(try.data.frame[,3]),df=n-(length(try2)+1)))*2,5) + vector <- rep(NA,length(names)) + vector[is.na(try.data.frame[,4])] <- 0 + maxi <- which.max(try.data.frame[,4]) + continue <- max(try.data.frame[,4],na.rm=TRUE) > .05 + vector[maxi] <- 0 + list(summary=try.data.frame,next.vector=vector,continue=continue) + } > arimaSelect <- function(series, order=c(13,0,0), seasonal=list(order=c(2,0,0),period=12), include.mean=F){ + nrc <- order[1]+order[3]+seasonal$order[1]+seasonal$order[3] + coeff <- matrix(NA, nrow=nrc*2, ncol=nrc) + pval <- matrix(NA, nrow=nrc*2, ncol=nrc) + mylist <- rep(list(NULL), nrc) + names <- NULL + if(order[1] > 0) names <- paste('ar',1:order[1],sep='') + if(order[3] > 0) names <- c( names , paste('ma',1:order[3],sep='') ) + if(seasonal$order[1] > 0) names <- c(names, paste('sar',1:seasonal$order[1],sep='')) + if(seasonal$order[3] > 0) names <- c(names, paste('sma',1:seasonal$order[3],sep='')) + arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML') + mylist[[1]] <- arima.out + last.arma <- armaGR(arima.out, names, length(series)) + mystop <- FALSE + i <- 1 + coeff[i,] <- last.arma[[1]][,1] + pval [i,] <- last.arma[[1]][,4] + i <- 2 + aic <- arima.out$aic + while(!mystop){ + mylist[[i]] <- arima.out + arima.out <- arima(series, order=order, seasonal=seasonal, include.mean=include.mean, method='ML', fixed=last.arma$next.vector) + aic <- c(aic, arima.out$aic) + last.arma <- armaGR(arima.out, names, length(series)) + mystop <- !last.arma$continue + coeff[i,] <- last.arma[[1]][,1] + pval [i,] <- last.arma[[1]][,4] + i <- i+1 + } + list(coeff, pval, mylist, aic=aic) + } > arimaSelectplot <- function(arimaSelect.out,noms,choix){ + noms <- names(arimaSelect.out[[3]][[1]]$coef) + coeff <- arimaSelect.out[[1]] + k <- min(which(is.na(coeff[,1])))-1 + coeff <- coeff[1:k,] + pval <- arimaSelect.out[[2]][1:k,] + aic <- arimaSelect.out$aic[1:k] + coeff[coeff==0] <- NA + n <- ncol(coeff) + if(missing(choix)) choix <- k + layout(matrix(c(1,1,1,2, + 3,3,3,2, + 3,3,3,4, + 5,6,7,7),nr=4), + widths=c(10,35,45,15), + heights=c(30,30,15,15)) + couleurs <- rainbow(75)[1:50]#(50) + ticks <- pretty(coeff) + par(mar=c(1,1,3,1)) + plot(aic,k:1-.5,type='o',pch=21,bg='blue',cex=2,axes=F,lty=2,xpd=NA) + points(aic[choix],k-choix+.5,pch=21,cex=4,bg=2,xpd=NA) + title('aic',line=2) + par(mar=c(3,0,0,0)) + plot(0,axes=F,xlab='',ylab='',xlim=range(ticks),ylim=c(.1,1)) + rect(xleft = min(ticks) + (0:49)/50*(max(ticks)-min(ticks)), + xright = min(ticks) + (1:50)/50*(max(ticks)-min(ticks)), + ytop = rep(1,50), + ybottom= rep(0,50),col=couleurs,border=NA) + axis(1,ticks) + rect(xleft=min(ticks),xright=max(ticks),ytop=1,ybottom=0) + text(mean(coeff,na.rm=T),.5,'coefficients',cex=2,font=2) + par(mar=c(1,1,3,1)) + image(1:n,1:k,t(coeff[k:1,]),axes=F,col=couleurs,zlim=range(ticks)) + for(i in 1:n) for(j in 1:k) if(!is.na(coeff[j,i])) { + if(pval[j,i]<.01) symb = 'green' + else if( (pval[j,i]<.05) & (pval[j,i]>=.01)) symb = 'orange' + else if( (pval[j,i]<.1) & (pval[j,i]>=.05)) symb = 'red' + else symb = 'black' + polygon(c(i+.5 ,i+.2 ,i+.5 ,i+.5), + c(k-j+0.5,k-j+0.5,k-j+0.8,k-j+0.5), + col=symb) + if(j==choix) { + rect(xleft=i-.5, + xright=i+.5, + ybottom=k-j+1.5, + ytop=k-j+.5, + lwd=4) + text(i, + k-j+1, + round(coeff[j,i],2), + cex=1.2, + font=2) + } + else{ + rect(xleft=i-.5,xright=i+.5,ybottom=k-j+1.5,ytop=k-j+.5) + text(i,k-j+1,round(coeff[j,i],2),cex=1.2,font=1) + } + } + axis(3,1:n,noms) + par(mar=c(0.5,0,0,0.5)) + plot(0,axes=F,xlab='',ylab='',type='n',xlim=c(0,8),ylim=c(-.2,.8)) + cols <- c('green','orange','red','black') + niv <- c('0','0.01','0.05','0.1') + for(i in 0:3){ + polygon(c(1+2*i ,1+2*i ,1+2*i-.5 ,1+2*i), + c(.4 ,.7 , .4 , .4), + col=cols[i+1]) + text(2*i,0.5,niv[i+1],cex=1.5) + } + text(8,.5,1,cex=1.5) + text(4,0,'p-value',cex=2) + box() + residus <- arimaSelect.out[[3]][[choix]]$res + par(mar=c(1,2,4,1)) + acf(residus,main='') + title('acf',line=.5) + par(mar=c(1,2,4,1)) + pacf(residus,main='') + title('pacf',line=.5) + par(mar=c(2,2,4,1)) + qqnorm(residus,main='') + title('qq-norm',line=.5) + qqline(residus) + residus + } > if (par2 == 0) x <- log(x) > if (par2 != 0) x <- x^par2 > (selection <- arimaSelect(x, order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5))) [[1]] [,1] [,2] [,3] [1,] 0.4726035 -0.09291640 0.07830372 [2,] 0.4671177 -0.05743159 0.00000000 [3,] 0.4421631 0.00000000 0.00000000 [4,] NA NA NA [5,] NA NA NA [6,] NA NA NA [[2]] [,1] [,2] [,3] [1,] 0 0.11151 0.14518 [2,] 0 0.28001 NA [3,] 0 NA NA [4,] NA NA NA [5,] NA NA NA [6,] NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 0.4726 -0.0929 0.0783 s.e. 0.0529 0.0582 0.0536 sigma^2 estimated as 112.1: log likelihood = -1349.15, aic = 2706.3 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 0.4726 -0.0929 0.0783 s.e. 0.0529 0.0582 0.0536 sigma^2 estimated as 112.1: log likelihood = -1349.15, aic = 2706.3 [[3]][[3]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 0.4671 -0.0574 0 s.e. 0.0529 0.0531 0 sigma^2 estimated as 112.8: log likelihood = -1350.21, aic = 2706.42 $aic [1] 2706.295 2706.420 2705.588 Warning messages: 1: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 2: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE > postscript(file="/var/www/html/rcomp/tmp/1owx21260645808.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > resid <- arimaSelectplot(selection) > dev.off() null device 1 > resid Time Series: Start = 1 End = 358 Frequency = 1 [1] 0.25499984 22.57047533 8.55383613 31.54505694 17.77367592 [6] 5.20794123 -11.30526642 -4.38296418 -3.24357294 -3.59447173 [11] -9.07717546 -0.23751030 -3.79048250 -1.28852819 -1.23999310 [16] -10.99224765 0.05609050 -6.76674337 -1.69291819 -12.87147597 [21] -1.75007656 -1.33194181 0.67289263 -1.33229304 -3.65101185 [26] -2.17754119 -5.33177318 -0.46564548 -0.66710910 5.38651311 [31] 19.69542671 16.59333865 -0.36183640 1.38280886 2.63138432 [36] 0.27280859 -12.58727961 11.27356403 -10.29929511 -1.70855908 [41] 4.07370280 -3.53862285 8.08923393 -6.45520491 -9.15565712 [46] -0.93974301 -11.67575292 -3.69262185 0.48519774 -14.62134108 [51] 1.59751217 -0.62678531 -1.84150298 2.18241342 -4.06315162 [56] 0.05137499 -0.34787905 0.72851541 -3.43853552 10.51774933 [61] -6.18784055 12.75769618 -4.32851885 0.44089060 0.42303943 [66] -2.01632938 -2.03047231 2.55126453 -2.17380464 -1.57137413 [71] 0.09396653 0.78831330 1.41475271 0.83461567 -0.44975465 [76] -4.10153300 1.52666896 -0.84862242 -0.94927846 2.06130776 [81] -2.97533764 2.11380636 1.80653279 -3.26365094 5.56549479 [86] 3.31833255 -4.51644847 2.34353271 0.70653279 2.95017855 [91] 0.83974905 -1.62007197 1.76481821 0.25254485 -1.44574488 [96] 1.56551792 -0.53029246 2.05743159 -0.53423544 -0.87198391 [101] -0.40333319 0.82774891 0.02049587 -5.31141952 1.24624161 [106] 1.36189701 -1.68274740 -7.22299576 23.88034346 73.96954393 [111] -17.62531538 -11.51069129 0.44800487 -1.76877569 -6.02920649 [116] -10.27382173 -13.71316138 6.68018086 3.26844101 -2.37925749 [121] -2.61297565 -6.48639402 -2.08780794 -7.23785031 -5.73071033 [126] 2.73789672 -2.95557652 -8.37330791 8.25874711 4.02115450 [131] -14.76557021 2.87297478 10.85888588 -4.59592688 -6.06007628 [136] 10.75349465 -5.77011175 -0.21696488 6.79729972 -7.28227724 [141] 3.26468203 0.83263823 3.05101185 1.65781182 2.57100840 [146] 7.16776514 -5.18665273 8.71265100 1.17524427 -1.40568499 [151] 5.88882453 -8.08631013 -4.44446111 -2.90017122 -11.11654427 [156] 9.36149968 -4.36352667 5.92950283 -9.75702822 3.13234274 [161] 5.15527689 1.38981714 6.18262831 -6.07282324 1.50344106 [166] 0.43835826 -8.74504518 3.59921640 0.09867860 2.39018028 [171] -8.89153343 6.74612856 -6.34357638 0.97432450 -5.75118911 [176] -5.32524298 0.23332084 2.42958084 -4.13774589 -3.17810731 [181] 6.35264081 -0.28427781 -6.38727961 0.87743417 5.36016362 [186] -5.85128507 4.61058363 -5.36222840 -5.62317561 -1.17388853 [191] -8.43445033 1.75944682 -0.51884119 10.40547598 -3.74009509 [196] 1.60719815 3.05675501 0.25781182 0.82497321 -5.39155656 [201] 1.62831243 -7.74868922 5.40331609 3.41122173 2.90792358 [206] -2.16566013 -1.06613029 0.74822165 1.77288401 5.41821949 [211] 71.46627839 79.55497250 -51.13754122 6.76911677 3.44734468 [216] -11.54072197 6.45495827 -17.72170422 -4.84737887 2.54380522 [221] -1.30255547 -0.14373569 -2.92393952 3.84883143 -6.80486360 [226] -10.39301674 0.70336838 -4.57005343 -14.89677124 9.11848424 [231] -5.61230581 -0.35686806 -7.45535560 3.14498441 -5.99641154 [236] 3.67482382 -6.50022092 3.82000258 -6.94118954 5.31259283 [241] -2.17141521 2.06481821 18.81240954 29.13638325 4.78176226 [246] 24.05085568 6.33372390 -3.41028674 -5.96655090 -19.83551835 [251] 1.31150442 -11.33486302 -7.47806952 0.33727243 7.64794255 [256] -10.50135057 -4.29873936 -5.84134022 2.33228716 -6.52769402 [261] -5.35645867 -8.16100280 2.88285198 -3.29100236 0.46101745 [266] -0.39292422 5.06380766 -3.28236716 3.64278934 -8.81207297 [271] 3.52322272 0.42171803 -3.87943733 10.58085729 -18.85835825 [276] 8.28434805 18.00012427 4.74205962 -9.69108311 -2.05786929 [281] -3.26382216 -7.80569087 5.86678977 -1.47499245 -10.32042908 [286] 2.69324973 -6.97537269 0.23032163 2.22307118 -1.43857918 [291] -0.80409969 -7.17966085 0.42788853 6.90584171 -8.83403246 [296] -2.00515909 -0.05654600 -0.31195389 -2.35348861 -6.29621375 [301] 5.64831760 -0.50510766 -9.03502507 15.82135574 -2.46493212 [306] -8.26296244 7.51096990 -7.04100969 1.66614824 -4.80197744 [311] 3.24293155 -5.14853250 18.21274955 -15.27329425 5.32803145 [316] 6.64885715 -10.55169446 3.14727271 1.17250636 -2.94171199 [321] 0.94903182 -9.43866911 -0.22057976 11.20888459 -3.04851540 [326] -3.84275688 9.37925749 -6.15684838 -6.14243741 -4.64102938 [331] 16.14143030 -6.44430266 0.33512432 -3.21315291 -4.63477239 [336] 2.50086246 27.03734770 -23.66380004 13.55946547 19.25088344 [341] -1.49414135 5.86932197 -11.75278303 19.13002010 -10.88428125 [346] 2.48489951 -15.60101056 1.39361287 1.52483632 -5.99296789 [351] 15.39205329 -7.16549823 6.84978711 -21.81425943 8.84930847 [356] 3.28990377 -4.28486705 -2.18441658 > postscript(file="/var/www/html/rcomp/tmp/2lpwd1260645808.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(resid,length(resid)/2, main='Residual Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3aimk1260645808.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(resid,length(resid)/2, main='Residual Partial Autocorrelation Function') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4nqvr1260645808.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > cpgram(resid, main='Residual Cumulative Periodogram') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5ydmi1260645808.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(resid, main='Residual Histogram', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6eimw1260645808.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7k3461260645808.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(resid, main='Residual Normal Q-Q Plot') > qqline(resid) > dev.off() null device 1 > ncols <- length(selection[[1]][1,]) > nrows <- length(selection[[2]][,1])-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,'ARIMA Parameter Estimation and Backward Selection', ncols+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Iteration', header=TRUE) > for (i in 1:ncols) { + a<-table.element(a,names(selection[[3]][[1]]$coef)[i],header=TRUE) + } > a<-table.row.end(a) > for (j in 1:nrows) { + a<-table.row.start(a) + mydum <- 'Estimates (' + mydum <- paste(mydum,j) + mydum <- paste(mydum,')') + a<-table.element(a,mydum, header=TRUE) + for (i in 1:ncols) { + a<-table.element(a,round(selection[[1]][j,i],4)) + } + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'(p-val)', header=TRUE) + for (i in 1:ncols) { + mydum <- '(' + mydum <- paste(mydum,round(selection[[2]][j,i],4),sep='') + mydum <- paste(mydum,')') + a<-table.element(a,mydum) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/8htnb1260645808.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Estimated ARIMA Residuals', 1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Value', 1,TRUE) > a<-table.row.end(a) > for (i in (par4*par5+par3):length(resid)) { + a<-table.row.start(a) + a<-table.element(a,resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/9ldzv1260645808.tab") > > try(system("convert tmp/1owx21260645808.ps tmp/1owx21260645808.png",intern=TRUE)) character(0) > try(system("convert tmp/2lpwd1260645808.ps tmp/2lpwd1260645808.png",intern=TRUE)) character(0) > try(system("convert tmp/3aimk1260645808.ps tmp/3aimk1260645808.png",intern=TRUE)) character(0) > try(system("convert tmp/4nqvr1260645808.ps tmp/4nqvr1260645808.png",intern=TRUE)) character(0) > try(system("convert tmp/5ydmi1260645808.ps tmp/5ydmi1260645808.png",intern=TRUE)) character(0) > try(system("convert tmp/6eimw1260645808.ps tmp/6eimw1260645808.png",intern=TRUE)) character(0) > try(system("convert tmp/7k3461260645808.ps tmp/7k3461260645808.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.855 1.105 3.056