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(132,131.4,132.7,130.9,126,109.7,68.3,70.6,75.3,74.1,74.9,74,74.2,76,76.2,74.9,74.1,76.5,57.8,59.2,57.3,57.5,60.4,59.9,59.9,60,60.2,65.4,62.4,78.8,65.6,64.4,67.4,65.3,66.7,66.8,69.4,71.7,77.1,81.1,82.1,92.1,77.1,78.2,77.7,77.3,78.5,78.8,78.7,79.8,82.2,84,81.7,77.6,64.3,72.6,73.8,73.8,70.1,70,72.3,72.1,73.3,79.1,77,76.1,66.4,72.7,73.2,70.7,73.6,74.2,72.6,73.6,79.1,79.6,78,85.4,82,91.9,89.4,92.1,93.8,93.6,95.6,99.9,103.7,99.2,93.7,93.5,80.7,91.8,105.8,111.3,110.3,109.4,111.4,111.6,111.8,106.6,104.3,105.5,98.5,108.5,106,101.8,101.3,92.4,88.9,84.9,86.4,90.7,86.8,90.6,88.3,95.4,93.6,91.3,91.3,89.3) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = 'Default' > #'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/1wai71290793704.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/2wai71290793704.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.004856523 0.038748305 -0.025782253 -0.104056753 [6] 0.039723135 -0.039873005 0.046565410 -0.051746213 -0.024655254 [11] 0.065191647 -0.142181911 0.462540529 -0.158412298 0.070231233 [16] -0.014524737 -0.101196348 0.024949687 0.017255420 0.067038955 [21] -0.088036406 > (mypacf <- c(rpacf$acf)) [1] 0.004856523 0.038725632 -0.026191115 -0.105521340 0.043213779 [6] -0.032908862 0.038777053 -0.059301717 -0.020522354 0.064168170 [11] -0.136156755 0.464908032 -0.252264391 0.143707421 -0.081374687 [16] 0.013063603 -0.050713996 0.115271240 -0.022944345 -0.083741336 > 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/3skgy1290793704.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/4lbx11290793704.tab") > > try(system("convert tmp/1wai71290793704.ps tmp/1wai71290793704.png",intern=TRUE)) character(0) > try(system("convert tmp/2wai71290793704.ps tmp/2wai71290793704.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.526 0.332 1.363