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(123.9,124.9,112.7,121.9,100.6,104.3,120.4,107.5,102.9,125.6,107.5,108.8,128.4,121.1,119.5,128.7,108.7,105.5,119.8,111.3,110.6,120.1,97.5,107.7,127.3,117.2,119.8,116.2,111,112.4,130.6,109.1,118.8,123.9,101.6,112.8,128,129.6,125.8,119.5,115.7,113.6,129.7,112,116.8,127,112.1,114.2,121.1,131.6,125,120.4,117.7,117.5,120.6,127.5,112.3,124.5,115.2,105.4) > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '60' > #'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!) > 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 (par2 == 0) { + x <- log(x) + } else { + x <- (x ^ par2 - 1) / par2 + } > if (par3 > 0) x <- diff(x,lag=1,difference=par3) > if (par4 > 0) x <- diff(x,lag=par5,difference=par4) > postscript(file="/var/www/html/freestat/rcomp/tmp/1ma7m1228857501.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x,par1,main='Autocorrelation',xlab='lags',ylab='ACF') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2i55z1228857501.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > rpacf <- pacf(x,par1,main='Partial Autocorrelation',xlab='lags',ylab='PACF') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.024927188 -0.140591665 0.301702720 -0.218303350 [6] -0.072002338 0.390651608 -0.156268711 -0.222456118 0.169678332 [11] -0.264025657 -0.056500681 0.585980730 0.033592049 -0.117153925 [16] 0.186409152 -0.178253285 -0.025037342 0.285712385 -0.118254926 [21] -0.175325426 0.039412293 -0.246415419 -0.047247765 0.281370251 [26] 0.013030798 -0.145622233 0.069576786 -0.170398616 -0.092189047 [31] 0.114879754 -0.084474113 -0.172933287 -0.065058220 -0.131780473 [36] -0.086951397 0.180771995 0.053807182 -0.095436097 0.065465082 [41] -0.025844504 -0.073502967 0.071577869 -0.004237564 -0.109490839 [46] -0.062083385 -0.052994118 -0.114656810 0.062441823 0.039827973 [51] -0.064310835 0.033018020 0.031107342 -0.041500588 0.080921595 [56] 0.043647353 -0.005330135 0.020611645 -0.024625701 -0.018864385 > (mypacf <- c(rpacf$acf)) [1] 0.024927188 -0.141300829 0.315720618 -0.305449843 0.099219999 [6] 0.251684288 -0.130107850 -0.185055905 0.022939821 -0.161874054 [11] 0.096977228 0.459570792 0.148337682 -0.091224598 -0.143916637 [16] -0.007525283 0.049493239 -0.109027744 -0.007240975 -0.012359697 [21] -0.049271527 -0.018839173 0.092257142 -0.095732378 -0.010220829 [26] -0.183476863 0.080011857 -0.129488046 -0.108314542 -0.195331393 [31] 0.060932698 -0.078211883 -0.024056801 0.067346072 -0.013595004 [36] 0.014429764 -0.024088260 0.055462248 0.032235353 -0.006033584 [41] 0.016621566 -0.019322513 0.022460565 0.052449112 0.034961026 [46] 0.004160149 -0.056548244 -0.103054064 -0.037640347 -0.007421576 [51] -0.018052488 -0.085736261 0.026058382 0.045414889 -0.008025669 [56] 0.058078077 -0.001713344 -0.083986966 0.003973591 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'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/html/freestat/rcomp/tmp/3291c1228857501.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/html/freestat/rcomp/tmp/4hr8k1228857501.tab") > > system("convert tmp/1ma7m1228857501.ps tmp/1ma7m1228857501.png") > system("convert tmp/2i55z1228857501.ps tmp/2i55z1228857501.png") > > > proc.time() user system elapsed 0.831 0.427 0.927