R version 2.11.1 (2010-05-31) Copyright (C) 2010 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 = '1' > 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/rcomp/tmp/1yzpt1281783760.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/rcomp/tmp/2yzpt1281783760.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.299259885 -0.094869109 -0.296188458 -0.350559094 [6] 0.030146977 0.105737464 -0.036506565 -0.393554767 -0.290975905 [11] -0.043490374 0.223856010 0.692291484 0.334241895 -0.024979253 [16] -0.257213988 -0.292437178 0.069442153 0.129913652 -0.069059309 [21] -0.333891500 -0.303743063 -0.016192213 0.253690364 0.430636978 [26] 0.194985744 -0.034853515 -0.148162025 -0.186013039 0.013576060 [31] 0.109717899 -0.086983941 -0.248329601 -0.225920647 -0.050279764 [36] 0.249886606 0.313116828 0.110197223 -0.039652116 -0.089038722 [41] -0.062830385 0.001676116 0.058524947 -0.123054632 -0.151713170 [46] -0.134010083 -0.080145779 0.147177828 0.219914688 > (mypacf <- c(rpacf$acf)) [1] 0.299259885 -0.202566753 -0.230707038 -0.242081454 0.172348898 [6] -0.083462428 -0.211415447 -0.515232391 -0.085392928 -0.138176686 [11] -0.079578995 0.452027088 0.142110052 0.083722756 -0.105825432 [16] -0.041845419 0.150080410 0.038469414 -0.168476147 0.095583818 [21] 0.110119602 0.077752851 -0.008213122 -0.178443900 -0.052732271 [26] -0.032712546 -0.045272341 -0.061203998 -0.116320910 0.022102131 [31] -0.109423360 -0.104192789 0.025419510 -0.093474771 -0.039534410 [36] -0.075577893 -0.030361218 0.125337874 -0.024559312 -0.060660259 [41] 0.019996891 0.080008429 -0.031255316 0.064367630 -0.046661026 [46] 0.032308296 -0.126855870 0.006685493 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3u85k1281783760.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/rcomp/tmp/450451281783760.tab") > > try(system("convert tmp/1yzpt1281783760.ps tmp/1yzpt1281783760.png",intern=TRUE)) character(0) > try(system("convert tmp/2yzpt1281783760.ps tmp/2yzpt1281783760.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.830 0.220 1.019