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(89,97,154,81,110,116,73,73,174,103,130,91,136,106,136,122,131,135,75,68,143,115,93,128,152,125,107,116,220,137,34,51,153,145,116,145,98,118,139,140,113,149,79,47,166,180,122,134,114,125,181,142,143,187,137,62,239,157,139,187,99,146,175,148,130,183,115,80,223,131,201,157) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > 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: > 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 (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/1k9b11292323666.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=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2k9b11292323666.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') > dev.off() null device 1 > (myacf <- c(racf$acf)) [1] 1.000000000 0.024720634 -0.156378577 0.186824039 0.062012314 [6] 0.086723081 0.303901551 0.040101416 0.016417386 0.183417891 [11] -0.192207771 0.078459387 0.548460266 0.020149632 -0.119420566 [16] 0.029462344 -0.007155877 0.073765552 0.193938052 -0.046373606 [21] -0.002036012 0.073716816 -0.176231465 -0.045795531 0.286480895 [26] 0.027051987 -0.133109452 -0.062520997 -0.090739536 0.006525484 [31] 0.122799918 -0.019663288 -0.129346044 0.063643837 -0.122662976 [36] -0.095723132 0.163805924 0.031954328 -0.182074518 -0.085394725 [41] -0.050978497 -0.079661740 0.101932313 -0.060271898 -0.075249183 [46] -0.028041840 -0.085900667 -0.129041194 0.068271753 > (mypacf <- c(rpacf$acf)) [1] 0.0247206344 -0.1570856835 0.2002408066 0.0217831300 0.1535438196 [6] 0.2931287261 0.0555570883 0.0930829748 0.1035991726 -0.2855091301 [11] 0.0580112525 0.4104801814 0.0581780503 -0.0064294170 -0.1802363656 [16] -0.0734078899 -0.0550386061 -0.0410840002 -0.0185401442 0.0002077641 [21] -0.0042332059 -0.0114392673 -0.1721539672 -0.0179886456 0.0115028366 [26] 0.0033958453 0.0100712844 -0.0594269169 -0.0484143156 0.0149271471 [31] 0.0775240564 -0.0997673724 0.0903908163 0.0270170294 0.0363969844 [36] 0.0013377789 -0.0242360502 -0.1280299948 -0.0394699553 0.0447011797 [41] -0.0324475870 -0.0169684247 -0.0610054493 0.1310872411 -0.1280299221 [46] 0.0125023678 -0.1104518639 -0.0410316417 > 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/3gi8r1292323666.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/4rs8d1292323666.tab") > > try(system("convert tmp/1k9b11292323666.ps tmp/1k9b11292323666.png",intern=TRUE)) character(0) > try(system("convert tmp/2k9b11292323666.ps tmp/2k9b11292323666.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.579 0.345 1.835