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(1.83,1.89,1.9,2.01,2.04,2.04,2.03,2.04,1.87,1.85,1.82,1.79,1.88,2.01,1.9,1.96,1.94,1.92,1.79,1.77,1.74,1.75,1.86,1.84,1.77,1.98,1.94,1.85,1.84,1.82,1.83,1.91,1.85,1.81,1.83,1.79,1.8,1.82,1.88,2.01,1.97,1.92,1.98,2.02,1.9,1.94,1.96,1.84,1.87,1.84,2.07,2.08,2.14,2.15,2.05,2.05,1.95,2.02,2.02,1.88,1.96,1.93,2.03,2.1,1.95,2.07,2.09,2.01,1.92,1.99,2.11,2) > 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/freestat/rcomp/tmp/1r1v71228915013.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/2em7x1228915013.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.182638503 -0.132874529 0.112695409 -0.150015482 [6] -0.072785844 -0.186094491 -0.043532218 0.038943773 0.029888877 [11] 0.133636667 -0.145514017 0.275650325 0.029205566 -0.073043695 [16] 0.004192036 -0.127527593 -0.034412656 -0.017662319 0.008663679 [21] 0.094466625 -0.043017289 -0.095779608 -0.024883982 0.111389978 [26] -0.063586167 0.032989778 0.164453059 -0.025073948 -0.083603599 [31] 0.014736364 -0.057369216 -0.037349810 -0.007477497 -0.164551453 [36] 0.108103316 0.020371403 0.043400911 0.103937884 -0.023016764 [41] 0.102130784 0.009691777 -0.167767399 -0.086126193 -0.016293852 [46] 0.084885601 -0.098447541 0.071379316 0.084138525 > (mypacf <- c(rpacf$acf)) [1] -0.182638503 -0.171967646 0.056335801 -0.147521114 -0.114765855 [6] -0.302214147 -0.194073332 -0.148124690 -0.067380936 0.025333922 [11] -0.252996615 0.141146986 0.002039214 0.099247382 -0.021650818 [16] -0.043261809 -0.068896904 0.023306512 0.084198285 0.115681223 [21] 0.001016613 -0.289066870 -0.168065258 -0.043441083 -0.052760935 [26] -0.001946528 0.079092047 0.001049479 -0.100137492 -0.003267263 [31] -0.024148618 -0.027712540 -0.050094986 -0.212826676 0.061984113 [36] -0.124872415 0.035380700 -0.057965635 -0.190306524 -0.078301898 [41] 0.122800228 0.021012350 -0.133028560 -0.121751560 -0.083892539 [46] 0.023288238 -0.003352158 0.025523516 > 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/3aou21228915013.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/4i6bh1228915013.tab") > > system("convert tmp/1r1v71228915013.ps tmp/1r1v71228915013.png") > system("convert tmp/2em7x1228915013.ps tmp/2em7x1228915013.png") > > > proc.time() user system elapsed 0.798 0.414 0.930