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(77,70,67,76,85,106,108,120,108,111,109,104,104,117,111,110,116,118,115,111,112,97,106,93,95,97,81,71,75,70,72,80,78,80,81,99,87,100,95,128,112,104,102,108,103,99,96,85,78,74,106,100,109,87,107,106,109,83,84,83,65,68,61,75,66,78,68,68,174,64,48,45) > 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/1q5oo1273078180.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/2q5oo1273078180.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.393273050 -0.011103654 -0.009425382 0.006752545 [6] 0.030779684 -0.069995893 0.022670746 -0.095043704 0.083118404 [11] -0.057838673 -0.020453906 0.048634503 0.062370550 -0.025007056 [16] -0.047010311 0.025314873 0.009430058 0.062598373 -0.080887477 [21] -0.035614926 -0.021347765 0.029371134 -0.033725115 0.017331604 [26] 0.005617668 0.033611753 -0.066260311 0.009920984 0.117172841 [31] -0.061054369 0.010391242 -0.046867639 0.083289025 -0.009390845 [36] -0.022049968 -0.014507728 0.038556404 -0.028595900 -0.009835115 [41] 0.006372514 -0.033137080 -0.056467675 0.089626373 -0.029284634 [46] -0.011591395 0.070605488 -0.056974011 0.035537461 > (mypacf <- c(rpacf$acf)) [1] -0.393273050 -0.196096327 -0.112899209 -0.056147979 0.010032588 [6] -0.063527001 -0.036250600 -0.141641594 -0.031352777 -0.073437559 [11] -0.090323667 -0.018630641 0.082799232 0.039483140 -0.027986545 [16] -0.026213477 -0.004986775 0.073487175 -0.008084183 -0.060002102 [21] -0.091825091 -0.051607377 -0.069230315 -0.018936835 -0.020529928 [26] 0.025260462 -0.076889110 -0.064288577 0.084233269 0.012293411 [31] -0.004502257 -0.029507269 0.080681118 0.074519214 0.024345294 [36] -0.002343207 0.074679647 0.001694816 0.003928166 0.008099719 [41] -0.041051732 -0.172933821 -0.020559734 0.002573015 -0.005477586 [46] 0.035459906 -0.045341359 0.017317925 > 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/3mfme1273078180.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/4f6li1273078180.tab") > > try(system("convert tmp/1q5oo1273078180.ps tmp/1q5oo1273078180.png",intern=TRUE)) character(0) > try(system("convert tmp/2q5oo1273078180.ps tmp/2q5oo1273078180.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.580 0.344 1.081