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(97.4,97,105.4,102.7,98.1,104.5,87.4,89.9,109.8,111.7,98.6,96.9,95.1,97,112.7,102.9,97.4,111.4,87.4,96.8,114.1,110.3,103.9,101.6,94.6,95.9,104.7,102.8,98.1,113.9,80.9,95.7,113.2,105.9,108.8,102.3,99,100.7,115.5,100.7,109.9,114.6,85.4,100.5,114.8,116.5,112.9,102,106,105.3,118.8,106.1,109.3,117.2,92.5,104.2,112.5,122.4,113.3,100,110.7,112.8,109.8,117.3,109.1,115.9,96,99.8,117) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '-0.5' > 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/10xz91229278443.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/28lc51229278443.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.141780328 0.143934569 0.327738349 -0.047649594 [6] 0.142328289 0.187867257 -0.196386328 -0.060845172 0.152385674 [11] -0.218284143 -0.090841636 -0.075753274 -0.148657477 -0.061074672 [16] 0.055641064 -0.213413766 0.015798886 0.038149969 -0.171127656 [21] 0.016899002 0.058338358 -0.280127818 0.220089624 -0.232385717 [26] -0.083947615 0.177034572 -0.128919882 -0.046427104 0.048564750 [31] -0.110973494 0.019428882 0.168751599 -0.167036165 0.098602776 [36] 0.050670103 -0.007481098 0.029562819 0.026439251 -0.058176184 [41] 0.027743976 0.115610791 -0.095740647 -0.001867663 0.075373043 [46] -0.131204283 0.087004488 0.021609963 -0.114103360 > (mypacf <- c(rpacf$acf)) [1] -0.1417803277 0.1263732190 0.3769604113 0.0448404457 0.0365413224 [6] 0.1161643332 -0.2062783155 -0.3040761548 0.0676849775 -0.0108865209 [11] -0.1420072706 -0.1433166722 0.0628524788 0.0138104485 0.0927446334 [16] -0.0303314020 0.0469420537 -0.0140724625 -0.1833888948 -0.1456597184 [21] 0.1033444423 -0.2380144786 0.0908585019 -0.2383671683 0.0291627979 [26] 0.1525460896 0.1133503148 -0.0426515303 -0.0755652150 -0.1799127149 [31] -0.0289970858 0.0132698225 0.0162012074 0.0375561918 -0.0635146461 [36] -0.0929871480 0.0459372245 -0.0415090551 0.0732485279 -0.0897393469 [41] 0.0005757695 -0.0451959445 -0.0521656485 -0.0404383081 0.0565993456 [46] -0.1094758452 0.0478675510 -0.0522925626 > 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/3yz951229278443.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/4e0j51229278443.tab") > > system("convert tmp/10xz91229278443.ps tmp/10xz91229278443.png") > system("convert tmp/28lc51229278443.ps tmp/28lc51229278443.png") > > > proc.time() user system elapsed 0.802 0.414 0.889