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.0,6.9,6.7,6.6,6.5,6.4,6.5,6.5,6.6,6.7,6.8,7.2,7.6,7.6,7.3,6.4,6.1,6.3,7.1,7.5,7.4,7.1,6.8,6.9,7.2,7.4,7.3,6.9,6.9,6.8,7.1,7.2,7.1,7.0,6.9,7.0,7.4,7.5,7.5,7.4,7.3,7.0,6.7,6.5,6.5,6.5,6.6,6.8,6.9,6.9,6.8,6.8,6.5,6.1,6.0,5.9,5.8,5.9,5.9,6.2,6.3,6.2,6.0,5.8,5.5,5.5,5.7,5.8) > 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/rcomp/tmp/1fq5g1229009225.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/2sco21229009225.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.87648729 0.64801621 0.43614938 0.33780157 0.35194610 [7] 0.38968964 0.39124803 0.36216093 0.34060780 0.35372564 0.37788590 [13] 0.34978856 0.24179433 0.09963877 -0.02642957 -0.07561461 -0.06201666 [19] -0.03688142 -0.03742811 -0.06864244 -0.10586917 -0.13452047 -0.15058564 [25] -0.16113329 -0.17873479 -0.19536131 -0.21099808 -0.22060029 -0.23272121 [31] -0.24685118 -0.26652822 -0.28068035 -0.28575480 -0.26921713 -0.22455269 [37] -0.17437811 -0.13830386 -0.12734279 -0.14599314 -0.16665255 -0.19584305 [43] -0.21700472 -0.23162218 -0.23767162 -0.21707891 -0.16734750 -0.09253245 [49] -0.02629282 > (mypacf <- c(rpacf$acf)) [1] 0.876487294 -0.518676943 0.166381903 0.324170776 0.104020110 [6] -0.163399947 0.034981751 0.202891605 0.104129875 0.007982778 [11] -0.055203708 -0.186753017 -0.148664351 0.034204538 -0.160070436 [16] -0.001297654 -0.053236452 -0.064242092 -0.027990291 0.012724512 [21] -0.027662066 -0.105746687 0.051580934 0.113560674 -0.020377536 [26] 0.032841045 -0.036712291 -0.058223709 -0.051294465 0.003285212 [31] -0.091893633 -0.029371175 -0.022305497 0.082538820 0.082412216 [36] -0.042431014 -0.044153094 0.015429599 -0.000957612 0.052580752 [41] -0.186564173 -0.012715105 -0.036518463 -0.057116559 0.056900342 [46] -0.004335520 0.051852076 -0.047536692 > 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/3ma491229009225.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/4wm381229009225.tab") > > system("convert tmp/1fq5g1229009225.ps tmp/1fq5g1229009225.png") > system("convert tmp/2sco21229009225.ps tmp/2sco21229009225.png") > > > proc.time() user system elapsed 0.596 0.332 0.709