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(349,348,347,345,365,364,349,339,340,340,341,343,341,343,341,335,355,357,337,325,336,338,337,328,326,327,319,310,320,322,303,292,303,315,311,307,308,312,309,310,309,304,287,275,290,298,294,286,294,292,287,281,280,271,264,259,271,279,279,273,286,286,280,277,269,255,252,245,257,267,261,258,271,262,258,253,236,228,235,226,231,235,227,222,233,221,218,220,204,196,208,190,191,194,179,162,179,176,168,170,153,142,155,136,136,144,135,114,135,132,123,123,103,97,113,108,111,121,111,97) > 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/html/rcomp/tmp/14pho1282246159.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/24pho1282246159.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.083520901 -0.405411270 0.186442484 -0.026503525 [6] -0.221066411 0.247225675 -0.190760800 -0.049643141 0.222953205 [11] -0.288967665 -0.095915898 0.757133447 -0.075041340 -0.424822963 [16] 0.121141805 0.076044327 -0.156116146 0.168034425 -0.124241445 [21] -0.082196648 0.142528705 -0.135300530 -0.070914101 0.509724792 [26] -0.044600033 -0.343427539 0.063917808 0.127302222 -0.107209132 [31] 0.066628171 -0.115249866 -0.066290064 0.094025542 -0.021438717 [36] -0.018312845 0.303943807 -0.063543752 -0.250283213 -0.002918927 [41] 0.120911218 -0.046140299 -0.002928319 -0.108421979 0.009296977 [46] 0.082596935 0.032753650 -0.015305828 0.144745510 > (mypacf <- c(rpacf$acf)) [1] -0.083520901 -0.415283924 0.126356611 -0.205281867 -0.133682004 [6] 0.150398084 -0.384296241 0.223323936 -0.157591687 -0.313870453 [11] 0.135538476 0.565475917 0.044467582 -0.012427981 -0.108688888 [16] 0.206021425 0.065508772 -0.047504165 0.086792408 -0.109275390 [21] -0.098970499 0.111665942 0.030080662 -0.055437878 -0.052503045 [26] 0.126430448 0.036053004 -0.054175272 0.020363778 -0.027889133 [31] -0.125232576 0.016016343 0.011042035 0.024656634 -0.015161273 [36] -0.032934399 -0.008376205 -0.053602679 -0.084435526 -0.004714419 [41] -0.051482988 -0.043590578 -0.029355185 0.063342328 0.040390601 [46] 0.027852956 -0.054393063 0.024421772 > 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/3jhee1282246159.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/4t8wz1282246159.tab") > > try(system("convert tmp/14pho1282246159.ps tmp/14pho1282246159.png",intern=TRUE)) character(0) > try(system("convert tmp/24pho1282246159.ps tmp/24pho1282246159.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.577 0.317 1.680