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(113,95.4,86.2,111.7,97.5,99.7,111.5,91.8,86.3,88.7,95.1,105.1,104.5,89.1,82.6,102.7,91.8,94.1,103.1,93.2,91,94.3,99.4,115.7,116.8,99.8,96,115.9,109.1,117.3,109.8,112.8,110.7,100,113.3,122.4,112.5,104.2,92.5,117.2,109.3,106.1,118.8,105.3,106,102,112.9,116.5,114.8,100.5,85.4,114.6,109.9,100.7,115.5,100.7,99,102.3) > 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/rcomp/tmp/16wm81292231976.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/html/rcomp/tmp/26wm81292231976.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.311548445 0.041910472 0.224819028 0.159132775 [6] 0.379438145 0.409546261 0.294921680 0.124851184 -0.001647482 [11] -0.086590880 0.102686056 0.472030957 0.033594079 -0.228572275 [16] -0.134921789 -0.111396814 0.046537696 0.019180399 -0.033868984 [21] -0.143692862 -0.258759584 -0.263022586 -0.094247759 0.132969609 [26] -0.123202806 -0.325033802 -0.238876873 -0.139093179 -0.049458344 [31] -0.053184051 -0.049964465 -0.185477553 -0.170197921 -0.153413727 [36] -0.102390701 0.146490636 -0.063956457 -0.209496157 -0.055694267 [41] -0.070959660 -0.002877487 0.059182995 0.004004216 -0.087581933 [46] -0.039995006 -0.036287755 -0.032215326 0.128785759 > (mypacf <- c(rpacf$acf)) [1] 0.311548445 -0.061080592 0.255671271 0.009217574 0.408829664 [6] 0.182819345 0.263632391 -0.109709931 -0.120971538 -0.479683463 [11] -0.136586416 0.294944669 -0.196605385 -0.104869236 -0.194308384 [16] 0.166221510 -0.023374985 0.010683360 -0.012730766 0.037586227 [21] 0.060514585 -0.059396245 -0.015369241 -0.120293308 -0.007590299 [26] -0.103514627 0.013210365 0.010909084 -0.016027586 0.075656276 [31] 0.047773320 -0.067813632 0.119141750 -0.060600565 -0.101768041 [36] -0.052226329 -0.105087249 0.024663557 0.054955351 -0.078640513 [41] -0.026416361 0.094709855 0.026848136 -0.001989731 -0.043046945 [46] 0.006410869 -0.041914301 -0.099251863 > 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/3k63z1292231976.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/4vxk21292231976.tab") > > try(system("convert tmp/16wm81292231976.ps tmp/16wm81292231976.png",intern=TRUE)) character(0) > try(system("convert tmp/26wm81292231976.ps tmp/26wm81292231976.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.569 0.324 9.305