R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-bit) 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(57.7,63.6,78,77.4,74.1,85.9,82,78.4,68.1,70.9,85.2,149.6,57.9,63.7,85,66.1,80.2,83.4,85.7,81.8,69.4,76.4,90.3,157.3,65.3,68.4,72.7,86.6,82.6,84.8,93.4,82.2,75.2,83.9,85.4,166.3,70.4,73.9,82.4,92.3,82.7,95.8,105.8,84.2,82.7,88.4,90.2,176.6,69.5,77.3,98.6,86.4,90.8,101.5,112.2,93.6,93.8,90.8,98.1,187.6,75,83.7,99.7,104.9,98.9,117.3,115.7,102.2,101.9,96.6,110,203.7,82.3,93.3,121.9,100.9,107.7,130,123.2,116.1,105.3,107.7,123.9,205.2,90.3,106.9,122.4,111.3,122.6,124.8,139.5,118.8,111,121.2,120.6,219.1,101.3,105,113.4,133.6,123.9,136.2,151.7,121.9,120.2,132.2,125.2,233.8) > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #Technical description: > if (par1 == 'Default') { + par1 = 10*log10(length(x)) + } else { + par1 <- as.numeric(par1) + } > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > par5 <- as.numeric(par5) > if (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > if (par8 != '') par8 <- as.numeric(par8) > ox <- x > if (par8 == '') { + if (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } + } else { + x <- log(x,base=par8) + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/wessaorg/rcomp/tmp/1htg01295092341.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow=c(2,1)) > plot(ox,type='l',main='Original Time Series',xlab='time',ylab='value') > if (par8=='') { + mytitle <- paste('Working Time Series (lambda=',par2,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } else { + mytitle <- paste('Working Time Series (base=',par8,', d=',par3,', D=',par4,')',sep='') + mysub <- paste('(base=',par8,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='') + } > plot(x,type='l', main=mytitle,xlab='time',ylab='value') > par(op) > dev.off() null device 1 > postscript(file="/var/www/wessaorg/rcomp/tmp/23jj01295092341.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=mysub) > dev.off() null device 1 > postscript(file="/var/www/wessaorg/rcomp/tmp/3rdni1295092341.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF',sub=mysub) > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 -0.439496277 -0.087729076 0.045102105 -0.039874157 [6] 0.034581124 0.024814778 0.040712057 -0.031761921 0.060674824 [11] -0.087905486 -0.443500541 0.848788311 -0.363266719 -0.070858367 [16] 0.012259590 -0.008777878 0.020261897 0.015871897 0.049636929 [21] -0.038525161 0.043826704 -0.057367766 -0.393070565 0.725055264 [26] -0.298637099 -0.072035968 0.018075529 -0.004162543 0.003857695 [31] 0.016194260 0.051388960 -0.031053600 0.028608303 -0.044483911 [36] -0.340210422 0.619977528 -0.256429336 -0.056186302 0.018823171 [41] -0.012443054 0.011699486 0.005488945 0.043147628 -0.021498434 [46] 0.025722867 -0.039394328 -0.274372007 0.490000169 > (mypacf <- c(rpacf$acf)) [1] -0.439496277 -0.348129743 -0.225480668 -0.224321396 -0.155152880 [6] -0.082527330 0.040698365 0.064943164 0.190957861 0.108309249 [11] -0.692878961 0.511143273 0.067236846 0.002261693 -0.131809290 [16] 0.052123862 0.018592640 0.014536422 0.038586896 -0.004216275 [21] -0.164827516 -0.079446494 0.089357813 0.066763242 -0.008184208 [26] -0.093188903 0.114769439 0.011970676 -0.010316038 -0.001312950 [31] -0.021605276 -0.043957666 -0.027903471 -0.004424216 0.024963898 [36] -0.022245382 -0.045113411 0.082435288 0.040764560 -0.045292587 [41] 0.021402902 0.020169106 -0.050963496 -0.069953264 0.033398559 [46] 0.001847607 0.057280597 -0.137243843 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','ACF(k)','click here for more information about the Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 2:(par1+1)) { + a<-table.row.start(a) + a<-table.element(a,i-1,header=TRUE) + a<-table.element(a,round(myacf[i],6)) + mytstat <- myacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/wessaorg/rcomp/tmp/4rru51295092341.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Partial Autocorrelation Function',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Time lag k',header=TRUE) > a<-table.element(a,hyperlink('http://www.xycoon.com/basics.htm','PACF(k)','click here for more information about the Partial Autocorrelation Function'),header=TRUE) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,'P-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:par1) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,round(mypacf[i],6)) + mytstat <- mypacf[i]*sqrtn + a<-table.element(a,round(mytstat,4)) + a<-table.element(a,round(1-pt(abs(mytstat),lengthx),6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/wessaorg/rcomp/tmp/5l0bv1295092341.tab") > > try(system("convert tmp/1htg01295092341.ps tmp/1htg01295092341.png",intern=TRUE)) character(0) > try(system("convert tmp/23jj01295092341.ps tmp/23jj01295092341.png",intern=TRUE)) character(0) > try(system("convert tmp/3rdni1295092341.ps tmp/3rdni1295092341.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.830 0.220 1.098