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(7.8,7.6,7.5,7.6,7.5,7.3,7.6,7.5,7.6,7.9,7.9,8.1,8.2,8.0,7.5,6.8,6.5,6.6,7.6,8.0,8.0,7.7,7.5,7.6,7.7,7.9,7.8,7.5,7.5,7.1,7.5,7.5,7.6,7.7,7.7,7.9,8.1,8.2,8.2,8.1,7.9,7.3,6.9,6.6,6.7,6.9,7.0,7.1,7.2,7.1,6.9,7.0,6.8,6.4,6.7,6.7,6.4,6.3,6.2,6.5,6.8,6.8,6.5,6.3,5.9,5.9,6.4,6.4) > 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/1wswt1228771392.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/2c4f51228771392.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.364167487 -0.037787663 -0.317455597 -0.456428042 [6] -0.160519080 0.043494832 0.080988681 -0.070521045 -0.087353737 [11] -0.072380371 -0.022454089 0.282122721 0.084529597 0.163342585 [16] 0.084983646 -0.073211286 -0.120281044 -0.124340712 -0.012836451 [21] -0.039446853 0.028801879 -0.040889878 -0.176608687 -0.010489370 [26] -0.042855635 0.146494966 0.199863028 0.110781525 0.070583374 [31] -0.035825136 -0.118460745 -0.177351145 -0.098471401 -0.076013758 [36] 0.029401134 0.163957721 0.019850143 -0.035529723 -0.067606703 [41] 0.012179859 0.131332422 0.151197422 0.020022180 -0.182578819 [46] -0.151371973 -0.110987528 0.022477109 0.211795214 0.094580484 [51] -0.004254381 -0.014230566 -0.052229383 -0.054135352 0.005325435 [56] -0.004370737 -0.013064290 0.041037726 -0.014281408 -0.009615267 [61] 0.033767710 > (mypacf <- c(rpacf$acf)) [1] 0.364167487 -0.196459707 -0.275147710 -0.308732946 0.071100930 [6] -0.046160964 -0.155168542 -0.311395893 -0.037754932 -0.089177713 [11] -0.170146219 0.163131752 -0.265108854 0.246627458 0.001671941 [16] 0.070837542 -0.147708842 0.136550433 0.120668227 -0.045803273 [21] -0.001418187 -0.075236474 -0.068611316 -0.068490692 -0.069175432 [26] -0.091340925 0.019569592 -0.059088643 0.106384440 -0.059692864 [31] -0.113962318 -0.013568563 -0.060825849 -0.084764275 0.087358822 [36] 0.022787892 -0.042697485 -0.152421453 0.017283002 0.085376650 [41] -0.054649304 0.004639195 -0.123077419 -0.078719667 0.016779490 [46] -0.041142981 -0.117913927 0.097073319 -0.004473500 0.019429286 [51] 0.047496839 0.012209450 -0.001538119 -0.087197513 -0.013176830 [56] -0.010967750 -0.046261304 0.001629891 0.039344384 -0.043015628 > 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/3prvz1228771392.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/48bxd1228771392.tab") > > system("convert tmp/1wswt1228771392.ps tmp/1wswt1228771392.png") > system("convert tmp/2c4f51228771392.ps tmp/2c4f51228771392.png") > > > proc.time() user system elapsed 0.806 0.413 1.018