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(99.3,98.7,107.9,101.0,97.6,103.0,94.1,94.1,115.1,116.5,103.4,112.5,95.6,97.5,119.3,100.9,97.7,115.3,92.8,99.2,118.7,110.1,110.3,112.9,102.2,99.4,116.1,103.8,101.8,113.7,89.7,99.5,122.9,108.6,114.4,110.5,104.1,103.6,121.6,101.1,116.0,120.1,96.0,105.0,124.7,123.9,123.6,114.8,108.8,106.1,123.2,106.2,115.2,120.6,109.5,114.4,121.4,129.5,124.3,112.6) > par5 = '12' > par4 = '1' > par3 = '0' > par2 = '1' > par1 = '60' > #'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/1pieh1229882660.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/2c41z1229882660.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.07934511 -0.05331568 0.29324759 -0.08909180 0.12112788 [7] 0.08102164 -0.14848179 0.13671750 0.13633927 -0.03830833 -0.14659249 [13] -0.12078419 -0.05500892 0.06522122 -0.10747019 -0.22075941 0.05557914 [19] 0.04011681 -0.23999384 -0.01790128 0.03395080 -0.14162608 0.22751400 [25] -0.09836465 -0.18718315 0.15518679 -0.01413421 -0.04146732 0.02020594 [31] -0.02835309 0.07645707 0.03317460 -0.12325921 -0.07082282 0.03064807 [37] -0.07921161 0.08938195 0.07269399 -0.12421447 0.12260282 0.03313773 [43] -0.16833598 0.02431019 0.02497041 -0.04257634 0.03277553 0.03022103 > (mypacf <- c(rpacf$acf)) [1] -0.079345106 -0.059988997 0.286835189 -0.053515051 0.152827247 [6] 0.004506292 -0.099098673 0.056363076 0.138651560 0.046218026 [11] -0.241750169 -0.214165036 -0.123809154 0.132636242 -0.003820925 [16] -0.182149091 -0.046269687 0.060055134 -0.146695676 0.014349129 [21] 0.174803978 -0.081674845 0.100541643 -0.100593259 -0.051976178 [26] -0.041255894 0.030553584 -0.005450830 -0.047722900 -0.017628063 [31] -0.079534256 -0.021878986 -0.056100005 -0.050978478 -0.071887644 [36] -0.096522061 0.115597584 0.151464352 -0.007315955 -0.003660716 [41] -0.065142875 -0.044822717 -0.026185753 -0.040124259 -0.001248524 [46] -0.138733567 -0.015223948 > 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/3jdyf1229882660.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/4l51q1229882660.tab") > > system("convert tmp/1pieh1229882660.ps tmp/1pieh1229882660.png") > system("convert tmp/2c41z1229882660.ps tmp/2c41z1229882660.png") > > > proc.time() user system elapsed 0.580 0.314 0.687