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(2.13,1.87,2.23,3,2.12,1.6,1.17,1.02,1.22,1.8,2.13,2.21,2.38,1.99,1.82,2.47,1.94,1.39,1.11,0.97,1.38,2.39,1.88,2.11,2.11,2.17,2.54,3.13,2.25,1.39,1.36,1.33,1.6,1.95,2.23,2.53,2.36,1.95,2.16,2.76,2.09,1.49,1.17,1.3,1.26,2.17,2.03,2.18,2.61,2.58,3.86,3.81,2.41,1.47,1.33,1.38,1.57,2.6,2.18,2.36,2.24,2.41,2.51,2.98,1.87,1.9,1.47,1.45,2.71,2.9,2.11,2.18,2.24,2.05,2.42,2.77,1.99,1.47,1.09,0.93,1.32,2.03,2.04,2.78,2.8,3.03,3.11,2.75,2.78,1.76,1.29,1.28,1.43,1.71,1.89,1.84) > 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: 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/10egu1228664474.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/2de361228664474.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.65853701 0.23497295 -0.08693878 -0.31643312 -0.34643368 [7] -0.28260783 -0.35195561 -0.33618403 -0.16104018 0.07029520 0.39610040 [13] 0.57720207 0.38591603 0.12312050 -0.05565713 -0.19153574 -0.17553876 [19] -0.10345178 -0.23424943 -0.23819220 -0.14334580 0.07779209 0.37424694 [25] 0.51702412 0.32756617 0.05981642 -0.13427769 -0.26978510 -0.26091301 [31] -0.24233813 -0.29573856 -0.24733246 -0.06216706 0.14103130 0.37401066 [37] 0.47016380 0.29953089 0.10242411 -0.09667765 -0.20249539 -0.23484273 [43] -0.24324800 -0.32273374 -0.28480591 -0.13007107 0.04830734 0.26142827 [49] 0.32252686 > (mypacf <- c(rpacf$acf)) [1] 0.658537012 -0.350852684 -0.130721033 -0.208714930 0.030094172 [6] -0.103021144 -0.409008017 -0.034416771 0.096838765 0.092621082 [11] 0.285258597 0.057503493 -0.244380997 0.007111871 0.101986070 [16] -0.015991342 0.031775800 0.113307540 -0.226968462 0.165111056 [21] -0.073837292 0.276787399 0.087332036 0.041337526 -0.072874263 [26] -0.116936522 0.053308632 -0.097029589 -0.099653466 -0.094105103 [31] 0.044486857 0.042901270 0.061345730 -0.127319459 -0.033987938 [36] 0.041503254 0.051117126 -0.010985543 -0.089151840 0.006927742 [41] -0.089082578 -0.005826742 -0.096180410 0.044748960 -0.049703147 [46] -0.085888316 -0.042370182 -0.120578552 > 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/3xqr31228664474.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/4u6ca1228664474.tab") > > system("convert tmp/10egu1228664474.ps tmp/10egu1228664474.png") > system("convert tmp/2de361228664474.ps tmp/2de361228664474.png") > > > proc.time() user system elapsed 0.799 0.413 0.892