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(0.24,0.23,0.23,0.24,0.23,0.23,0.25,0.21,0.26,0.25,0.24,0.24,0.27,0.25,0.26,0.29,0.24,0.26,0.24,0.26,0.25,0.26,0.24,0.21,0.20,0.22,0.20,0.21,0.20,0.19,0.20,0.20,0.21,0.24,0.22,0.19,0.23,0.23,0.23,0.22,0.23,0.25,0.25,0.22,0.25,0.25,0.24,0.19,0.24,0.26,0.24,0.24,0.25,0.23,0.27,0.24,0.26,0.27,0.29,0.28,0.32,0.29,0.27,0.26,0.28,0.31,0.29,0.31,0.31,0.32,0.32,0.26,0.31,0.31,0.31,0.31,0.29,0.27,0.30,0.27,0.27,0.30,0.28,0.24,0.28,0.28,0.33,0.28,0.29,0.25,0.31,0.29,0.37,0.31,0.29,0.28,0.30,0.32,0.31,0.28,0.29,0.29,0.28,0.26,0.28,0.30,0.33,0.31,0.37,0.36,0.37,0.37,0.36,0.33,0.33,0.40,0.32,0.39,0.39,0.37,0.37,0.30,0.33,0.33,0.34,0.35,0.34,0.37,0.37,0.37,0.36,0.32,0.33,0.35,0.36,0.35,0.37,0.35,0.32,0.33,0.28,0.32,0.35,0.30,0.32,0.32,0.32,0.32,0.36,0.31,0.26,0.33,0.31,0.34,0.33,0.38,0.32,0.30,0.32,0.33,0.34,0.29,0.33,0.36,0.32,0.32,0.32,0.31,0.30,0.34,0.34,0.30,0.28,0.25,0.27,0.33,0.28,0.33,0.32,0.27,0.27,0.28,0.27,0.27,0.25,0.25,0.22,0.27) > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '-0.2' > par1 = '36' > #'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/1rch51228844285.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/2e53w1228844285.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.0000000000 -0.4062571948 -0.0269851799 -0.0455238883 0.0327088192 [6] -0.0659918388 0.0864507379 -0.0163595049 0.0204524465 -0.0104194085 [11] -0.0373881186 -0.0729281738 0.2227033865 -0.1539816770 -0.0148559505 [16] -0.0478815836 0.0824115191 -0.0942399443 0.1053253858 0.0347114559 [21] -0.0737313918 0.0183484484 0.0063240602 -0.0840820045 0.1711535973 [26] -0.0721645292 -0.0900713397 0.1118622729 -0.0002473674 -0.0395252252 [31] 0.0377384069 -0.0941689387 -0.0078254345 0.0917662275 0.0142370923 [36] -0.2516899642 0.2976919909 > (mypacf <- c(rpacf$acf)) [1] -0.406257195 -0.229988523 -0.192772516 -0.103989934 -0.149922206 [6] -0.025265404 -0.008219579 0.027133640 0.032936900 -0.024528581 [11] -0.124489402 0.153220192 -0.008818425 -0.067020839 -0.130614743 [16] -0.038745759 -0.109579807 -0.017146683 0.085032051 -0.010227776 [21] 0.030247751 0.052563212 -0.053478097 0.090222822 0.049256756 [26] -0.097290632 0.057668152 0.025039135 0.036020329 0.019153620 [31] -0.134325353 -0.099204947 0.035535089 0.077094141 -0.272081283 [36] 0.050985681 > 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/3gnml1228844285.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/4uklj1228844285.tab") > > system("convert tmp/1rch51228844285.ps tmp/1rch51228844285.png") > system("convert tmp/2e53w1228844285.ps tmp/2e53w1228844285.png") > > > proc.time() user system elapsed 0.790 0.434 0.875