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(172,150.6,163.3,153.7,152.9,135.5,148.5,148.4,133.6,194.1,208.6,197.3,164.4,148.1,152,144.1,155,124.5,153,146,138,190,192,192,147,133,163,150,129,131,145,137,138,168,176,188,139,143,150,154,137,129,128,140,143,151,177,184,151,134,164,126,131,125,127,143,143,160,190,182,138,136,152,127,151,130,119,153) > 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/16hos1292069037.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/2z8nd1292069037.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.00000000 0.47577817 0.10483018 -0.05648119 -0.18567918 -0.25537615 [7] -0.37375130 -0.26705540 -0.14164364 0.02998466 0.11822706 0.42869091 [13] 0.66513014 0.32942617 0.06625628 -0.11011629 -0.14977683 -0.16359934 [19] -0.31402439 -0.24202700 -0.11519495 -0.03013594 0.02771370 0.28371817 [25] 0.43393313 0.25960443 0.04167205 -0.10329281 -0.12060685 -0.12700545 [31] -0.27911977 -0.23737121 -0.13493313 -0.08878987 0.04679109 0.19074929 [37] 0.28364258 0.22217677 0.04036627 -0.10027047 -0.12813619 -0.12827251 [43] -0.24893864 -0.16751363 -0.13353969 -0.07084919 0.09288125 0.11625115 [49] 0.17779406 > (mypacf <- c(rpacf$acf)) [1] 0.4757781740 -0.1570956262 -0.0522829584 -0.1551175751 -0.1281285730 [6] -0.2746665413 -0.0084695191 -0.0950733956 0.0668117279 -0.0452639596 [11] 0.4409840725 0.3885979792 -0.1348056619 0.0153151621 -0.0003245295 [16] 0.0774101902 0.1276417824 -0.0913415967 0.0323274247 -0.0564574880 [21] -0.1499690514 -0.1186132044 -0.0007647939 -0.0107505491 0.0201083887 [26] -0.0947573106 0.0178300327 -0.1214144937 0.0370793338 -0.0808355778 [31] 0.0227967525 -0.0449667823 -0.0287445151 0.0854754651 -0.0561079728 [36] -0.0717363441 0.0865802528 -0.0319562870 -0.0080314407 -0.0851622348 [41] 0.0236784372 -0.0452447981 0.0965049385 -0.1093628346 0.0719280123 [46] 0.0064412526 -0.0454879243 -0.1034281228 > 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/3294j1292069037.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/45rkp1292069037.tab") > > try(system("convert tmp/16hos1292069037.ps tmp/16hos1292069037.png",intern=TRUE)) character(0) > try(system("convert tmp/2z8nd1292069037.ps tmp/2z8nd1292069037.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.588 0.347 1.257