R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(51.220 + ,50.487 + ,49.415 + ,49.398 + ,48.196 + ,47.348 + ,49.331 + ,49.644 + ,49.588 + ,49.567 + ,49.010 + ,49.563 + ,49.741 + ,49.487 + ,48.278 + ,47.478 + ,46.985 + ,45.216 + ,46.581 + ,49.266 + ,48.121 + ,46.412 + ,46.285 + ,46.824 + ,46.949 + ,45.355 + ,44.924 + ,45.059 + ,44.202 + ,44.149 + ,46.151 + ,47.703 + ,48.436 + ,47.089 + ,47.492 + ,49.295 + ,49.127 + ,50.041 + ,48.857 + ,48.428 + ,48.788 + ,48.820 + ,50.743 + ,52.590 + ,51.959 + ,53.451 + ,55.674 + ,56.120 + ,55.685 + ,56.714 + ,54.882 + ,55.173 + ,53.574 + ,53.954 + ,58.055 + ,61.062 + ,58.353 + ,59.693 + ,58.833 + ,60.417 + ,61.696 + ,62.515 + ,62.687 + ,61.794 + ,63.014 + ,63.134 + ,68.057 + ,67.327 + ,68.310 + ,69.780 + ,69.944 + ,69.881 + ,71.397 + ,70.631 + ,70.452 + ,69.862 + ,69.114 + ,69.358 + ,71.133 + ,73.128 + ,73.528 + ,73.677 + ,72.273 + ,71.962 + ,73.654 + ,73.305 + ,73.355 + ,73.346 + ,72.881 + ,72.424 + ,74.540 + ,74.847 + ,75.904 + ,76.870 + ,76.370 + ,77.631 + ,78.335 + ,77.926 + ,77.236 + ,76.755 + ,74.710 + ,73.486 + ,76.034 + ,76.389 + ,77.767 + ,78.124 + ,76.696 + ,77.375 + ,77.431 + ,77.347 + ,77.013 + ,76.666 + ,75.225 + ,75.579 + ,77.100 + ,78.592 + ,79.502 + ,78.528 + ,77.775 + ,77.271 + ,78.738 + ,77.885 + ,76.896 + ,75.813 + ,74.958 + ,75.340 + ,77.187 + ,78.602 + ,81.653 + ,78.125 + ,76.092 + ,74.870 + ,75.615 + ,74.776 + ,72.528 + ,71.894 + ,71.641 + ,71.145 + ,73.320 + ,72.186 + ,72.854 + ,74.243 + ,74.628 + ,72.368 + ,75.361 + ,72.746 + ,70.536 + ,69.410 + ,66.219 + ,66.739 + ,67.626 + ,70.602 + ,71.758 + ,71.786 + ,69.641 + ,68.055 + ,70.148 + ,69.390 + ,68.562 + ,68.622 + ,68.120 + ,68.308 + ,70.421 + ,69.766 + ,72.157 + ,72.928 + ,75.340 + ,74.812 + ,74.593 + ,76.003 + ,75.112 + ,75.452 + ,75.634 + ,75.653 + ,78.645 + ,73.100 + ,79.699 + ,82.848 + ,81.834 + ,81.736 + ,82.267 + ,84.120 + ,83.819 + ,82.734 + ,81.842 + ,81.735 + ,83.227 + ,81.934 + ,89.521 + ,88.827 + ,85.874 + ,85.211 + ,87.130 + ,88.620 + ,89.563 + ,89.056 + ,88.542 + ,89.504 + ,89.428 + ,86.040 + ,96.240 + ,94.423 + ,93.028 + ,92.285 + ,91.685 + ,94.260 + ,93.858 + ,92.437 + ,92.980 + ,92.099 + ,92.803 + ,88.551 + ,98.334 + ,98.329 + ,96.455 + ,97.109 + ,97.687 + ,98.512 + ,98.673 + ,96.028 + ,98.014 + ,95.580 + ,97.838 + ,97.760 + ,99.913 + ,97.588 + ,93.942 + ,93.656 + ,93.365 + ,92.881 + ,93.120 + ,91.063 + ,90.930 + ,91.946 + ,94.624 + ,95.484 + ,95.862 + ,95.530 + ,94.574 + ,94.677 + ,93.845 + ,91.533 + ,91.214 + ,90.922 + ,89.563 + ,89.945 + ,91.850 + ,92.505 + ,92.437 + ,93.876) > par9 = '1' > par8 = '2' > par7 = '1' > par6 = '3' > par5 = '12' > par4 = '1' > 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] [,4] [,5] [,6] [1,] 0.04314573 -0.06323787 -0.01550791 -0.2817762 0.4552065 0.08588673 [2,] 0.00000000 -0.07315943 -0.02076691 -0.2393108 0.4546142 0.08619379 [3,] 0.00000000 -0.07296799 0.00000000 -0.2406296 0.4516397 0.08898347 [4,] 0.00000000 0.00000000 0.00000000 -0.2586319 0.4528587 0.09503754 [5,] 0.00000000 0.00000000 0.00000000 -0.2521398 0.4640184 0.00000000 [6,] NA NA NA NA NA NA [7,] NA NA NA NA NA NA [8,] NA NA NA NA NA NA [9,] NA NA NA NA NA NA [10,] NA NA NA NA NA NA [11,] NA NA NA NA NA NA [12,] NA NA NA NA NA NA [13,] NA NA NA NA NA NA [14,] NA NA NA NA NA NA [,7] [1,] -0.9999972 [2,] -1.0000087 [3,] -1.0000028 [4,] -1.0000009 [5,] -0.9412078 [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA [13,] NA [14,] NA [[2]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.9324 0.64062 0.86771 0.57625 0e+00 0.21447 0 [2,] NA 0.27500 0.75184 0.00030 0e+00 0.21206 0 [3,] NA 0.27492 NA 0.00030 0e+00 0.19397 0 [4,] NA NA NA 0.00019 0e+00 0.16438 0 [5,] NA NA NA 0.00033 1e-05 NA 0 [6,] NA NA NA NA NA NA NA [7,] NA NA NA NA NA NA NA [8,] NA NA NA NA NA NA NA [9,] NA NA NA NA NA NA NA [10,] NA NA NA NA NA NA NA [11,] NA NA NA NA NA NA NA [12,] NA NA NA NA NA NA NA [13,] NA NA NA NA NA NA NA [14,] NA NA NA NA NA NA NA [[3]] [[3]][[1]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.0431 -0.0632 -0.0155 -0.2818 0.4552 0.0859 -1.0000 s.e. 0.5081 0.1353 0.0930 0.5035 0.0678 0.0690 0.0896 sigma^2 estimated as 1.906: log likelihood = -424.12, aic = 864.24 [[3]][[2]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0.0431 -0.0632 -0.0155 -0.2818 0.4552 0.0859 -1.0000 s.e. 0.5081 0.1353 0.0930 0.5035 0.0678 0.0690 0.0896 sigma^2 estimated as 1.906: log likelihood = -424.12, aic = 864.24 [[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 ma1 sar1 sar2 sma1 0 -0.0732 -0.0208 -0.2393 0.4546 0.0862 -1.0000 s.e. 0 0.0669 0.0656 0.0652 0.0674 0.0689 0.0899 sigma^2 estimated as 1.905: log likelihood = -424.12, aic = 862.24 [[3]][[4]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0 -0.0730 0 -0.2406 0.4516 0.0890 -1.0000 s.e. 0 0.0667 0 0.0656 0.0668 0.0683 0.0902 sigma^2 estimated as 1.906: log likelihood = -424.17, aic = 860.34 [[3]][[5]] Call: arima(x = series, order = order, seasonal = seasonal, include.mean = include.mean, fixed = last.arma$next.vector, method = "ML") Coefficients: ar1 ar2 ar3 ma1 sar1 sar2 sma1 0 0 0 -0.2586 0.4529 0.0950 -1.0000 s.e. 0 0 0 0.0683 0.0668 0.0681 0.0928 sigma^2 estimated as 1.918: log likelihood = -424.76, aic = 859.53 [[3]][[6]] NULL [[3]][[7]] NULL $aic [1] 864.2377 862.2443 860.3445 859.5289 859.4049 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 3: In arima(series, order = order, seasonal = seasonal, include.mean = include.mean, : some AR parameters were fixed: setting transform.pars = FALSE 4: 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/freestat/rcomp/tmp/1qwmt1229088290.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 = 250 Frequency = 1 [1] 0.0295718737 0.0126571609 0.0073800470 0.0054857650 0.0032888727 [6] 0.0019564579 0.0035214784 0.0033734498 0.0029444119 0.0026292105 [11] 0.0018574344 -0.0255253933 -0.1788841828 0.3996208255 -0.0180568113 [16] -0.6797300841 0.4354850783 -0.6815427325 -0.7091968082 1.8616934371 [21] -0.4575632359 -1.5738809703 -0.0364146935 -0.0216089926 -0.0803563293 [26] -1.0961703338 0.3855779225 0.7220296368 0.0625747494 1.3092189610 [31] 0.7378546223 -0.1473224631 1.3532961966 0.1860756820 0.6562990113 [36] 1.3163758457 0.0559695757 1.9401580345 0.0541670512 -0.3060940648 [41] 1.0310183265 0.7958163517 0.2564182708 0.3202429845 -0.6972634346 [46] 2.3019183298 2.5292459562 -0.1628611374 -0.4129762947 0.7231139268 [51] -0.5548726547 0.4083147068 -1.2484997752 0.2706179574 2.1249698429 [56] 1.8280936709 -1.7312947657 0.3197587454 -1.9447629357 0.3166248551 [61] 1.4996701120 0.6428492755 1.7446341749 -0.4350129176 2.0777097220 [66] 0.6585922713 1.8304010471 -2.4424270987 1.9147180294 1.1035525858 [71] 0.6182066591 -1.0340945646 0.4929421241 -1.0648610308 -0.0007468959 [76] -0.0607180763 -0.9595202829 0.0578422316 -2.0360303666 0.9530548109 [81] 0.5693901256 -0.6039111414 -1.5071704160 -1.0862362582 0.3118363718 [86] 0.1039424520 0.4629790465 0.5951158793 0.1650813043 -0.3788117575 [91] -0.3414560716 -1.1977361376 0.5250486298 0.7940412912 0.4304473904 [96] 1.2362916804 -0.1842250683 -0.1197755706 -0.4087530574 -0.4032742710 [101] -1.5496146847 -1.2264809251 0.0126854737 -0.4785784660 0.7127807875 [106] -0.0321670153 -0.9402103641 -0.4330882316 -0.7790889565 0.0328153217 [111] 0.3041141294 0.0861527693 -0.0644662750 1.1374789595 -0.6078854418 [116] 0.6250437930 0.2813610274 -1.2140369392 -0.2010071151 -1.2528790824 [121] 0.7897414834 -0.4571036957 -0.5631915087 -0.8628822293 0.1422043272 [126] 0.5131766774 0.0207828474 0.1544135677 2.3876377322 -2.3964172285 [131] -1.9576745191 -1.7393692250 -0.6703366851 -0.4676003399 -1.4969076026 [136] -0.3111097818 0.5290590414 -0.4250095948 0.0543969658 -2.3796190512 [141] -1.6263414239 2.7634336120 2.3031900583 -1.1311447497 1.8607693043 [146] -1.4494973584 -1.0121584231 -0.7960288212 -2.7976788958 0.1169429581 [151] -1.2366109645 2.5452383397 1.0332882278 0.0058616076 -1.9046471252 [156] -0.9333394033 -0.0165333306 0.7636753707 1.0388798864 1.0921101329 [161] 1.6922524072 0.5394033266 0.6747571310 -2.2276579617 0.9789917783 [166] 0.8729828376 3.7443434969 1.3804235648 -1.4873335315 1.7927920630 [171] 0.5836875173 0.7225147418 1.2680280455 0.3118805985 1.0185460369 [176] -5.5330387347 3.5343206270 3.6072730706 -0.8515465821 0.0580415447 [181] 0.1043457380 1.3890274571 0.9468096935 -0.8344982206 -0.7888687800 [186] -0.2366542700 -1.1348844134 0.8546010555 3.9083206921 -1.2992135265 [191] -2.8216892268 -1.3038229521 0.9802087516 0.7948435459 1.7204682130 [196] 0.5875995920 0.3875374488 1.1822615821 -1.6598013476 -2.8056203704 [201] 4.4915185955 -0.6475320116 0.1666482312 -0.3696944249 -1.9839526474 [206] 1.1804598608 -0.1710317284 -0.9236764990 0.9489882768 -0.9846620589 [211] -0.5305673772 -2.7082908735 2.6070117211 1.5746294203 -0.2510501218 [216] 0.9933968765 0.5944519910 -0.3884478228 0.4750180911 -1.5603487957 [221] 1.6355439557 -1.5504204563 0.6545738669 2.3727902385 -3.7453225134 [226] -3.0740889203 -3.0862052392 -1.3182738144 -1.1552291748 -1.4220761316 [231] 0.1338925328 -0.3712468651 -0.9575657614 2.0999265896 1.2014537553 [236] 1.5647026467 -2.0772602958 0.2594720861 1.3382344228 0.5161421755 [241] -0.8974569213 -2.3535246404 -0.7616136052 0.9953570076 -0.9621738610 [246] -0.0072227719 -0.4590814274 0.0767809403 -1.2957071858 1.4933217090 > postscript(file="/var/www/html/freestat/rcomp/tmp/22hq51229088290.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/freestat/rcomp/tmp/3odvt1229088290.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/freestat/rcomp/tmp/4yz3t1229088290.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/freestat/rcomp/tmp/5rzxk1229088290.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/freestat/rcomp/tmp/6z89g1229088290.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/freestat/rcomp/tmp/756p71229088290.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/80k291229088291.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/freestat/rcomp/tmp/9uag51229088291.tab") > > system("convert tmp/1qwmt1229088290.ps tmp/1qwmt1229088290.png") > system("convert tmp/22hq51229088290.ps tmp/22hq51229088290.png") > system("convert tmp/3odvt1229088290.ps tmp/3odvt1229088290.png") > system("convert tmp/4yz3t1229088290.ps tmp/4yz3t1229088290.png") > system("convert tmp/5rzxk1229088290.ps tmp/5rzxk1229088290.png") > system("convert tmp/6z89g1229088290.ps tmp/6z89g1229088290.png") > system("convert tmp/756p71229088290.ps tmp/756p71229088290.png") > > > proc.time() user system elapsed 24.241 2.182 25.414