R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(46,62,66,59,58,61,41,27,58,70,49,59,44,36,72,45,56,54,53,35,61,52,47,51,52,63,74,45,51,64,36,30,55,64,39,40,63,45,59,55,40,64,27,28,45,57,45,69,60,56,58,50,51,53,37,22,55,70,62,58,39,49,58,47,42,62,39,40,72,70,54,65) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '2' > 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/rcomp/tmp/1yd5l1291976238.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/rcomp/tmp/2yd5l1291976238.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.047792998 0.033962465 -0.043016236 -0.005729324 [6] -0.095003528 -0.029795529 0.030274827 0.096670524 -0.059499365 [11] -0.048031880 0.120509252 -0.498851609 -0.096240054 0.041545352 [16] -0.043147731 -0.025227086 -0.121967953 0.051286645 -0.036222979 [21] -0.141102406 0.083836291 0.174289097 0.017320622 0.113882721 [26] 0.145073913 -0.158436154 0.050976500 -0.055988751 0.192753679 [31] -0.055034115 0.020055532 0.127571602 0.066547647 -0.101325028 [36] -0.101013988 -0.063100424 -0.118338592 0.085222669 -0.036929283 [41] 0.077777451 -0.065893329 0.068832340 0.009379540 -0.017944328 [46] -0.085120560 0.034882177 0.008102387 > (mypacf <- c(rpacf$acf)) [1] -0.04779300 0.03175082 -0.04005893 -0.01064718 -0.09356418 -0.04019391 [7] 0.03222623 0.09552472 -0.05788454 -0.06899578 0.12397782 -0.50442522 [13] -0.14539416 0.10492991 -0.15495586 -0.05696274 -0.23185351 -0.05817031 [19] -0.07351037 -0.15611825 0.02815843 0.05827909 0.15609565 -0.19249888 [25] 0.02672819 -0.15096288 -0.03224442 -0.00931979 -0.08086609 -0.07412518 [31] -0.07859961 -0.02699084 0.03676726 0.07359185 -0.06052181 -0.16552621 [37] -0.02139203 -0.02368902 -0.01168141 0.02305488 0.02881725 0.13996765 [43] -0.08997775 0.06182244 0.01334710 0.07354572 -0.04537542 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/32d491291976238.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/rcomp/tmp/45e2x1291976238.tab") > > try(system("convert tmp/1yd5l1291976238.ps tmp/1yd5l1291976238.png",intern=TRUE)) character(0) > try(system("convert tmp/2yd5l1291976238.ps tmp/2yd5l1291976238.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.460 1.052