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(5.11,5.11,5.11,5.1,5.1,5.1,5.1,5.1,5.12,5.25,5.26,5.26,5.26,5.26,5.26,5.26,5.29,5.3,5.33,5.33,5.35,5.38,5.38,5.38,5.38,5.38,5.39,5.39,5.4,5.4,5.4,5.4,5.4,5.41,5.41,5.41,5.41,5.41,5.42,5.42,5.42,5.42,5.43,5.43,5.45,5.51,5.51,5.51,5.51,5.51,5.51,5.53,5.53,5.53,5.53,5.52,5.53,5.54,5.54,5.57,5.56,5.57,5.58,5.61,5.66,5.68,5.69,5.7,5.72,5.71,5.69,5.7,5.7) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '48' > #'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/rcomp/tmp/1czpx1242290634.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/rcomp/tmp/2wze51242290634.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.0000000000 0.1539734490 -0.0288673244 -0.0550171497 -0.1155004273 [6] -0.0826109781 -0.1627570339 0.0358397150 -0.0426253262 0.0420190006 [11] -0.0804580624 0.0007732951 0.1480226852 -0.0775056741 -0.0342754374 [16] -0.0990886014 -0.0748589249 0.0277162255 -0.0164153635 0.0874842228 [21] 0.0066759490 -0.0234471839 -0.0345697565 -0.0003558714 0.0448610191 [26] -0.0786348406 -0.0230771625 -0.0255399623 -0.0326382875 0.0442631835 [31] -0.0352206544 -0.0383456721 -0.0848204937 0.0074138692 -0.0720699687 [36] 0.0751794214 0.2487647089 -0.0397762326 -0.0245629079 -0.0710377294 [41] -0.0631597417 -0.0326135251 0.0192764845 0.0351520271 -0.0383209097 [46] -0.0014072131 -0.0258760237 0.0700260076 0.0455571970 > (mypacf <- c(rpacf$acf)) [1] 0.153973449 -0.053851858 -0.043187385 -0.104362743 -0.054315341 [6] -0.159194425 0.071866132 -0.097077745 0.046028182 -0.147490656 [11] 0.035287154 0.102298846 -0.114090675 -0.036461806 -0.088190526 [16] -0.080661793 0.058434636 -0.048829940 0.043446114 -0.043493348 [21] -0.073464723 0.004242380 -0.005470894 0.002112972 -0.071200999 [26] -0.057542494 0.001454896 -0.056589392 0.026978218 -0.074199851 [31] -0.118089570 -0.082389714 0.016134226 -0.128551357 0.091093604 [36] 0.139301420 -0.137543553 -0.040799194 -0.054773717 -0.070122927 [41] -0.031722472 0.025742549 -0.041992129 -0.076578401 -0.065158056 [46] 0.005926405 -0.027151123 -0.055744718 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #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,'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/rcomp/tmp/3skbv1242290634.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/rcomp/tmp/4h3nj1242290634.tab") > > system("convert tmp/1czpx1242290634.ps tmp/1czpx1242290634.png") > system("convert tmp/2wze51242290634.ps tmp/2wze51242290634.png") > > > proc.time() user system elapsed 0.575 0.333 0.696