R version 2.8.0 (2008-10-20) Copyright (C) 2008 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 = '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/html/freestat/rcomp/tmp/1q5oo1273078034.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/freestat/rcomp/tmp/2q5oo1273078034.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.453290274 0.305968515 0.192580173 0.261022461 [6] 0.166377059 0.050293240 0.020803241 -0.044738713 -0.006760240 [11] -0.073515448 -0.072692291 -0.058770612 -0.067285692 -0.131664466 [16] -0.175656780 -0.133259550 -0.118354595 -0.110778343 -0.198912148 [21] -0.173889071 -0.126196156 -0.055177146 -0.058524159 -0.028399482 [26] -0.004563958 0.031031434 0.029311545 0.096167476 0.162796087 [31] 0.099390840 0.102146428 0.110673164 0.190443281 0.136841986 [36] 0.100870523 0.076038565 0.078102005 0.019733663 -0.014086913 [41] -0.025690958 -0.049323842 -0.056139571 -0.010463722 -0.045865337 [46] -0.060844157 -0.051461319 -0.091192182 -0.081777441 > (mypacf <- c(rpacf$acf)) [1] 0.4532902740 0.1264857276 0.0180291646 0.1797931608 -0.0261071204 [6] -0.1022354969 -0.0004004845 -0.0976734444 0.0305324103 -0.0543106030 [11] -0.0221869115 0.0343739560 -0.0413598415 -0.0996810359 -0.0762599042 [16] -0.0137912176 -0.0165222624 -0.0113132568 -0.1184621238 -0.0284407538 [21] 0.0035830377 0.0305240705 0.0044590632 0.0330737228 -0.0027480836 [26] 0.0188450636 -0.0196047215 0.0852887894 0.0939131785 -0.0703324296 [31] 0.0321727950 0.0403569585 0.0729516969 -0.0220109519 -0.0237064766 [36] 0.0080086500 0.0102140377 -0.0893965729 -0.0122072172 -0.0133163425 [41] -0.0361738452 -0.0019729222 0.1075578622 -0.0302339955 -0.0234421732 [46] 0.0037344520 -0.0666276762 0.0440432144 > lengthx <- length(x) > sqrtn <- sqrt(lengthx) > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3mfme1273078034.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/freestat/rcomp/tmp/4f6li1273078034.tab") > > try(system("convert tmp/1q5oo1273078034.ps tmp/1q5oo1273078034.png",intern=TRUE)) character(0) > try(system("convert tmp/2q5oo1273078034.ps tmp/2q5oo1273078034.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.792 0.414 0.869