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(2.64,2.75,2.7,2.87,3.03,3.14,3.02,2.86,3.07,2.93,2.83,2.72,2.73,2.72,2.77,2.61,2.47,2.3,2.38,2.43,2.39,2.6,2.84,2.87,2.92,3.08,3.33,3.48,3.57,3.66,3.77,3.75,3.75,3.81,3.82,3.89,4.05,4.1,4.07,4.26,4.4,4.61,4.63,4.48,4.46,4.45,4.32,4.52,4.21,3.97,4.12,4.5,4.73,5.26,5.2,4.94,4.95,4.52,3.85,3.41,2.95,2.68,2.53,2.44,2.16,2.2,2.1,2.29,2.03,2.05,1.94) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > 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/1pt671261307056.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/2w3601261307056.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.95159806 0.88335829 0.79626206 0.70522842 0.60595295 [7] 0.51250265 0.41557942 0.33344434 0.26358473 0.19603037 0.13222599 [13] 0.07452767 0.02407411 -0.01105023 -0.04117207 -0.07579401 -0.10598392 [19] -0.13481124 -0.17379143 -0.21096998 -0.25621885 -0.29830514 -0.32784672 [25] -0.34542311 -0.36411384 -0.37755379 -0.38932222 -0.39725537 -0.39873484 [31] -0.39674625 -0.39419167 -0.39297871 -0.39286485 -0.38556655 -0.37227684 [37] -0.35476137 > (mypacf <- c(rpacf$acf)) [1] 0.9515980579 -0.2348116448 -0.2047756033 -0.0280055850 -0.1154187952 [6] 0.0304812516 -0.1056711209 0.0936608367 0.0484723521 -0.1339919307 [11] -0.0301135421 -0.0215489877 0.0102873620 0.0940755972 -0.0682339138 [16] -0.1245163434 0.0154415505 -0.0572937512 -0.1723612387 0.0172681700 [21] -0.1127849513 0.0325226429 0.0815602196 -0.0178021788 -0.0820017668 [26] -0.0638337285 -0.0426047068 -0.0248294616 -0.0152534855 0.0029913617 [31] -0.0182044265 -0.1456905432 -0.0799043275 0.0731193062 -0.0007594039 [36] 0.0514129187 > 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/3ti0i1261307056.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/4sfy81261307056.tab") > > try(system("convert tmp/1pt671261307056.ps tmp/1pt671261307056.png",intern=TRUE)) character(0) > try(system("convert tmp/2w3601261307056.ps tmp/2w3601261307056.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.557 0.309 0.868