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(12.008,9.169,8.788,8.417,8.247,8.197,8.236,8.253,7.733,8.366,8.626,8.863,10.102,8.463,9.114,8.563,8.872,8.301,8.301,8.278,7.736,7.973,8.268,9.476,11.100,8.962,9.173,8.738,8.459,8.078,8.411,8.291,7.810,8.616,8.312,9.692,9.911,8.915,9.452,9.112,8.472,8.230,8.384,8.625,8.221,8.649,8.625,10.443,10.357,8.586,8.892,8.329,8.101,7.922,8.120,7.838,7.735,8.406,8.209,9.451,10.041,9.411,10.405,8.467,8.464,8.102,7.627,7.513,7.510,8.291,8.064,9.383) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '1' > par1 = '36' > #'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/107d41259339632.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/2azss1259339632.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.00000000 0.42070102 0.22705716 -0.02636525 -0.26914064 -0.33709862 [7] -0.42943826 -0.34829820 -0.32642871 -0.05789044 0.08101548 0.28219794 [13] 0.59120512 0.24879323 0.23725946 0.03182221 -0.16458030 -0.22626715 [19] -0.31235812 -0.26463224 -0.27992004 -0.07700530 0.04202977 0.32289553 [25] 0.52832945 0.16109502 0.12698821 -0.05180587 -0.19838796 -0.22807016 [31] -0.26282769 -0.21167071 -0.19647594 -0.01907414 0.03734683 0.25939431 [37] 0.35834844 > (mypacf <- c(rpacf$acf)) [1] 0.420701025 0.060834943 -0.172776457 -0.270365442 -0.146615804 [6] -0.235724134 -0.137321988 -0.258258508 0.016646420 -0.067661526 [11] 0.076723886 0.393170986 -0.295758748 0.049811428 0.004813456 [16] -0.096383784 0.033709554 -0.024883446 -0.009627731 -0.050476563 [21] -0.065582287 0.082336800 0.201178296 0.155190559 -0.263493508 [26] -0.156145310 0.035647197 -0.068623789 -0.013121590 0.020719701 [31] -0.017312798 -0.008375076 -0.065019073 -0.079664597 -0.053646665 [36] -0.048970355 > 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/33gxg1259339632.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/4i1mk1259339632.tab") > > system("convert tmp/107d41259339632.ps tmp/107d41259339632.png") > system("convert tmp/2azss1259339632.ps tmp/2azss1259339632.png") > > > proc.time() user system elapsed 0.553 0.310 0.663