R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(93.8,93.8,107.6,101,95.4,96.5,89.2,87.1,110.5,110.8,104.2,88.9,89.8,90,93.9,91.3,87.8,99.7,73.5,79.2,96.9,95.2,95.6,89.7,92.8,88,101.1,92.7,95.8,103.8,81.8,87.1,105.9,108.1,102.6,93.7,103.5,100.6,113.3,102.4,102.1,106.9,87.3,93.1,109.1,120.3,104.9,92.6,109.8,111.4,117.9,121.6,117.8,124.2,106.8,102.7,116.8,113.6,96.1,85) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '-1.0' > 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: > 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 (par6 == 'White Noise') par6 <- 'white' else par6 <- 'ma' > par7 <- as.numeric(par7) > 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/1dctw1260531834.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > racf <- acf(x, par1, main='Autocorrelation', xlab='time lag', ylab='ACF', ci.type=par6, ci=par7, sub=paste('(lambda=',par2,', d=',par3,', D=',par4,', CI=', par7, ', CI type=',par6,')',sep='')) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2xuim1260531834.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.47975778 0.17102336 0.21882648 0.28507950 0.35795185 [7] 0.28970444 0.29237038 0.08510850 -0.01645498 -0.09940561 0.14473654 [13] 0.48031055 0.09710447 -0.11500127 -0.04509056 0.04448845 0.09852084 [19] 0.03786510 0.01986512 -0.13338247 -0.19865573 -0.22416888 -0.07787797 [25] 0.12691568 -0.13192510 -0.29162394 -0.23090498 -0.08660726 -0.06652728 [31] -0.13432050 -0.13850200 -0.24851918 -0.29285022 -0.25070567 -0.14907121 [37] -0.02778275 > (mypacf <- c(rpacf$acf)) [1] 0.479757779 -0.076827316 0.218651543 0.131620941 0.225703606 [6] 0.035756598 0.175358980 -0.260707944 -0.061231628 -0.346624731 [11] 0.366643903 0.383657423 -0.282836834 -0.043734962 -0.005056799 [16] -0.090445619 0.015112039 -0.189696266 -0.092151185 0.015088551 [21] -0.001289555 0.089297506 -0.123719716 -0.018692896 0.050029663 [26] -0.094701719 -0.063982575 0.069649379 -0.188871051 0.047915500 [31] -0.076028114 -0.066335657 -0.072390003 0.073552761 -0.078408473 [36] 0.101583598 > 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/31k7n1260531834.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/4sr1u1260531834.tab") > > system("convert tmp/1dctw1260531834.ps tmp/1dctw1260531834.png") > system("convert tmp/2xuim1260531834.ps tmp/2xuim1260531834.png") > > > proc.time() user system elapsed 0.547 0.322 1.386