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(172,171,170,168,166,165,166,168,169,169,170,172,173,172,165,152,148,145,141,149,146,144,149,150,149,156,150,137,130,126,125,123,117,111,114,121,122,131,125,116,106,98,99,96,95,83,85,98,102,110,101,90,88,83,88,85,86,80,79,97,105,116,99,87,82,81,85,84,78,77,79,85,96,108,98,86,80,74,75,82,71,66,71,75) > par7 = '0.95' > par6 = 'White Noise' > 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: > 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/1bj0e1281783206.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/2bj0e1281783206.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.95503703 0.89613915 0.83799332 0.79337025 0.76712762 [7] 0.73607564 0.69872316 0.66306118 0.64347316 0.63933586 0.63975748 [13] 0.62407301 0.57508688 0.50985934 0.44749723 0.40188811 0.37146907 [19] 0.33957035 0.30224478 0.26229451 0.23812040 0.23119318 0.22869505 [25] 0.21016409 0.17114902 0.11141560 0.05570685 0.01484055 -0.01619324 [31] -0.04500500 -0.08058974 -0.11035465 -0.12699278 -0.12724695 -0.12390832 [37] -0.13847369 -0.16823636 -0.21421877 -0.25712966 -0.28697830 -0.30887507 [43] -0.32547033 -0.34594846 -0.35695017 -0.35753602 -0.34221438 -0.32243922 [49] -0.32016563 > (mypacf <- c(rpacf$acf)) [1] 9.550370e-01 -1.815223e-01 1.795304e-03 1.209024e-01 1.460865e-01 [6] -1.305635e-01 -5.082470e-02 6.998586e-02 1.801512e-01 7.273824e-02 [11] -3.010584e-03 -1.500936e-01 -2.913193e-01 -1.275397e-01 -3.222927e-03 [16] 6.520383e-02 5.344210e-02 -2.111003e-02 -1.558190e-02 -5.861119e-02 [21] 6.058754e-02 3.677492e-02 -1.462063e-02 -1.045545e-01 -1.427637e-02 [26] -1.573075e-01 -1.376825e-02 -5.685073e-03 -1.030259e-02 -1.181573e-02 [31] -2.207059e-02 7.992604e-02 -7.666586e-05 -3.618614e-03 -3.848069e-02 [36] -1.139602e-01 1.393400e-02 -6.594808e-02 -1.577819e-02 -1.307625e-02 [41] -4.147353e-03 3.375285e-02 -9.365801e-03 6.567260e-02 -1.856937e-02 [46] 2.355143e-02 6.776640e-03 -8.240279e-02 > 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/3ptgn1281783206.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/4i2y81281783206.tab") > > try(system("convert tmp/1bj0e1281783206.ps tmp/1bj0e1281783206.png",intern=TRUE)) character(0) > try(system("convert tmp/2bj0e1281783206.ps tmp/2bj0e1281783206.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.566 0.306 0.763