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(6.3,6.2,6.1,6.3,6.5,6.6,6.5,6.2,6.2,5.9,6.1,6.1,6.1,6.1,6.1,6.4,6.7,6.9,7,7,6.8,6.4,5.9,5.5,5.5,5.6,5.8,5.9,6.1,6.1,6,6,5.9,5.5,5.6,5.4,5.2,5.2,5.2,5.5,5.8,5.8,5.5,5.3,5.1,5.2,5.8,5.8,5.5,5,4.9,5.3,6.1,6.5,6.8,6.6,6.4,6.4,6.6) > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '0' > par2 = '0.5' > 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/1vfcn1259943515.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/2o0v21259943515.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.000000e+00 8.671983e-01 6.283764e-01 3.941922e-01 2.455099e-01 [6] 1.877395e-01 1.649711e-01 1.204844e-01 8.764170e-02 8.985268e-02 [11] 1.425110e-01 2.126844e-01 2.524173e-01 2.219315e-01 1.551222e-01 [16] 4.989703e-02 -7.702783e-02 -1.869829e-01 -2.610723e-01 -2.948112e-01 [21] -2.837352e-01 -2.548067e-01 -2.252992e-01 -1.936050e-01 -1.591997e-01 [26] -1.425235e-01 -1.249880e-01 -1.580237e-01 -2.224980e-01 -2.980044e-01 [31] -3.599225e-01 -3.817322e-01 -3.532226e-01 -2.747751e-01 -1.614924e-01 [36] -5.516407e-02 1.907285e-02 3.934066e-02 2.842862e-02 9.762320e-03 [41] -1.343491e-05 -1.244971e-02 -3.827036e-02 -7.870645e-02 -1.088833e-01 [46] -1.021700e-01 -5.895489e-02 -1.435808e-02 2.052278e-02 3.670635e-02 [51] 5.590839e-02 6.563325e-02 7.726046e-02 7.134949e-02 5.586229e-02 [56] 3.378580e-02 1.926163e-02 1.702522e-02 1.224285e-02 > (mypacf <- c(rpacf$acf)) [1] 0.867198320 -0.498681400 0.053547824 0.179386443 0.047763501 [6] -0.106028675 -0.116089288 0.227094868 0.090996881 0.071585641 [11] -0.017941709 -0.012320929 -0.091432991 0.047750086 -0.239031713 [16] -0.196787434 0.047017560 0.005963882 -0.067947596 -0.053348576 [21] -0.006024015 -0.020245502 0.012922066 -0.019119033 -0.134108309 [26] 0.131691649 -0.197179499 0.007648921 -0.098624537 -0.013520458 [31] 0.036881613 -0.032730036 0.201940735 0.016353082 -0.029027135 [36] -0.019394865 -0.062256601 0.002113246 0.064385010 -0.035287743 [41] -0.071767781 0.064018623 -0.059110236 -0.041490145 -0.055794602 [46] -0.056484317 -0.132621400 0.013309773 0.029287800 0.007561385 [51] -0.051455094 0.069482824 0.028871427 -0.016346014 -0.009008665 [56] 0.017807299 -0.016460502 -0.045688042 > 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/3mvf21259943515.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/4oyoq1259943515.tab") > > system("convert tmp/1vfcn1259943515.ps tmp/1vfcn1259943515.png") > system("convert tmp/2o0v21259943515.ps tmp/2o0v21259943515.png") > > > proc.time() user system elapsed 0.603 0.317 0.681