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 = '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/12omd1229006308.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/2j36i1229006308.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.00000000 0.36416749 -0.03778766 -0.31745560 -0.45642804 -0.16051908 [7] 0.04349483 0.08098868 -0.07052104 -0.08735374 -0.07238037 -0.02245409 [13] 0.28212272 0.08452960 0.16334258 0.08498365 -0.07321129 -0.12028104 [19] -0.12434071 -0.01283645 -0.03944685 0.02880188 -0.04088988 -0.17660869 [25] -0.01048937 -0.04285563 0.14649497 0.19986303 0.11078152 0.07058337 [31] -0.03582514 -0.11846074 -0.17735114 -0.09847140 -0.07601376 0.02940113 [37] 0.16395772 0.01985014 -0.03552972 -0.06760670 0.01217986 0.13133242 [43] 0.15119742 0.02002218 -0.18257882 -0.15137197 -0.11098753 0.02247711 [49] 0.21179521 > (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 > 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/386gw1229006308.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/44fvo1229006308.tab") > > system("convert tmp/12omd1229006308.ps tmp/12omd1229006308.png") > system("convert tmp/2j36i1229006308.ps tmp/2j36i1229006308.png") > > > proc.time() user system elapsed 0.546 0.328 0.685