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(16,29,22,30,20,39,18,9.6,10.2,20.2,50,120,19.8,18,3,11,15,27,28,14,5.6,6.5,8.5,87.9,5.8,25.2,7.5,13.7,34,17,9,9.2,5,24,40,86.5,0.54,14,4.8,28,16,5.8,16,9.1,6,17,26,99.6,41,72,23,42,40,18,45,18,2,10,13.6,160) > 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/1msh21292066361.ps",horizontal=F,onefile=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/2msh21292066361.ps",horizontal=F,onefile=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.066448626 0.012485551 -0.209035832 -0.116018049 [6] 0.063652505 -0.020380774 0.031577678 -0.043869435 -0.201455836 [11] 0.041466026 -0.054796079 0.515580531 0.013039007 0.039658721 [16] -0.113582178 -0.058009544 0.008435629 -0.053384571 -0.036109419 [21] -0.045382747 -0.170222280 -0.057585594 -0.074296841 0.398801482 [26] 0.021809527 0.012603685 -0.149862364 -0.070452428 -0.028145721 [31] -0.042823964 0.012687989 -0.080370692 -0.163361395 -0.050950619 [36] -0.096477710 0.310458934 0.028395194 0.033271774 -0.067176026 [41] -0.040979158 0.019990360 0.009650931 -0.001275931 -0.027509827 [46] -0.122575473 -0.058748273 -0.067040205 0.235017624 > (mypacf <- c(rpacf$acf)) [1] 0.0664486264 0.0081059224 -0.2113443816 -0.0926488703 0.0880020650 [6] -0.0716346103 -0.0119874606 -0.0226320861 -0.2160361668 0.0632034435 [11] -0.0601884643 0.4752601766 -0.1090151499 0.0705327168 0.0083527408 [16] 0.0661444360 -0.0873284944 -0.0319949154 -0.0523247252 -0.0623754760 [21] -0.0398628814 -0.1808206247 0.0361376001 0.1449590540 -0.0433217095 [26] -0.0777967146 -0.0476802033 -0.0226228856 -0.0865954674 -0.0311718664 [31] 0.0212091146 -0.1099707010 -0.0460584415 0.0003015510 -0.0578730083 [36] 0.0243195185 0.0028087148 -0.0255348035 0.0442726783 -0.0033678082 [41] 0.0130060065 0.0762325960 -0.0316187812 0.0182616651 0.0060452242 [46] -0.0397932317 0.0177398298 -0.0021206062 > 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/302xs1292066361.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/4bbed1292066361.tab") > > try(system("convert tmp/1msh21292066361.ps tmp/1msh21292066361.png",intern=TRUE)) character(0) > try(system("convert tmp/2msh21292066361.ps tmp/2msh21292066361.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.578 0.328 1.233