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(401,394,372,334,320,334,400,427,423,395,373,377,391,398,393,375,371,364,400,406,407,397,389,394,399,401,396,392,384,370,380,376,378,376,373,374,379,376,371,375,360,338,352,344,330,334,333,343,350,341,320,302,287,304,370,385,365,333,313,330,367) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '1' > par3 = '2' > par2 = '1' > 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/1e0ij1261925947.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/2wkmk1261925947.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.325216845 -0.232004395 -0.617768530 -0.412806153 [6] 0.024236220 0.370699216 0.304066917 -0.011220025 -0.162491165 [11] -0.195129989 0.076734223 0.059318251 0.088466517 0.021131653 [16] -0.060434748 -0.015541304 -0.046026454 -0.002407559 -0.055420765 [21] 0.087373812 0.112852923 0.040289284 -0.109258549 -0.182173470 [26] -0.057875477 0.126118463 0.252301610 -0.006250456 -0.121587792 [31] -0.234859734 -0.025384022 0.170435815 0.270568885 0.078585764 [36] -0.199823877 -0.314486236 -0.148426093 0.139545616 0.236187931 [41] 0.160602528 -0.035259414 -0.116421197 -0.087467884 -0.010524973 [46] 0.011108422 0.005209366 > (mypacf <- c(rpacf$acf)) [1] 0.325216845 -0.377720361 -0.509979095 -0.218200016 -0.116574555 [6] -0.059295320 -0.147716247 -0.199809729 0.021595661 -0.089550583 [11] 0.147803595 -0.155462201 0.051989400 0.164688568 -0.023742561 [16] 0.151234333 -0.059790428 0.062451660 -0.044403344 0.098941510 [21] 0.155116062 -0.138064324 0.013382816 -0.108579748 -0.006341679 [26] 0.094510307 -0.045826526 -0.166110955 -0.005322066 -0.053247100 [31] 0.018779908 -0.025773155 0.190418320 0.033886006 0.005588737 [36] -0.039646028 -0.025814768 -0.028547229 -0.055847832 -0.131728016 [41] -0.022305890 0.024268821 -0.012550533 -0.031424607 -0.044728376 [46] 0.069500129 > 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/35tum1261925947.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/47mck1261925947.tab") > > try(system("convert tmp/1e0ij1261925947.ps tmp/1e0ij1261925947.png",intern=TRUE)) character(0) > try(system("convert tmp/2wkmk1261925947.ps tmp/2wkmk1261925947.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.593 0.324 1.269