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(181.10,191.20,206.20,212.00,224.70,231.30,229.30,227.40,253.90,265.90,277.70,292.10,282.90,292.80,311.00,330.90,350.00,348.50,360.90,345.90,308.80,320.00,322.00,322.90,343.30,354.70,376.60,383.20,392.50,388.20,407.40,412.50,419.80,418.10,389.20,391.60,412.90,385.90,385.50,350.20,336.30,318.50,345.40,377.40,359.50,315.60,307.80,277.40,186.90,160.00,149.10,148.90,137.90,134.00,157.50,175.10,181.00,182.20,207.80,219.40) > par7 = '0.95' > par6 = 'MA' > par5 = '12' > par4 = '1' > par3 = '1' > 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/1mdjo1260717131.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/2cle41260717131.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.253836625 -0.002747495 0.085656286 -0.081298716 [6] -0.113699159 0.014004378 0.083561744 0.075704260 -0.143121421 [11] -0.038311664 0.003192070 -0.231045722 -0.126059081 0.063708869 [16] -0.038355755 -0.127609320 -0.031707074 -0.073917300 -0.030024564 [21] -0.051208541 -0.013681313 -0.060947465 -0.163089771 -0.105814906 [26] 0.132511718 0.031421276 0.160436229 0.240170534 -0.006669676 [31] -0.066866034 -0.065527585 -0.034948483 -0.012161517 -0.008139346 [36] 0.046101439 -0.038845994 > (mypacf <- c(rpacf$acf)) [1] 0.253836625 -0.071807289 0.112416757 -0.145934481 -0.046781340 [6] 0.041049827 0.088662612 0.045911663 -0.215712457 0.051887925 [11] -0.010662155 -0.188459389 -0.039779071 0.053864430 -0.035085306 [16] -0.133438598 -0.009213374 -0.097339816 0.082302105 -0.068697172 [21] -0.072656279 -0.119294008 -0.094847077 -0.081600192 0.123621417 [26] -0.026606243 0.152968271 0.076230430 -0.117134629 -0.047696998 [31] -0.073583393 0.018576804 -0.090567271 -0.035737738 -0.072875276 [36] -0.121949032 > 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/3r6141260717131.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/4kuv21260717131.tab") > > try(system("convert tmp/1mdjo1260717131.ps tmp/1mdjo1260717131.png",intern=TRUE)) character(0) > try(system("convert tmp/2cle41260717131.ps tmp/2cle41260717131.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.538 0.312 0.637