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(127.96,127.47,126.47,125.75,125.42,125.14,125.15,125.51,125.63,126.22,126.88,127.96,128.74,129.6,131.2,132.72,134.67,135.94,136.39,136.74,137.2,137.36,138.63,141.07,143.32,147.91,152.56,151.61,156.56,157.45,158.13,159.18,159.47,159.79,161.65,162.77,163.48,166.16,163.86,162.12,149.08,145.32,141.21,134.68,133.65,139.17,138.61,144.96,157.99,167.18,174.48,182.77,190.00,189.70,188.90,198.28,201.18,204.14,221.02,221.12,220.68) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-2.0' > 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/113fr1229961947.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/2n3jy1229961947.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.518589754 0.376340513 0.408789239 0.047256485 [6] -0.249537784 -0.172436248 -0.225951503 -0.277365426 -0.224697269 [11] -0.051342639 -0.047145554 -0.190158510 -0.001757720 -0.109072637 [16] -0.266355048 -0.131228963 -0.123208265 -0.205660611 0.009113212 [21] 0.016592967 0.023358995 0.082984730 0.071289822 0.038189681 [26] 0.020950671 -0.011514599 -0.020904494 -0.048692268 -0.026079866 [31] 0.023944051 0.007855216 0.074041615 0.091935023 0.084846430 [36] 0.095965670 0.094797863 0.094733060 0.109236610 0.083886618 [41] 0.043572127 0.035427070 -0.011731300 -0.063807675 -0.072858163 [46] -0.085017592 -0.098414773 -0.075849625 -0.046093600 -0.032586350 [51] -0.024739233 -0.006477148 -0.006215660 -0.016217177 -0.015376510 [56] -0.010204247 -0.011605487 -0.004249833 0.007576323 0.003280034 > (mypacf <- c(rpacf$acf)) [1] 0.518589754 0.146916114 0.232224591 -0.379336469 -0.426122601 [6] 0.033110823 0.194481619 0.184413700 -0.246617861 -0.075473209 [11] 0.003667824 -0.280406782 0.110300702 -0.225337505 -0.006382901 [16] 0.053021845 -0.079425341 -0.013061561 0.042345425 -0.134050963 [21] -0.089152715 -0.085523050 -0.001531457 -0.021926475 0.076826830 [26] -0.131498423 -0.156210427 -0.006199914 -0.056394409 0.035278750 [31] 0.051296261 -0.098933909 -0.019863900 0.034160581 -0.030740438 [36] -0.001007014 0.141275847 0.006077317 -0.004330854 -0.147772314 [41] -0.073994255 0.080292383 0.073945488 -0.024836644 -0.084583206 [46] 0.066722820 0.023940290 0.008599981 0.007407105 -0.120867792 [51] 0.057732366 0.047192300 0.048454399 0.057608652 -0.038774047 [56] -0.049699713 -0.068343308 -0.001311154 0.039081995 > 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/3xu4k1229961947.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/4bq5x1229961947.tab") > > system("convert tmp/113fr1229961947.ps tmp/113fr1229961947.png") > system("convert tmp/2n3jy1229961947.ps tmp/2n3jy1229961947.png") > > > proc.time() user system elapsed 0.831 0.432 0.944