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(627,696,825,677,656,785,412,352,839,729,696,641,695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,707,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1006,789,734,906,532,387,991,841) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '1' > par2 = '-0.5' > par1 = '60' > #'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/1f5341260991285.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/26b4j1260991285.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.295836490 -0.197856737 0.096319927 -0.275431799 [6] 0.218357400 0.058248435 -0.242910183 0.185120359 0.070650833 [11] -0.056401659 0.151631814 -0.238536008 -0.075803005 0.120932594 [16] 0.008245668 -0.004827004 0.053513674 -0.023404085 -0.113174933 [21] 0.181623720 -0.035970969 -0.079350624 0.087005108 -0.162353810 [26] 0.051015872 0.085683394 -0.101899167 0.041655490 0.095165711 [31] -0.090123010 0.073579792 -0.184158613 -0.009446341 0.117844334 [36] -0.022675675 0.015127126 0.036427545 -0.010993877 0.026338536 [41] -0.073490346 -0.104462950 0.074423520 0.065782442 0.014562936 [46] 0.005642643 -0.058761229 0.011638593 -0.003232127 -0.054937188 [51] 0.047657885 0.007775902 0.031022463 -0.010887038 -0.025821104 [56] 0.008519267 0.011232987 > (mypacf <- c(rpacf$acf)) [1] -0.295836490 -0.312747375 -0.088725511 -0.404404770 -0.043406889 [6] -0.068259597 -0.254902238 -0.080666666 0.083954178 0.065089275 [11] 0.207529380 0.031419664 -0.031428105 -0.075978916 0.044134940 [16] -0.113895010 -0.016839547 0.035922558 -0.218611939 0.055075495 [21] 0.120937511 0.072934585 0.137877968 0.007358559 -0.060564436 [26] -0.134910261 -0.072819405 -0.186166284 -0.020715332 0.003474279 [31] -0.025665516 -0.212661609 0.006523517 -0.052503958 0.010227332 [36] -0.043637330 0.013837293 -0.049077867 0.086846565 -0.061183530 [41] -0.099554688 -0.001111945 0.032873794 -0.071445755 0.037820761 [46] -0.020882999 -0.003194962 -0.044330876 -0.071054343 -0.031635454 [51] -0.012024748 0.065479475 -0.045727455 -0.014918532 0.032182929 [56] -0.039672804 > 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/3d6vu1260991285.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/4k6cs1260991285.tab") > > try(system("convert tmp/1f5341260991285.ps tmp/1f5341260991285.png",intern=TRUE)) character(0) > try(system("convert tmp/26b4j1260991285.ps tmp/26b4j1260991285.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.593 0.320 0.741